From 9d6c0c12f4b2846790db5e5a42f300176721bc19 Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Mon, 1 May 2017 11:56:54 -0700 Subject: [PATCH 001/761] Fixing breaking form 2.3 by using default type paramters instead --- types/react-leaflet/index.d.ts | 34 ++++++++++----------- types/react-leaflet/react-leaflet-tests.tsx | 4 +-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index da829ff2cc..d59527932b 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -143,7 +143,7 @@ export interface MapProps extends MapEvents, Leaflet.MapOptions, Leaflet.LocateO zoom?: number; } -export class Map

extends MapComponent { +export class Map

extends MapComponent { className?: string; container: HTMLDivElement; getChildContext(): { layerContainer: E, map: E }; @@ -165,7 +165,7 @@ export interface PaneProps { export interface PaneState { name?: string; } -export class Pane

extends React.Component { +export class Pane

extends React.Component { getChildContext(): { pane: string }; createPane(props: P): void; removePane(): void; @@ -196,13 +196,13 @@ export interface TileLayerProps extends TileLayerEvents, Leaflet.TileLayerOption children?: Children; url: string; } -export class TileLayer

extends GridLayer { } +export class TileLayer

extends GridLayer { } export interface WMSTileLayerProps extends TileLayerEvents, Leaflet.WMSOptions { children?: Children; url: string; } -export class WMSTileLayer

extends GridLayer { } +export class WMSTileLayer

extends GridLayer { } export interface ImageOverlayProps extends Leaflet.ImageOverlayOptions { bounds: Leaflet.LatLngBoundsExpression; @@ -224,7 +224,7 @@ export interface MarkerProps extends MarkerEvents, Leaflet.MarkerOptions { children?: Children; position: Leaflet.LatLngExpression; } -export class Marker

extends MapLayer { +export class Marker

extends MapLayer { getChildContext(): { popupContainer: E }; } @@ -241,19 +241,19 @@ export interface CircleProps extends PathEvents, Leaflet.CircleMarkerOptions { children?: Children; radius: number; } -export class Circle

extends Path { } +export class Circle

extends Path { } export interface CircleMarkerProps extends PathEvents, Leaflet.CircleMarkerOptions { center: Leaflet.LatLngExpression; children?: Children; radius: number; } -export class CircleMarker

extends Path { } +export class CircleMarker

extends Path { } export interface FeatureGroupProps extends FeatureGroupEvents, Leaflet.PathOptions { children?: Children; } -export class FeatureGroup

extends Path { +export class FeatureGroup

extends Path { getChildContext(): { layerContainer: E, popupContainer: E }; } @@ -268,27 +268,27 @@ export interface PolylineProps extends PathEvents, Leaflet.PolylineOptions { children?: Children; positions: Leaflet.LatLngExpression[] | Leaflet.LatLngExpression[][]; } -export class Polyline

extends Path { } +export class Polyline

extends Path { } export interface PolygonProps extends PathEvents, Leaflet.PolylineOptions { children?: Children; popupContainer?: Leaflet.FeatureGroup; positions: Leaflet.LatLngExpression[] | Leaflet.LatLngExpression[][] | Leaflet.LatLngExpression[][][]; } -export class Polygon

extends Path { } +export class Polygon

extends Path { } export interface RectangleProps extends PathEvents, Leaflet.PolylineOptions { children?: Children; bounds: Leaflet.LatLngBoundsExpression; popupContainer?: Leaflet.FeatureGroup; } -export class Rectangle

extends Path { } +export class Rectangle

extends Path { } export interface PopupProps extends Leaflet.PopupOptions { children?: Children; position?: Leaflet.LatLngExpression; } -export class Popup

extends MapComponent { +export class Popup

extends MapComponent { onPopupOpen(arg: { popup: E }): void; onPopupClose(arg: { popup: E }): void; renderPopupContent(): void; @@ -298,7 +298,7 @@ export class Popup

extends MapCom export interface TooltipProps extends Leaflet.TooltipOptions { children?: Children; } -export class Tooltip

extends MapComponent { +export class Tooltip

extends MapComponent { onTooltipOpen(arg: { tooltip: E }): void; onTooltipClose(arg: { tooltip: E }): void; renderTooltipContent(): void; @@ -320,7 +320,7 @@ export interface LayersControlProps extends LayersControlEvents, Leaflet.Control children?: Children; overlays?: Leaflet.Control.LayersObject; } -export class LayersControl

extends MapControl { } +export class LayersControl

extends MapControl { } export namespace LayersControl { interface BaseControlledLayerProps { @@ -340,12 +340,12 @@ export namespace LayersControl { addLayer(): void; removeLayer(layer: Leaflet.Layer): void; } - class BaseLayer

extends ControlledLayer

{ } - class Overlay

extends ControlledLayer

{ } + class BaseLayer

extends ControlledLayer

{ } + class Overlay

extends ControlledLayer

{ } } export type ScaleControlProps = Leaflet.Control.ScaleOptions; export class ScaleControl

extends MapControl { } export type ZoomControlProps = Leaflet.Control.ZoomOptions; -export class ZoomControl

extends MapControl { } +export class ZoomControl

extends MapControl { } diff --git a/types/react-leaflet/react-leaflet-tests.tsx b/types/react-leaflet/react-leaflet-tests.tsx index 667d92d6ea..d87d4f995e 100644 --- a/types/react-leaflet/react-leaflet-tests.tsx +++ b/types/react-leaflet/react-leaflet-tests.tsx @@ -686,7 +686,7 @@ class CenterControl extends MapControl { // n const centerControl = new L.Control({ position: 'bottomright' }); // see http://leafletjs.com/reference.html#control-positions for other positions const jsx = ( // PUT YOUR JSX FOR THE COMPONENT HERE: -

+
{/* add your JSX */}
); @@ -713,7 +713,7 @@ class LegendControl extends MapControl +
{this.props.children}
); From 42a15de2ebbd752c47cc5faefe1e3b2e7717027f Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Tue, 2 May 2017 10:27:11 -0700 Subject: [PATCH 002/761] Address PR : add type parameter --- types/react-leaflet/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index d59527932b..aac671947d 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/PaulLeCam/react-leaflet // Definitions by: Dave Leaver , David Schneider // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import * as Leaflet from 'leaflet'; import * as React from 'react'; @@ -202,7 +202,7 @@ export interface WMSTileLayerProps extends TileLayerEvents, Leaflet.WMSOptions { children?: Children; url: string; } -export class WMSTileLayer

extends GridLayer { } +export class WMSTileLayer

extends GridLayer { } export interface ImageOverlayProps extends Leaflet.ImageOverlayOptions { bounds: Leaflet.LatLngBoundsExpression; @@ -320,7 +320,7 @@ export interface LayersControlProps extends LayersControlEvents, Leaflet.Control children?: Children; overlays?: Leaflet.Control.LayersObject; } -export class LayersControl

extends MapControl { } +export class LayersControl

extends MapControl { } export namespace LayersControl { interface BaseControlledLayerProps { @@ -348,4 +348,4 @@ export type ScaleControlProps = Leaflet.Control.ScaleOptions; export class ScaleControl

extends MapControl { } export type ZoomControlProps = Leaflet.Control.ZoomOptions; -export class ZoomControl

extends MapControl { } +export class ZoomControl

extends MapControl { } From b596befb5ad07f5fd9c9d6386baa538b0a385c45 Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Tue, 2 May 2017 10:29:10 -0700 Subject: [PATCH 003/761] Address PR: add type parameter --- types/react-leaflet/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index aac671947d..8c36af705e 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -196,7 +196,7 @@ export interface TileLayerProps extends TileLayerEvents, Leaflet.TileLayerOption children?: Children; url: string; } -export class TileLayer

extends GridLayer { } +export class TileLayer

extends GridLayer { } export interface WMSTileLayerProps extends TileLayerEvents, Leaflet.WMSOptions { children?: Children; From 25dfb2fb8c3a718bbea0203ba682e10ae2e26bb1 Mon Sep 17 00:00:00 2001 From: Yui Date: Tue, 2 May 2017 13:13:30 -0700 Subject: [PATCH 004/761] Update header of the index.d.ts file --- types/react-leaflet/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index 8c36af705e..ddbfc786e3 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-leaflet 1.1 // Project: https://github.com/PaulLeCam/react-leaflet -// Definitions by: Dave Leaver , David Schneider +// Definitions by: Dave Leaver , David Schneider , Yui T. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 920d2d7bdfc6cd50f06bd2020991f25f46d8c7a6 Mon Sep 17 00:00:00 2001 From: beary Date: Thu, 4 May 2017 18:13:19 +0800 Subject: [PATCH 005/761] Add default generic to Collection TypeScript support default generic since version 2.3, so add generic to Collection. --- types/mongodb/index.d.ts | 52 ++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 5fe6332350..6f5cf3df0e 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -181,20 +181,20 @@ export class Db extends EventEmitter { close(forceClose?: boolean): Promise; close(forceClose: boolean, callback: MongoCallback): void; // http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#collection - collection(name: string): Collection; - collection(name: string, callback: MongoCallback): Collection; - collection(name: string, options: DbCollectionOptions, callback: MongoCallback): Collection; + collection(name: string): Collection; + collection(name: string, callback: MongoCallback>): Collection; + collection(name: string, options: DbCollectionOptions, callback: MongoCallback>): Collection; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#collections - collections(): Promise; - collections(callback: MongoCallback): void; + collections(): Promise[]>; + collections(callback: MongoCallback[]>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#command command(command: Object, callback: MongoCallback): void; command(command: Object, options?: { readPreference: ReadPreference | string }): Promise; command(command: Object, options: { readPreference: ReadPreference | string }, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#createCollection - createCollection(name: string, callback: MongoCallback): void; - createCollection(name: string, options?: CollectionCreateOptions): Promise; - createCollection(name: string, options: CollectionCreateOptions, callback: MongoCallback): void; + createCollection(name: string, callback: MongoCallback>): void; + createCollection(name: string, options?: CollectionCreateOptions): Promise>; + createCollection(name: string, options: CollectionCreateOptions, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#createIndex createIndex(name: string, fieldOrSpec: string | Object, callback: MongoCallback): void; createIndex(name: string, fieldOrSpec: string | Object, options?: IndexOptions): Promise; @@ -236,9 +236,9 @@ export class Db extends EventEmitter { removeUser(username: string, options?: { w?: number | string, wtimeout?: number, j?: boolean }): Promise; removeUser(username: string, options: { w?: number | string, wtimeout?: number, j?: boolean }, callback: MongoCallback): void; // http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#renameCollection - renameCollection(fromCollection: string, toCollection: string, callback: MongoCallback): void; - renameCollection(fromCollection: string, toCollection: string, options?: { dropTarget?: boolean }): Promise; - renameCollection(fromCollection: string, toCollection: string, options: { dropTarget?: boolean }, callback: MongoCallback): void; + renameCollection(fromCollection: string, toCollection: string, callback: MongoCallback>): void; + renameCollection(fromCollection: string, toCollection: string, options?: { dropTarget?: boolean }): Promise>; + renameCollection(fromCollection: string, toCollection: string, options: { dropTarget?: boolean }, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#stats stats(callback: MongoCallback): void; stats(options?: { scale?: number }): Promise; @@ -409,7 +409,7 @@ export interface FSyncOptions { } // Documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html -export interface Collection { +export interface Collection { // Get the collection name. collectionName: string; // Get the full collection namespace. @@ -421,10 +421,10 @@ export interface Collection { // Get current index hint for collection. hint: any; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#aggregate - aggregate(pipeline: Object[], callback: MongoCallback): AggregationCursor; - aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback): AggregationCursor; - aggregate(pipeline: Object[], callback: MongoCallback): AggregationCursor; - aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback): AggregationCursor; + // aggregate(pipeline: Object[], callback: MongoCallback): AggregationCursor; + // aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback): AggregationCursor; + aggregate(pipeline: Object[], callback: MongoCallback): AggregationCursor; + aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback): AggregationCursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#bulkWrite bulkWrite(operations: Object[], callback: MongoCallback): void; bulkWrite(operations: Object[], options?: CollectionBluckWriteOptions): Promise; @@ -463,14 +463,14 @@ export interface Collection { dropIndexes(): Promise; dropIndexes(callback?: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#find - find(query?: Object): Cursor; - find(query?: Object): Cursor; + // find(query?: Object): Cursor; + find(query?: Object): Cursor; /** @deprecated */ - find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; + find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOne - findOne(filter: Object, callback: MongoCallback): void; - findOne(filter: Object, options?: FindOneOptions): Promise; - findOne(filter: Object, options: FindOneOptions, callback: MongoCallback): void; + findOne(filter: Object, callback: MongoCallback): void; + findOne(filter: Object, options?: FindOneOptions): Promise; + findOne(filter: Object, options: FindOneOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndDelete findOneAndDelete(filter: Object, callback: MongoCallback): void; findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise; @@ -551,9 +551,9 @@ export interface Collection { /** @deprecated Use use deleteOne, deleteMany or bulkWrite */ remove(selector: Object, options?: CollectionOptions & { single?: boolean }, callback?: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#rename - rename(newName: string, callback: MongoCallback): void; - rename(newName: string, options?: { dropTarget?: boolean }): Promise; - rename(newName: string, options: { dropTarget?: boolean }, callback: MongoCallback): void; + rename(newName: string, callback: MongoCallback>): void; + rename(newName: string, options?: { dropTarget?: boolean }): Promise>; + rename(newName: string, options: { dropTarget?: boolean }, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#replaceOne replaceOne(filter: Object, doc: Object, callback: MongoCallback): void; replaceOne(filter: Object, doc: Object, options?: ReplaceOneOptions): Promise; @@ -1204,7 +1204,7 @@ export interface GridFSBucketOpenUploadStreamOptions { // https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketReadStream.html export class GridFSBucketReadStream extends Readable { - constructor(chunks: Collection, files: Collection, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions); + constructor(chunks: Collection, files: Collection, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions); } // https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketReadStream.html From 22b3831e3141b51b0d2038b465d9f2a7fcafea6a Mon Sep 17 00:00:00 2001 From: beary Date: Thu, 4 May 2017 18:22:34 +0800 Subject: [PATCH 006/761] Add generic to collection --- types/mongodb/index.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 6f5cf3df0e..bd15f3bd07 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -421,8 +421,6 @@ export interface Collection { // Get current index hint for collection. hint: any; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#aggregate - // aggregate(pipeline: Object[], callback: MongoCallback): AggregationCursor; - // aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback): AggregationCursor; aggregate(pipeline: Object[], callback: MongoCallback): AggregationCursor; aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback): AggregationCursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#bulkWrite @@ -463,7 +461,6 @@ export interface Collection { dropIndexes(): Promise; dropIndexes(callback?: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#find - // find(query?: Object): Cursor; find(query?: Object): Cursor; /** @deprecated */ find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; From b0d31d86b194178eb882ca60fc37d53b16c7e12e Mon Sep 17 00:00:00 2001 From: beary Date: Thu, 4 May 2017 19:19:41 +0800 Subject: [PATCH 007/761] Add generic to findOneAnd*** functions --- types/mongodb/index.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index bd15f3bd07..02208e721b 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -461,25 +461,25 @@ export interface Collection { dropIndexes(): Promise; dropIndexes(callback?: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#find - find(query?: Object): Cursor; + find(query?: Object): Cursor; /** @deprecated */ find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOne - findOne(filter: Object, callback: MongoCallback): void; + findOne(filter: Object, callback: MongoCallback): void; findOne(filter: Object, options?: FindOneOptions): Promise; findOne(filter: Object, options: FindOneOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndDelete - findOneAndDelete(filter: Object, callback: MongoCallback): void; - findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise; - findOneAndDelete(filter: Object, options: { projection?: Object, sort?: Object, maxTimeMS?: number }, callback: MongoCallback): void; + findOneAndDelete(filter: Object, callback: MongoCallback>): void; + findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise>; + findOneAndDelete(filter: Object, options: { projection?: Object, sort?: Object, maxTimeMS?: number }, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndReplace - findOneAndReplace(filter: Object, replacement: Object, callback: MongoCallback): void; - findOneAndReplace(filter: Object, replacement: Object, options?: FindOneAndReplaceOption): Promise; - findOneAndReplace(filter: Object, replacement: Object, options: FindOneAndReplaceOption, callback: MongoCallback): void; + findOneAndReplace(filter: Object, replacement: Object, callback: MongoCallback>): void; + findOneAndReplace(filter: Object, replacement: Object, options?: FindOneAndReplaceOption): Promise>; + findOneAndReplace(filter: Object, replacement: Object, options: FindOneAndReplaceOption, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndUpdate - findOneAndUpdate(filter: Object, update: Object, callback: MongoCallback): void; - findOneAndUpdate(filter: Object, update: Object, options?: FindOneAndReplaceOption): Promise; - findOneAndUpdate(filter: Object, update: Object, options: FindOneAndReplaceOption, callback: MongoCallback): void; + findOneAndUpdate(filter: Object, update: Object, callback: MongoCallback>): void; + findOneAndUpdate(filter: Object, update: Object, options?: FindOneAndReplaceOption): Promise>; + findOneAndUpdate(filter: Object, update: Object, options: FindOneAndReplaceOption, callback: MongoCallback>): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#geoHaystackSearch geoHaystackSearch(x: number, y: number, callback: MongoCallback): void; geoHaystackSearch(x: number, y: number, options?: GeoHaystackSearchOptions): Promise; @@ -707,9 +707,9 @@ export interface DeleteWriteOpResultObject { } //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#~findAndModifyWriteOpResult -export interface FindAndModifyWriteOpResultObject { +export interface FindAndModifyWriteOpResultObject { //Document returned from findAndModify command. - value?: any; + value?: TSchema; //The raw lastErrorObject returned from the command. lastErrorObject?: any; //Is 1 if the command executed correctly. From 5dcda0ca0b73e2eb3ee06ba20c56e4b507b687f4 Mon Sep 17 00:00:00 2001 From: Hugo Wood Date: Mon, 15 May 2017 14:13:32 +0200 Subject: [PATCH 008/761] highland: add support for mapping hints Also fixes the signature of _(source) for the Event Emitter case. The signature was missing the first parameter. Closes #13727. --- types/highland/highland-tests.ts | 8 ++++++- types/highland/index.d.ts | 36 +++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/types/highland/highland-tests.ts b/types/highland/highland-tests.ts index 7c813e1c1e..e4af44c0a0 100644 --- a/types/highland/highland-tests.ts +++ b/types/highland/highland-tests.ts @@ -134,7 +134,10 @@ fooStream = _((push, next) => { fooStream = _(fooStream); fooStream = _(readable); -fooStream = _(emitter); +fooStream = _(str, emitter); +fooStream = _(str, emitter, num); +fooStream = _(str, emitter, strArr); +fooStream = _(str, emitter, f); fooStream = _(fooStreamThen); fooStream = _(fooThen); @@ -210,6 +213,9 @@ _.log(str, num, foo); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - f = _.wrapCallback(func); +f = _.wrapCallback(func, num); +f = _.wrapCallback(func, strArr); +f = _.wrapCallback(func, fn); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/types/highland/index.d.ts b/types/highland/index.d.ts index b10f8e00bf..82806d6349 100644 --- a/types/highland/index.d.ts +++ b/types/highland/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Highland 1.14.0 +// Type definitions for Highland 2.10.5 // Project: http://highlandjs.org/ // Definitions by: Bart van der Schoor +// Hugo Wood // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -48,6 +49,17 @@ interface HighlandStatic { * event emitter as the two arguments to the constructor and the first * argument emitted to the event handler will be written to the new Stream. * + * You can pass a mapping hint as the third argument, which specifies how + * event arguments are pushed into the stream. If no mapping hint is + * provided, only the first value emitted with the event to the will be + * pushed onto the Stream. + * + * If mappingHint is a number, an array of that length will be pushed onto + * the stream, containing exactly that many parameters from the event. If + * it's an array, it's used as keys to map the arguments into an object which + * is pushed to the tream. If it is a function, it's called with the event + * arguments, and the returned value is pushed. + * * **Promise -** Accepts an ES6 / jQuery style promise and returns a * Highland Stream which will emit a single value (or an error). * @@ -63,7 +75,7 @@ interface HighlandStatic { (xs: Highland.Stream): Highland.Stream; (xs: NodeJS.ReadableStream): Highland.Stream; - (xs: NodeJS.EventEmitter): Highland.Stream; + (eventName: string, xs: NodeJS.EventEmitter, mappingHint?: Highland.MappingHint): Highland.Stream; // moar (promise for everything?) (xs: Highland.Thenable>): Highland.Stream; @@ -298,16 +310,28 @@ interface HighlandStatic { /** * Wraps a node-style async function which accepts a callback, transforming * it to a function which accepts the same arguments minus the callback and - * returns a Highland Stream instead. Only the first argument to the - * callback (or an error) will be pushed onto the Stream. + * returns a Highland Stream instead. The wrapped function keeps its context, + * so you can safely use it as a method without binding (see the second + * example below). + * + * wrapCallback also accepts an optional mappingHint, which specifies how + * callback arguments are pushed to the stream. This can be used to handle + * non-standard callback protocols that pass back more than one value. + * + * mappingHint can be a function, number, or array. See the documentation on + * EventEmitter Stream Objects for details on the mapping hint. If + * mappingHint is a function, it will be called with all but the first + * argument that is passed to the callback. The first is still assumed to be + * the error argument. * * @id wrapCallback * @section Utils * @name _.wrapCallback(f) * @param {Function} f - the node-style function to wrap + * @param {Array | Function | Number} [mappingHint] - how to pass the arguments to the callback * @api public */ - wrapCallback(f: Function): Function; + wrapCallback(f: Function, mappingHint?: Highland.MappingHint): (...args: any[]) => Highland.Stream; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1009,6 +1033,8 @@ declare namespace Highland { */ latest(): Stream; } + + type MappingHint = number | string[] | Function; } declare var highland:HighlandStatic; From cdca61035a709b4c022b91c52ac65061e29d43f2 Mon Sep 17 00:00:00 2001 From: Mike Dvorscak Date: Thu, 18 May 2017 11:40:32 -0500 Subject: [PATCH 009/761] Add JQueryCssProperties interface for $.css(properties: object) Adding JQueryCssProperties interface and changing the signature for $.css(properties: object) to $.css(properties: JQueryCssProperties) --- types/jquery/index.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index ca799f21e5..9dc1bf466e 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -679,6 +679,13 @@ interface JQueryCoordinates { top: number; } +/** + * The interface used to specify the properties parameter in css() + */ +interface JQueryCssProperties { + [propertyName: string]: string | number | Function; +} + /** * Elements in the array returned by serializeArray() */ @@ -1687,7 +1694,7 @@ interface JQuery { * @param properties An object of property-value pairs to set. * @see {@link https://api.jquery.com/css/#css-properties} */ - css(properties: Object): JQuery; + css(properties: JQueryCssProperties): JQuery; /** * Get the current computed height for the first element in the set of matched elements. From 9d9aad622f688044f0e94ab64451e53795e27077 Mon Sep 17 00:00:00 2001 From: Gabe Scholz Date: Fri, 19 May 2017 11:44:50 -0700 Subject: [PATCH 010/761] Add resolves and rejects matchers from Jest 20 --- types/jest/index.d.ts | 2 ++ types/jest/jest-tests.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index 36011e67a7..7ac5c7486b 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -178,6 +178,8 @@ declare namespace jest { interface Matchers { /** If you know how to test something, `.not` lets you test its opposite. */ not: Matchers; + resolves: Matchers; + rejects: Matchers; lastCalledWith(...args: any[]): void; /** Checks that a value is what you expect. It uses `===` to check strict equality. Don't use `toBe` with floating-point numbers. */ toBe(expected: any): void; diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index d951153842..0605724334 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -501,3 +501,18 @@ describe('Mocks', function () { anotherIns.testMethod.mockImplementation(() => 1); }); }); + +// https://facebook.github.io/jest/docs/en/expect.html#resolves +describe('resolves', function () { + it('unwraps the expected Promise', function () { + return expect(Promise.resolve('test')).resolves.toEqual('test'); + }); +}); + +// https://facebook.github.io/jest/docs/en/expect.html#rejects +describe('rejects', function () { + it('unwraps the expected Promise', function () { + const error = new Error('error'); + return expect(Promise.reject(error)).rejects.toBeDefined(); + }); +}); \ No newline at end of file From 485f913ab730e724f243885b2a039217a302562a Mon Sep 17 00:00:00 2001 From: Eliot Fallon Date: Mon, 22 May 2017 14:24:16 +0100 Subject: [PATCH 011/761] Updated to include 'playsinline' parameter --- types/youtube/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/youtube/index.d.ts b/types/youtube/index.d.ts index a45ec6a8c8..5a2dc3f19e 100644 --- a/types/youtube/index.d.ts +++ b/types/youtube/index.d.ts @@ -2,7 +2,8 @@ // Project: https://developers.google.com/youtube/ // Definitions by: Daz Wilkin , // Ian Obermiller , -// Josh Goldberg +// Josh Goldberg +// Eliot Fallon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -518,6 +519,11 @@ declare namespace YT * Comma separated list of video IDs to play after the URL path's video. */ playlist?: string; + + /** + * Whether videos play inline or fullscreen in an HTML5 player on iOS. Valid values are: 1 or 0. + */ + playsinline?: number; /** * Whether to show related videos after the video finishes (by default, Show). From bbe4aab4f419d20208ce7b89544d68c1204f1dd5 Mon Sep 17 00:00:00 2001 From: amiram Date: Tue, 23 May 2017 10:40:47 +0300 Subject: [PATCH 012/761] auth0 fix getUser returns only a single user fix deleteUser returns void fix getUser and deleteUser mandatory params --- types/auth0/auth0-tests.ts | 36 ++++++++++++++++++++++++++++++++++++ types/auth0/index.d.ts | 8 ++++---- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index 24a4aad87d..b84e92e223 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -28,6 +28,42 @@ management // Handle the error. }); +// Using a callback. +management.getUser({id: 'user_id'},(err: Error, user: auth0.User) => { + if (err) { + // Handle error. + } + console.log(user); +}); + +// Using a Promise. +management + .getUser({id: 'user_id'}) + .then((user) => { + console.log(user); + }) + .catch((err) => { + // Handle the error. + }); + +// Using a callback. +management.deleteUser({id: 'user_id'},(err: Error) => { + if (err) { + // Handle error. + } + console.log('deleted'); +}); + +// Using a Promise. +management + .deleteUser({id: 'user_id'}) + .then(() => { + console.log('deleted'); + }) + .catch((err) => { + // Handle the error. + }); + management .createUser({ connection: 'My-Connection', diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index a8a6242bb4..096ba489a5 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -307,8 +307,8 @@ export class ManagementClient { getUsers(params?: GetUsersData): Promise; getUsers(params?: GetUsersData, cb?: (err: Error, users: User[]) => void): void; - getUser(params?: ObjectWithId): Promise; - getUser(params?: ObjectWithId, cb?: (err: Error, users: User[]) => void): void; + getUser(params: ObjectWithId): Promise; + getUser(params: ObjectWithId, cb?: (err: Error, user: User) => void): void; createUser(data: UserData): Promise; createUser(data: UserData, cb: (err: Error, data: User) => void): void; @@ -322,8 +322,8 @@ export class ManagementClient { deleteAllUsers(): Promise; deleteAllUsers(cb: (err: Error, data: any) => void): void; - deleteUser(params?: ObjectWithId): Promise; - deleteUser(params?: ObjectWithId, cb?: (err: Error, users: User[]) => void): void; + deleteUser(params: ObjectWithId): Promise; + deleteUser(params: ObjectWithId, cb?: (err: Error) => void): void; updateAppMetadata(params: UpdateUserParameters, data: AppMetadata): Promise; updateAppMetadata(params: UpdateUserParameters, data: AppMetadata, cb: (err: Error, data: User) => void): void; From e4a921428005061a0796734543058a720f1b318f Mon Sep 17 00:00:00 2001 From: amiram Date: Tue, 23 May 2017 10:44:03 +0300 Subject: [PATCH 013/761] auth0 fix getUser returns only a single user fix deleteUser returns void fix getUser and deleteUser mandatory params --- types/auth0/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 096ba489a5..c920f3709a 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for auth0 2.4 // Project: https://github.com/auth0/node-auth0 -// Definitions by: Wilson Hobbs , Seth Westphal +// Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as Promise from 'bluebird'; From 163ae5a140eae83b28705339781f41b675d780eb Mon Sep 17 00:00:00 2001 From: amiram Date: Tue, 23 May 2017 10:47:44 +0300 Subject: [PATCH 014/761] auth0 fix getUser returns only a single user fix deleteUser returns void fix getUser and deleteUser mandatory params --- types/auth0/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index c920f3709a..be4de08f1f 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0 2.4 +// Type definitions for auth0 3.0 // Project: https://github.com/auth0/node-auth0 // Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 673e4d70ec792560b1173cb7822dcef68b89049e Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Tue, 23 May 2017 11:45:51 +0200 Subject: [PATCH 015/761] add type definitions for HERE data lens --- types/heredatalens/heredatalens-tests.ts | 136 ++++ types/heredatalens/index.d.ts | 939 +++++++++++++++++++++++ types/heredatalens/tsconfig.json | 22 + types/heredatalens/tslint.json | 3 + 4 files changed, 1100 insertions(+) create mode 100644 types/heredatalens/heredatalens-tests.ts create mode 100644 types/heredatalens/index.d.ts create mode 100644 types/heredatalens/tsconfig.json create mode 100644 types/heredatalens/tslint.json diff --git a/types/heredatalens/heredatalens-tests.ts b/types/heredatalens/heredatalens-tests.ts new file mode 100644 index 0000000000..51fa56b380 --- /dev/null +++ b/types/heredatalens/heredatalens-tests.ts @@ -0,0 +1,136 @@ +/** + * Typescript definition tests for heredatalens + * + * Note: These tests are intended to test the definitions only + * in the sense of typing and call signature consistency. They + * are not intended as functional tests. + */ + +import './index'; + + +let service: H.datalens.Service; +let serviceOptions: H.datalens.Service.Options = { + subDomain: 'sub', + version: 'version', + access_token: 'token', + refresh_token: 'token', + domainSharding: ['a', 'b'], + baseUrl: 'url' +}; + +let queryTileProviderTileParamNames: H.datalens.QueryTileProvider.TileParamNames = { + x: 'x', + y: 'y', + z: 'z' +}; + +let queryTileProviderOptions: H.datalens.QueryTileProvider.Options = { + queryId: 'id', + queryParams: 'params', + tileParamNames: queryTileProviderTileParamNames +}; + +let queryTileProvider = new H.datalens.QueryTileProvider(service, queryTileProviderOptions); +queryTileProvider.setQueryId('some id'); +queryTileProvider.setQueryParams('some params'); +queryTileProvider.setTileParamNames(queryTileProviderTileParamNames); + + +service = new H.datalens.Service(serviceOptions); +service.request('method', 'endpoint', 'params', 'body', function(result) {}, function(error) {}).then(data => {}); +service.fetchQueryData('id', 'params', function(result) {}, function(error) {}).then(data => {}); +service.fetchQueryStats('id', 'query', function(result) {}, function(error) {}).then(data => {}); +service.fetchLayer('name', 'params', function(result) {}, function(error) {}).then(data => {}); +service.fetchLayerTile('name', 1, 2, 3, 'params', function(result) {}, function(error) {}).then(data => {}); +service.setTokens('token', 'refresh_token'); +service.configure('app_id', 'app_code', true, true, new H.service.Url('scheme', 'host')); + + +let provider = new H.datalens.Provider({ columns: ['1', '2'], rows: [[], []]}); +provider.getData(); +provider.setData({ columns: ['3', '4'], rows: [[], []]}); + + +let queryProviderOptions: H.datalens.QueryProvider.Options = { + queryId: 'id', + queryParams: 'params' +}; +let queryProvider = new H.datalens.QueryProvider({ columns: ['1', '2'], rows: [[], []]}, queryProviderOptions); +queryProvider.setQueryId('id'); +queryProvider.setQueryParams('params'); +queryProvider.reload(); +queryProvider.getData(); +queryProvider.setData({ columns: ['3', '4'], rows: [[], []]}); + + +let rasterLayerOptions: H.datalens.RasterLayer.Options = { + dataToRows: (): H.datalens.RasterLayer.Row[] => { return []; }, + rowToTilePoint: (): H.datalens.RasterLayer.TilePoint => { return { x: 1, y: 2 }; }, + buffer: (): number => { return 1; }, + renderTile: () => {} +}; + +let rasterLayer = new H.datalens.RasterLayer(); +rasterLayer.redraw(); + + +let heatmapLayerOptions: H.datalens.HeatmapLayer.Options = { + dataToRows: (): H.datalens.HeatmapLayer.Row[] => { return []; }, + rowToTilePoint: (): H.datalens.HeatmapLayer.TilePoint => { return { x: 1, y: 2, value: 5, count: 5 }; }, + bandwidth: 5, + valueRange: (): number[] => { return []; }, + countRange: (): number[] => { return []; }, + colorScale: (): string => { return '2'; }, + alphaScale: (): number => { return 1; }, + aggregation: H.datalens.HeatmapLayer.Aggregation.SUM, + inputScale: H.datalens.HeatmapLayer.InputScale.LINEAR +}; + +let heatmapLayer = new H.datalens.HeatmapLayer(queryTileProvider, heatmapLayerOptions); +heatmapLayer.getOptionsPerZoom(5); +heatmapLayer.dispose(); +heatmapLayer.redraw(); + + +let objectLayerOptions: H.datalens.ObjectLayer.Options = { + dataToRows: (): H.datalens.ObjectLayer.Row[] => { return []; }, + rowToMapObject: (): H.map.Object => { return new H.map.Object() }, + rowToStyle: (): H.datalens.ObjectLayer.ObjectStyleOptions => { return { icon: new H.map.Icon('x'), style: {}, arrows: {}, zIndex: 1 }; }, + dataDomains: 2, + clustering: { rowToDataPoint: (): H.clustering.DataPoint => { return; }, options: (): H.clustering.Provider.ClusteringOptions => { return {}; } } +} + +let objectLayer = new H.datalens.ObjectLayer(provider, objectLayerOptions); +objectLayer.redraw(); +objectLayer.updateObjectStyle(new H.map.Object, { icon: new H.map.Icon('x'), style: {}, arrows: {}, zIndex: 1 }); + + +let rawDataProviderOptions: H.datalens.RawDataProvider.Options = { + dataUrl: 'url', + dataToFeatures: (): H.datalens.RawDataProvider.Feature[] => { return []; }, + featuresToRows: (): H.datalens.ObjectLayer.Row[] => { return []; } +}; + +let rawDataProvider = new H.datalens.RawDataProvider(rawDataProviderOptions); + + +let spatialTileProviderOptions: H.datalens.SpatialTileProvider.Options = { + layerName: 'name', + queryParams: 'params' +}; + +let spatialProvider: H.datalens.SpatialTileProvider = new H.datalens.SpatialTileProvider(service, spatialTileProviderOptions); + +let spatialLayerOptions: H.datalens.SpatialLayer.Options = { + dataToRows: (): H.datalens.SpatialLayer.Row[] => { return []; }, + rowToSpatialId: (): string => { return 'asd'; }, + featureToSpatialId: (): string => { return 'asd'; }, + rowToStyle: (): any => { return; }, + defaultStyle: (): any => { return; }, + transformFeature: 1 +}; + +let spatialLayer = new H.datalens.SpatialLayer(provider, spatialProvider, spatialLayerOptions); + + diff --git a/types/heredatalens/index.d.ts b/types/heredatalens/index.d.ts new file mode 100644 index 0000000000..9c7c5d910c --- /dev/null +++ b/types/heredatalens/index.d.ts @@ -0,0 +1,939 @@ +// Type definitions for HERE Data Lens API for JavaScript v2.3.0-31 +// Project: https://developer.here.com/ +// Definitions by: Bernd Hacker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace H { + /** + * Data Lens REST API connector for HERE Maps API + * Data Lens JavaScript API is a module for HERE Maps API. + * It connects Data Lens REST API and provides data-driven styling of data on a map. + */ + namespace datalens { + /** + * HERE Maps API and Data Lens JavaScript API can be used to visualize data from different network sources. + * For each network source type, a service class is required. The service also stores API connection credentials. + * The service instance must be configured with a H.service.Platform instance. + */ + class Service implements H.service.IConfigurable { + /** + * Constructor + * @param options {H.datalens.Service.Options=} - Overrides the configuration from the H.service.Platform instance + */ + constructor(options?: H.datalens.Service.Options); + + /** + * This method makes an HTTP request to the Data Lens REST API. + * It makes any CRUD request (GET, PUT, POST, DELETE). + * This method can be used when implementing a custom provider or implementing data management. + * Otherwise existing providers are used to get data from the Data Lens REST API. + * @param method {string} - Any HTTP method (GET, PUT, POST, etc.) + * @param endpoint {string} - The REST API endpoint + * @param params {any=} - URL parameters + * @param body {any=} - The payload of the request + * @param onResult {function(any)=} - Callback called on a successful request with response data + * @param onError {function(Error)=} - Callback called on an unsuccessful request with the Error object + * @returns {Promise} - Response Promise + */ + request(method: string, endpoint: string, params?: any, body?: any, onResult?: (result: any) => void, onError?: (error: any) => void): Promise; + + /** + * This method fetches query data for a given query ID. + * This method can be used when implementing a custom provider. + * Otherwise existing providers are used to get data from the Data Lens REST API. + * @param queryId {string} - The ID of the Data Lens REST API query + * @param params {any=} - Query dynamic parameters + * @param onResult {function(any)=} - Callback called on a successful request with response data + * @param onError {function(Error)=} - Callback called on an unsuccessful request with the Error object + * @returns {Promise} - Response Promise + */ + fetchQueryData(queryId: string, params?: any, onResult?: (result: any) => void, onError?: (error: any) => void): Promise; + + /** + * This method fetches statistical data for the Data Lens query (eg minimum and maximum values for the query metric). + * It can be used to define visualization boundaries, scales and legends. + * @param queryId {string} - The ID of the Data Lens REST API query + * @param statsQuery {any} - A JSON object which defines a statistics query for the Data Lens query + * @param onResult {function(any)=} - Callback called on a successful request with response data + * @param onError {function(Error)=} - Callback called on an unsuccessful request with the Error object + * @returns {Promise} - Response Promise + */ + fetchQueryStats(queryId: string, statsQuery: any, onResult?: (result: any) => void, onError?: (error: any) => void): Promise; + + /** + * This method fetches a layer of geometries (eg buildings or administrative boundaries). + * @param layerName {string} - The name of the layer + * @param params {any=} - URL parameters (eg bounding box) + * @param onResult {function(any)=} - Callback called on a successful request with response data + * @param onError {function(Error)=} - Callback called on an unsuccessful request with the Error object + * @returns {Promise} - Response Promise + */ + fetchLayer(layerName: string, params?: any, onResult?: (result: any) => void, onError?: (error: any) => void): Promise; + + /** + * This method fetches vector tile data from the layer. + * @param layerName {string} + * @param x {H.datalens.QueryTileProvider.X} - Tile columns + * @param y {H.datalens.QueryTileProvider.Y} - Tile row + * @param z {H.datalens.QueryTileProvider.Zoom} - zoom level + * @param params {any=} - URL parameters (eg bounding box) + * @param onResult {function(any)=} - Callback called on a successful request with response data + * @param onError {function(Error)=} - Callback called on an unsuccessful request with the Error object + * @returns {Promise} - Typed array with tile data + */ + fetchLayerTile(layerName: string, x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, z: H.datalens.QueryTileProvider.Zoom, + params?: any, onResult?: (result: any) => void, onError?: (error: any) => void): Promise; + + /** + * Sets the access and refresh tokens used to authenticate all requests against the Data Lens REST API. + * Use this method to implement custom authentication to the Data Lens REST API. + * @param accessToken {string} - The token used to authenticate all requests + * @param refreshToken {string} - The token used to fetch a new access token after the previous access token has expired. + * When refreshToken is provided, Service will automatically update the expired accessToken. + */ + setTokens(accessToken: string, refreshToken: string): void; + + /** + * This method implements H.service.IConfigurable interface. It is called by the H.service.Platform instance. + * @param appId {string} - The appId + * @param appCode {string} - The appCode + * @param useHTTPS {boolean} - A flag to use HTTPS or not + * @param useCIT {boolean} - A flag to use the staging server (CIT) or not + * @param baseUrl {H.service.Url=} - The base URL for all requests to the Data Lens REST API + * @returns {H.datalens.Service} + */ + configure(appId: string, appCode: string, useHTTPS: boolean, useCIT: boolean, baseUrl?: H.service.Url): H.datalens.Service; + } + + namespace Service { + /** + * Overrides the H.datalens.Service configuration + * Normally the H.datalens.Service instance is configured with the H.service.Platform instance. + * This configuration can be overridden by specifying these options. + * It can be useful when the Data Lens environment is different from the HERE Platform environment. + * @property subDomain {string=} - Subdomain of the Data Lens REST API URL + * @property version {string=} - Pathname prefix of the Data Lens REST API endpoints + * @property access_token {string=} - The token used to authenticate all requests + * @property refresh_token {string=} - The token used to fetch a new access token after the previous access token has expired. + * When refresh_token is provided, Service will automatically update the expired access_token. + * @property domainSharding {string[]=} - To increase the number of simultaneous requests to the Data Lens REST API, domain sharding is used. + * This option can be used when the Data Lens environment does not support domain sharding. + * @property baseUrl {string=} - Defines an alternative host for the Data Lens REST API URL + */ + interface Options { + subDomain?: string; + version?: string; + access_token?: string; + refresh_token?: string; + domainSharding?: string[]; + baseUrl?: string; + } + + /** + * The format of Data Lens query data. + * The Data Lens query data has a table-like structure with named columns and rows. + * @property columns {string[]} - Column names + * @property rows {Array} - Rows of data + */ + interface Data { + columns: string[]; + rows: [any[]]; // rows : { Array. } + } + } + + /** + * Providers define interfaces for layers to access data. + * The input data can be stored locally or loaded from the network. Data can be loaded by tiles or in one chunk. + * This provider allows you to supply data stored locally or fetched using external tools. + */ + class Provider extends H.map.provider.Provider { + /** + * Constructor + * @param data {H.datalens.Service.Data=} - JSON object + * @param options {H.map.provider.Provider.Options=} - Configures data accessibility parameters + */ + constructor(data?: H.datalens.Service.Data, options?: H.map.provider.Provider.Options); + + /** + * Updates the provider data. When data is updated, the update event is triggered so that the consuming layers are redrawn. + * @param data {H.datalens.Service.Data} - JSON object + */ + setData(data: H.datalens.Service.Data): void; + + /** + * Retrieves the provider data. + * @returns {H.datalens.Service.Data} - JSON object + */ + getData(): H.datalens.Service.Data; + } + + /** + * Defines the source of the data for layers from a Data Lens query. + * Providers define interfaces for layers to access data. The input data can be stored locally or loaded from the network. + * Data can be loaded by tiles or in one chunk. This provider loads query data with the Data Lens REST API. + * Note that this provider must be used only for non-tiled queries. + */ + class QueryProvider extends H.datalens.Provider { + /** + * Constructor + * @param service {H.datalens.Service} - Data Lens REST API service + * @param options {H.datalens.QueryProvider.Options=} - Configures source query and data accessibility parameters + */ + constructor(data: H.datalens.Service.Data, options?: H.map.provider.Provider.Options); + + /** + * Updates the query ID to be used in the next call of the Data Lens REST API. + * Note that new data will be fetched only after the reload method is called. + * @param queryId {string} + */ + setQueryId(queryId: string): void; + + /** + * Updates the query's dynamic parameters to be used in the next call of the Data Lens REST API. + * Note that new data will be fetched only after the reload method is called. + * This method is normally used when updating your visualization. + * @param queryParams {any|null} - Query dynamic parameters + */ + setQueryParams(queryParams: any|null): void; + + /** + * Fetches new data from the Data Lens REST API. + * When data is fetched, the update event is triggered so that the consuming layers are redrawn. + */ + reload(): void; + + /** + * Updates the provider data. + * When data is updated, the update event is triggered so that the consuming layers are redrawn. + * @param data {H.datalens.Service.Data} - JSON object + */ + setData(data: H.datalens.Service.Data): void; + + /** + * Retrieves the provider data. + * @returns {H.datalens.Service.Data} - JSON object + */ + getData(): H.datalens.Service.Data; + } + + namespace QueryProvider { + /** + * Configures source query and data accessibility parameters for H.datalens.QueryProvider + * Specifies the query credentials and dynamic parameters required for fetching query data with the Data Lens REST API. Other options from H.datalens.Provider.Options are available. + * @property queryId {string} - The ID of the Data Lens REST API query + * @property queryParams {any=} - The query's dynamic parameters. The dynamic parameters can be used to filter data provided by the query. + */ + interface Options { + queryId: string; + queryParams?: any; + } + } + + /** + * Providers define interfaces for layers to access data. + * The input data can be stored locally or loaded from the network. Data can be loaded by tiles or in one chunk. + * This provider loads tiled query data with the Data Lens REST API. Tiled queries are used to load data only for the current viewport. + * This optimizes memory and network usage and enables progressive rendering. + */ + class QueryTileProvider extends H.map.provider.RemoteTileProvider { + /** + * Constructor + * @param service {H.datalens.Service} - Data Lens REST API service + * @param options {H.datalens.QueryTileProvider.Options} - Configures source query and data accessibility parameters + */ + constructor(service: H.datalens.Service, options: H.datalens.QueryTileProvider.Options); + + /** + * Updates the query ID to be used in the next call of the Data Lens REST API. + * Note that new data will be fetched only after the reload method is called. + * @param queryId {string} + */ + setQueryId(queryId: string): void; + + /** + * Updates the query's dynamic parameters to be used in the next call of the Data Lens REST API. + * Note that new data will be fetched only after the reload method is called. This method is normally used when updating your visualization. + * @param queryParams {any|null} + */ + setQueryParams(queryParams: any|null): void; + + /** + * Updates the names of the dynamic parameters that defines tiles. This method is only needed when the query ID is updated. + * Note that new data will be fetched only after the reload method is called. + * @param tileParamNames {H.datalens.QueryTileProvider.TileParamNames} - Names of the URI parameters that control the x/y/z of a tiled query + */ + setTileParamNames(tileParamNames: H.datalens.QueryTileProvider.TileParamNames): void; + } + + namespace QueryTileProvider { + /** + * Represents the names of the URI parameters that control the x/y/z of tiled query. + * When defining the Data Lens query, dynamic parameters that control tiling can be arbitrarily named. + * Names of these parameters must be specified to fetch tiles. + * @property x {string} - Name of the dynamic parameter that defines tile column + * @property y {string} - Name of the dynamic parameter that defines tile row + * @property z {string} - Name of the dynamic parameter that defines zoom level + */ + interface TileParamNames { + x: string; + y: string; + z: string; + } + + /** + * Configures source query and data accessibility parameters for H.datalens.QueryTileProvider + * Specifies the query credentials and dynamic parameters required for fetching tiled query data with the Data Lens REST API. + * Other options from H.datalens.Provider.Options are available. + * @property tileParamNames {H.datalens.QueryTileProvider.TileParamNames=} - Names of the URI parameters that control the x/y/z of a tiled query + * @property queryId {string} - The ID for the Data Lens REST API query + * @property queryParams {any=} - The query's dynamic parameters. The dynamic parameters can be used to filter data provided by the query. + */ + interface Options { + tileParamNames: H.datalens.QueryTileProvider.TileParamNames; + queryId: string; + queryParams?: string; + } + + /** + * Tile X coordinate (column) + * Coordinate in XYZ tile numbering scheme. + */ + type X = number; + + /** + * Tile Y coordinate (row) + * Coordinate in XYZ tile numbering scheme. + */ + type Y = number; + + /** + * Zoom level + * Coordinate in XYZ tile numbering scheme. May vary within range 1 to 20. + */ + type Zoom = number; + } + + /** + * Provides pixel-wise rendering of data. + * Layer used when you need to visualize more than 10k points. The layer requires source data to be located in pixel coordinates. + * The rendering is implemented by drawing directly on a canvas. The layer is often used together with a Data Lens query which groups rows by pixels. + * This reduces the amount of data delivered to the client. + */ + class RasterLayer extends H.map.layer.TileLayer { + /** + * Constructor + */ + constructor(); + + /** + * Default value for dataToRows callback option. + * It represents each row as an object where property names correspond to data column names. + */ + static defaultDataToRows: any; + + /** + * Force re-rendering of the layer. + * In the case where the callbacks passed to the layer options are not pure functions, you can call this method to force re-rendering. + */ + redraw(): void; + + /** + * This is a default implementation of renderTile callback. This method represents each point as a black 1x1 pixel square. + * @param points {Array} - Input data points within a tile + * @param canvas {HTMLCanvasElement} - The target canvas + */ + static defaultRenderTile(points: H.datalens.RasterLayer.TilePoint[], canvas: HTMLCanvasElement): void; + } + + namespace RasterLayer { + /** + * Defines data processing and rendering options for RasterLayer. + * The initial step of rendering is to split the tile data by rows, where each row represents a bucket. + * By default this step is processed with H.datalens.RasterLayer.defaultDataToRows. + * This behavior can be changed by defining the dataToRows callback. + * To collect the rows for a tile including buffer, the rows must be translated to H.datalens.RasterLayer.TilePoint. + * This translation must be specified with the rowToTilePoint callback. The final rendering on the tile canvas must be defined in renderTile. + * @property dataToRows {function(H.datalens.Service.Data, H.datalens.QueryTileProvider.X, H.datalens.QueryTileProvider.Y, H.datalens.QueryTileProvider.Zoom)=} - + * Defines how the input tile data is split by rows. You can specify this callback to define client-side aggregation and filtering. This callback is called for each tile. + * @property rowToTilePoint {function(H.datalens.RasterLayer.Row, H.datalens.RasterLayer.X, H.datalens.RasterLayer.Y)=} - + * Defines how the row is translated to the H.datalens.RasterLayer.TilePoint. This callback is called for each row that is returned from dataToRows. + * @property buffer {function(H.datalens.QueryTileProvider.Zoom)=} - Defines the buffer as a function of the zoom level. + * The buffer is a value (in pixels) that defines an extra area around each tile to capture data points from. + * This is done to avoid drawing edges between tiles. For example, if data points represented with circles with a maximum radius of 10 pixels, then the buffer must be 10 pixels. + * @property renderTile {function(Array, HTMLCanvasElement, H.datalens.QueryTileProvider.Zoom)=} - + * Defines how tile data is represented on a canvas. Input points for each tile are collected with respect to the buffer. + * For progressive rendering this callback may be called more than once for the tile. + */ + interface Options { + dataToRows?(data: H.datalens.Service.Data, x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, zoom: H.datalens.QueryTileProvider.Zoom): + H.datalens.RasterLayer.Row[]; + rowToTilePoint?(row: H.datalens.RasterLayer.Row, x: H.datalens.RasterLayer.X, y: H.datalens.RasterLayer.Y): H.datalens.RasterLayer.TilePoint; + buffer?(zoom: H.datalens.QueryTileProvider.Zoom): number; + renderTile?(points: H.datalens.RasterLayer.TilePoint[], canvas: HTMLCanvasElement, zoom: H.datalens.QueryTileProvider.Zoom): void; + } + + /** + * Defines the input data format for heat map rendering. + * To collect data rows for each tile with respect to the buffer, each row must be represented as a point within the map tile. + * @property x {number} - Row relative to tile + * @property y {number} - Column relative to tile + * @property data {H.datalens.RasterLayer.Row=} - Reference to source data row + */ + interface TilePoint { + x: number; + y: number; + data?: H.datalens.RasterLayer.Row; + } + + /** + * Tile X coordinate (column) + * Coordinate in XYZ tile numbering scheme. + */ + type X = number; + + /** + * Tile Y coordinate (row) + * Coordinate in XYZ tile numbering scheme. + */ + type Y = number; + + /** + * Slice of data (eg Data Lens query data row) that represents a data point. + * Each row is transformed into TilePoint and passed to renderTile callback. By default each row is an Object where property names correspond to data column names. + * This representation can be changed with the dataToRows callback. + */ + type Row = number; + } + + /** + * Provides functionality of value-based heat map with density alpha mask. + * Layer support different types of blending, including weighted average. Also it allows to apply alpha mask calculated by density. + * In most cases, the layer consumes data grouped by 1x1 pixels buckets. For proper averaging it requires aggregated value and count (number of rows in bucket) for each bucket. + * Blending of buckets is implemented via kernel density estimation (KDE) with a Gaussian kernel. + */ + class HeatmapLayer extends H.datalens.RasterLayer { + /** + * Constructor + * @param provider {H.datalens.QueryTileProvider} - Source of tiled data + * @param options {H.datalens.HeatmapLayer.Options} - Configuration for data processing and rendering + */ + constructor(provider: H.datalens.QueryTileProvider, options: H.datalens.HeatmapLayer.Options); + + /** + * Default value for dataToRows callback option. It represents each row as an object where property names correspond to data column names. + * @param data {H.datalens.Service.Data} + * @param x {H.datalens.QueryTileProvider.X} + * @param y {H.datalens.QueryTileProvider.Y} + * @param zoom {H.datalens.QueryTileProvider.Zoom} + * @returns {Array} + */ + static defaultDataToRows: (data: H.datalens.Service.Data, x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, zoom: H.datalens.QueryTileProvider.Zoom) => + H.datalens.HeatmapLayer.Row[]; + + /** + * Set of possible values for the inputScale option + * @type {H.datalens.HeatmapLayer.InputScale} + */ + static inputScale: H.datalens.HeatmapLayer.InputScale; + + /** + * Set of possible values for the aggregation option + * @type {H.datalens.HeatmapLayer.Aggregation} + */ + static aggregation: H.datalens.HeatmapLayer.Aggregation; + + /** + * @param zoom {number} - zoom level + * @return {H.datalens.HeatmapLayer.Options} + */ + getOptionsPerZoom(zoom: number): H.datalens.HeatmapLayer.Options; + + /** + * Removes listeners, and references to memory consuming objects, from this layer. Call this method when you no longer need the layer. + */ + dispose(): void; + + /** + * Force re-rendering of the layer. In the case where the callbacks passed to the layer options are not pure functions, you can call this method to force re-rendering. + */ + redraw(): void; + } + + namespace HeatmapLayer { + /** + * Defines data processing and rendering options for HeatmapLayer. + * The data processing flow of HeatmapLayer is similar to RasterLayer. The initial step of rendering is to split the tile data by rows, where each row represents a bucket. + * By default this step is processed with H.datalens.HeatmapLayer.defaultDataToRows. This behavior can be changed by defining the dataToRows callback. + * To collect the rows for a tile including buffer, the rows must be translated to H.datalens.HeatmapLayer.TilePoint. This translation must be specified with the rowToTilePoint callback. + * Other options define the blending options for the heat map. + * @property dataToRows {function(H.datalens.Service.Data, H.datalens.QueryTileProvider.X, H.datalens.QueryTileProvider.Y, H.datalens.QueryTileProvider.Zoom)=} - + * Defines how the input tile data is split by rows. You can specify this callback to define client-side aggregation and filtering. This callback is called for each tile. + * @property rowToTilePoint {function(H.datalens.HeatmapLayer.Row, H.datalens.HeatmapLayer.X, H.datalens.HeatmapLayer.Y)=} - + * Defines how the row is translated to the H.datalens.HeatmapLayer.TilePoint. This callback is called for each row that is returned from dataToRows. + * @property bandwidth {H.datalens.HeatmapLayer~Bandwidth | H.datalens.HeatmapLayer~BandwidthStop | Array. | + * H.datalens.HeatmapLayer~BandwidthCallback=} - Describes the bandwidth behavior in relation to current zoom level A numeric value sets it static across all levels + * An Object with zoom, value and optional zoomIncrementFactor (1 equals doubling on every zoom increment) defines a behavior across all zoom levels + * An Array of one or more zoom, value objects describes the behavior between the two defined levels and extrapolates the implied change outside of the defined range + * Alternatively defines the level of smoothing as a function of the zoom level. The callback must return a value in pixels. + * The cut-off of the Gaussian kernel is defined as 3 * bandwidth , a multiple (default 3) of bandwidth. + * @property valueRange {function(H.datalens.QueryTileProvider.Zoom)} - Defines the range for the color scale as a function of the zoom level. + * The returned value must be an array of 2 numbers. + * @property countRange {function(H.datalens.QueryTileProvider.Zoom)} - Defines the range for the density alpha mask as a function of the zoom level. + * When defined, the density alpha mask is applied. The returned value must be an array of 2 numbers. + * @property colorScale {function(number)} - Defines a color palette as a function of the normalized value. You can use D3.js library scale functions with the domain [0, 1]. + * @property alphaScale {function(number)} - Defines the alpha mask value as a function of the normalized count. + * You can use D3.js library scale functions with the domain [0, 1] and the range [0, 1]. + * @property aggregation {H.datalens.HeatmapLayer.Aggregation} - Specifies which type of aggregation was applied (eg. type of aggregation function for bucket in the Data Lens query). + * Possible values are SUM or AVERAGE. If the aggregation type is AVERAGE , then an averaged heat map is rendered. + * @property inputScale {H.datalens.HeatmapLayer.InputScale} - Defines the scale (eg logarithmic scale) of the TilePoint value. + * Note: if the value is not in a linear scale, then the aggregation in the source query must be defined with respect to the scale type. + * For example, before applying the average aggregation function in a query, the value must be transformed to the linear scale. This guarantees correct linear averaging of values. + */ + interface Options { + dataToRows?(data: H.datalens.Service.Data, x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, zoom: H.datalens.QueryTileProvider.Zoom): + H.datalens.HeatmapLayer.Row[]; + rowToTilePoint(row: H.datalens.HeatmapLayer.Row, x: H.datalens.HeatmapLayer.X, y: H.datalens.HeatmapLayer.Y): H.datalens.HeatmapLayer.TilePoint; + bandwidth?: H.datalens.HeatmapLayer.Bandwidth | H.datalens.HeatmapLayer.BandwidthStop | H.datalens.HeatmapLayer.BandwidthStop[] | H.datalens.HeatmapLayer.BandwidthCallback; + valueRange?(zoom: H.datalens.QueryTileProvider.Zoom): number[]; + countRange?(zoom: H.datalens.QueryTileProvider.Zoom): number[]; + colorScale?(scale: number): string; + alphaScale?(scale: number): number; + aggregation?: H.datalens.HeatmapLayer.Aggregation; + inputScale?: H.datalens.HeatmapLayer.InputScale; + } + + /** + * Tile X coordinate (column) + * Coordinate in XYZ tile numbering scheme. + */ + type X = number; + + /** + * Tile Y coordinate (row) + * Coordinate in XYZ tile numbering scheme. + */ + type Y = number; + + /** + * Slice of data (eg Data Lens query data row) that represents a data point. + * Each row is transformed into TilePoint and then rendered on a heat map. By default each row is an Object where property names correspond to data column names. + * This representation can be changed with the dataToRows callback. + */ + type Row = number; + + /** + * Defines a constant for the bandwidth + * A number that sets a constant for the bandwidth across all zoom levels. + */ + type Bandwidth = number; + + /** + * Sets the bandwidth for a given zoom level and uses this to calculate the increment or decrement of the bandwidth at other zoom levels + * This object defines the behavior of the bandwidth value across all zoom levels, initialized by a reference zoom level and its value at that level. + * The default behavior with zoomIncrementFactor = 1 doubles the bandwidth with every increasing zoom level and halves it on every decrease in zoom level. + * For example, a bandwidth of 10@zoom1 turns to 20@zoom2 and 5@zoom0. A zoomIncrementFactor of 0 effectively equals the bandwidth number, ignoring the provided zoom level. + * A zoomIncrementFactor of 0.5 mean a bandwidth increase of 50% compared to a factor of 1. So a bandwidth of 10@zoom1 computes to 15@zoom2. + */ + interface BandwidthStop { + zoom: number; + value: number; + zoomIncrementFactor?: number; + } + + /** + * TODO: this is missing in the documentation: https://developer.here.com/visualization/documentation/datalens/h-datalens-heatmaplayer-options.html + */ + type BandwidthCallback = () => void; + + /** + * Defines the input data format for heat map rendering. + * For heat map rendering, each row of data must be represented as a point within the map tile. + * @property x {number} - Row relative to tile + * @property y {number} - Column relative to tile + * @property value {number} - Value at the point (eg aggregated bucket value) + * @property count {number} - Number of contributors to the value at the point (eg number of rows in a bucket) + * @property data {H.datalens.HeatmapLayer.Row} - Reference to source data row + */ + interface TilePoint { + x: number; + y: number; + value: number; + count: number; + data?: H.datalens.HeatmapLayer.Row; + } + + /** + * Set of possible values for the aggregation option. + * If the heat map input data is buckets, then different types of aggregation can be applied to the rows in a bucket. + * The aggregation type is required for proper blending mode of the heat map. For the AVERAGE aggregation type, an averaged heat map is rendered. + * @property SUM {string} - Specifies that the sum aggregation was applied to the bucket value + * @property AVERAGE {string} - Specifies that the average aggregation was applied to the bucket value + */ + enum Aggregation { + SUM, + AVERAGE + } + + /** + * Set of possible values for the inputScale option. + * The input scale is required for proper heat map blending. If the input scale is not linear, then the TilePoint.value is converted to linear scale before calculating the sum or average. + * @property DB {string} - Decibel (dB) scale + * @property LINEAR {string} - Linear scale + * @property LOG {string} - Logarithmic scale + */ + enum InputScale { + DB, + LINEAR, + LOG + } + } + + /** + * Presents data as points or spatial map objects with data-driven styles and client-side clustering. + * Applicable for drawing interactive map objects like markers, polygons, circles and other instances of H.map.Object. Source of data can be either tiled or not tiled. + * Styles for objects can be parametrized with data rows and zoom level. Allows to create data-driven icons for markers like donuts or bars. + * Also enables clustering and data domains for visualizing up to 100k points or more. + */ + class ObjectLayer extends H.map.layer.ObjectLayer { + /** + * Constructor + * @param provider {H.map.provider.RemoteTileProvider | H.datalens.Provider | H.datalens.QueryProvider | H.datalens.QueryTileProvider} - Data source (tiled or not) + * @param options {H.datalens.ObjectLayer.Options} - Defines data processing, clustering and data-driven styling + */ + constructor(provider: H.map.provider.RemoteTileProvider | H.datalens.Provider | H.datalens.QueryProvider | H.datalens.QueryTileProvider, options: H.datalens.ObjectLayer.Options); + + /** + * Default value for dataToRows callback option. It represents each row as an object where property names correspond to data column names. + * @property data {H.datalens.Service.Data} + * @returns {Array} + */ + static defaultDataToRows(data: H.datalens.Service.Data): H.datalens.ObjectLayer.Row[]; + + /** + * A factory method for data-driven icons. The method allows you to build an icon from SVG markup or JsonML object. Provides caching of icons with the same markup. + * @param svg {string | Array} - SVG presented as markup or JsonML Array + * @param options {H.map.Icon.Options} - Icon options (eg size and anchor). Note that the default anchor is in the middle. + * @param options.size {H.math.ISize | number} - When the icon is a square, you can define the size as a number in pixels + * @returns {H.map.Icon} - Icon which can be used for marker or cluster + */ + static createIcon(svg: string | any[], options?: H.map.Icon.Options): H.map.Icon; + + /** + * Returns cache of icons created with the createIcon method. Can be used to clean the icon cache. + * @return {H.util.Cache} - Icon cache + */ + static getIconCache(): H.util.Cache; + + /** + * Force re-rendering of the layer. In the case where the callbacks passed to the layer options are not pure functions, you can call this method to force re-rendering. + */ + redraw(): void; + + /** + * Recalculates the style and applies it to the map object based on the new StyleState + * @param object {H.map.Object} - Map object + * @param state {H.datalens.ObjectLayer.StyleState} - New state + */ + updateObjectStyle(any: H.map.Object, state: H.datalens.ObjectLayer.StyleState): void; + } + + namespace ObjectLayer { + /** + * Defines data processing and data-driven styling for ObjectLayer + * The initial step of rendering is to split the tile data by rows, where each row represents a bucket. + * By default this step is processed with H.datalens.ObjectLayer.defaultDataToRows. This behavior can be changed by defining the dataToRows callback. + * In the next step each row must be presented as a map object with the rowToMapObject callback. Data-driven styling can be provided with the rowToStyle callback. + * @property dataToRows {function(H.datalens.Service.Data)=} - Defines how the input data is split by rows. You can specify this callback to define client-side aggregation and filtering. + * @property rowToMapObject {function(H.datalens.ObjectLayer.Row, H.datalens.QueryTileProvider.Zoom)} - Defines how each row is presented on the map (eg marker, polygon) + * @property rowToStyle {function(H.datalens.ObjectLayer.Row, H.datalens.QueryTileProvider.Zoom, H.datalens.ObjectLayer.StyleState)=} - + * Defines map object style and icon according to data row and zoom level. Also it can define different styles depending on the StyleState (eg hovered, selected). + * @property dataDomains {H.datalens.ObjectLayer.DataDomains=} - Defines quantization of data for improving data-driven styling performance + * @property clustering {H.datalens.ObjectLayer.Clustering=} - When present, client-side clustering is applied + */ + interface Options { + dataToRows?(data: H.datalens.Service.Data): H.datalens.ObjectLayer.Row[]; + rowToMapObject(row: H.datalens.ObjectLayer.Row, z: H.datalens.QueryTileProvider.Zoom): H.map.Object; + rowToStyle?(row: H.datalens.ObjectLayer.Row, z: H.datalens.QueryTileProvider.Zoom, styleState: H.datalens.ObjectLayer.StyleState): H.datalens.ObjectLayer.ObjectStyleOptions; + dataDomains?: H.datalens.ObjectLayer.DataDomains; + clustering?: H.datalens.ObjectLayer.Clustering; + } + + /** + * Defines client-side clustering in the ObjectLayer. + * When the clustering option is provided, rows returned from dataToRows go to the clustering.rowToDataPoint callback to be transformed to data points. + * Then, the data points are clustered according to clustering.options. Clustering produces clusters and noise points (data points that are not clustered). + * Clusters and noise points must be presented as map objects with the rowToMapObject callback and can be styled with the rowToStyle callback. + * @property rowToDataPoint {H.datalens.ObjectLayer.Row} - Defines data points from rows + * @property options {function(H.datalens.QueryTileProvider.Zoom)} - Defines clustering options as a function of the zoom level + */ + interface Clustering { + rowToDataPoint(row: H.datalens.ObjectLayer.Row): H.clustering.DataPoint; + options(zoom: H.datalens.QueryTileProvider.Zoom): H.clustering.Provider.ClusteringOptions; + } + + /** + * Slice of data (eg Data Lens query data row) that represents a data point. + * Each row is translated to map objects with the rowToMapObject callback. By default each row is an Object where property names correspond to data column names. + * This representation can be changed with the dataToRows callback. + */ + type Row = number; + + /** + * User defined modification of a data-driven style + * StyleState appears as a parameter in the rowToStyle callback. By default it is 'DEFAULT_STATE'. To change StyleState, use the ObjectLayer.updateObjectStyle method. + */ + type StyleState = any; + + /** + * Output from the rowToStyle callback. + * Defines the styles or the icon that is applied to the map object. + * @property icon {H.map.Icon} - Marker icon + * @property style {H.map.SpatialStyle.Options} - Spatial style + * @property arrows {H.map.ArrowStyle.Options} - Style of arrows to render along a polyline + * @property zIndex {number} - The z-index value of the map object, default is 0 + */ + interface ObjectStyleOptions { + icon: H.map.Icon; + style: H.map.SpatialStyle.Options; + arrows: H.map.ArrowStyle.Options; + zIndex: number; + } + + /** + * Input data quantization domain, used to optimize styling performance. + * The option must have properties corresponding to the properties of H.datalens.ObjectLayer.Row. Values must be represented as an Array of Numbers that defines the quantization domain. + * When provided, the input data will be quantized, and rowToStyle will be called only for quantized values. + */ + type DataDomains = any; + } + + /** + * Defines how to load data from a raw data file + * This provider defines the interface for loading data, such as geometries or coordinates, from a local or remote data file in GeoJSON or CSV format + */ + class RawDataProvider extends H.map.provider.RemoteTileProvider { + /** + * Constructor + * @param options {H.datalens.RawDataProvider.Options} - Configures options + */ + constructor(options: H.datalens.RawDataProvider.Options); + + /** + * Updates the data url. Note that new data will be fetched only after the reload method is called. + * @param dataUrl {string} + */ + setDataUrl(dataUrl: string): void; + } + + namespace RawDataProvider { + /** + * Defines options for RawDataProvider + * Options for RawDataProvider + * @property dataUrl - The data url to fetch + * @property dataToFeatures {function(any)=} - Defines how the input data is mapped to an array of GeoJSON features + * @property featuresToRows {function(Array, H.datalens.QueryTileProvider.X, H.datalens.QueryTileProvider.Y, H.datalens.QueryTileProvider.Zoom, + * H.datalens.RawDataProvider.TileSize, H.datalens.RawDataProvider.Helpers)=} - + * Defines how GeoJSON features on a tile should be mapped to data rows, which are inputs to layers such as ObjectLayer and HeatmapLayer + */ + interface Options { + dataUrl?: string; + dataToFeatures?(obj: any): H.datalens.RawDataProvider.Feature[]; + featuresToRows?(features: H.datalens.RawDataProvider.Feature[], x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, z: H.datalens.QueryTileProvider.Zoom, + tileSize: H.datalens.RawDataProvider.TileSize, helpers: H.datalens.RawDataProvider.Helpers): H.datalens.ObjectLayer.Row[]; + } + + /** + * A GeoJSON feature + * A GeoJSON feature object which conforms to the standard GeoJSON spec + */ + type Feature = any; + + /** + * Tile size + * The tile size in pixels. + */ + type TileSize = any; + + /** + * A helper class used in the worker thread + * This helper class provides convenience functions you can use in the worker thread + * @property latLngToPixel {function(H.datalens.RawDataProvider.Latitude, H.datalens.RawDataProvider.Longitude, H.datalens.QueryTileProvider.Zoom, H.datalens.RawDataProvider.TileSize)=} - + * Translates geographical coordinates (latitude, longitude) to world pixel coordinates. + * @property pixelToLatLng {function(H.datalens.RawDataProvider.PX, H.datalens.RawDataProvider.PY, H.datalens.QueryTileProvider.Zoom, H.datalens.RawDataProvider.TileSize)=} - + * Translates world pixel coordinates to geographical coordinates (latitude, longitude). + * @property parseCSV {function(any)=} - Takes CSV data as input, parses it, and return the parsed result. + */ + interface Helpers { + latLngToPixel?(latitude: H.datalens.RawDataProvider.Latitude, longitude: H.datalens.RawDataProvider.Longitude, z: H.datalens.QueryTileProvider.Zoom, + tileSize: H.datalens.RawDataProvider.TileSize): H.datalens.RawDataProvider.PixelCoordinates; + pixelToLatLng?(x: H.datalens.RawDataProvider.PX, y: H.datalens.RawDataProvider.PY, z: H.datalens.QueryTileProvider.Zoom, tileSize: H.datalens.RawDataProvider.TileSize): + H.datalens.RawDataProvider.GeoCoordinates; + parseCSV?(obj: any): any[]; + } + + /** + * Geographic coordinates + * A geographic coordinates pair [lat, lng] + */ + type GeoCoordinates = [number, number]; + + /** + * Latitude coordinate + * The latitude in the geographic coordinates pair + */ + type Latitude = number; + + /** + * Longitude coordinate + * The longitude in the geographic coordinates pair + */ + type Longitude = number; + + /** + * Pixel coordinates + * Pixel coordinates [px, py] pair + */ + type PixelCoordinates = [number, number]; + + /** + * Pixel coordinate in the x direction + * The x coordinate of the pixel coordinates pair [px, py] + */ + type PX = number; + + /** + * Pixel coordinate in the y direction + * The y coordinate of the pixel coordinates pair [px, py] + */ + type PY = number; + } + + /** + * Renders vector tiles using data-driven styles + * This layer binds the spatial data and user data, all provided by the Data Lens REST API. The layer renders geometry features using data-driven styles. + */ + class SpatialLayer extends H.map.layer.TileLayer { + /** + * Constructor + * @param dataProvider {H.datalens.Provider} - Source of tiled data (pass in null if data come from feature properties) + * @param spatialProvider {H.datalens.SpatialTileProvider} - Source of geometry data + * @param options {H.datalens.SpatialLayer.Options} - Configuration for data processing and rendering + */ + constructor(dataProvider: H.datalens.Provider, spatialProvider: H.datalens.SpatialTileProvider, options: H.datalens.SpatialLayer.Options); + + static DEFAULT_STATE: any; + static Spatial: any; + + /** + * Default value for dataToRows callback option. It represents each row as an object where property names correspond to data column names. + */ + static defaultDataToRows: any; + + /** + * Forces re-rendering of the layer. When the callbacks passed to the layer options are not pure functions, you can call this method to force re-rendering. + */ + redraw(): void; + + /** + * This method changes the state of a map object; for example, style on mouse event. + * @param {H.map.Object} spatial + * @param {H.datalens.SpatialLayer.StyleState} state + */ + updateSpatialStyle(spatial: H.map.Object, state: H.datalens.SpatialLayer.StyleState): void; + } + + namespace SpatialLayer { + /** + * Defines data processing and rendering options for SpatialLayer + * The initial step of rendering is to split the tile data by rows, where each row represents a bucket. + * By default this step is processed with H.datalens.SpatialLayer.defaultDataToRows. This behavior can be changed by defining the dataToRows callback. + * @property dataToRows {function(H.datalens.Service.Data, H.datalens.QueryTileProvider.X, H.datalens.QueryTileProvider.Y, H.datalens.QueryTileProvider.Zoom)=} - + * Defines how the input tile data is split by rows. You can specify this callback to define client-side aggregation and filtering. This callback is called for each tile. + * @property rowToSpatialId {function(H.datalens.SpatialLayer.Row)} - + * Defines how to get the spatial ID from a data row. This callback is called for each row that is returned from dataToRows. + * @property featureToSpatialId {function(H.datalens.SpatialLayer.Feature)} - + * Defines how to get the spatial ID from a geometry feature. This callback is called for each geometry feature in the vector tile. + * @property rowToStyle {function(H.datalens.SpatialLayer.Row, H.datalens.QueryTileProvider.Zoom, H.datalens.SpatialLayer.StyleState)} - + * Defines how the row is translated to map object style. This callback is called for each row that is returned from dataToRows. + * @property defaultStyle {function(H.datalens.QueryTileProvider.Zoom, H.datalens.SpatialLayer.StyleState)} - Defines the default map object style. + * @property transformFeature {H.datalens.SpatialLayer.transformFeature} - Defines how to transform the features. + */ + interface Options { + dataToRows?(data: H.datalens.Service.Data, x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, z: H.datalens.QueryTileProvider.Zoom): + H.datalens.SpatialLayer.Row[]; + rowToSpatialId(row: H.datalens.SpatialLayer.Row): string; + featureToSpatialId(feature: H.datalens.SpatialLayer.Feature): string; + rowToStyle(row: H.datalens.SpatialLayer.Row, z: H.datalens.QueryTileProvider.Zoom, styleState: H.datalens.SpatialLayer.StyleState): any; + defaultStyle(z: H.datalens.QueryTileProvider.Zoom, styleState: H.datalens.SpatialLayer.StyleState): any; + transformFeature: H.datalens.SpatialLayer.transformFeature; + } + + /** + * Defines modification of a data-driven style + * StyleState appears as a parameter in the rowToStyle callback. By default it is 'DEFAULT_STATE'. To change StyleState, use the SpatialLayer.updateSpatialStyle method. + */ + type StyleState = any; + + /** + * Defines a slice of data (eg Data Lens query data row) that represents a data point + * By default each row is an object where property names correspond to data column names. This representation can be changed with the dataToRows callback. + */ + type Row = any; + + /** + * Defines a geometry in the vector tile + * Each geometry is described by various properties, including a unique identifier which must be used to map the geometry to user data. + */ + type Feature = any; + + /** + * TODO: missing in documentation: https://developer.here.com/visualization/documentation/datalens/h-datalens-spatiallayer-options.html + */ + type transformFeature = any; + } + + /** + * Specifies how to access layer data (shapes, geometries) using the Data Lens REST API. + * This provider defines the interface for accessing shape layers via the Data Lens REST API. The input data is provided as vector tiles in the MapBox format (Protobuf). + * Data is loaded by tiles. + */ + class SpatialTileProvider extends H.map.provider.RemoteTileProvider { + /** + * Constructor + * @param service {H.datalens.Service} - Data Lens REST API service + * @param options {H.datalens.SpatialTileProvider.Options} - Configures layer name + */ + constructor(service: H.datalens.Service, options: H.datalens.SpatialTileProvider.Options); + + static VectorTile: any; + + /** + * Updates the layer name to be used in the next call of the Data Lens REST API. Note that new data will be fetched only after the reload method is called. + * @param {string} layerName + */ + setLayerName(layerName: string): void; + + /** + * Updates the query's dynamic parameters to be used in the next call of the Data Lens REST API. Note that new data will be fetched only after the reload method is called. + * This method is normally used when updating your visualization. + * @param {any|null} queryParams + */ + setQueryParams(queryParams: any | null): void; + } + + namespace SpatialTileProvider { + /** + * Defines layer name and data accessibility parameters for H.datalens.SpatialTileProvider + * This defines the layer name and dynamic parameters required for fetching tiled geometry data with the Data Lens REST API. Other options from H.datalens.Provider.Options are available. + * @property layerName {string} - The name of the layer to fetch with the Data Lens REST API query + * @property queryParams {any} - The query's dynamic parameters. The dynamic parameters can be used to filter data provided by the query. + */ + interface Options { + layerName: string; + queryParams?: any; + } + } + } +} diff --git a/types/heredatalens/tsconfig.json b/types/heredatalens/tsconfig.json new file mode 100644 index 0000000000..d687f69017 --- /dev/null +++ b/types/heredatalens/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/heredatalens/tslint.json b/types/heredatalens/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/heredatalens/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 5cced096319d160a84587c0ae96c0d9fff73e9e5 Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Tue, 23 May 2017 11:55:28 +0200 Subject: [PATCH 016/761] add missing test file to tsconfig.json --- types/heredatalens/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/heredatalens/tsconfig.json b/types/heredatalens/tsconfig.json index d687f69017..9c60b13753 100644 --- a/types/heredatalens/tsconfig.json +++ b/types/heredatalens/tsconfig.json @@ -17,6 +17,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "heredatalens-tests.ts" ] } \ No newline at end of file From dd14b496587c5d4497378ab0da1a656ff03130f1 Mon Sep 17 00:00:00 2001 From: Gabe Scholz Date: Tue, 23 May 2017 12:01:10 -0700 Subject: [PATCH 017/761] Ensure that typings for resolves and rejects return type Matchers> --- types/jest/index.d.ts | 72 +++++++++++++++++++++------------------- types/jest/jest-tests.ts | 39 +++++++++++++++++----- 2 files changed, 68 insertions(+), 43 deletions(-) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index 7ac5c7486b..9c96fd1615 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -159,7 +159,7 @@ declare namespace jest { * * @param {any} actual The value to apply matchers against. */ - (actual: any): Matchers; + (actual: any): Matchers; anything(): any; /** Matches anything that was created with the given constructor. You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value. */ any(classType: any): any; @@ -175,69 +175,71 @@ declare namespace jest { stringMatching(str: string | RegExp): any; } - interface Matchers { + interface Matchers { /** If you know how to test something, `.not` lets you test its opposite. */ - not: Matchers; - resolves: Matchers; - rejects: Matchers; - lastCalledWith(...args: any[]): void; + not: Matchers; + /** Use resolves to unwrap the value of a fulfilled promise so any other matcher can be chained. If the promise is rejected the assertion fails. */ + resolves: Matchers>; + /** Unwraps the reason of a rejected promise so any other matcher can be chained. If the promise is fulfilled the assertion fails. */ + rejects: Matchers>; + lastCalledWith(...args: any[]): R; /** Checks that a value is what you expect. It uses `===` to check strict equality. Don't use `toBe` with floating-point numbers. */ - toBe(expected: any): void; + toBe(expected: any): R; /** Ensures that a mock function is called. */ - toBeCalled(): void; + toBeCalled(): R; /** Ensure that a mock function is called with specific arguments. */ - toBeCalledWith(...args: any[]): void; + toBeCalledWith(...args: any[]): R; /** Using exact equality with floating point numbers is a bad idea. Rounding means that intuitive things fail. */ - toBeCloseTo(expected: number, delta?: number): void; + toBeCloseTo(expected: number, delta?: number): R; /** Ensure that a variable is not undefined. */ - toBeDefined(): void; + toBeDefined(): R; /** When you don't care what a value is, you just want to ensure a value is false in a boolean context. */ - toBeFalsy(): void; + toBeFalsy(): R; /** For comparing floating point numbers. */ - toBeGreaterThan(expected: number): void; + toBeGreaterThan(expected: number): R; /** For comparing floating point numbers. */ - toBeGreaterThanOrEqual(expected: number): void; + toBeGreaterThanOrEqual(expected: number): R; /** Ensure that an object is an instance of a class. This matcher uses `instanceof` underneath. */ - toBeInstanceOf(expected: any): void + toBeInstanceOf(expected: any): R /** For comparing floating point numbers. */ - toBeLessThan(expected: number): void; + toBeLessThan(expected: number): R; /** For comparing floating point numbers. */ - toBeLessThanOrEqual(expected: number): void; + toBeLessThanOrEqual(expected: number): R; /** This is the same as `.toBe(null)` but the error messages are a bit nicer. So use `.toBeNull()` when you want to check that something is null. */ - toBeNull(): void; + toBeNull(): R; /** Use when you don't care what a value is, you just want to ensure a value is true in a boolean context. In JavaScript, there are six falsy values: `false`, `0`, `''`, `null`, `undefined`, and `NaN`. Everything else is truthy. */ - toBeTruthy(): void; + toBeTruthy(): R; /** Used to check that a variable is undefined. */ - toBeUndefined(): void; + toBeUndefined(): R; /** Used when you want to check that an item is in a list. For testing the items in the list, this uses `===`, a strict equality check. */ - toContain(expected: any): void; + toContain(expected: any): R; /** Used when you want to check that an item is in a list. For testing the items in the list, this matcher recursively checks the equality of all fields, rather than checking for object identity. */ - toContainEqual(expected: any): void; + toContainEqual(expected: any): R; /** Used when you want to check that two objects have the same value. This matcher recursively checks the equality of all fields, rather than checking for object identity. */ - toEqual(expected: any): void; + toEqual(expected: any): R; /** Ensures that a mock function is called. */ - toHaveBeenCalled(): boolean; + toHaveBeenCalled(): R; /** Ensures that a mock function is called an exact number of times. */ - toHaveBeenCalledTimes(expected: number): boolean; + toHaveBeenCalledTimes(expected: number): R; /** Ensure that a mock function is called with specific arguments. */ - toHaveBeenCalledWith(...params: any[]): boolean; + toHaveBeenCalledWith(...params: any[]): R; /** If you have a mock function, you can use `.toHaveBeenLastCalledWith` to test what arguments it was last called with. */ - toHaveBeenLastCalledWith(...params: any[]): boolean; + toHaveBeenLastCalledWith(...params: any[]): R; /** Used to check that an object has a `.length` property and it is set to a certain numeric value. */ - toHaveLength(expected: number): void; - toHaveProperty(propertyPath: string, value?: any): void; + toHaveLength(expected: number): R; + toHaveProperty(propertyPath: string, value?: any): R; /** Check that a string matches a regular expression. */ - toMatch(expected: string | RegExp): void; + toMatch(expected: string | RegExp): R; /** Used to check that a JavaScript object matches a subset of the properties of an objec */ - toMatchObject(expected: {}): void; + toMatchObject(expected: {}): R; /** This ensures that a value matches the most recent snapshot. Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information. */ - toMatchSnapshot(snapshotName?: string): void; + toMatchSnapshot(snapshotName?: string): R; /** Used to test that a function throws when it is called. */ - toThrow(error?: string | Constructable | RegExp): void; + toThrow(error?: string | Constructable | RegExp): R; /** If you want to test that a specific error is thrown inside a function. */ - toThrowError(error?: string | Constructable | RegExp): void; + toThrowError(error?: string | Constructable | RegExp): R; /** Used to test that a function throws a error matching the most recent snapshot when it is called. */ - toThrowErrorMatchingSnapshot(): void; + toThrowErrorMatchingSnapshot(): R; } interface Constructable { diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index 0605724334..eb86e1c861 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -503,16 +503,39 @@ describe('Mocks', function () { }); // https://facebook.github.io/jest/docs/en/expect.html#resolves -describe('resolves', function () { - it('unwraps the expected Promise', function () { - return expect(Promise.resolve('test')).resolves.toEqual('test'); +describe('resolves', function() { + it('unwraps the expected Promise', function() { + const expectation = expect(Promise.resolve('test')).resolves.toEqual('test'); + expect(expectation instanceof Promise).toBeTruthy(); + return expectation; + }); + + it('unwraps a .toHaveBeenCalledX', function(done) { + expect.assertions(2); + + const fn = jest.fn(); + return expect(Promise.resolve(fn)).resolves.toHaveBeenCalledTimes(0).then(val => { + expect(val).toEqual(true); + done(); + }); + }); + + it('unwraps a not.toHaveBeenCalledX', function(done) { + expect.assertions(2); + + const fn = jest.fn(); + return expect(Promise.resolve(fn)).resolves.not.toHaveBeenCalledTimes(1).then(val => { + expect(val).toEqual(true); + done(); + }); }); }); // https://facebook.github.io/jest/docs/en/expect.html#rejects -describe('rejects', function () { - it('unwraps the expected Promise', function () { - const error = new Error('error'); - return expect(Promise.reject(error)).rejects.toBeDefined(); +describe('rejects', function() { + it('unwraps the expected Promise', function() { + const expectation = expect(Promise.reject(new Error('error'))).rejects.toMatch('error'); + expect(expectation instanceof Promise).toBeTruthy(); + return expectation; }); -}); \ No newline at end of file +}); From c42655ba9dc3b7b59e693e99f7b4626b16f91111 Mon Sep 17 00:00:00 2001 From: james1293 Date: Tue, 23 May 2017 16:37:38 -0400 Subject: [PATCH 018/761] Add undefined as possible output of Map.get() --- types/es6-shim/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/es6-shim/index.d.ts b/types/es6-shim/index.d.ts index 483f4357e0..b1dd1d8fd4 100644 --- a/types/es6-shim/index.d.ts +++ b/types/es6-shim/index.d.ts @@ -556,7 +556,7 @@ interface Map { clear(): void; delete(key: K): boolean; forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; + get(key: K): V | undefined; has(key: K): boolean; set(key: K, value?: V): Map; size: number; From 4f0face89dfec6305fef20f3859819e45c55f35b Mon Sep 17 00:00:00 2001 From: amiram Date: Wed, 24 May 2017 08:00:30 +0300 Subject: [PATCH 019/761] CreateUserData: add more properties. UpdateUserData: added. DeleteMultifactorParams: added type for provider. UnlinkAccountsParams: added type for provider. UnlinkAccountsResponse: added. deleteUserMultifactor: removed returned value. --- types/auth0/index.d.ts | 85 +++++++++++++++++++++++++++++++++--------- 1 file changed, 67 insertions(+), 18 deletions(-) diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index be4de08f1f..a27493244a 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -13,7 +13,7 @@ export interface ManagementClientOptions { export interface UserMetadata { } export interface AppMetadata { } -export interface UserData { +export interface CreateUserData { connection: string; email?: string; username?: string; @@ -21,9 +21,28 @@ export interface UserData { phone_number?: string; user_metadata?: UserMetadata; email_verified?: boolean; + verify_email?: boolean; + phone_verified?: boolean, app_metadata?: AppMetadata; } +export interface UpdateUserData { + blocked?: boolean; + email_verified?: boolean; + email?: string; + verify_email?: boolean, + phone_number?: string, + phone_verified?: boolean, + verify_phone_number?: boolean, + password?: string, + verify_password?: boolean, + user_metadata?: UserMetadata, + app_metadata?: AppMetadata, + connection?: string, + username?: string, + client_id?: string +} + export interface GetUsersData { per_page?: number; page?: number; @@ -67,8 +86,7 @@ export interface Identity { isSocial: boolean; } -export interface UpdateUserParameters { - id: string; +export interface UpdateUserParameters extends ObjectWithId { } export interface AuthenticationClientOptions { @@ -134,17 +152,47 @@ export interface ClientParams { client_id: string; } +export type DeleteDeleteMultifactorParamsProvider = 'duo' | 'google-authenticator'; + export interface DeleteMultifactorParams { id: string; - provider: string; + provider: DeleteDeleteMultifactorParamsProvider; } -export interface LinkAccountsParams { +export type UnlinkAccountsParamsProvider = 'ad' | 'adfs' | 'amazon' | 'dropbox' | 'bitbucket' | 'aol' | 'auth0-adldap' | + 'auth0-oidc' | 'auth0' | 'baidu' | 'bitly' | 'box' | 'custom' | 'dwolla' | 'email' | 'evernote-sandbox' | 'evernote' | + 'exact' | 'facebook' | 'fitbit' | 'flickr' | 'github' | 'google-apps' | 'google-oauth2' | 'guardian' | 'instagram' | + 'ip' | 'linkedin' | 'miicard' | 'oauth1' | 'oauth2' | 'office365' | 'paypal' | 'paypal-sandbox' | 'pingfederate' | + 'planningcenter' | 'renren' | 'salesforce-community' | 'salesforce-sandbox' | 'salesforce' | 'samlp' | 'sharepoint' | + 'shopify' | 'sms' | 'soundcloud' | 'thecity-sandbox' | 'thecity' | 'thirtysevensignals' | 'twitter' | 'untappd' | + 'vkontakte' | 'waad' | 'weibo' | 'windowslive' | 'wordpress' | 'yahoo' | 'yammer' | 'yandex'; + +export interface UnlinkAccountsParams { id: string; - provider: string; + provider: UnlinkAccountsParamsProvider; user_id: string; } +export interface UnlinkAccountsResponseProfile { + email?: string; + email_verified?: boolean; + name?: string; + username?: string; + given_name?: string; + phone_number?: string; + phone_verified?: boolean; + family_name?: string; +} + +export interface UnlinkAccountsResponse { + connection: string; + user_id: string; + provider: string; + isSocial?: boolean; + access_token?: string; + profileData?: UnlinkAccountsResponseProfile +} + export interface LinkAccountsData { user_id: string; connection_id: string; @@ -310,29 +358,30 @@ export class ManagementClient { getUser(params: ObjectWithId): Promise; getUser(params: ObjectWithId, cb?: (err: Error, user: User) => void): void; - createUser(data: UserData): Promise; - createUser(data: UserData, cb: (err: Error, data: User) => void): void; + createUser(data: CreateUserData): Promise; + createUser(data: CreateUserData, cb: (err: Error, data: User) => void): void; - updateUser(params: UpdateUserParameters, data: User): Promise; - updateUser(params: UpdateUserParameters, data: User, cb: (err: Error, data: User) => void): void; + updateUser(params: ObjectWithId, data: UpdateUserData): Promise; + updateUser(params: ObjectWithId, data: UpdateUserData, cb: (err: Error, data: User) => void): void; - updateUserMetadata(params: UpdateUserParameters, data: UserMetadata): Promise; - updateUserMetadata(params: UpdateUserParameters, data: UserMetadata, cb: (err: Error, data: User) => void): void; + updateUserMetadata(params: ObjectWithId, data: UserMetadata): Promise; + updateUserMetadata(params: ObjectWithId, data: UserMetadata, cb: (err: Error, data: User) => void): void; + // Should be removed from auth0 also. Doesn't exist in api. deleteAllUsers(): Promise; deleteAllUsers(cb: (err: Error, data: any) => void): void; deleteUser(params: ObjectWithId): Promise; deleteUser(params: ObjectWithId, cb?: (err: Error) => void): void; - updateAppMetadata(params: UpdateUserParameters, data: AppMetadata): Promise; - updateAppMetadata(params: UpdateUserParameters, data: AppMetadata, cb: (err: Error, data: User) => void): void; + updateAppMetadata(params: ObjectWithId, data: AppMetadata): Promise; + updateAppMetadata(params: ObjectWithId, data: AppMetadata, cb: (err: Error, data: User) => void): void; - deleteUserMultifactor(params: DeleteMultifactorParams): Promise; - deleteUserMultifactor(params: DeleteMultifactorParams, cb: (err: Error, data: any) => void): void; + deleteUserMultifactor(params: DeleteMultifactorParams): Promise; + deleteUserMultifactor(params: DeleteMultifactorParams, cb: (err: Error) => void): void; - unlinkUsers(params: LinkAccountsParams): Promise; - unlinkUsers(params: LinkAccountsParams, cb: (err: Error, data: any) => void): void; + unlinkUsers(params: UnlinkAccountsParams): Promise; + unlinkUsers(params: UnlinkAccountsParams, cb: (err: Error, data: UnlinkAccountsResponse) => void): void; linkUsers(params: ObjectWithId, data: LinkAccountsData): Promise; linkUsers(params: ObjectWithId, data: LinkAccountsData, cb: (err: Error, data: any) => void): void; From 3c74c9177ae449efe328eabd7aa3a429aa32b863 Mon Sep 17 00:00:00 2001 From: LKay Date: Wed, 24 May 2017 14:48:34 +0900 Subject: [PATCH 020/761] Fix export for react-icon-base --- types/react-icon-base/index.d.ts | 19 ++++++++++++------- .../react-icon-base/react-icon-base-tests.tsx | 6 +++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/types/react-icon-base/index.d.ts b/types/react-icon-base/index.d.ts index 600d33dff7..11628505e0 100644 --- a/types/react-icon-base/index.d.ts +++ b/types/react-icon-base/index.d.ts @@ -1,15 +1,20 @@ // Type definitions for react-icon-base 2.0 // Project: https://github.com/gorangajic/react-icon-base#readme -// Definitions by: Alexandre Paré +// Definitions by: Alexandre Paré , Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -import * as React from 'react'; +import * as React from "react"; -export interface IconBaseProps { - color?: string; - size?: string | number; - style?: React.CSSProperties; +export = IconBaseClass; + +declare namespace IconBaseClass { + export interface IconBaseProps { + color?: string; + size?: string | number; + style?: React.CSSProperties; + viewBox?: string; + } } -export default class IconBase extends React.Component {} +declare class IconBaseClass extends React.Component {} diff --git a/types/react-icon-base/react-icon-base-tests.tsx b/types/react-icon-base/react-icon-base-tests.tsx index 16ebafd133..c0d56f03f2 100644 --- a/types/react-icon-base/react-icon-base-tests.tsx +++ b/types/react-icon-base/react-icon-base-tests.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; -import IconBase from 'react-icon-base'; +import * as React from "react"; +import * as IconBase from "react-icon-base"; -export default ; +export default ; From b918472ea5c2bfdba70bce1d818e804b986ff736 Mon Sep 17 00:00:00 2001 From: LKay Date: Wed, 24 May 2017 16:07:46 +0900 Subject: [PATCH 021/761] Remove unnecessary export --- types/react-icon-base/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-icon-base/index.d.ts b/types/react-icon-base/index.d.ts index 11628505e0..121b846ed8 100644 --- a/types/react-icon-base/index.d.ts +++ b/types/react-icon-base/index.d.ts @@ -9,7 +9,7 @@ import * as React from "react"; export = IconBaseClass; declare namespace IconBaseClass { - export interface IconBaseProps { + interface IconBaseProps { color?: string; size?: string | number; style?: React.CSSProperties; From 7c3baa4616a9c634f6242f9035030007390f512c Mon Sep 17 00:00:00 2001 From: Eliot Fallon Date: Wed, 24 May 2017 10:05:42 +0100 Subject: [PATCH 022/761] Added a new type to better restrict playsinline parameter to 1 or 0. --- types/youtube/index.d.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/types/youtube/index.d.ts b/types/youtube/index.d.ts index 5a2dc3f19e..11e2a4e30d 100644 --- a/types/youtube/index.d.ts +++ b/types/youtube/index.d.ts @@ -251,6 +251,22 @@ declare namespace YT */ Modest = 1 } + + /** + * Whether to playback video inline or full-screen in an HTML5 player on iOS + */ + export const enum PlaysInline + { + /** + * Playback in fullscreen. + */ + Fullscreen = 0, + + /** + * Playback inline + */ + Inline = 1 + } /** * Whether to show related videos after the video finishes. @@ -267,7 +283,7 @@ declare namespace YT */ Show = 1 } - + /** * Whether to show video information before playing. */ @@ -521,9 +537,9 @@ declare namespace YT playlist?: string; /** - * Whether videos play inline or fullscreen in an HTML5 player on iOS. Valid values are: 1 or 0. + * Whether videos play inline or fullscreen in an HTML5 player on iOS. (currently by default, Fullscreen). */ - playsinline?: number; + playsinline?: PlaysInline; /** * Whether to show related videos after the video finishes (by default, Show). From 52c5e0734682fc73882a3d751581c7a6d3385f5a Mon Sep 17 00:00:00 2001 From: amiram Date: Sun, 28 May 2017 21:30:21 +0300 Subject: [PATCH 023/761] Make UpdateUserData extend UserData --- types/auth0/index.d.ts | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index a27493244a..5fab6ff513 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -13,33 +13,23 @@ export interface ManagementClientOptions { export interface UserMetadata { } export interface AppMetadata { } -export interface CreateUserData { +export interface UserData { connection: string; email?: string; username?: string; - password?: string; - phone_number?: string; - user_metadata?: UserMetadata; email_verified?: boolean; verify_email?: boolean; + password?: string; + phone_number?: string; phone_verified?: boolean, + user_metadata?: UserMetadata; app_metadata?: AppMetadata; } -export interface UpdateUserData { +export interface UpdateUserData extends UserData { blocked?: boolean; - email_verified?: boolean; - email?: string; - verify_email?: boolean, - phone_number?: string, - phone_verified?: boolean, verify_phone_number?: boolean, - password?: string, verify_password?: boolean, - user_metadata?: UserMetadata, - app_metadata?: AppMetadata, - connection?: string, - username?: string, client_id?: string } @@ -358,8 +348,8 @@ export class ManagementClient { getUser(params: ObjectWithId): Promise; getUser(params: ObjectWithId, cb?: (err: Error, user: User) => void): void; - createUser(data: CreateUserData): Promise; - createUser(data: CreateUserData, cb: (err: Error, data: User) => void): void; + createUser(data: UserData): Promise; + createUser(data: UserData, cb: (err: Error, data: User) => void): void; updateUser(params: ObjectWithId, data: UpdateUserData): Promise; updateUser(params: ObjectWithId, data: UpdateUserData, cb: (err: Error, data: User) => void): void; From babb37825c209e7c9630414ca0968847611db7df Mon Sep 17 00:00:00 2001 From: amiram Date: Mon, 29 May 2017 07:32:13 +0300 Subject: [PATCH 024/761] Make CreateUserData extend UserData --- types/auth0/index.d.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 5fab6ff513..79e02498c2 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -14,7 +14,6 @@ export interface UserMetadata { } export interface AppMetadata { } export interface UserData { - connection: string; email?: string; username?: string; email_verified?: boolean; @@ -26,7 +25,12 @@ export interface UserData { app_metadata?: AppMetadata; } +export interface CreateUserData extends UserData { + connection: string; +} + export interface UpdateUserData extends UserData { + connection?: string; blocked?: boolean; verify_phone_number?: boolean, verify_password?: boolean, @@ -348,8 +352,8 @@ export class ManagementClient { getUser(params: ObjectWithId): Promise; getUser(params: ObjectWithId, cb?: (err: Error, user: User) => void): void; - createUser(data: UserData): Promise; - createUser(data: UserData, cb: (err: Error, data: User) => void): void; + createUser(data: CreateUserData): Promise; + createUser(data: CreateUserData, cb: (err: Error, data: User) => void): void; updateUser(params: ObjectWithId, data: UpdateUserData): Promise; updateUser(params: ObjectWithId, data: UpdateUserData, cb: (err: Error, data: User) => void): void; From 5332c59958bcdf3220c211ce21530b12b7144dcc Mon Sep 17 00:00:00 2001 From: Geert Jansen Date: Mon, 29 May 2017 09:04:45 +0200 Subject: [PATCH 025/761] update methodNames parameter type on createSpyObj Adds missing Object type to the methodNames parameter on the jasmine.createSpyObj method. --- types/jasmine/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/jasmine/index.d.ts b/types/jasmine/index.d.ts index 11b0d1919c..4f57d976fe 100644 --- a/types/jasmine/index.d.ts +++ b/types/jasmine/index.d.ts @@ -58,8 +58,8 @@ declare namespace jasmine { function objectContaining(sample: Partial): ObjectContaining; function createSpy(name: string, originalFn?: Function): Spy; - function createSpyObj(baseName: string, methodNames: any[]): any; - function createSpyObj(baseName: string, methodNames: any[]): T; + function createSpyObj(baseName: string, methodNames: any[] | {[methodName: string]: any}): any; + function createSpyObj(baseName: string, methodNames: any[] | {[methodName: string]: any}): T; function pp(value: any): string; From 649f8e44f145620cd9409aa8ac4ca87888a11796 Mon Sep 17 00:00:00 2001 From: Gabe Scholz Date: Mon, 29 May 2017 16:17:51 -0700 Subject: [PATCH 026/761] PR Fixes: - Fix Jest version - Add hasAssertions() --- types/jest/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index 9c96fd1615..9abee06c9f 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Jest 19.2.0 +// Type definitions for Jest 20.0.4 // Project: http://facebook.github.io/jest/ // Definitions by: Asana , Ivo Stratev , jwbay , Alexey Svetliakov , Alex Jover Morales // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -167,6 +167,8 @@ declare namespace jest { arrayContaining(arr: any[]): any; /** Verifies that a certain number of assertions are called during a test. This is often useful when testing asynchronous code, in order to make sure that assertions in a callback actually got called. */ assertions(num: number): void; + /** Verifies that at least one assertion is called during a test. This is often useful when testing asynchronous code, in order to make sure that assertions in a callback actually got called. */ + hasAssertions(): void; /** You can use `expect.extend` to add your own matchers to Jest. */ extend(obj: ExpectExtendMap): void; /** Matches any object that recursively matches the provided keys. This is often handy in conjunction with other asymmetric matchers. */ From 0ceebb9dd2e45f5cbe7b995d7b2534677b7c899e Mon Sep 17 00:00:00 2001 From: Marc Fallows Date: Thu, 1 Jun 2017 21:51:10 +1000 Subject: [PATCH 027/761] react-motion fix merge I believe there was an error when merging: https://github.com/DefinitelyTyped/DefinitelyTyped/commit/b488f3cb5f70ea62c66a3ecaef4e38baadf3727c#diff-3b3fa3639f39b82eca3e15e4ef0f54eeR125 You can see the originally merge PR matches my change: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/9965/files#diff-1ad63a2a56d869f9cc5e998febe8e52eR128 --- types/react-motion/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-motion/index.d.ts b/types/react-motion/index.d.ts index 8254ad78aa..733daa071b 100644 --- a/types/react-motion/index.d.ts +++ b/types/react-motion/index.d.ts @@ -123,7 +123,7 @@ interface TransitionProps { */ willLeave?: (styleThatLeft: TransitionStyle) => Style | void; } -export class TransitionMotion extends Component { } +export class TransitionMotion extends Component { } interface StaggeredMotionProps { From c0b269b6eed1fcb6615e337d6a8511828de2d22e Mon Sep 17 00:00:00 2001 From: Marc Fallows Date: Thu, 1 Jun 2017 22:04:46 +1000 Subject: [PATCH 028/761] children optional as per https://github.com/DefinitelyTyped/DefinitelyTyped/pull/9965/files#diff-1ad63a2a56d869f9cc5e998febe8e52eR116 --- types/react-motion/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-motion/index.d.ts b/types/react-motion/index.d.ts index 733daa071b..abdfd27048 100644 --- a/types/react-motion/index.d.ts +++ b/types/react-motion/index.d.ts @@ -111,7 +111,7 @@ interface TransitionProps { * */ styles: Array | InterpolateFunction; - children: (interpolatedStyles: Array) => ReactElement; + children?: (interpolatedStyles: Array) => ReactElement; /** * Triggers when new elements appears * @param styleThatEntered From 644f9e560d3c3c89917fd11740cac3d17732ed5e Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 1 Jun 2017 14:42:15 +0200 Subject: [PATCH 029/761] Update index.d.ts fixed curry right --- types/lodash/index.d.ts | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index b8ae248190..198bc528fd 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -10331,6 +10331,36 @@ declare namespace _ { (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; } + interface RightCurriedFunction1{ + ():RightCurriedFunction1 + (t1:T1):R + } + interface RightCurriedFunction2{ + ():RightCurriedFunction2 + (t2:T2):RightCurriedFunction1 + (t1:T1,t2:T2):R + } + interface RightCurriedFunction3{ + ():RightCurriedFunction3 + (t3:T3):RightCurriedFunction2 + (t2:T2,t3:T3):RightCurriedFunction1 + (t1:T1,t2:T2,t3:T3):R + } + interface RightCurriedFunction4{ + ():RightCurriedFunction4 + (t4:T4):RightCurriedFunction3 + (t3:T3,t4:T4):RightCurriedFunction2 + (t2:T2,t3:T3,t4:T4):RightCurriedFunction1 + (t1:T1,t2:T2,t3:T3,t4:T4):R + } + interface RightCurriedFunction5{ + ():RightCurriedFunction5 + (t5:T5):RightCurriedFunction4 + (t4:T4,t5:T5):RightCurriedFunction3 + (t3:T3,t4:T4,t5:T5):RightCurriedFunction2 + (t2:T2,t3:T3,t4:T4,t5:T5):RightCurriedFunction1 + (t1:T1,t2:T2,t3:T3,t4:T4,t5:T5):R + } interface LoDashImplicitObjectWrapper { /** @@ -10348,7 +10378,7 @@ declare namespace _ { * @return Returns the new curried function. */ curryRight(func: (t1: T1) => R): - CurriedFunction1; + RightCurriedFunction1; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight * instead of _.partial. @@ -10356,7 +10386,7 @@ declare namespace _ { * @return Returns the new curried function. */ curryRight(func: (t1: T1, t2: T2) => R): - CurriedFunction2; + RightCurriedFunction2; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight * instead of _.partial. @@ -10364,7 +10394,7 @@ declare namespace _ { * @return Returns the new curried function. */ curryRight(func: (t1: T1, t2: T2, t3: T3) => R): - CurriedFunction3; + RightCurriedFunction3; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight * instead of _.partial. @@ -10372,7 +10402,7 @@ declare namespace _ { * @return Returns the new curried function. */ curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): - CurriedFunction4; + RightCurriedFunction4; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight * instead of _.partial. @@ -10380,7 +10410,7 @@ declare namespace _ { * @return Returns the new curried function. */ curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): - CurriedFunction5; + RightCurriedFunction5; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight * instead of _.partial. From 4d2f91fcce89ce6343206c2c776e7e6f2a160cb2 Mon Sep 17 00:00:00 2001 From: Luke Libraro Date: Thu, 1 Jun 2017 12:10:55 -0500 Subject: [PATCH 030/761] Added noble callback function signatures --- types/noble/index.d.ts | 9 ++++++++- types/noble/noble-tests.ts | 4 ++++ types/noble/tsconfig.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/types/noble/index.d.ts b/types/noble/index.d.ts index 4e293993f7..e5fa57caa8 100644 --- a/types/noble/index.d.ts +++ b/types/noble/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for noble // Project: https://github.com/sandeepmistry/noble -// Definitions by: Seon-Wook Park , Hans Bakker , Shantanu Bhadoria +// Definitions by: Seon-Wook Park +// Hans Bakker +// Shantanu Bhadoria +// Luke Libraro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -9,9 +12,13 @@ import events = require("events"); export declare function startScanning(): void; +export declare function startScanning(callback: Function): void; export declare function startScanning(serviceUUIDs: string[]): void; +export declare function startScanning(serviceUUIDs: string[], callback: Function): void; export declare function startScanning(serviceUUIDs: string[], allowDuplicates: boolean): void; +export declare function startScanning(serviceUUIDs: string[], allowDuplicates: boolean, callback: Function): void; export declare function stopScanning(): void; +export declare function stopScanning(callback: Function): void; export declare function on(event: string, listener: Function): events.EventEmitter; export declare function on(event: "stateChange", listener: (state: string) => void): events.EventEmitter; diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index 9c3f403944..2a2324fd33 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -4,14 +4,18 @@ import noble = require("noble"); function test_startScanning(): void { "use strict"; noble.startScanning(); + noble.startScanning(function(err: any) {}); noble.startScanning(["0x180d"]); + noble.startScanning(["0x180d"], function(err: any) {}); noble.startScanning(["0x180d"], true); + noble.startScanning(["0x180d"], true, function(err: any) {}); } test_startScanning(); function test_stopScanning(): void { "use strict"; noble.stopScanning(); + noble.stopScanning(function(err: any) {}); } test_stopScanning(); diff --git a/types/noble/tsconfig.json b/types/noble/tsconfig.json index 5821c4f99e..9b75c82d95 100644 --- a/types/noble/tsconfig.json +++ b/types/noble/tsconfig.json @@ -19,4 +19,4 @@ "index.d.ts", "noble-tests.ts" ] -} \ No newline at end of file +} From 3da30f09115a591f71d71f5fc4f1f71c696c102d Mon Sep 17 00:00:00 2001 From: Luke Libraro Date: Thu, 1 Jun 2017 13:02:20 -0500 Subject: [PATCH 031/761] changes based on feedback --- types/noble/index.d.ts | 12 ++++-------- types/noble/noble-tests.ts | 8 ++++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/types/noble/index.d.ts b/types/noble/index.d.ts index e5fa57caa8..4f2b5f0b7c 100644 --- a/types/noble/index.d.ts +++ b/types/noble/index.d.ts @@ -11,14 +11,10 @@ import events = require("events"); -export declare function startScanning(): void; -export declare function startScanning(callback: Function): void; -export declare function startScanning(serviceUUIDs: string[]): void; -export declare function startScanning(serviceUUIDs: string[], callback: Function): void; -export declare function startScanning(serviceUUIDs: string[], allowDuplicates: boolean): void; -export declare function startScanning(serviceUUIDs: string[], allowDuplicates: boolean, callback: Function): void; -export declare function stopScanning(): void; -export declare function stopScanning(callback: Function): void; +export declare function startScanning(callback?: (error?: Error) => void): void; +export declare function startScanning(serviceUUIDs: string[], callback?: (error?: Error) => void): void; +export declare function startScanning(serviceUUIDs: string[], allowDuplicates: boolean, callback?: (error?: Error) => void): void; +export declare function stopScanning(callback?: () => void): void; export declare function on(event: string, listener: Function): events.EventEmitter; export declare function on(event: "stateChange", listener: (state: string) => void): events.EventEmitter; diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index 2a2324fd33..5cba50632a 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -4,18 +4,18 @@ import noble = require("noble"); function test_startScanning(): void { "use strict"; noble.startScanning(); - noble.startScanning(function(err: any) {}); + noble.startScanning((err: Error) => {}); noble.startScanning(["0x180d"]); - noble.startScanning(["0x180d"], function(err: any) {}); + noble.startScanning(["0x180d"], (err: Error) => {}); noble.startScanning(["0x180d"], true); - noble.startScanning(["0x180d"], true, function(err: any) {}); + noble.startScanning(["0x180d"], true, (err: Error) => {}); } test_startScanning(); function test_stopScanning(): void { "use strict"; noble.stopScanning(); - noble.stopScanning(function(err: any) {}); + noble.stopScanning(() => {}); } test_stopScanning(); From 4ed9a56eb0c2a34aa3e6c594f0e9063db24e7d1f Mon Sep 17 00:00:00 2001 From: Luke Libraro Date: Thu, 1 Jun 2017 13:03:46 -0500 Subject: [PATCH 032/761] removed unnecessary Error types --- types/noble/noble-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index 5cba50632a..baa65c5662 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -4,11 +4,11 @@ import noble = require("noble"); function test_startScanning(): void { "use strict"; noble.startScanning(); - noble.startScanning((err: Error) => {}); + noble.startScanning((err) => {}); noble.startScanning(["0x180d"]); - noble.startScanning(["0x180d"], (err: Error) => {}); + noble.startScanning(["0x180d"], (err) => {}); noble.startScanning(["0x180d"], true); - noble.startScanning(["0x180d"], true, (err: Error) => {}); + noble.startScanning(["0x180d"], true, (err) => {}); } test_startScanning(); From 7ded9e7db477e1503b219009ff7971b25d08cb53 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 1 Jun 2017 21:09:29 +0100 Subject: [PATCH 033/761] Initial commit of files --- types/nodegit/index.d.ts | 6 +++ types/nodegit/nodegit-tests.ts | 5 +++ types/nodegit/repository.d.ts | 71 ++++++++++++++++++++++++++++++++++ types/nodegit/tsconfig.json | 23 +++++++++++ types/nodegit/tslint.json | 6 +++ 5 files changed, 111 insertions(+) create mode 100644 types/nodegit/index.d.ts create mode 100644 types/nodegit/nodegit-tests.ts create mode 100644 types/nodegit/repository.d.ts create mode 100644 types/nodegit/tsconfig.json create mode 100644 types/nodegit/tslint.json diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts new file mode 100644 index 0000000000..3a70a8ea9a --- /dev/null +++ b/types/nodegit/index.d.ts @@ -0,0 +1,6 @@ +// Type definitions for nodegit 0.18 +// Project: https://github.com/nodegit/nodegit +// Definitions by: Dolan Miu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export { Repository } from './repository'; diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts new file mode 100644 index 0000000000..b7fa54b0c1 --- /dev/null +++ b/types/nodegit/nodegit-tests.ts @@ -0,0 +1,5 @@ +import * as Git from 'nodegit'; + +Git.Repository.discover("startPath", 1, "ceilingDirs").then((string) => { + // Use string +}); diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts new file mode 100644 index 0000000000..f075a063f1 --- /dev/null +++ b/types/nodegit/repository.d.ts @@ -0,0 +1,71 @@ +interface RepositoryInitOptions { + description: string, + flags: number, + initialHead: string, + mode: number, + originUrl: string, + templatePath: string, + version: number, + workdirPath: string +} + + +export class Repository { + /** + * Creates a branch with the passed in name pointing to the commit + * + * @static + * @param {string} startPath + * @param {number} acrossFs + * @param {string} ceilingDirs + * @returns {Promise} + * + * @memberof Repository + */ + static discover(startPath: string, acrossFs: number, ceilingDirs: string): Promise; + /** + * + * + * @static + * @param {string} path + * @param {boolean} [isBare] + * @returns {Promise} + * + * @memberof Repository + */ + static init(path: string, isBare?: boolean): Promise; + /** + * + * + * @static + * @param {string} repoPath + * @param {RepositoryInitOptions} [options] + * @returns {Promise} + * + * @memberof Repository + */ + static initExt(repoPath: string, options?: RepositoryInitOptions): Promise; + /** + * + * + * @static + * @param {string} path + * @returns {Promise} + * + * @memberof Repository + */ + static open(path: string): Promise; + /** + * + * + * @static + * @param {string} barePath + * @returns {Promise} + * + * @memberof Repository + */ + static openBare(barePath: string): Promise; + static openExt(path: string, flags?: number, ceilingDirs?: string): Promise; + + // getBranchCommit(name: string): Promise; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json new file mode 100644 index 0000000000..ba25d4da3e --- /dev/null +++ b/types/nodegit/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "nodegit-tests.ts", + "repository.d.ts" + ] +} diff --git a/types/nodegit/tslint.json b/types/nodegit/tslint.json new file mode 100644 index 0000000000..a62d0d4e68 --- /dev/null +++ b/types/nodegit/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false + } +} From 082710a32c88410a67e873c250f7ce1c1c29fd72 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 2 Jun 2017 03:05:10 +0100 Subject: [PATCH 034/761] Added more types --- types/nodegit/buf.d.ts | 12 +++++ types/nodegit/index.d.ts | 7 +++ types/nodegit/object.d.ts | 21 +++++++++ types/nodegit/odb.d.ts | 18 ++++++++ types/nodegit/oid.d.ts | 11 +++++ types/nodegit/reference.d.ts | 58 ++++++++++++++++++++++++ types/nodegit/repository.d.ts | 83 ++++++++++++++++++++++++++++++++++- types/nodegit/signature.d.ts | 15 +++++++ types/nodegit/time.d.ts | 4 ++ types/nodegit/tsconfig.json | 9 +++- 10 files changed, 235 insertions(+), 3 deletions(-) create mode 100644 types/nodegit/buf.d.ts create mode 100644 types/nodegit/object.d.ts create mode 100644 types/nodegit/odb.d.ts create mode 100644 types/nodegit/oid.d.ts create mode 100644 types/nodegit/reference.d.ts create mode 100644 types/nodegit/signature.d.ts create mode 100644 types/nodegit/time.d.ts diff --git a/types/nodegit/buf.d.ts b/types/nodegit/buf.d.ts new file mode 100644 index 0000000000..53886615ed --- /dev/null +++ b/types/nodegit/buf.d.ts @@ -0,0 +1,12 @@ +/// + +export class Buf { + containsNul(): number; + free(): void; + grow(target_size: number): Promise; + isBinary(): number; + set(data: Buffer, datalen: number): Promise; + ptr: string; + asize: number; + size: number; + } diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 3a70a8ea9a..77d7003e05 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -3,4 +3,11 @@ // Definitions by: Dolan Miu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export { Buf } from './buf'; +export { Object } from './object'; +export { Odb } from './odb'; +export { Oid } from './oid'; +export { Reference } from './reference'; export { Repository } from './repository'; +export { Signature } from './signature'; +export { Time } from './time'; diff --git a/types/nodegit/object.d.ts b/types/nodegit/object.d.ts new file mode 100644 index 0000000000..8fabe5fdd2 --- /dev/null +++ b/types/nodegit/object.d.ts @@ -0,0 +1,21 @@ +import { Oid } from './oid'; +import { Repository } from './repository'; +import { Buf } from './buf'; + +export class Object { + static size(type: number): number; + static lookup(repo: Repository, id: Oid, type: number): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number, type: number): Promise; + static string2type(str: string): number; + static type2string(type: number): string; + static typeisloose(type: number): number; + + dup(): Promise; + free(): void; + id(): Oid; + lookupByPath(path: string, type: number): Promise; + owner(): Repository; + peel(target_type: number): Promise; + shortId(): Promise; + type(): number; +} diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts new file mode 100644 index 0000000000..acacda8b73 --- /dev/null +++ b/types/nodegit/odb.d.ts @@ -0,0 +1,18 @@ +import { Oid } from './oid'; + +export namespace Odb { + enum STREAM { + RDONLY = 2, + WRONLY = 4, + RW = 6 + } +} + +export class Odb { + static open(objects_dir: string): Promise; + + addDiskAlternate(path: string): number; + free(): void; + read(id: Oid): Promise; + write(data: Buffer, len: number, type: number): Promise; +} diff --git a/types/nodegit/oid.d.ts b/types/nodegit/oid.d.ts new file mode 100644 index 0000000000..2aa65905f6 --- /dev/null +++ b/types/nodegit/oid.d.ts @@ -0,0 +1,11 @@ +export class Oid { + static fromString(str: string): Oid; + cmp(b: Oid): number; + cpy(): Oid; + equal(b: Oid): number; + iszero(): number; + ncmp(b: Oid, len: number): number; + strcmp(str: string): number; + streq(str: string): number; + tostrS(): string; +} diff --git a/types/nodegit/reference.d.ts b/types/nodegit/reference.d.ts new file mode 100644 index 0000000000..92e3e546b2 --- /dev/null +++ b/types/nodegit/reference.d.ts @@ -0,0 +1,58 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; + +export namespace Reference { + enum TYPE { + INVALID = 0, + OID = 1, + SYMBOLIC = 2, + LISTALL = 3 + } + + enum NORMALIZE { + REF_FORMAT_NORMAL = 0, + REF_FORMAT_ALLOW_ONELEVEL = 1, + REF_FORMAT_REFSPEC_PATTERN = 2, + REF_FORMAT_REFSPEC_SHORTHAND = 4 + } +} + +export class Reference { + static create(repo: Repository, name: string, id: Oid, force: number, logMessage: string): Promise; + static createMatching(repo: Repository, name: string, id: Oid, force: number, currentId: Oid, logMessage: string): Promise; + static dwim(repo: Repository, id: string | Reference, callback: Function): Promise; + static ensureLog(repo: Repository, refname: string): number; + static hasLog(repo: Repository, refname: string): number; + static isValidName(refname: string): number; + static list(repo: Repository): Promise; + static lookup(repo: Repository, id: string | Reference, callback: Function): Promise; + static nameToId(repo: Repository, name: string): Promise; + static normalizeName(bufferOut: string, bufferSize: number, name: string, flags: number): number; + static remove(repo: Repository, name: string): number; + static symbolicCreate(repo: Repository, name: string, target: string, force: number, logMessage: string): Promise; + static symbolicCreateMatching(repo: Repository, name: string, target: string, force: number, currentValue: string, logMessage: string): Promise; + + cmp(ref2: Reference): number; + delete(): number; + isBranch(): number; + isNote(): number; + isRemote(): number; + isTag(): number; + name(): string; + owner(): Repository; + peel(type: number): Promise; + rename(newName: string, force: number, logMessage: string): Promise; + resolve(): Promise; + setTarget(id: Oid, logMessage: string): Promise; + shorthand(): string; + symbolicSetTarget(target: string, logMessage: string): Promise; + symbolicTarget(): string; + target(): Oid; + targetPeel(): Oid; + type(): number; + isValid(): Boolean; + isConcrete(): Boolean; + isSymbolic(): Boolean; + toString(): string; + isHead(): boolean; +} diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index f075a063f1..f32ca65c60 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -1,3 +1,9 @@ +import { Oid } from './oid'; +import { Buf } from './buf'; +import { Reference } from './reference'; +import { Odb } from './odb'; +import { Object } from './object'; + interface RepositoryInitOptions { description: string, flags: number, @@ -22,7 +28,7 @@ export class Repository { * * @memberof Repository */ - static discover(startPath: string, acrossFs: number, ceilingDirs: string): Promise; + static discover(startPath: string, acrossFs: number, ceilingDirs: string): Promise; /** * * @@ -66,6 +72,79 @@ export class Repository { */ static openBare(barePath: string): Promise; static openExt(path: string, flags?: number, ceilingDirs?: string): Promise; + static wrapOdb(odb: Odb): Promise; - // getBranchCommit(name: string): Promise; + cleanup(): void; + config(): Promise; + configSnapshot(): Promise; + detachHead(): number; + fetchheadForeach(callback: Function): Promise; + free(): void; + getNamespace(): string; + head(): Promise; + headDetached(): number; + headUnborn(): number; + index(): Promise; + isBare(): number; + isEmpty(): number; + isShallow(): number; + mergeheadForeach(callback: Function): Promise; + messageRemove(): number; + odb(): Promise; + path(): string; + refdb(): Promise; + setHead(refname: string): Promise; + setHeadDetached(commitish: Oid): number; + setHeadDetachedFromAnnotated(commitish: NodeGit.AnnotatedCommit): number; + setIdent(name: string, email: string): number; + setNamespace(nmspace: string): number; + setWorkdir(workdir: string, update_gitlink: number): number; + state(): number; + stateCleanup(): number; + workdir(): string; + createBranch(name: string, commit: NodeGit.Commit | string | Oid, force: boolean, signature: NodeGit.Signature, logMessage: string): Promise; + getReferenceCommit(name: string | Reference): Promise; + getBranch(name: string | Reference): Promise; + getBranchCommit(name: string | Reference): Promise; + getCurrentBranch(): Promise; + getReference(name: string | Reference): Promise; + getReferences(type: Reference.TYPE): Promise; + getReferenceNames(type: Reference.TYPE): Promise; + getCommit(string: string | Oid): Promise; + getBlob(string: string | Oid): Promise; + getTree(string: string | Oid): Promise; + createTag(string: string | Oid, name: string, message: string): Promise; + createLightweightTag(string: string | Oid, name: string): Promise; + getTag(string: string | Oid): Promise; + getTagByName(Short: string): Promise; + deleteTagByName(Short: string): Promise; + createRevWalk(string: string | Oid): any; + getMasterCommit(): Promise; + getHeadCommit(): Promise; + createCommit(updateRef: string, author: NodeGit.Signature, committer: NodeGit.Signature, message: string, Tree: NodeGit.Tree | Oid | string, parents: any[]): Promise; + createCommitOnHead(filesToAdd: any[], author: NodeGit.Signature, committer: NodeGit.Signature, message: string): Promise; + createBlobFromBuffer(buffer: Buffer): Oid; + treeBuilder(tree: NodeGit.Tree): any; + defaultSignature(): Signature; + getRemotes(Optional: Function): Promise; + getRemote(remote: string | Remote, callback: Function): Promise; + fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; + fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; + mergeBranches(to: string | Reference, from: string | Reference, signature: NodeGit.Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise; + rebaseBranches(branch: string, upstream: string, onto: string, signature: NodeGit.Signature, beforeNextFn: Function): Promise; + continueRebase(signature: NodeGit.Signature, beforeNextFn: Function): Promise; + getStatus(opts: any): Promise; + getStatusExt(opts: any): Promise; + getSubmoduleNames(): Promise; + checkoutRef(reference: Reference, opts: Object | CheckoutOptions): Promise; + checkoutBranch(branch: string | Reference, opts: Object | CheckoutOptions): Promise; + stageFilemode(filePath: string | any[], stageNew: Boolean): Promise; + stageLines(filePath: string, newLines: any[], isStaged: Boolean): Promise; + isDefaultState(): Boolean; + isApplyingMailbox(): Boolean; + isBisecting(): Boolean; + isCherrypicking(): Boolean; + isMerging(): Boolean; + isRebasing(): Boolean; + isReverting(): Boolean; } diff --git a/types/nodegit/signature.d.ts b/types/nodegit/signature.d.ts new file mode 100644 index 0000000000..c18ccb45ff --- /dev/null +++ b/types/nodegit/signature.d.ts @@ -0,0 +1,15 @@ +import { Repository } from './repository'; +import { Time } from './time'; + +export class Signature { + static default(repo: Repository): Signature; + static create(name: string, email: string, time: number, offset: number): Signature; + static now(name: string, email: string): Signature; + + dup(): Promise; + free(): void; + toString(): string; + name: string; + email: string; + when: Time; +} diff --git a/types/nodegit/time.d.ts b/types/nodegit/time.d.ts new file mode 100644 index 0000000000..575c005781 --- /dev/null +++ b/types/nodegit/time.d.ts @@ -0,0 +1,4 @@ +export class Time { + time: number; + offset: number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index ba25d4da3e..471d7919cd 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -16,8 +16,15 @@ "forceConsistentCasingInFileNames": true }, "files": [ + "buf.d.ts", "index.d.ts", "nodegit-tests.ts", - "repository.d.ts" + "object.d.ts", + "odb.d.ts", + "oid.d.ts", + "reference.d.ts", + "repository.d.ts", + "signature.d.ts", + "time.d.ts", ] } From 78d04b84f9efae7534a1cb101f0e51ca93847f23 Mon Sep 17 00:00:00 2001 From: Edvinas Naraveckas Date: Fri, 2 Jun 2017 10:21:14 +0300 Subject: [PATCH 035/761] Adding Window type to webix.event --- types/webix/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/webix/index.d.ts b/types/webix/index.d.ts index f5d2954d7a..2ddc28403a 100755 --- a/types/webix/index.d.ts +++ b/types/webix/index.d.ts @@ -200,7 +200,7 @@ function delay(code:WebixCallback, owner?:any, params?:any[], delay?:number):num function detachEvent(id:string):void; function dp(name:string):any; function editStop():void; -function event(node:HTMLElement|string, event:string, handler:WebixCallback, context?:any):string|number; +function event(node:HTMLElement|Window|string, event:string, handler:WebixCallback, context?:any):string|number; function eventRemove(id:string|number):void; function exec(code:string):void; function extend(target:any, source:any, overwrite?:boolean):any; @@ -811,7 +811,7 @@ interface TreeCollection{ clearAll():void; clearValidation():void; copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; + count():number; define(property:string, value:any):void; destructor():void; detachEvent(id:string):void; From 9f2fc6d8382ea219fd63e6121d142ebf1e71927c Mon Sep 17 00:00:00 2001 From: Tim Brust Date: Fri, 2 Jun 2017 12:06:13 +0200 Subject: [PATCH 036/761] fix(webdriverio): $$ utility returns an array, fixes #16841 --- types/webdriverio/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/webdriverio/index.d.ts b/types/webdriverio/index.d.ts index 5c856575b2..666da7f5bf 100644 --- a/types/webdriverio/index.d.ts +++ b/types/webdriverio/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for WebdriverIO 4.7 // Project: http://www.webdriver.io/ -// Definitions by: Nick Malaguti , Tim Brust +// Definitions by: Nick Malaguti +// Tim Brust +// Fredrik Smedberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -1551,7 +1553,7 @@ declare namespace WebdriverIO { $(selector: string): Client> & RawResult; $

(selector: string): Client

; - $$(selector: string): Client> & RawResult; + $$(selector: string): Client>> & Array>; $$

(selector: string): Client

; addCommand( From 9d2d217c3c929db64c59a9cf96b5b356e9c5bf95 Mon Sep 17 00:00:00 2001 From: Dvorscak Date: Fri, 2 Jun 2017 10:05:20 -0500 Subject: [PATCH 037/761] Add test for css function second parameter --- types/jquery/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index 9dc1bf466e..39d75e1eaf 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -682,8 +682,9 @@ interface JQueryCoordinates { /** * The interface used to specify the properties parameter in css() */ +type cssPropertySetter = (index: number, value: string) => string | number; interface JQueryCssProperties { - [propertyName: string]: string | number | Function; + [propertyName: string]: string | number | cssPropertySetter; } /** From 5222e357223f7208a46098464d61cc4f4038300b Mon Sep 17 00:00:00 2001 From: Dvorscak Date: Fri, 2 Jun 2017 10:05:42 -0500 Subject: [PATCH 038/761] Make cssPropertySettter more strict --- types/jquery/jquery-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index d2d58aa2a2..3a2d2a74bc 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -1062,8 +1062,8 @@ function test_css() { var color = $(this).css("background-color"); $("#result").html("That div is " + color + "."); }); - $('div.example').css('width', function (index) { - return index * 50; + $('div.example').css('width', function (index, style) { + return style.length > 0 ? style : index * 50; }); $("p").mouseover(function () { $(this).css("color", "red"); From 4d87daf40a39ab1954ea8dc1183b34a1d529455c Mon Sep 17 00:00:00 2001 From: Marco Gonzalez Date: Fri, 2 Jun 2017 09:45:41 -0600 Subject: [PATCH 039/761] Added typings for the http-aws-es package. --- types/http-aws-es/http-aws-es-tests.ts | 42 ++++++++++++++++++++++++++ types/http-aws-es/index.d.ts | 25 +++++++++++++++ types/http-aws-es/package.json | 5 +++ types/http-aws-es/tsconfig.json | 22 ++++++++++++++ types/http-aws-es/tslint.json | 1 + 5 files changed, 95 insertions(+) create mode 100644 types/http-aws-es/http-aws-es-tests.ts create mode 100644 types/http-aws-es/index.d.ts create mode 100644 types/http-aws-es/package.json create mode 100644 types/http-aws-es/tsconfig.json create mode 100644 types/http-aws-es/tslint.json diff --git a/types/http-aws-es/http-aws-es-tests.ts b/types/http-aws-es/http-aws-es-tests.ts new file mode 100644 index 0000000000..df432dbab4 --- /dev/null +++ b/types/http-aws-es/http-aws-es-tests.ts @@ -0,0 +1,42 @@ +import { EnvironmentCredentials } from "aws-sdk/lib/core"; +import { Client } from "elasticsearch"; +import HttpAmazonESConnector = require("http-aws-es"); + +new Client({ + amazonES: { + accessKey: "AKID", + region: "us-east-1", + secretKey: "secret", + }, + connectionClass: HttpAmazonESConnector, + host: "https://amazon-es-host.us-east-1.es.amazonaws.com", +}); + +new Client({ + amazonES: { + accessKey: "AKID", + region: "us-east-1", + secretKey: "secret", + }, + connectionClass: require("http-aws-es"), + host: "https://amazon-es-host.us-east-1.es.amazonaws.com", +}); + +const myCredentials = new EnvironmentCredentials("AWS"); +new Client({ + amazonES: { + credentials: myCredentials, + region: "us-east-1", + }, + connectionClass: HttpAmazonESConnector, + host: "https://amazon-es-host.us-east-1.es.amazonaws.com", +}); + +new Client({ + amazonES: { + credentials: myCredentials, + region: "us-east-1", + }, + connectionClass: require("http-aws-es"), + host: "https://amazon-es-host.us-east-1.es.amazonaws.com", +}); diff --git a/types/http-aws-es/index.d.ts b/types/http-aws-es/index.d.ts new file mode 100644 index 0000000000..c14547a58f --- /dev/null +++ b/types/http-aws-es/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for http-aws-es 1.1 +// Project: https://github.com/TheDeveloper/http-aws-es#readme +// Definitions by: Marco Gonzalez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as e from "elasticsearch"; +import { Credentials } from "aws-sdk/lib/core"; + +declare module "elasticsearch" { + interface AmazonESOptions { + accessKey?: string; + credentials?: Credentials; + region: string; + secretKey?: string; + } + + interface ConfigOptions { + amazonES?: AmazonESOptions; + } +} + +declare const HttpAmazonESConnector: any; +export = HttpAmazonESConnector; diff --git a/types/http-aws-es/package.json b/types/http-aws-es/package.json new file mode 100644 index 0000000000..e4fd5a5e97 --- /dev/null +++ b/types/http-aws-es/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "aws-sdk": "^2.7.0" + } +} diff --git a/types/http-aws-es/tsconfig.json b/types/http-aws-es/tsconfig.json new file mode 100644 index 0000000000..f1689d92e4 --- /dev/null +++ b/types/http-aws-es/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "http-aws-es-tests.ts" + ] +} diff --git a/types/http-aws-es/tslint.json b/types/http-aws-es/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/http-aws-es/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 84e83354e7cf3dec1b9e6c366c59f6b561e7bd9a Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Fri, 2 Jun 2017 21:56:32 +0300 Subject: [PATCH 040/761] Formatting. --- types/superagent/index.d.ts | 66 ++--- types/superagent/superagent-tests.ts | 367 ++++++++++++++------------- types/superagent/tsconfig.json | 2 +- 3 files changed, 220 insertions(+), 215 deletions(-) diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index fe6a797675..b53feed20d 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -21,7 +21,7 @@ declare namespace request { method: string; url: string; cookies: string; - } + } interface SuperAgentStatic extends SuperAgent { (url: string): SuperAgentRequest; (method: string, url: string): SuperAgentRequest; @@ -58,9 +58,9 @@ declare namespace request { search(url: string, callback?: CallbackHandler): Req; connect(url: string, callback?: CallbackHandler): Req; - parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this; - saveCookies(res: Response): void; - attachCookies(req: Req): void; + parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this; + saveCookies(res: Response): void; + attachCookies(req: Req): void; } interface Response extends NodeJS.ReadableStream { @@ -90,35 +90,35 @@ declare namespace request { } interface Request extends Promise /* extends NodeJS.WritableStream */ { - abort(): void; - accept(type: string): this; - attach(field: string, file: string, filename?: string): this; - auth(user: string, name: string): this; - buffer(val?: boolean): this; - clearTimeout(): this; - end(callback?: CallbackHandler): this; - field(name: string, val: string): this; - get(field: string): string; - on(name: string, handler: Function): this; - on(name: 'error', handler: (err: any) => void): this; - part(): this; - pipe(stream: NodeJS.WritableStream, options?: Object): stream.Writable; - query(val: Object): this; - redirects(n: number): this; - responseType(type: string): this; - send(data: string): this; - send(data: Object): this; - send(): this; - set(field: string, val: string): this; - set(field: Object): this; - timeout(ms: number): this; - type(val: string): this; - unset(field: string): this; - use(fn: Function): this; - withCredentials(): this; - write(data: string, encoding?: string): this; - write(data: Buffer, encoding?: string): this; - parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this; + abort(): void; + accept(type: string): this; + attach(field: string, file: string, filename?: string): this; + auth(user: string, name: string): this; + buffer(val?: boolean): this; + clearTimeout(): this; + end(callback?: CallbackHandler): this; + field(name: string, val: string): this; + get(field: string): string; + on(name: string, handler: Function): this; + on(name: 'error', handler: (err: any) => void): this; + part(): this; + pipe(stream: NodeJS.WritableStream, options?: Object): stream.Writable; + query(val: Object): this; + redirects(n: number): this; + responseType(type: string): this; + send(data: string): this; + send(data: Object): this; + send(): this; + set(field: string, val: string): this; + set(field: Object): this; + timeout(ms: number): this; + type(val: string): this; + unset(field: string): this; + use(fn: Function): this; + withCredentials(): this; + write(data: string, encoding?: string): this; + write(data: Buffer, encoding?: string): this; + parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this; } } diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index da60314b23..cfac121640 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -1,9 +1,9 @@ // via: http://visionmedia.github.io/superagent/ -import * as request from 'superagent'; -import * as fs from 'fs'; -import * as assert from 'assert'; -import { Agent } from 'https'; +import * as request from 'superagent' +import * as fs from 'fs' +import * as assert from 'assert' +import {Agent} from 'https' // Examples taken from https://github.com/visionmedia/superagent/blob/gh-pages/docs/index.md @@ -12,207 +12,208 @@ import { Agent } from 'https'; const httpsAgent: Agent = new Agent(); request - .post('/api/pet') - .send({ name: 'Manny', species: 'cat' }) - .set('X-API-Key', 'foobar') - .set('Accept', 'application/json') - .agent(httpsAgent) - .end((err, res) => { - if (res.ok) { - console.log('yay got ' + JSON.stringify(res.body)); - } else { - console.log('Oh no! error ' + res.text); - } - }); + .post('/api/pet') + .send({name: 'Manny', species: 'cat'}) + .set('X-API-Key', 'foobar') + .set('Accept', 'application/json') + .agent(httpsAgent) + .end((err, res) => { + if (res.ok) { + console.log('yay got ' + JSON.stringify(res.body)); + } else { + console.log('Oh no! error ' + res.text); + } + }); var agent = request.agent(); agent - .post('/api/pet') - .send({ name: 'Manny', species: 'cat' }) - .set('X-API-Key', 'foobar') - .set('Accept', 'application/json') - .end((err, res) => { - if (res.error) { - console.log('oh no ' + res.error.message); - } else { - console.log('got ' + res.status + ' response'); - } - }); + .post('/api/pet') + .send({name: 'Manny', species: 'cat'}) + .set('X-API-Key', 'foobar') + .set('Accept', 'application/json') + .end((err, res) => { + if (res.error) { + console.log('oh no ' + res.error.message); + } else { + console.log('got ' + res.status + ' response'); + } + }); // Plugins var nocache = require('superagent-no-cache'); var prefix = require('superagent-prefix')('/static'); request - .get('/some-url') - .use(prefix) // Prefixes *only* this request - .use(nocache) // Prevents caching of *only* this request - .end(function(err, res){ - // Do something - }); + .get('/some-url') + .use(prefix) // Prefixes *only* this request + .use(nocache) // Prevents caching of *only* this request + .end(function (err, res) { + // Do something + }); -var callback = (err: any, res: request.Response) => {}; +var callback = (err: any, res: request.Response) => { +}; // Request basics request - .get('/search') - .end(callback); + .get('/search') + .end(callback); request('GET', '/search') - .end(callback); + .end(callback); request - .get('http://example.com/search') - .end(callback); + .get('http://example.com/search') + .end(callback); request - .head('/favicon.ico') - .end(callback); + .head('/favicon.ico') + .end(callback); request - .del('/user/1') - .end(callback); + .del('/user/1') + .end(callback); request - .delete('/user/1') - .end(callback); + .delete('/user/1') + .end(callback); request - .delete('/user/1') - .send() - .end(callback); + .delete('/user/1') + .send() + .end(callback); request('/search') - .end(callback); + .end(callback); // Setting header fields request - .get('/search') - .set('API-Key', 'foobar') - .set('Accept', 'application/json') - .end(callback); + .get('/search') + .set('API-Key', 'foobar') + .set('Accept', 'application/json') + .end(callback); request - .get('/search') - .set({ 'API-Key': 'foobar', Accept: 'application/json' }) - .end(callback); + .get('/search') + .set({'API-Key': 'foobar', Accept: 'application/json'}) + .end(callback); // GET requests request - .get('/search') - .query({ query: 'Manny' }) - .query({ range: '1..5' }) - .query({ order: 'desc' }) - .end(callback); + .get('/search') + .query({query: 'Manny'}) + .query({range: '1..5'}) + .query({order: 'desc'}) + .end(callback); request - .get('/search') - .query({ query: 'Manny', range: '1..5', order: 'desc' }) - .end(callback); + .get('/search') + .query({query: 'Manny', range: '1..5', order: 'desc'}) + .end(callback); request - .get('/querystring') - .query('search=Manny&range=1..5') - .end(callback); + .get('/querystring') + .query('search=Manny&range=1..5') + .end(callback); request - .get('/querystring') - .query('search=Manny') - .query('range=1..5') - .end(callback); + .get('/querystring') + .query('search=Manny') + .query('range=1..5') + .end(callback); // HEAD requests request - .head('/users') - .query({ email: 'joe@smith.com' }) - .end(callback); + .head('/users') + .query({email: 'joe@smith.com'}) + .end(callback); // POST / PUT requests request.post('/user') - .set('Content-Type', 'application/json') - .send('{"name":"tj","pet":"tobi"}') - .end(callback); + .set('Content-Type', 'application/json') + .send('{"name":"tj","pet":"tobi"}') + .end(callback); request.post('/user') - .send({ name: 'tj', pet: 'tobi' }) - .end(callback); + .send({name: 'tj', pet: 'tobi'}) + .end(callback); request.post('/user') - .send({ name: 'tj' }) - .send({ pet: 'tobi' }) - .end(callback); + .send({name: 'tj'}) + .send({pet: 'tobi'}) + .end(callback); request.post('/user') - .send('name=tj') - .send('pet=tobi') - .end(callback); + .send('name=tj') + .send('pet=tobi') + .end(callback); request.post('/user') - .type('form') - .send({ name: 'tj' }) - .send({ pet: 'tobi' }) - .end(callback); + .type('form') + .send({name: 'tj'}) + .send({pet: 'tobi'}) + .end(callback); // Setting the Content-Type request.post('/user') - .set('Content-Type', 'application/json'); + .set('Content-Type', 'application/json'); request.post('/user') - .type('application/json'); + .type('application/json'); request.post('/user') - .type('json'); + .type('json'); request.post('/user') - .type('png'); + .type('png'); // Setting Accept request.get('/user') - .accept('application/json'); + .accept('application/json'); request.get('/user') - .accept('json'); + .accept('json'); request.get('/user') - .accept('png'); + .accept('png'); // Query strings request - .post('/') - .query({ format: 'json' }) - .query({ dest: '/login' }) - .send({ post: 'data', here: 'wahoo' }) - .end(callback); + .post('/') + .query({format: 'json'}) + .query({dest: '/login'}) + .send({post: 'data', here: 'wahoo'}) + .end(callback); // Parsing response bodies request('/search') - .end((res: request.Response) => { - var status: number = res.status; - var body = res.body; - var files: Object = res.files; - var text: string = res.text; - var contentLength = res.header['content-length']; - var contentType: string = res.type; - var charset: string = res.charset; - }); + .end((res: request.Response) => { + var status: number = res.status; + var body = res.body; + var files: Object = res.files; + var text: string = res.text; + var contentLength = res.header['content-length']; + var contentType: string = res.type; + var charset: string = res.charset; + }); // Custom parsers request - .post('/search') - .parse((res, callback) => { - res.setEncoding("binary"); - let data = ""; - res.on("data", (chunk: string) => { - data += chunk; - }); + .post('/search') + .parse((res, callback) => { + res.setEncoding("binary"); + let data = ""; + res.on("data", (chunk: string) => { + data += chunk; + }); - res.on("end", () => { - callback(null, new Buffer(data, "base64")); + res.on("end", () => { + callback(null, new Buffer(data, "base64")); + }); + }) + .end((res: request.Response) => { + res.body.toString("hex"); }); - }) - .end((res: request.Response) => { - res.body.toString("hex"); - }); var req = request.get('/hoge'); // Aborting requests @@ -230,94 +231,98 @@ console.log(reqMethod + ' request to ' + reqUrl + ' cookies ' + reqCookies); // Basic authentication request.get('http://tobi:learnboost@local').end(callback); request - .get('http://local') - .auth('tobo', 'learnboost') - .end(callback); + .get('http://local') + .auth('tobo', 'learnboost') + .end(callback); // Following redirects request - .get('/some.png') - .redirects(2) - .end(callback); + .get('/some.png') + .redirects(2) + .end(callback); // Piping data /* -(function() { -var stream = fs.createReadStream('path/to/my.json'); -var req = request.post('/somewhere'); -req.type('json'); -stream.pipe(req); -})(); -*/ + (function() { + var stream = fs.createReadStream('path/to/my.json'); + var req = request.post('/somewhere'); + req.type('json'); + stream.pipe(req); + })(); + */ -(function() { -var stream = fs.createWriteStream('path/to/my.json'); -var req = request.get('/some.json'); -req.pipe(stream); +(function () { + var stream = fs.createWriteStream('path/to/my.json'); + var req = request.get('/some.json'); + req.pipe(stream); })(); // Multipart requests -(function() { -var req = request.post('/upload'); +(function () { + var req = request.post('/upload'); -req.part() - .set('Content-Type', 'image/png') - .set('Content-Disposition', 'attachment; filename="myimage.png"') - .write('some image data') - .write('some more image data'); + req.part() + .set('Content-Type', 'image/png') + .set('Content-Disposition', 'attachment; filename="myimage.png"') + .write('some image data') + .write('some more image data'); -req.part() - .set('Content-Disposition', 'form-data; name="name"') - .set('Content-Type', 'text/plain') - .write('tobi'); + req.part() + .set('Content-Disposition', 'form-data; name="name"') + .set('Content-Type', 'text/plain') + .write('tobi'); -req.end(callback); + req.end(callback); })(); // Attaching files request - .post('/upload') - .attach('avatar', 'path/to/tobi.png', 'user.png') - .attach('image', 'path/to/loki.png') - .attach('file', 'path/to/jane.png') - .end(callback); + .post('/upload') + .attach('avatar', 'path/to/tobi.png', 'user.png') + .attach('image', 'path/to/loki.png') + .attach('file', 'path/to/jane.png') + .end(callback); // Field values request - .post('/upload') - .field('user[name]', 'Tobi') - .field('user[email]', 'tobi@learnboost.com') - .attach('image', 'path/to/tobi.png') - .end(callback); + .post('/upload') + .field('user[name]', 'Tobi') + .field('user[email]', 'tobi@learnboost.com') + .attach('image', 'path/to/tobi.png') + .end(callback); // CORS request - .get('http://localhost:4001/') - .withCredentials() - .end(callback); + .get('http://localhost:4001/') + .withCredentials() + .end(callback); // Error handling request - .post('/upload') - .attach('image', 'path/to/tobi.png') - .end((err: any, res: request.Response): void => {}); + .post('/upload') + .attach('image', 'path/to/tobi.png') + .end((err: any, res: request.Response): void => { + }); request - .post('/upload') - .attach('image', 'path/to/tobi.png') - .on('error', (err: any) => {}) - .end(callback); + .post('/upload') + .attach('image', 'path/to/tobi.png') + .on('error', (err: any) => { + }) + .end(callback); //Promise request - .get('/search') - .then((response) => {}) - .catch((error) => {}); + .get('/search') + .then((response) => { + }) + .catch((error) => { + }); // Requesting binary data. // adapted from: https://github.com/visionmedia/superagent/blob/v2.0.0/test/client/request.js#L110 request - .get('/blob') - .responseType('blob') - .end(function (err, res) { - assert(res.xhr instanceof XMLHttpRequest) - assert(res.xhr.response instanceof Blob); - }); + .get('/blob') + .responseType('blob') + .end(function (err, res) { + assert(res.xhr instanceof XMLHttpRequest) + assert(res.xhr.response instanceof Blob); + }); diff --git a/types/superagent/tsconfig.json b/types/superagent/tsconfig.json index 1a20530571..b1f13095f7 100644 --- a/types/superagent/tsconfig.json +++ b/types/superagent/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "superagent-tests.ts" ] -} \ No newline at end of file +} From 2ea788c86674d734ba6fe33119349223bb7b53a7 Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Fri, 2 Jun 2017 22:11:19 +0300 Subject: [PATCH 041/761] Add superagent Plugin type. --- types/superagent/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index b53feed20d..0a028e015b 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -114,13 +114,14 @@ declare namespace request { timeout(ms: number): this; type(val: string): this; unset(field: string): this; - use(fn: Function): this; + use(fn: Plugin): this; withCredentials(): this; write(data: string, encoding?: string): this; write(data: Buffer, encoding?: string): this; parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this; } + type Plugin = (req: Request) => void; } export = request; From f72abdaf74df9837f986efd925c78fff3bf80a97 Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Fri, 2 Jun 2017 22:13:28 +0300 Subject: [PATCH 042/761] Add definitions for superagent-no-cache 0.1. --- types/superagent-no-cache/index.d.ts | 11 +++++++++ .../superagent-no-cache-tests.ts | 9 ++++++++ types/superagent-no-cache/tsconfig.json | 23 +++++++++++++++++++ types/superagent-no-cache/tslint.json | 1 + types/superagent/superagent-tests.ts | 2 -- 5 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 types/superagent-no-cache/index.d.ts create mode 100644 types/superagent-no-cache/superagent-no-cache-tests.ts create mode 100644 types/superagent-no-cache/tsconfig.json create mode 100644 types/superagent-no-cache/tslint.json diff --git a/types/superagent-no-cache/index.d.ts b/types/superagent-no-cache/index.d.ts new file mode 100644 index 0000000000..9dcfc02005 --- /dev/null +++ b/types/superagent-no-cache/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for superagent-no-cache 0.1 +// Project: https://github.com/johntron/superagent-no-cache +// Definitions by: Michael Ledin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import * as request from 'superagent'; + +declare const plugin: request.Plugin; + +export default plugin; diff --git a/types/superagent-no-cache/superagent-no-cache-tests.ts b/types/superagent-no-cache/superagent-no-cache-tests.ts new file mode 100644 index 0000000000..528eb4fd40 --- /dev/null +++ b/types/superagent-no-cache/superagent-no-cache-tests.ts @@ -0,0 +1,9 @@ +import * as request from 'superagent'; +import plugin from 'superagent-no-cache'; + +request + .get('/some-url') + .use(plugin) + .end((err, res) => { + // Do something + }); diff --git a/types/superagent-no-cache/tsconfig.json b/types/superagent-no-cache/tsconfig.json new file mode 100644 index 0000000000..668d406795 --- /dev/null +++ b/types/superagent-no-cache/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "superagent-no-cache-tests.ts" + ] +} diff --git a/types/superagent-no-cache/tslint.json b/types/superagent-no-cache/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/superagent-no-cache/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index cfac121640..628b4fd1f6 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -40,13 +40,11 @@ agent }); // Plugins -var nocache = require('superagent-no-cache'); var prefix = require('superagent-prefix')('/static'); request .get('/some-url') .use(prefix) // Prefixes *only* this request - .use(nocache) // Prevents caching of *only* this request .end(function (err, res) { // Do something }); From 89ca5ad175ac540c24a11ef1e570d69562439e7e Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Fri, 2 Jun 2017 22:14:15 +0300 Subject: [PATCH 043/761] Add definitions for superagent-prefix 0.0. --- types/superagent-prefix/index.d.ts | 9 ++++++++ .../superagent-prefix-tests.ts | 9 ++++++++ types/superagent-prefix/tsconfig.json | 23 +++++++++++++++++++ types/superagent-prefix/tslint.json | 1 + types/superagent/superagent-tests.ts | 10 -------- 5 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 types/superagent-prefix/index.d.ts create mode 100644 types/superagent-prefix/superagent-prefix-tests.ts create mode 100644 types/superagent-prefix/tsconfig.json create mode 100644 types/superagent-prefix/tslint.json diff --git a/types/superagent-prefix/index.d.ts b/types/superagent-prefix/index.d.ts new file mode 100644 index 0000000000..238046dde9 --- /dev/null +++ b/types/superagent-prefix/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for superagent-prefix 0.0 +// Project: https://github.com/johntron/superagent-prefix +// Definitions by: Michael Ledin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import * as request from 'superagent'; + +export default function(prefix: string): request.Plugin; diff --git a/types/superagent-prefix/superagent-prefix-tests.ts b/types/superagent-prefix/superagent-prefix-tests.ts new file mode 100644 index 0000000000..58101d8fda --- /dev/null +++ b/types/superagent-prefix/superagent-prefix-tests.ts @@ -0,0 +1,9 @@ +import * as request from 'superagent'; +import plugin from 'superagent-prefix'; + +request + .get('/some-url') + .use(plugin('/static')) + .end((err, res) => { + // Do something + }); diff --git a/types/superagent-prefix/tsconfig.json b/types/superagent-prefix/tsconfig.json new file mode 100644 index 0000000000..20c1d2c993 --- /dev/null +++ b/types/superagent-prefix/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "superagent-prefix-tests.ts" + ] +} diff --git a/types/superagent-prefix/tslint.json b/types/superagent-prefix/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/superagent-prefix/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index 628b4fd1f6..482c2d9e96 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -39,16 +39,6 @@ agent } }); -// Plugins -var prefix = require('superagent-prefix')('/static'); - -request - .get('/some-url') - .use(prefix) // Prefixes *only* this request - .end(function (err, res) { - // Do something - }); - var callback = (err: any, res: request.Response) => { }; From 7419b3c13a7a1f9ac0614c1c9aa22cdeece79414 Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Fri, 2 Jun 2017 22:19:10 +0300 Subject: [PATCH 044/761] Update definitions for superagent: - update version to 2.3 - fix tslint errors - update to typescript 2.2 --- types/promisify-supertest/index.d.ts | 2 +- types/simple-cw-node/index.d.ts | 2 +- types/superagent/index.d.ts | 29 ++++++----- types/superagent/superagent-tests.ts | 72 ++++++++++++++-------------- types/superagent/tslint.json | 1 + types/supertest/index.d.ts | 1 + 6 files changed, 53 insertions(+), 54 deletions(-) create mode 100644 types/superagent/tslint.json diff --git a/types/promisify-supertest/index.d.ts b/types/promisify-supertest/index.d.ts index 5c0ea6251a..9f59afdb89 100644 --- a/types/promisify-supertest/index.d.ts +++ b/types/promisify-supertest/index.d.ts @@ -2,7 +2,7 @@ // Project: https://www.npmjs.com/package/promisify-supertest // Definitions by: Leo Liang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.2 // Mostly copy-pasted from supertest.d.ts diff --git a/types/simple-cw-node/index.d.ts b/types/simple-cw-node/index.d.ts index c73394e4b0..66aace5ddb 100644 --- a/types/simple-cw-node/index.d.ts +++ b/types/simple-cw-node/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/astronaughts/simple-cw-node // Definitions by: vvakame // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.2 import superagent = require("superagent"); // TODO 1. update superagent with generics diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index 0a028e015b..f598bbd4fe 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -1,22 +1,23 @@ -// Type definitions for SuperAgent v2.0.1 +// Type definitions for SuperAgent 2.3 // Project: https://github.com/visionmedia/superagent // Definitions by: Alex Varju // Nico Zelaya +// Michael Ledin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// -import stream = require('stream'); -import https = require('https'); +import * as stream from 'stream'; +import * as https from 'https'; type CallbackHandler = (err: any, res: request.Response) => void; -declare var request: request.SuperAgentStatic; +declare const request: request.SuperAgentStatic; declare namespace request { interface SuperAgentRequest extends Request { - agent(agent: https.Agent): this; - agent(): this; + agent(agent?: https.Agent): this; method: string; url: string; @@ -24,6 +25,7 @@ declare namespace request { } interface SuperAgentStatic extends SuperAgent { (url: string): SuperAgentRequest; + // tslint:disable-next-line:unified-signatures (method: string, url: string): SuperAgentRequest; agent(): SuperAgent; @@ -99,25 +101,22 @@ declare namespace request { end(callback?: CallbackHandler): this; field(name: string, val: string): this; get(field: string): string; - on(name: string, handler: Function): this; + on(name: string, handler: (event: any) => void): this; on(name: 'error', handler: (err: any) => void): this; part(): this; - pipe(stream: NodeJS.WritableStream, options?: Object): stream.Writable; - query(val: Object): this; + pipe(stream: NodeJS.WritableStream, options?: object): stream.Writable; + query(val: object | string): this; redirects(n: number): this; responseType(type: string): this; - send(data: string): this; - send(data: Object): this; - send(): this; + send(data?: string | object): this; set(field: string, val: string): this; - set(field: Object): this; + set(field: object): this; timeout(ms: number): this; type(val: string): this; unset(field: string): this; use(fn: Plugin): this; withCredentials(): this; - write(data: string, encoding?: string): this; - write(data: Buffer, encoding?: string): this; + write(data: string | Buffer, encoding?: string): this; parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this; } diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index 482c2d9e96..0ad9c302fc 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -1,10 +1,9 @@ // via: http://visionmedia.github.io/superagent/ -import * as request from 'superagent' -import * as fs from 'fs' -import * as assert from 'assert' -import {Agent} from 'https' - +import * as request from 'superagent'; +import * as fs from 'fs'; +import * as assert from 'assert'; +import { Agent } from 'https'; // Examples taken from https://github.com/visionmedia/superagent/blob/gh-pages/docs/index.md // and https://github.com/visionmedia/superagent/blob/master/Readme.md @@ -25,7 +24,7 @@ request } }); -var agent = request.agent(); +const agent = request.agent(); agent .post('/api/pet') .send({name: 'Manny', species: 'cat'}) @@ -39,8 +38,7 @@ agent } }); -var callback = (err: any, res: request.Response) => { -}; +const callback = (err: any, res: request.Response) => {}; // Request basics request @@ -175,15 +173,15 @@ request // Parsing response bodies request('/search') - .end((res: request.Response) => { - var status: number = res.status; - var body = res.body; - var files: Object = res.files; - var text: string = res.text; - var contentLength = res.header['content-length']; - var contentType: string = res.type; - var charset: string = res.charset; - }); + .end((res: request.Response) => { + const status: number = res.status; + const body = res.body; + const files: object = res.files; + const text: string = res.text; + const contentLength = res.header['content-length']; + const contentType: string = res.type; + const charset: string = res.charset; + }); // Custom parsers request @@ -203,7 +201,7 @@ request res.body.toString("hex"); }); -var req = request.get('/hoge'); +const req = request.get('/hoge'); // Aborting requests req.abort(); @@ -231,23 +229,23 @@ request // Piping data /* - (function() { - var stream = fs.createReadStream('path/to/my.json'); - var req = request.post('/somewhere'); - req.type('json'); - stream.pipe(req); - })(); - */ +(() => { +const stream = fs.createReadStream('path/to/my.json'); +const req = request.post('/somewhere'); +req.type('json'); +stream.pipe(req); +})(); +*/ -(function () { - var stream = fs.createWriteStream('path/to/my.json'); - var req = request.get('/some.json'); +(() => { + const stream = fs.createWriteStream('path/to/my.json'); + const req = request.get('/some.json'); req.pipe(stream); })(); // Multipart requests -(function () { - var req = request.post('/upload'); +(() => { + const req = request.post('/upload'); req.part() .set('Content-Type', 'image/png') @@ -298,7 +296,7 @@ request }) .end(callback); -//Promise +// Promise request .get('/search') .then((response) => { @@ -308,9 +306,9 @@ request // Requesting binary data. // adapted from: https://github.com/visionmedia/superagent/blob/v2.0.0/test/client/request.js#L110 request - .get('/blob') - .responseType('blob') - .end(function (err, res) { - assert(res.xhr instanceof XMLHttpRequest) - assert(res.xhr.response instanceof Blob); - }); + .get('/blob') + .responseType('blob') + .end((err, res) => { + assert(res.xhr instanceof XMLHttpRequest); + assert(res.xhr.response instanceof Blob); + }); diff --git a/types/superagent/tslint.json b/types/superagent/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/superagent/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/supertest/index.d.ts b/types/supertest/index.d.ts index f3866469e3..206c70defd 100644 --- a/types/supertest/index.d.ts +++ b/types/supertest/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/visionmedia/supertest // Definitions by: Alex Varju // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import * as superagent from "superagent" From 3863bbf41574d7e9ccf43f29ce6c031d00450a0a Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Fri, 2 Jun 2017 22:29:04 +0300 Subject: [PATCH 045/761] Add definitions for superagent 3.5. --- types/superagent/index.d.ts | 2 +- types/superagent/v2/index.d.ts | 126 ++++++++++ types/superagent/v2/superagent-tests.ts | 314 ++++++++++++++++++++++++ types/superagent/v2/tsconfig.json | 27 ++ types/superagent/v2/tslint.json | 1 + 5 files changed, 469 insertions(+), 1 deletion(-) create mode 100644 types/superagent/v2/index.d.ts create mode 100644 types/superagent/v2/superagent-tests.ts create mode 100644 types/superagent/v2/tsconfig.json create mode 100644 types/superagent/v2/tslint.json diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index f598bbd4fe..97ce3a6600 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for SuperAgent 2.3 +// Type definitions for SuperAgent 3.5 // Project: https://github.com/visionmedia/superagent // Definitions by: Alex Varju // Nico Zelaya diff --git a/types/superagent/v2/index.d.ts b/types/superagent/v2/index.d.ts new file mode 100644 index 0000000000..f598bbd4fe --- /dev/null +++ b/types/superagent/v2/index.d.ts @@ -0,0 +1,126 @@ +// Type definitions for SuperAgent 2.3 +// Project: https://github.com/visionmedia/superagent +// Definitions by: Alex Varju +// Nico Zelaya +// Michael Ledin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import * as stream from 'stream'; +import * as https from 'https'; + +type CallbackHandler = (err: any, res: request.Response) => void; + +declare const request: request.SuperAgentStatic; + +declare namespace request { + interface SuperAgentRequest extends Request { + agent(agent?: https.Agent): this; + + method: string; + url: string; + cookies: string; + } + interface SuperAgentStatic extends SuperAgent { + (url: string): SuperAgentRequest; + // tslint:disable-next-line:unified-signatures + (method: string, url: string): SuperAgentRequest; + + agent(): SuperAgent; + } + + interface SuperAgent extends stream.Stream { + get(url: string, callback?: CallbackHandler): Req; + post(url: string, callback?: CallbackHandler): Req; + put(url: string, callback?: CallbackHandler): Req; + head(url: string, callback?: CallbackHandler): Req; + del(url: string, callback?: CallbackHandler): Req; + delete(url: string, callback?: CallbackHandler): Req; + options(url: string, callback?: CallbackHandler): Req; + trace(url: string, callback?: CallbackHandler): Req; + copy(url: string, callback?: CallbackHandler): Req; + lock(url: string, callback?: CallbackHandler): Req; + mkcol(url: string, callback?: CallbackHandler): Req; + move(url: string, callback?: CallbackHandler): Req; + purge(url: string, callback?: CallbackHandler): Req; + propfind(url: string, callback?: CallbackHandler): Req; + proppatch(url: string, callback?: CallbackHandler): Req; + unlock(url: string, callback?: CallbackHandler): Req; + report(url: string, callback?: CallbackHandler): Req; + mkactivity(url: string, callback?: CallbackHandler): Req; + checkout(url: string, callback?: CallbackHandler): Req; + merge(url: string, callback?: CallbackHandler): Req; + // m-search(url: string, callback?: CallbackHandler): Req; + notify(url: string, callback?: CallbackHandler): Req; + subscribe(url: string, callback?: CallbackHandler): Req; + unsubscribe(url: string, callback?: CallbackHandler): Req; + patch(url: string, callback?: CallbackHandler): Req; + search(url: string, callback?: CallbackHandler): Req; + connect(url: string, callback?: CallbackHandler): Req; + + parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this; + saveCookies(res: Response): void; + attachCookies(req: Req): void; + } + + interface Response extends NodeJS.ReadableStream { + text: string; + body: any; + files: any; + header: any; + type: string; + charset: string; + status: number; + statusType: number; + info: boolean; + ok: boolean; + redirect: boolean; + clientError: boolean; + serverError: boolean; + error: Error; + accepted: boolean; + noContent: boolean; + badRequest: boolean; + unauthorized: boolean; + notAcceptable: boolean; + notFound: boolean; + forbidden: boolean; + xhr: XMLHttpRequest; + get(header: string): string; + } + + interface Request extends Promise /* extends NodeJS.WritableStream */ { + abort(): void; + accept(type: string): this; + attach(field: string, file: string, filename?: string): this; + auth(user: string, name: string): this; + buffer(val?: boolean): this; + clearTimeout(): this; + end(callback?: CallbackHandler): this; + field(name: string, val: string): this; + get(field: string): string; + on(name: string, handler: (event: any) => void): this; + on(name: 'error', handler: (err: any) => void): this; + part(): this; + pipe(stream: NodeJS.WritableStream, options?: object): stream.Writable; + query(val: object | string): this; + redirects(n: number): this; + responseType(type: string): this; + send(data?: string | object): this; + set(field: string, val: string): this; + set(field: object): this; + timeout(ms: number): this; + type(val: string): this; + unset(field: string): this; + use(fn: Plugin): this; + withCredentials(): this; + write(data: string | Buffer, encoding?: string): this; + parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this; + } + + type Plugin = (req: Request) => void; +} + +export = request; diff --git a/types/superagent/v2/superagent-tests.ts b/types/superagent/v2/superagent-tests.ts new file mode 100644 index 0000000000..0ad9c302fc --- /dev/null +++ b/types/superagent/v2/superagent-tests.ts @@ -0,0 +1,314 @@ +// via: http://visionmedia.github.io/superagent/ + +import * as request from 'superagent'; +import * as fs from 'fs'; +import * as assert from 'assert'; +import { Agent } from 'https'; + +// Examples taken from https://github.com/visionmedia/superagent/blob/gh-pages/docs/index.md +// and https://github.com/visionmedia/superagent/blob/master/Readme.md + +const httpsAgent: Agent = new Agent(); + +request + .post('/api/pet') + .send({name: 'Manny', species: 'cat'}) + .set('X-API-Key', 'foobar') + .set('Accept', 'application/json') + .agent(httpsAgent) + .end((err, res) => { + if (res.ok) { + console.log('yay got ' + JSON.stringify(res.body)); + } else { + console.log('Oh no! error ' + res.text); + } + }); + +const agent = request.agent(); +agent + .post('/api/pet') + .send({name: 'Manny', species: 'cat'}) + .set('X-API-Key', 'foobar') + .set('Accept', 'application/json') + .end((err, res) => { + if (res.error) { + console.log('oh no ' + res.error.message); + } else { + console.log('got ' + res.status + ' response'); + } + }); + +const callback = (err: any, res: request.Response) => {}; + +// Request basics +request + .get('/search') + .end(callback); + +request('GET', '/search') + .end(callback); + +request + .get('http://example.com/search') + .end(callback); + +request + .head('/favicon.ico') + .end(callback); + +request + .del('/user/1') + .end(callback); + +request + .delete('/user/1') + .end(callback); + +request + .delete('/user/1') + .send() + .end(callback); + +request('/search') + .end(callback); + +// Setting header fields +request + .get('/search') + .set('API-Key', 'foobar') + .set('Accept', 'application/json') + .end(callback); + +request + .get('/search') + .set({'API-Key': 'foobar', Accept: 'application/json'}) + .end(callback); + +// GET requests +request + .get('/search') + .query({query: 'Manny'}) + .query({range: '1..5'}) + .query({order: 'desc'}) + .end(callback); + +request + .get('/search') + .query({query: 'Manny', range: '1..5', order: 'desc'}) + .end(callback); + +request + .get('/querystring') + .query('search=Manny&range=1..5') + .end(callback); + +request + .get('/querystring') + .query('search=Manny') + .query('range=1..5') + .end(callback); + +// HEAD requests +request + .head('/users') + .query({email: 'joe@smith.com'}) + .end(callback); + +// POST / PUT requests +request.post('/user') + .set('Content-Type', 'application/json') + .send('{"name":"tj","pet":"tobi"}') + .end(callback); + +request.post('/user') + .send({name: 'tj', pet: 'tobi'}) + .end(callback); + +request.post('/user') + .send({name: 'tj'}) + .send({pet: 'tobi'}) + .end(callback); + +request.post('/user') + .send('name=tj') + .send('pet=tobi') + .end(callback); + +request.post('/user') + .type('form') + .send({name: 'tj'}) + .send({pet: 'tobi'}) + .end(callback); + +// Setting the Content-Type +request.post('/user') + .set('Content-Type', 'application/json'); + +request.post('/user') + .type('application/json'); + +request.post('/user') + .type('json'); + +request.post('/user') + .type('png'); + +// Setting Accept +request.get('/user') + .accept('application/json'); + +request.get('/user') + .accept('json'); + +request.get('/user') + .accept('png'); + +// Query strings +request + .post('/') + .query({format: 'json'}) + .query({dest: '/login'}) + .send({post: 'data', here: 'wahoo'}) + .end(callback); + +// Parsing response bodies +request('/search') + .end((res: request.Response) => { + const status: number = res.status; + const body = res.body; + const files: object = res.files; + const text: string = res.text; + const contentLength = res.header['content-length']; + const contentType: string = res.type; + const charset: string = res.charset; + }); + +// Custom parsers +request + .post('/search') + .parse((res, callback) => { + res.setEncoding("binary"); + let data = ""; + res.on("data", (chunk: string) => { + data += chunk; + }); + + res.on("end", () => { + callback(null, new Buffer(data, "base64")); + }); + }) + .end((res: request.Response) => { + res.body.toString("hex"); + }); + +const req = request.get('/hoge'); +// Aborting requests +req.abort(); + +// Request timeouts +req.timeout(100); + +const reqUrl: string = req.url; +const reqMethod: string = req.method; +const reqCookies: string = req.cookies; + +console.log(reqMethod + ' request to ' + reqUrl + ' cookies ' + reqCookies); + +// Basic authentication +request.get('http://tobi:learnboost@local').end(callback); +request + .get('http://local') + .auth('tobo', 'learnboost') + .end(callback); + +// Following redirects +request + .get('/some.png') + .redirects(2) + .end(callback); + +// Piping data +/* +(() => { +const stream = fs.createReadStream('path/to/my.json'); +const req = request.post('/somewhere'); +req.type('json'); +stream.pipe(req); +})(); +*/ + +(() => { + const stream = fs.createWriteStream('path/to/my.json'); + const req = request.get('/some.json'); + req.pipe(stream); +})(); + +// Multipart requests +(() => { + const req = request.post('/upload'); + + req.part() + .set('Content-Type', 'image/png') + .set('Content-Disposition', 'attachment; filename="myimage.png"') + .write('some image data') + .write('some more image data'); + + req.part() + .set('Content-Disposition', 'form-data; name="name"') + .set('Content-Type', 'text/plain') + .write('tobi'); + + req.end(callback); +})(); + +// Attaching files +request + .post('/upload') + .attach('avatar', 'path/to/tobi.png', 'user.png') + .attach('image', 'path/to/loki.png') + .attach('file', 'path/to/jane.png') + .end(callback); + +// Field values +request + .post('/upload') + .field('user[name]', 'Tobi') + .field('user[email]', 'tobi@learnboost.com') + .attach('image', 'path/to/tobi.png') + .end(callback); + +// CORS +request + .get('http://localhost:4001/') + .withCredentials() + .end(callback); + +// Error handling +request + .post('/upload') + .attach('image', 'path/to/tobi.png') + .end((err: any, res: request.Response): void => { + }); +request + .post('/upload') + .attach('image', 'path/to/tobi.png') + .on('error', (err: any) => { + }) + .end(callback); + +// Promise +request + .get('/search') + .then((response) => { + }) + .catch((error) => { + }); +// Requesting binary data. +// adapted from: https://github.com/visionmedia/superagent/blob/v2.0.0/test/client/request.js#L110 +request + .get('/blob') + .responseType('blob') + .end((err, res) => { + assert(res.xhr instanceof XMLHttpRequest); + assert(res.xhr.response instanceof Blob); + }); diff --git a/types/superagent/v2/tsconfig.json b/types/superagent/v2/tsconfig.json new file mode 100644 index 0000000000..9061d77842 --- /dev/null +++ b/types/superagent/v2/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "superagent": ["superagent/v2"], + "superagent/*": ["superagent/v2/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "superagent-tests.ts" + ] +} diff --git a/types/superagent/v2/tslint.json b/types/superagent/v2/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/superagent/v2/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From df04a6e201b34f942f22f8a61d63df060aaf1e8c Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Fri, 2 Jun 2017 22:44:21 +0300 Subject: [PATCH 046/761] Add superagent request.on('progress', ...). --- types/superagent/index.d.ts | 8 ++++++++ types/superagent/superagent-tests.ts | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index 97ce3a6600..9c3706d574 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -103,6 +103,7 @@ declare namespace request { get(field: string): string; on(name: string, handler: (event: any) => void): this; on(name: 'error', handler: (err: any) => void): this; + on(name: 'progress', handler: (event: ProgressEvent) => void): this; part(): this; pipe(stream: NodeJS.WritableStream, options?: object): stream.Writable; query(val: object | string): this; @@ -121,6 +122,13 @@ declare namespace request { } type Plugin = (req: Request) => void; + + interface ProgressEvent { + direction: 'download' | 'upload'; + loaded: number; + percent?: number; + total?: number; + } } export = request; diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index 0ad9c302fc..9d0e5f0ac9 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -296,6 +296,20 @@ request }) .end(callback); +// Progress +request + .post('/upload') + .attach('image', 'path/to/tobi.png') + .on('progress', (progress: request.ProgressEvent) => { + if (progress.direction === 'download') { + } else if (progress.direction === 'upload') { + } + const loaded: number = progress.loaded; + const percent: number | undefined = progress.percent; + const total: number | undefined = progress.total; + }) + .end(callback); + // Promise request .get('/search') From eab5bd9833ef005d33bdc43c1731514c19406456 Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Fri, 2 Jun 2017 22:51:52 +0300 Subject: [PATCH 047/761] superagent - attach blobs to request. --- types/superagent/index.d.ts | 2 +- types/superagent/superagent-tests.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index 9c3706d574..e02747ac5d 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -94,7 +94,7 @@ declare namespace request { interface Request extends Promise /* extends NodeJS.WritableStream */ { abort(): void; accept(type: string): this; - attach(field: string, file: string, filename?: string): this; + attach(field: string, file: string | Blob, filename?: string): this; auth(user: string, name: string): this; buffer(val?: boolean): this; clearTimeout(): this; diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index 9d0e5f0ac9..9e8dc0aa96 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -262,11 +262,13 @@ stream.pipe(req); })(); // Attaching files +const blob: Blob = new File([], 'thor.png'); request .post('/upload') .attach('avatar', 'path/to/tobi.png', 'user.png') .attach('image', 'path/to/loki.png') .attach('file', 'path/to/jane.png') + .attach('blob', blob) .end(callback); // Field values From c27c678fa5d0ad5035390a5f574bc0b2415078ea Mon Sep 17 00:00:00 2001 From: Brandon Liles Date: Fri, 2 Jun 2017 16:25:09 -0400 Subject: [PATCH 048/761] Add support for Meteor 1.4 feature for specifying Mongo connection options --- types/meteor/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/meteor/index.d.ts b/types/meteor/index.d.ts index b33973f943..5f5963b164 100644 --- a/types/meteor/index.d.ts +++ b/types/meteor/index.d.ts @@ -1511,6 +1511,8 @@ declare module Mongo { new (hexString?: string): ObjectID; } interface ObjectID { } + + function setConnectionOptions(options: any): void; } declare module "meteor/mongo" { @@ -1620,6 +1622,8 @@ declare module "meteor/mongo" { new (hexString?: string): ObjectID; } interface ObjectID { } + + function setConnectionOptions(options: any): void; } } From 9fee1826732c16e8054dd562742ba12a9710c527 Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Sat, 3 Jun 2017 00:12:09 +0300 Subject: [PATCH 049/761] Update multer definitions: - add version 1.3 - fix tslint errors - enable strictNullChecks option --- types/multer/index.d.ts | 37 ++++++++++++++++++------------------ types/multer/multer-tests.ts | 29 +++++++++++++--------------- types/multer/tsconfig.json | 4 ++-- types/multer/tslint.json | 1 + 4 files changed, 35 insertions(+), 36 deletions(-) create mode 100644 types/multer/tslint.json diff --git a/types/multer/index.d.ts b/types/multer/index.d.ts index 35e71a251d..8dafd2b5d1 100644 --- a/types/multer/index.d.ts +++ b/types/multer/index.d.ts @@ -1,9 +1,12 @@ -// Type definitions for multer +// Type definitions for multer 1.3 // Project: https://github.com/expressjs/multer -// Definitions by: jt000 , vilicvane , David Broder-Rodgers +// Definitions by: jt000 +// vilicvane +// David Broder-Rodgers +// Michael Ledin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import express = require('express'); +import * as express from 'express'; declare namespace multer { interface Field { @@ -18,7 +21,9 @@ declare namespace multer { dest?: string; /** The storage engine to use for uploaded files. */ storage?: StorageEngine; - /** An object specifying the size limits of the following optional properties. This object is passed to busboy directly, and the details of properties can be found on https://github.com/mscdex/busboy#busboy-methods */ + /** An object specifying the size limits of the following optional properties. This object is passed to busboy + * directly, and the details of properties can be found on https://github.com/mscdex/busboy#busboy-methods + */ limits?: { /** Max field name size (Default: 100 bytes) */ fieldNameSize?: number; @@ -36,7 +41,7 @@ declare namespace multer { headerPairs?: number; }; /** A function to control which files to upload and which to skip. */ - fileFilter?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error, acceptFile: boolean) => void) => void; + fileFilter?(req: Express.Request, file: Express.Multer.File, callback: (error: Error, acceptFile: boolean) => void): void; } interface StorageEngine { @@ -48,27 +53,23 @@ declare namespace multer { /** A function used to determine within which folder the uploaded files should be stored. Defaults to the system's default temporary directory. */ destination?: string | ((req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, destination: string) => void) => void); /** A function used to determine what the file should be named inside the folder. Defaults to a random name with no file extension. */ - filename?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, filename: string) => void) => void; + filename?(req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, filename: string) => void): void; } interface Instance { /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ - single(): express.RequestHandler; - /** Accept a single file with the name fieldname. The single file will be stored in req.file. */ - single(fieldame: string): express.RequestHandler; - /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ - array(): express.RequestHandler; - /** Accept an array of files, all with the name fieldname. Optionally error out if more than maxCount files are uploaded. The array of files will be stored in req.files. */ - array(fieldame: string, maxCount?: number): express.RequestHandler; + /** Accept a single file with the name fieldName. The single file will be stored in req.file. */ + single(fieldName?: string): express.RequestHandler; + /** Accept an array of files, all with the name fieldName. Optionally error out if more than maxCount files are uploaded. The array of files will be stored in req.files. */ + array(fieldName: string, maxCount?: number): express.RequestHandler; /** Accept a mix of files, specified by fields. An object with arrays of files will be stored in req.files. */ fields(fields: Field[]): express.RequestHandler; - /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ + /** Accepts all files that comes over the wire. An array of files will be stored in req.files. */ any(): express.RequestHandler; } } interface Multer { - (options?: multer.Options): multer.Instance; /* The disk storage engine gives you full control on storing files to disk. */ @@ -77,13 +78,13 @@ interface Multer { memoryStorage(): multer.StorageEngine; } -declare var multer: Multer; +declare const multer: Multer; export = multer; declare global { namespace Express { - export interface Request { + interface Request { file: Multer.File; files: { [fieldname: string]: Multer.File[]; @@ -91,7 +92,7 @@ declare global { } namespace Multer { - export interface File { + interface File { /** Field name specified in the form */ fieldname: string; /** Name of the file on the user's computer */ diff --git a/types/multer/multer-tests.ts b/types/multer/multer-tests.ts index 00cbc52b98..e5af7862d5 100644 --- a/types/multer/multer-tests.ts +++ b/types/multer/multer-tests.ts @@ -1,33 +1,30 @@ +import * as express from 'express'; +import * as multer from 'multer'; +const upload = multer({ dest: 'uploads/' }); +const app = express(); -import express = require('express'); -import multer = require('multer'); - -var upload = multer({ dest: 'uploads/' }); - -var app = express(); - -app.post('/profile', upload.single('avatar'), (req, res, next) => { +app.post('/profile', upload.single('avatar'), (req: express.Request, res: express.Response, next: express.NextFunction) => { }); -app.post('/photos/upload', upload.array('photos', 12), (req, res, next) => { +app.post('/photos/upload', upload.array('photos', 12), (req: express.Request, res: express.Response, next: express.NextFunction) => { }); -var cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }]) -app.post('/cool-profile', cpUpload, (req, res, next) => { +const cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }]); +app.post('/cool-profile', cpUpload, (req: express.Request, res: express.Response, next: express.NextFunction) => { }); -var diskStorage = multer.diskStorage({ +const diskStorage = multer.diskStorage({ destination(req, file, cb) { cb(null, '/tmp/my-uploads'); }, filename(req, file, cb) { cb(null, file.fieldname + '-' + Date.now()); } -}) +}); -var diskUpload = multer({ storage: diskStorage }); +const diskUpload = multer({ storage: diskStorage }); -var memoryStorage = multer.memoryStorage(); -var memoryUpload = multer({ storage: memoryStorage }); +const memoryStorage = multer.memoryStorage(); +const memoryUpload = multer({ storage: memoryStorage }); diff --git a/types/multer/tsconfig.json b/types/multer/tsconfig.json index 4a6fa797a4..500a8758a9 100644 --- a/types/multer/tsconfig.json +++ b/types/multer/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +19,4 @@ "index.d.ts", "multer-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/multer/tslint.json b/types/multer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/multer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ee1b35dfcf7f0086c27b59f9d8a3bd964375f15e Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Sat, 3 Jun 2017 00:14:18 +0300 Subject: [PATCH 050/761] Request.files can be an array. --- types/multer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/multer/index.d.ts b/types/multer/index.d.ts index 8dafd2b5d1..3ccc878453 100644 --- a/types/multer/index.d.ts +++ b/types/multer/index.d.ts @@ -88,7 +88,7 @@ declare global { file: Multer.File; files: { [fieldname: string]: Multer.File[]; - }; + } | Multer.File[]; } namespace Multer { From c381369fde30ea9c1c60967d5ce08b8a94595909 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Sat, 3 Jun 2017 18:06:02 +0200 Subject: [PATCH 051/761] [react-text-mask] Update to 2.1.0 --- types/react-css-transition-replace/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-css-transition-replace/index.d.ts b/types/react-css-transition-replace/index.d.ts index ce09917fbe..776ebcdd0a 100644 --- a/types/react-css-transition-replace/index.d.ts +++ b/types/react-css-transition-replace/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-css-transition-replace 2.0.1 +// Type definitions for react-css-transition-replace 2.1 // Project: http://marnusw.github.io/react-css-transition-replace/ // Definitions by: Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,6 +9,7 @@ import * as CSSTransitionGroup from "react-addons-css-transition-group"; declare namespace CSSTransitionReplace { interface Props extends React.CSSTransitionGroupProps { + changeWidth?: boolean overflowHidden?: boolean } } From eeef424526f1f1115482931b334aa74bd7111edd Mon Sep 17 00:00:00 2001 From: dyst5422 Date: Sat, 3 Jun 2017 09:10:23 -0700 Subject: [PATCH 052/761] Add animateTransform SVG element to JSX.IntrinsicElements The animateTransform SVG element was missing from JSX.IntrinsicElements. Like the SVG animate element, this will need to be refined when TypeScript's lib.dom.d.ts is updated to include SVGAnimateTransformElement. --- types/react/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 979870febb..49d1e0b435 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -2857,6 +2857,7 @@ declare global { svg: React.SVGProps; animate: React.SVGProps; // TODO: It is SVGAnimateElement but is not in TypeScript's lib.dom.d.ts for now. + animateTransform: React.SVGProps; // TODO: It is SVGAnimateTransformElement but is not in TypeScript's lib.dom.d.ts for now. circle: React.SVGProps; clipPath: React.SVGProps; defs: React.SVGProps; From 0f40cdba7eb609897f5caf1c978178d954b9dd2a Mon Sep 17 00:00:00 2001 From: pilagod Date: Sun, 4 Jun 2017 01:54:34 +0800 Subject: [PATCH 053/761] [stacktrace-js] add getSync definition --- types/stacktrace-js/index.d.ts | 10 +++++++++- types/stacktrace-js/stacktrace-js-tests.ts | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/types/stacktrace-js/index.d.ts b/types/stacktrace-js/index.d.ts index 9f3078b102..7f3c972508 100644 --- a/types/stacktrace-js/index.d.ts +++ b/types/stacktrace-js/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for stacktrace.js // Project: https://github.com/stacktracejs/stacktrace.js // Definitions by: Exceptionless +// Chun-Yan Ho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace StackTrace { @@ -34,7 +35,7 @@ declare namespace StackTrace { isNative: boolean; toString(): string; } - + export interface RequestOptions { headers: { [id: string]: string }; } @@ -46,6 +47,13 @@ declare namespace StackTrace { */ export function get(options?: StackTraceOptions): Promise; + /** + * Get a backtrace from invocation point synchronously. + * @param options Options Object + * @return Array[StackFrame] + */ + export function getSync(options?: { filter?: (stackFrame: StackFrame) => boolean }): StackFrame[] + /** * Given an error object, parse it. * @param error Error object diff --git a/types/stacktrace-js/stacktrace-js-tests.ts b/types/stacktrace-js/stacktrace-js-tests.ts index da263a6485..1de6abb185 100644 --- a/types/stacktrace-js/stacktrace-js-tests.ts +++ b/types/stacktrace-js/stacktrace-js-tests.ts @@ -29,6 +29,7 @@ const options: StackTrace.StackTraceOptions = { const error = new Error('BOOM!'); StackTrace.get(options).then(logger); +logger(StackTrace.getSync({ filter: options.filter })) StackTrace.fromError(error, options).then(logger); StackTrace.generateArtificially(options).then(logger); From cdf69c51e9a57b1b069b74727a0b4ef28d2d64f5 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 4 Jun 2017 00:45:48 +0100 Subject: [PATCH 054/761] More types --- types/nodegit/annotated-commit.d.ts | 13 +++ types/nodegit/blob.d.ts | 20 ++++ types/nodegit/checkout-options.d.ts | 26 +++++ types/nodegit/commit.d.ts | 47 +++++++++ types/nodegit/diff-delta.d.ts | 10 ++ types/nodegit/diff-file.d.ts | 9 ++ types/nodegit/diff-perf-data.d.ts | 5 + types/nodegit/diff.d.ts | 154 ++++++++++++++++++++++++++++ types/nodegit/enums.d.ts | 41 ++++++++ types/nodegit/fetch-options.d.ts | 9 ++ types/nodegit/index-entry.d.ts | 21 ++++ types/nodegit/index.d.ts | 19 ++++ types/nodegit/index_.d.ts | 56 ++++++++++ types/nodegit/nodegit-tests.ts | 4 + types/nodegit/odb-object.d.ts | 10 ++ types/nodegit/odb.d.ts | 3 +- types/nodegit/reference.d.ts | 3 +- types/nodegit/remote-callbacks.d.ts | 8 ++ types/nodegit/remote.d.ts | 62 +++++++++++ types/nodegit/repository.d.ts | 43 +++++--- types/nodegit/str-array.d.ts | 6 ++ types/nodegit/tree-builder.d.ts | 16 +++ types/nodegit/tree-entry.d.ts | 30 ++++++ types/nodegit/tree.d.ts | 44 ++++++++ types/nodegit/tsconfig.json | 18 ++++ 25 files changed, 658 insertions(+), 19 deletions(-) create mode 100644 types/nodegit/annotated-commit.d.ts create mode 100644 types/nodegit/blob.d.ts create mode 100644 types/nodegit/checkout-options.d.ts create mode 100644 types/nodegit/commit.d.ts create mode 100644 types/nodegit/diff-delta.d.ts create mode 100644 types/nodegit/diff-file.d.ts create mode 100644 types/nodegit/diff-perf-data.d.ts create mode 100644 types/nodegit/diff.d.ts create mode 100644 types/nodegit/enums.d.ts create mode 100644 types/nodegit/fetch-options.d.ts create mode 100644 types/nodegit/index-entry.d.ts create mode 100644 types/nodegit/index_.d.ts create mode 100644 types/nodegit/odb-object.d.ts create mode 100644 types/nodegit/remote-callbacks.d.ts create mode 100644 types/nodegit/remote.d.ts create mode 100644 types/nodegit/str-array.d.ts create mode 100644 types/nodegit/tree-builder.d.ts create mode 100644 types/nodegit/tree-entry.d.ts create mode 100644 types/nodegit/tree.d.ts diff --git a/types/nodegit/annotated-commit.d.ts b/types/nodegit/annotated-commit.d.ts new file mode 100644 index 0000000000..f0f9d4d925 --- /dev/null +++ b/types/nodegit/annotated-commit.d.ts @@ -0,0 +1,13 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Reference } from './reference'; + +export class AnnotatedCommit { + static fromFetchhead(repo: Repository, branch_name: string, remote_url: string, id: Oid): Promise; + static fromRef(repo: Repository, ref: Reference): Promise; + static fromRevspec(repo: Repository, revspec: string): Promise; + static lookup(repo: Repository, id: Oid): Promise; + + free(): void; + id(): Oid; +} diff --git a/types/nodegit/blob.d.ts b/types/nodegit/blob.d.ts new file mode 100644 index 0000000000..32f020b0ce --- /dev/null +++ b/types/nodegit/blob.d.ts @@ -0,0 +1,20 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; + +export class Blob { + static createFromBuffer(repo: Repository, buffer: Buffer, len: number): Oid; + static createFromDisk(id: Oid, repo: Repository, path: string): number; + static createFromWorkdir(id: Oid, repo: Repository, relative_path: string): number; + static lookup(repo: Repository, id: string | Oid | Blob): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + + free(): void; + id(): Oid; + isBinary(): number; + owner(): Repository; + rawcontent(): Buffer; + rawsize(): number; + content(): Buffer; + toString(): string; + filemode(): number; +} diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts new file mode 100644 index 0000000000..cd23a70ede --- /dev/null +++ b/types/nodegit/checkout-options.d.ts @@ -0,0 +1,26 @@ +import { Strarray } from './str-array'; +import { Tree } from './tree'; +import { Index } from './index'; + +export interface CheckoutOptions { + version?: number; + checkoutStrategy?: number; + disableFilters?: number; + dirMode?: number; + fileMode?: number; + fileOpenFlags?: number; + notifyFlags?: number; + notifyCb?: any; + notifyPayload?: void; + progressCb?: any; + progressPayload?: void; + paths?: Strarray; + baseline?: Tree; + baselineIndex?: Index; + targetDirectory?: string; + ancestorLabel?: string; + ourLabel?: string; + theirLabel?: string; + perfdataCb?: any; + perfdataPayload?: void; +} diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts new file mode 100644 index 0000000000..3980ce080e --- /dev/null +++ b/types/nodegit/commit.d.ts @@ -0,0 +1,47 @@ +import { Repository } from './repository'; +import { Signature } from './signature'; +import { Oid } from './oid'; +import { Buf } from './buf'; +import { Object } from './object'; +import { Tree } from './tree'; +import { TreeEntry } from './tree-entry'; +import { Diff } from './diff'; + +export class Commit { + static create(repo: Repository, update_ref: string, author: Signature, committer: Signature, message_encoding: string, message: string, tree: Tree, parent_count: number, parents: any[]): Oid; + static createV(id: Oid, repo: Repository, update_ref: string, author: Signature, committer: Signature, message_encoding: string, message: string, tree: Tree, parent_count: number): number; + static lookup(repo: Repository, id: string | Oid | Commit): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + + amend(update_ref: string, author: Signature, committer: Signature, message_encoding: string, message: string, tree: Tree): Oid; + author(): Signature; + committer(): Signature; + free(): void; + headerField(field: string): Promise; + id(): Oid; + message(): string; + messageEncoding(): string; + messageRaw(): string; + nthGenAncestor(n: number): Promise; + owner(): Repository; + parent(n: number): Promise; + parentId(n: number): Oid; + parentcount(): number; + rawHeader(): string; + summary(): string; + time(): number; + timeOffset(): number; + tree(tree_out: Tree): number; + treeId(): Oid; + sha(): string; + timeMs(): number; + date(): Date; + getTree(): Promise; + getEntry(path: string): Promise; + history(): EventEmitter; + getParents(limit: number, callback: Function): Promise; + parents(callback: Function): Oid[]; + getDiff(callback: Function): Promise; + getDiffWithOptions(options: Object, callback: Function): Promise; + toString(): string; +} diff --git a/types/nodegit/diff-delta.d.ts b/types/nodegit/diff-delta.d.ts new file mode 100644 index 0000000000..c21d98f430 --- /dev/null +++ b/types/nodegit/diff-delta.d.ts @@ -0,0 +1,10 @@ +import { DiffFile } from './diff-file'; + +export class DiffDelta { + status: number; + flags: number; + similarity: number; + nfiles: number; + oldFile: DiffFile; + newFile: DiffFile; +} diff --git a/types/nodegit/diff-file.d.ts b/types/nodegit/diff-file.d.ts new file mode 100644 index 0000000000..99646ec08b --- /dev/null +++ b/types/nodegit/diff-file.d.ts @@ -0,0 +1,9 @@ +import { Oid } from './oid'; + +export class DiffFile { + flags(): number; + id(): Oid; + mode(): number; + path(): string; + size(): number; +} diff --git a/types/nodegit/diff-perf-data.d.ts b/types/nodegit/diff-perf-data.d.ts new file mode 100644 index 0000000000..5dfca09670 --- /dev/null +++ b/types/nodegit/diff-perf-data.d.ts @@ -0,0 +1,5 @@ +export class DiffPerfdata { + version: number; + statCalls: number; + oidCalculations: number; +} diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts new file mode 100644 index 0000000000..ab3b3aa2c8 --- /dev/null +++ b/types/nodegit/diff.d.ts @@ -0,0 +1,154 @@ +import { Blob } from './blob'; +import { Repository } from './repository'; +import { Tree } from './tree'; +import { Strarray } from './str-array'; +import { Index } from './index_'; +import { DiffDelta } from './diff-delta'; +import { DiffPerfdata } from './diff-perf-data'; + +export interface DiffFindOptions { + version: number; + flags: number; + renameThreshold: number; + renameFromRewriteThreshold: number; + copyThreshold: number; + breakRewriteThreshold: number; + renameLimit: number; +} + +export interface DiffOptions { + version: number; + flags: number; + ignoreSubmodules: number; + pathspec: Strarray; + notifyCb: Function; + notifyPayload: void; + contextLines: number; + interhunkLines: number; + idAbbrev: number; + maxSize: number; + oldPrefix: string; + newPrefix: string; +} + +export namespace Diff { + enum DELTA { + UNMODIFIED = 0, + ADDED = 1, + DELETED = 2, + MODIFIED = 3, + RENAMED = 4, + COPIED = 5, + IGNORED = 6, + UNTRACKED = 7, + TYPECHANGE = 8, + UNREADABLE = 9, + CONFLICTED = 10 + } + + enum FIND { + BY_CONFIG = 0, + RENAMES = 1, + RENAMES_FROM_REWRITES = 2, + COPIES = 4, + COPIES_FROM_UNMODIFIED = 8, + REWRITES = 16, + BREAK_REWRITES = 32, + AND_BREAK_REWRITES = 48, + FOR_UNTRACKED = 64, + ALL = 255, + IGNORE_LEADING_WHITESPACE = 0, + IGNORE_WHITESPACE = 4096, + DONT_IGNORE_WHITESPACE = 8192, + EXACT_MATCH_ONLY = 16384, + BREAK_REWRITES_FOR_RENAMES_ONLY = 32768, + REMOVE_UNMODIFIED = 65536 + } + + enum FLAG { + BINARY = 1, + NOT_BINARY = 2, + VALID_ID = 4, + EXISTS = 8 + } + + enum FORMAT { + PATCH = 1, + PATCH_HEADER = 2, + RAW = 3, + NAME_ONLY = 4, + NAME_STATUS = 5 + } + + enum FORMAT_EMAIL_FLAGS { + FORMAT_EMAIL_NONE = 0, + FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = 1 + } + + enum LINE { + CONTEXT = 32, + ADDITION = 43, + DELETION = 45, + CONTEXT_EOFNL = 61, + ADD_EOFNL = 62, + DEL_EOFNL = 60, + FILE_HDR = 70, + HUNK_HDR = 72, + BINARY = 66 + } + + enum OPTION { + NORMAL = 0, + REVERSE = 1, + INCLUDE_IGNORED = 2, + RECURSE_IGNORED_DIRS = 4, + INCLUDE_UNTRACKED = 8, + RECURSE_UNTRACKED_DIRS = 16, + INCLUDE_UNMODIFIED = 32, + INCLUDE_TYPECHANGE = 64, + INCLUDE_TYPECHANGE_TREES = 128, + IGNORE_FILEMODE = 256, + IGNORE_SUBMODULES = 512, + IGNORE_CASE = 1024, + INCLUDE_CASECHANGE = 2048, + DISABLE_PATHSPEC_MATCH = 4096, + SKIP_BINARY_CHECK = 8192, + ENABLE_FAST_UNTRACKED_DIRS = 16384, + UPDATE_INDEX = 32768, + INCLUDE_UNREADABLE = 65536, + INCLUDE_UNREADABLE_AS_UNTRACKED = 131072, + FORCE_TEXT = 1048576, + FORCE_BINARY = 2097152, + IGNORE_WHITESPACE = 4194304, + IGNORE_WHITESPACE_CHANGE = 8388608, + IGNORE_WHITESPACE_EOL = 16777216, + SHOW_UNTRACKED_CONTENT = 33554432, + SHOW_UNMODIFIED = 67108864, + PATIENCE = 268435456, + MINIMAL = 536870912, + SHOW_BINARY = 1073741824 + } + + enum STATS_FORMAT { + STATS_NONE = 0, + STATS_FULL = 1, + STATS_SHORT = 2, + STATS_NUMBER = 4, + STATS_INCLUDE_SUMMARY = 8 + } +} + +export class Diff { + static blobToBuffer(old_blob: Blob, old_as_path: string, buffer: string, buffer_as_path: string, opts: DiffOptions, file_cb: Function, binary_cb: Function, hunk_cb: Function, line_cb: Function): Promise; + static indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise; + static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; + static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; + static treeToWorkdir(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + static treeToWorkdirWithIndex(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + + findSimilar(options: DiffFindOptions): Promise; + getDelta(idx: number): DiffDelta; + getPerfdata(): Promise; + numDeltas(): number; + patches(): Promise; +} diff --git a/types/nodegit/enums.d.ts b/types/nodegit/enums.d.ts new file mode 100644 index 0000000000..850979ac51 --- /dev/null +++ b/types/nodegit/enums.d.ts @@ -0,0 +1,41 @@ +export namespace Enums { + enum CVAR { + FALSE = 0, + TRUE = 1, + INT32 = 2, + string = 3 + } + + enum DIRECTION { + FETCH = 0, + PUSH = 1 + } + + enum FEATURE { + THREADS = 1, + HTTPS = 2, + SSH = 4 + } + + enum IDXENTRY_EXTENDED_FLAG { + IDXENTRY_INTENT_TO_ADD = 8192, + IDXENTRY_SKIP_WORKTREE = 16384, + IDXENTRY_EXTENDED2 = 32768, + S = 24576, + IDXENTRY_UPDATE = 1, + IDXENTRY_REMOVE = 2, + IDXENTRY_UPTODATE = 4, + IDXENTRY_ADDED = 8, + IDXENTRY_HASHED = 16, + IDXENTRY_UNHASHED = 32, + IDXENTRY_WT_REMOVE = 64, + IDXENTRY_CONFLICTED = 128, + IDXENTRY_UNPACKED = 256, + IDXENTRY_NEW_SKIP_WORKTREE = 512 + } + + enum INDXENTRY_FLAG { + IDXENTRY_EXTENDED = 16384, + IDXENTRY_VALID = 32768 + } +} diff --git a/types/nodegit/fetch-options.d.ts b/types/nodegit/fetch-options.d.ts new file mode 100644 index 0000000000..1aa26fd974 --- /dev/null +++ b/types/nodegit/fetch-options.d.ts @@ -0,0 +1,9 @@ +import { RemoteCallbacks } from './remote-callbacks'; + +export interface FetchOptions { + version?: number; + callbacks?: RemoteCallbacks; + prune?: number; + updateFetchhead?: number; + downloadTags?: number; +} diff --git a/types/nodegit/index-entry.d.ts b/types/nodegit/index-entry.d.ts new file mode 100644 index 0000000000..a6591e37b9 --- /dev/null +++ b/types/nodegit/index-entry.d.ts @@ -0,0 +1,21 @@ +import { Oid } from './oid'; + +interface IndexTime { + seconds: number; + nanoseconds: number; +} + +export interface IndexEntry { + ctime: IndexTime; + mtime: IndexTime; + dev: number; + ino: number; + mode: number; + uid: number; + gid: number; + fileSize: number; + id: Oid; + flags: number; + flagsExtended: number; + path: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 77d7003e05..92307a1abb 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -3,11 +3,30 @@ // Definitions by: Dolan Miu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export { AnnotatedCommit } from './annotated-commit'; +export { Blob } from './blob'; export { Buf } from './buf'; +export { CheckoutOptions } from './checkout-options'; +export { Commit } from './commit'; +export { DiffDelta } from './diff-delta'; +export { DiffFile } from './diff-file'; +export { DiffPerfdata } from './diff-perf-data'; +export { Diff } from './diff'; +export { Enums } from './enums'; +export { FetchOptions } from './fetch-options'; +export { IndexEntry } from './index-entry'; +export { Index } from './index_'; export { Object } from './object'; +export { OdbObject } from './odb-object'; export { Odb } from './odb'; export { Oid } from './oid'; export { Reference } from './reference'; +export { RemoteCallbacks } from './remote-callbacks'; +export { Remote } from './remote'; export { Repository } from './repository'; export { Signature } from './signature'; +export { Strarray } from './str-array'; export { Time } from './time'; +export { Treebuilder } from './tree-builder'; +export { TreeEntry } from './tree-entry'; +export { Tree } from './tree'; diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts new file mode 100644 index 0000000000..9902b53d35 --- /dev/null +++ b/types/nodegit/index_.d.ts @@ -0,0 +1,56 @@ +import { Oid } from './oid'; +import { IndexEntry } from './index-entry'; +import { Repository } from './repository'; +import { Tree } from './tree'; +import { Strarray } from './str-array'; + +export namespace Index { + enum ADD_OPTION { + ADD_DEFAULT = 0, + ADD_FORCE = 1, + ADD_DISABLE_PATHSPEC_MATCH = 2, + ADD_CHECK_PATHSPEC = 4 + } + + enum CAP { + IGNORE_CASE = 1, + NO_FILEMODE = 2, + NO_SYMLINKS = 4, + FROM_OWNER = -1 + } +} + +export class Index { + static entryIsConflict(entry: IndexEntry): number; + static entryStage(entry: IndexEntry): number; + static open(index_path: string): Promise; + + add(source_entry: IndexEntry): number; + addAll(pathspec: Strarray, flags: number, callback: Function, payload: void): Promise; + addByPath(path: string): number; + caps(): number; + checksum(): Oid; + clear(): number; + conflictAdd(ancestor_entry: IndexEntry, our_entry: IndexEntry, their_entry: IndexEntry): number; + conflictCleanup(): number; + conflictGet(path: string): Promise; + conflictRemove(path: string): number; + entryCount(): number; + getByIndex(n: number): IndexEntry; + getByPath(path: string, stage: number): IndexEntry; + hasConflicts(): number; + owner(): Repository; + path(): string; + read(force: number): number; + readTree(tree: Tree): number; + remove(path: string, stage: number): number; + removeAll(pathspec: Strarray, callback: Function, payload: void): Promise; + removeByPath(path: string): number; + removeDirectory(dir: string, stage: number): number; + setCaps(caps: number): number; + updateAll(pathspec: Strarray, callback: Function, payload: void): Promise; + write(): number; + writeTree(): Promise; + writeTreeTo(repo: Repository): Promise; + entries(): IndexEntry[]; +} diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index b7fa54b0c1..c4c57854b7 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -3,3 +3,7 @@ import * as Git from 'nodegit'; Git.Repository.discover("startPath", 1, "ceilingDirs").then((string) => { // Use string }); + +Git.Repository.init("path", true).then((repository) => { + // Use repository +}); diff --git a/types/nodegit/odb-object.d.ts b/types/nodegit/odb-object.d.ts new file mode 100644 index 0000000000..361e8c0718 --- /dev/null +++ b/types/nodegit/odb-object.d.ts @@ -0,0 +1,10 @@ +import { Oid } from './oid'; + +export class OdbObject { + data(): Buffer; + dup(): Promise; + free(): void; + id(): Oid; + size(): number; + type(): number; +} diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index acacda8b73..f43f1673db 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -1,4 +1,5 @@ import { Oid } from './oid'; +import { OdbObject } from './odb-object'; export namespace Odb { enum STREAM { @@ -13,6 +14,6 @@ export class Odb { addDiskAlternate(path: string): number; free(): void; - read(id: Oid): Promise; + read(id: Oid): Promise; write(data: Buffer, len: number, type: number): Promise; } diff --git a/types/nodegit/reference.d.ts b/types/nodegit/reference.d.ts index 92e3e546b2..e2148f6a07 100644 --- a/types/nodegit/reference.d.ts +++ b/types/nodegit/reference.d.ts @@ -1,5 +1,6 @@ import { Repository } from './repository'; import { Oid } from './oid'; +import { Object } from './object'; export namespace Reference { enum TYPE { @@ -40,7 +41,7 @@ export class Reference { isTag(): number; name(): string; owner(): Repository; - peel(type: number): Promise; + peel(type: number): Promise; rename(newName: string, force: number, logMessage: string): Promise; resolve(): Promise; setTarget(id: Oid, logMessage: string): Promise; diff --git a/types/nodegit/remote-callbacks.d.ts b/types/nodegit/remote-callbacks.d.ts new file mode 100644 index 0000000000..0987b6259f --- /dev/null +++ b/types/nodegit/remote-callbacks.d.ts @@ -0,0 +1,8 @@ +export interface RemoteCallbacks { + version?: number; + credentials?: Function; + certificateCheck?: Function; + transferProgress?: Function; + transport?: Function; + payload?: void; +} diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts new file mode 100644 index 0000000000..3fc10534d4 --- /dev/null +++ b/types/nodegit/remote.d.ts @@ -0,0 +1,62 @@ +import { Repository } from './repository'; +import { RemoteCallbacks } from './remote-callbacks'; +import { Strarray } from './str-array'; +import { FetchOptions } from './fetch-options'; +import { Buf } from './buf'; +import { Enums } from './enums'; + +export namespace Remote { + enum AUTOTAG_OPTION { + DOWNLOAD_TAGS_UNSPECIFIED = 0, + DOWNLOAD_TAGS_AUTO = 1, + DOWNLOAD_TAGS_NONE = 2, + DOWNLOAD_TAGS_ALL = 3 + } + + enum COMPLETION_TYPE { + COMPLETION_DOWNLOAD = 0, + COMPLETION_INDEXING = 1, + COMPLETION_ERROR = 2 + } +} + +export class Remote { + static addFetch(repo: Repository, remote: string, refspec: string): number; + static addPush(repo: Repository, remote: string, refspec: string): number; + static create(repo: Repository, name: string, url: string): Remote; + static createAnonymous(repo: Repository, url: string): Promise; + static createWithFetchspec(repo: Repository, name: string, url: string, fetch: string): Promise; + static delete(repo: Repository, name: string): Promise; + static initCallbacks(opts: RemoteCallbacks, version: number): number; + static isValidName(remote_name: string): number; + static list(repo: Repository): Promise; + static lookup(repo: Repository, name: string | Remote, callback: Function): Promise; + static setAutotag(repo: Repository, remote: string, value: number): number; + static setPushurl(repo: Repository, remote: string, url: string): number; + static setUrl(repo: Repository, remote: string, url: string): number; + + autotag(): number; + connect(direction: Enums.DIRECTION, callbacks: RemoteCallbacks, callback: Function): Promise; + connected(): number; + defaultBranch(): Promise; + disconnect(): Promise; + download(refSpecs: any[], opts: FetchOptions, callback: Function): Promise; + dup(): Promise; + fetch(refSpecs: any[], opts: FetchOptions, message: string, callback: Function): Promise; + free(): void; + getFetchRefspecs(): Promise; + getPushRefspecs(): Promise; + getRefspec(n: number): Refspec; + name(): string; + owner(): Repository; + prune(callbacks: RemoteCallbacks): number; + pruneRefs(): number; + push(refSpecs: any[], options: PushOptions, callback: Function): Promise; + pushurl(): string; + refspecCount(): number; + stats(): TransferProgress; + stop(): void; + updateTips(callbacks: RemoteCallbacks, update_fetchhead: number, download_tags: number, reflog_message: string): number; + upload(refspecs: Strarray, opts: PushOptions): number; + url(): string; +} diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index f32ca65c60..e18984bbcb 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -3,6 +3,15 @@ import { Buf } from './buf'; import { Reference } from './reference'; import { Odb } from './odb'; import { Object } from './object'; +import { Index } from './index_'; +import { Commit } from './commit'; +import { Blob } from './blob'; +import { Tree } from './tree'; +import { Signature } from './signature'; +import { AnnotatedCommit } from './annotated-commit'; +import { FetchOptions } from './fetch-options'; +import { CheckoutOptions } from './checkout-options'; +import { Remote } from './remote'; interface RepositoryInitOptions { description: string, @@ -84,7 +93,7 @@ export class Repository { head(): Promise; headDetached(): number; headUnborn(): number; - index(): Promise; + index(): Promise; isBare(): number; isEmpty(): number; isShallow(): number; @@ -95,44 +104,44 @@ export class Repository { refdb(): Promise; setHead(refname: string): Promise; setHeadDetached(commitish: Oid): number; - setHeadDetachedFromAnnotated(commitish: NodeGit.AnnotatedCommit): number; + setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): number; setIdent(name: string, email: string): number; setNamespace(nmspace: string): number; setWorkdir(workdir: string, update_gitlink: number): number; state(): number; stateCleanup(): number; workdir(): string; - createBranch(name: string, commit: NodeGit.Commit | string | Oid, force: boolean, signature: NodeGit.Signature, logMessage: string): Promise; - getReferenceCommit(name: string | Reference): Promise; + createBranch(name: string, commit: Commit | string | Oid, force: boolean, signature: Signature, logMessage: string): Promise; + getReferenceCommit(name: string | Reference): Promise; getBranch(name: string | Reference): Promise; - getBranchCommit(name: string | Reference): Promise; + getBranchCommit(name: string | Reference): Promise; getCurrentBranch(): Promise; getReference(name: string | Reference): Promise; getReferences(type: Reference.TYPE): Promise; getReferenceNames(type: Reference.TYPE): Promise; - getCommit(string: string | Oid): Promise; - getBlob(string: string | Oid): Promise; - getTree(string: string | Oid): Promise; + getCommit(string: string | Oid): Promise; + getBlob(string: string | Oid): Promise; + getTree(string: string | Oid): Promise; createTag(string: string | Oid, name: string, message: string): Promise; createLightweightTag(string: string | Oid, name: string): Promise; getTag(string: string | Oid): Promise; getTagByName(Short: string): Promise; deleteTagByName(Short: string): Promise; createRevWalk(string: string | Oid): any; - getMasterCommit(): Promise; - getHeadCommit(): Promise; - createCommit(updateRef: string, author: NodeGit.Signature, committer: NodeGit.Signature, message: string, Tree: NodeGit.Tree | Oid | string, parents: any[]): Promise; - createCommitOnHead(filesToAdd: any[], author: NodeGit.Signature, committer: NodeGit.Signature, message: string): Promise; + getMasterCommit(): Promise; + getHeadCommit(): Promise; + createCommit(updateRef: string, author: Signature, committer: Signature, message: string, Tree: Tree | Oid | string, parents: any[]): Promise; + createCommitOnHead(filesToAdd: any[], author: Signature, committer: Signature, message: string): Promise; createBlobFromBuffer(buffer: Buffer): Oid; - treeBuilder(tree: NodeGit.Tree): any; + treeBuilder(tree: Tree): any; defaultSignature(): Signature; getRemotes(Optional: Function): Promise; - getRemote(remote: string | Remote, callback: Function): Promise; + getRemote(remote: string | Remote, callback: Function): Promise; fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; - mergeBranches(to: string | Reference, from: string | Reference, signature: NodeGit.Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise; - rebaseBranches(branch: string, upstream: string, onto: string, signature: NodeGit.Signature, beforeNextFn: Function): Promise; - continueRebase(signature: NodeGit.Signature, beforeNextFn: Function): Promise; + mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise; + rebaseBranches(branch: string, upstream: string, onto: string, signature: Signature, beforeNextFn: Function): Promise; + continueRebase(signature: Signature, beforeNextFn: Function): Promise; getStatus(opts: any): Promise; getStatusExt(opts: any): Promise; getSubmoduleNames(): Promise; diff --git a/types/nodegit/str-array.d.ts b/types/nodegit/str-array.d.ts new file mode 100644 index 0000000000..fc400448f2 --- /dev/null +++ b/types/nodegit/str-array.d.ts @@ -0,0 +1,6 @@ +export class Strarray { + copy(src: Strarray): number; + free(): void; + strings: string; + count: number; +} diff --git a/types/nodegit/tree-builder.d.ts b/types/nodegit/tree-builder.d.ts new file mode 100644 index 0000000000..03d11db900 --- /dev/null +++ b/types/nodegit/tree-builder.d.ts @@ -0,0 +1,16 @@ +import { Oid } from './oid'; +import { Repository } from './repository'; +import { Tree } from './tree'; +import { TreeEntry } from './tree-entry'; + +export class Treebuilder { + static create(repo: Repository, source: Tree): Promise; + + clear(): void; + entrycount(): number; + free(): void; + get(filename: string): TreeEntry; + insert(filename: string, id: Oid, filemode: number): Promise; + remove(filename: string): number; + write(): Oid; +} diff --git a/types/nodegit/tree-entry.d.ts b/types/nodegit/tree-entry.d.ts new file mode 100644 index 0000000000..8d1b5d553e --- /dev/null +++ b/types/nodegit/tree-entry.d.ts @@ -0,0 +1,30 @@ +import { Tree } from './tree'; +import { Oid } from './oid'; +import { Blob } from './blob'; + +export namespace TreeEntry { + enum FILEMODE { + UNREADABLE = 0, + TREE = 16384, + BLOB = 33188, + EXECUTABLE = 33261, + LINK = 40960, + COMMIT = 57344 + } +} + +export class TreeEntry { + isFile(): Boolean; + isTree(): Boolean; + isDirectory(): Boolean; + isBlob(): Boolean; + sha(): string; + getTree(): Promise; + getBlob(): Promise; + path(): string; + toString(): string; + attr: number; + oid: Oid; + filenameLen: number; + filename: string; +} diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts new file mode 100644 index 0000000000..b9ac62f9e2 --- /dev/null +++ b/types/nodegit/tree.d.ts @@ -0,0 +1,44 @@ +import { Oid } from './oid'; +import { TreeEntry } from './tree-entry'; +import { Repository } from './repository'; +import { Object } from './object'; +import { Treebuilder } from './tree-builder'; +import { DiffFile } from './diff-file'; + +export namespace Tree { + enum WALK_MODE { + WALK_PRE = 0, + WALK_POST = 1 + } +} + +export class Tree { + static entryCmp(e1: TreeEntry, e2: TreeEntry): number; + static entryDup(dest: TreeEntry, source: TreeEntry): number; + static entryFilemode(entry: TreeEntry): number; + static entryFilemodeRaw(entry: TreeEntry): number; + static entryFree(entry: TreeEntry): void; + static entryId(entry: TreeEntry): Oid; + static entryName(entry: TreeEntry): string; + static entryToObject(object_out: Object, repo: Repository, entry: TreeEntry): number; + static entryType(entry: TreeEntry): number; + static lookup(repo: Repository, id: string | Oid | Tree, callback: Function): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + + entryById(id: Oid): TreeEntry; + _entryByIndex(idx: number): TreeEntry; + entryByName(name: string): TreeEntry; + entryByPath(path: string): Promise; + entryCount(): number; + free(): void; + id(): Oid; + owner(): Repository; + diff(tree: Tree, callback: Function): Promise; + diffWithOptions(tree: Tree, options: Object, callback: Function): Promise; + entryByIndex(i: number): TreeEntry; + getEntry(filePath: string): TreeEntry; + entries(): TreeEntry[]; + walk(blobsOnly?: Boolean): NodeJS.EventEmitter; + path(): string; + builder(): Treebuilder; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 471d7919cd..eec4787935 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -16,15 +16,33 @@ "forceConsistentCasingInFileNames": true }, "files": [ + "annotated-commit.d.ts", + "blob.d.ts", "buf.d.ts", + "checkout-options.d.ts", + "commit.d.ts", + "diff-delta.d.ts", + "diff-file.d.ts", + "diff-perf-data.d.ts", + "diff.d.ts", + "enums.d.ts", + "fetch-options.d.ts", + "index-entry.d.ts", "index.d.ts", "nodegit-tests.ts", "object.d.ts", + "odb-object.d.ts", "odb.d.ts", "oid.d.ts", "reference.d.ts", + "remote-callbacks.d.ts", + "remote.d.ts", "repository.d.ts", "signature.d.ts", + "str-array.d.ts", "time.d.ts", + "tree-builder.d.ts", + "tree-entry.d.ts", + "tree.d.ts" ] } From dd5dc38dec7b349456af6a5604a88cbca23a5b3c Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 4 Jun 2017 02:39:34 +0100 Subject: [PATCH 055/761] Added more files --- types/nodegit/checkout-options.d.ts | 6 +-- types/nodegit/commit.d.ts | 2 + types/nodegit/config.d.ts | 22 +++++++++++ types/nodegit/diff.d.ts | 5 ++- types/nodegit/index-entry.d.ts | 2 +- types/nodegit/index.d.ts | 12 +++++- types/nodegit/merge-file-input.d.ts | 7 ++++ types/nodegit/merge-options.d.ts | 8 ++++ types/nodegit/merge.d.ts | 59 ++++++++++++++++++++++++++++ types/nodegit/oid-array.d.ts | 7 ++++ types/nodegit/push-options.d.ts | 7 ++++ types/nodegit/ref-db.d.ts | 8 ++++ types/nodegit/ref-spec.d.ts | 8 ++++ types/nodegit/remote-callbacks.d.ts | 4 +- types/nodegit/remote.d.ts | 3 ++ types/nodegit/repository.d.ts | 38 ++++++++++-------- types/nodegit/tag.d.ts | 27 +++++++++++++ types/nodegit/transfer-progress.d.ts | 9 +++++ types/nodegit/tsconfig.json | 10 +++++ 19 files changed, 218 insertions(+), 26 deletions(-) create mode 100644 types/nodegit/config.d.ts create mode 100644 types/nodegit/merge-file-input.d.ts create mode 100644 types/nodegit/merge-options.d.ts create mode 100644 types/nodegit/merge.d.ts create mode 100644 types/nodegit/oid-array.d.ts create mode 100644 types/nodegit/push-options.d.ts create mode 100644 types/nodegit/ref-db.d.ts create mode 100644 types/nodegit/ref-spec.d.ts create mode 100644 types/nodegit/tag.d.ts create mode 100644 types/nodegit/transfer-progress.d.ts diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index cd23a70ede..c799ce2047 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -11,9 +11,9 @@ export interface CheckoutOptions { fileOpenFlags?: number; notifyFlags?: number; notifyCb?: any; - notifyPayload?: void; + notifyPayload?: undefined; progressCb?: any; - progressPayload?: void; + progressPayload?: undefined; paths?: Strarray; baseline?: Tree; baselineIndex?: Index; @@ -22,5 +22,5 @@ export interface CheckoutOptions { ourLabel?: string; theirLabel?: string; perfdataCb?: any; - perfdataPayload?: void; + perfdataPayload?: undefined; } diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts index 3980ce080e..24ee08cc48 100644 --- a/types/nodegit/commit.d.ts +++ b/types/nodegit/commit.d.ts @@ -1,3 +1,5 @@ +import { EventEmitter } from 'events'; + import { Repository } from './repository'; import { Signature } from './signature'; import { Oid } from './oid'; diff --git a/types/nodegit/config.d.ts b/types/nodegit/config.d.ts new file mode 100644 index 0000000000..ad8df1a327 --- /dev/null +++ b/types/nodegit/config.d.ts @@ -0,0 +1,22 @@ +import { Buf } from './buf'; + +export namespace Config { + enum LEVEL { + SYSTEM = 1, + XDG = 2, + GLOBAL = 3, + LOCAL = 4, + APP = 5, + HIGHEST_LEVEL = -1 + } +} + +export class Config { + static openDefault(): Promise; + + getStringBuf(name: string): Promise; + setInt64(name: string, value: number): number; + setMultivar(name: string, regexp: string, value: string): number; + setString(name: string, value: string): Promise; + snapshot(): Promise; +} diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index ab3b3aa2c8..d8b60e1c6a 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -22,7 +22,7 @@ export interface DiffOptions { ignoreSubmodules: number; pathspec: Strarray; notifyCb: Function; - notifyPayload: void; + notifyPayload: undefined; contextLines: number; interhunkLines: number; idAbbrev: number; @@ -139,7 +139,8 @@ export namespace Diff { } export class Diff { - static blobToBuffer(old_blob: Blob, old_as_path: string, buffer: string, buffer_as_path: string, opts: DiffOptions, file_cb: Function, binary_cb: Function, hunk_cb: Function, line_cb: Function): Promise; + static blobToBuffer(old_blob: Blob, oldAsPath: string, + buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; static indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise; static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; diff --git a/types/nodegit/index-entry.d.ts b/types/nodegit/index-entry.d.ts index a6591e37b9..f2ac5cad8a 100644 --- a/types/nodegit/index-entry.d.ts +++ b/types/nodegit/index-entry.d.ts @@ -1,6 +1,6 @@ import { Oid } from './oid'; -interface IndexTime { +export interface IndexTime { seconds: number; nanoseconds: number; } diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 92307a1abb..10e7c3483a 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -8,25 +8,35 @@ export { Blob } from './blob'; export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; +export { Config } from './config'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; -export { IndexEntry } from './index-entry'; export { Index } from './index_'; +export { IndexEntry } from './index-entry'; +export { MergeFileInput } from './merge-file-input'; +export { MergeOptions } from './merge-options'; +export { Merge } from './merge'; export { Object } from './object'; export { OdbObject } from './odb-object'; export { Odb } from './odb'; +export { Oidarray } from './oid-array'; export { Oid } from './oid'; +export { PushOptions } from './push-options'; +export { Refdb } from './ref-db'; +import { Refspec } from './ref-spec'; export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; export { Signature } from './signature'; export { Strarray } from './str-array'; +export { Tag } from './tag'; export { Time } from './time'; +export { TransferProgress } from './transfer-progress'; export { Treebuilder } from './tree-builder'; export { TreeEntry } from './tree-entry'; export { Tree } from './tree'; diff --git a/types/nodegit/merge-file-input.d.ts b/types/nodegit/merge-file-input.d.ts new file mode 100644 index 0000000000..f49bd446ca --- /dev/null +++ b/types/nodegit/merge-file-input.d.ts @@ -0,0 +1,7 @@ +export interface MergeFileInput { + version: number; + ptr: string; + size: number; + path: string; + mode: number; +} diff --git a/types/nodegit/merge-options.d.ts b/types/nodegit/merge-options.d.ts new file mode 100644 index 0000000000..a4108c767d --- /dev/null +++ b/types/nodegit/merge-options.d.ts @@ -0,0 +1,8 @@ +export interface MergeOptions { + version: number; + treeFlags: number; + renameThreshold: number; + targetLimit: number; + fileFavor: number; + fileFlags: number; +} diff --git a/types/nodegit/merge.d.ts b/types/nodegit/merge.d.ts new file mode 100644 index 0000000000..fb135e178f --- /dev/null +++ b/types/nodegit/merge.d.ts @@ -0,0 +1,59 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Tree } from './tree'; +import { Commit } from './commit'; +import { Index } from './index'; +import { AnnotatedCommit } from './annotated-commit'; +import { CheckoutOptions } from './checkout-options'; +import { Oidarray } from './oid-array'; +import { MergeOptions } from './merge-options'; +import { MergeFileInput } from './merge-file-input'; + +export namespace Merge { + enum ANALYSIS { + NONE = 0, + NORMAL = 1, + UP_TO_DATE = 2, + FASTFORWARD = 4, + UNBORN = 8 + } + + enum FILE_FAVOR { + NORMAL = 0, + OURS = 1, + THEIRS = 2, + UNION = 3 + } + + enum FILE_FLAGS { + FILE_DEFAULT = 0, + FILE_STYLE_MERGE = 1, + FILE_STYLE_DIFF3 = 2, + FILE_SIMPLIFY_ALNUM = 4, + FILE_IGNORE_WHITESPACE = 8, + FILE_IGNORE_WHITESPACE_CHANGE = 16, + FILE_IGNORE_WHITESPACE_EOL = 32, + FILE_DIFF_PATIENCE = 64, + FILE_DIFF_MINIMAL = 128 + } + + enum PREFERENCE { + NONE = 0, + NO_FASTFORWARD = 1, + FASTFORWARD_ONLY = 2 + } + + enum TREE_FLAG { + TREE_FIND_RENAMES = 1 + } +} + +export class Merge { + static merge(repo: Repository, theirHead: AnnotatedCommit, mergeOpts?: MergeOptions, checkoutOpts?: CheckoutOptions): any; + static base(repo: Repository, one: Oid, two: Oid): Promise; + static bases(repo: Repository, one: Oid, two: Oid): Promise; + static commits(repo: Repository, ourCommit: Commit, theirCommit: Commit, options?: MergeOptions): any; + static fileInitInput(opts: MergeFileInput, version: number): number; + static initOptions(opts: MergeOptions, version: number): number; + static trees(repo: Repository, ancestor_tree: Tree, our_tree: Tree, their_tree: Tree, opts: MergeOptions): Promise; +} diff --git a/types/nodegit/oid-array.d.ts b/types/nodegit/oid-array.d.ts new file mode 100644 index 0000000000..7a96f24a7a --- /dev/null +++ b/types/nodegit/oid-array.d.ts @@ -0,0 +1,7 @@ +import { Oid } from './oid'; + +export class Oidarray { + free(): void; + ids: Oid; + count: number; +} diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts new file mode 100644 index 0000000000..5187548b8f --- /dev/null +++ b/types/nodegit/push-options.d.ts @@ -0,0 +1,7 @@ +import { RemoteCallbacks } from './remote-callbacks'; + +export interface PushOptions { + version: number; + pbParallelism: number; + callbacks: RemoteCallbacks; +} diff --git a/types/nodegit/ref-db.d.ts b/types/nodegit/ref-db.d.ts new file mode 100644 index 0000000000..8c9046d48d --- /dev/null +++ b/types/nodegit/ref-db.d.ts @@ -0,0 +1,8 @@ +import { Repository } from './repository'; + +export class Refdb { + static open(repo: Repository): Promise; + + compress(): number; + free(): void; +} diff --git a/types/nodegit/ref-spec.d.ts b/types/nodegit/ref-spec.d.ts new file mode 100644 index 0000000000..bf40f21ac2 --- /dev/null +++ b/types/nodegit/ref-spec.d.ts @@ -0,0 +1,8 @@ +export class Refspec { + direction(): number; + dst(): string; + dstMatches(refname: string): number; + force(): number; + src(): string; + srcMatches(refname: string): number; +} diff --git a/types/nodegit/remote-callbacks.d.ts b/types/nodegit/remote-callbacks.d.ts index 0987b6259f..ca244e5c5e 100644 --- a/types/nodegit/remote-callbacks.d.ts +++ b/types/nodegit/remote-callbacks.d.ts @@ -1,8 +1,8 @@ -export interface RemoteCallbacks { +export class RemoteCallbacks { version?: number; credentials?: Function; certificateCheck?: Function; transferProgress?: Function; transport?: Function; - payload?: void; + payload?: undefined; } diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 3fc10534d4..0c3923c57c 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -4,6 +4,9 @@ import { Strarray } from './str-array'; import { FetchOptions } from './fetch-options'; import { Buf } from './buf'; import { Enums } from './enums'; +import { TransferProgress } from './transfer-progress'; +import { PushOptions } from './push-options'; +import { Refspec } from './ref-spec'; export namespace Remote { enum AUTOTAG_OPTION { diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index e18984bbcb..acf5f5b83a 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -12,19 +12,23 @@ import { AnnotatedCommit } from './annotated-commit'; import { FetchOptions } from './fetch-options'; import { CheckoutOptions } from './checkout-options'; import { Remote } from './remote'; +import { Tag } from './tag'; +import { Config } from './config'; +import { Merge } from './merge'; +import { MergeOptions } from './merge-options'; +import { Refdb } from './ref-db'; -interface RepositoryInitOptions { - description: string, - flags: number, - initialHead: string, - mode: number, - originUrl: string, - templatePath: string, - version: number, - workdirPath: string +export interface RepositoryInitOptions { + description: string; + flags: number; + initialHead: string; + mode: number; + originUrl: string; + templatePath: string; + version: number; + workdirPath: string; } - export class Repository { /** * Creates a branch with the passed in name pointing to the commit @@ -84,8 +88,8 @@ export class Repository { static wrapOdb(odb: Odb): Promise; cleanup(): void; - config(): Promise; - configSnapshot(): Promise; + config(): Promise; + configSnapshot(): Promise; detachHead(): number; fetchheadForeach(callback: Function): Promise; free(): void; @@ -101,7 +105,7 @@ export class Repository { messageRemove(): number; odb(): Promise; path(): string; - refdb(): Promise; + refdb(): Promise; setHead(refname: string): Promise; setHeadDetached(commitish: Oid): number; setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): number; @@ -122,10 +126,10 @@ export class Repository { getCommit(string: string | Oid): Promise; getBlob(string: string | Oid): Promise; getTree(string: string | Oid): Promise; - createTag(string: string | Oid, name: string, message: string): Promise; + createTag(string: string | Oid, name: string, message: string): Promise; createLightweightTag(string: string | Oid, name: string): Promise; - getTag(string: string | Oid): Promise; - getTagByName(Short: string): Promise; + getTag(string: string | Oid): Promise; + getTagByName(Short: string): Promise; deleteTagByName(Short: string): Promise; createRevWalk(string: string | Oid): any; getMasterCommit(): Promise; @@ -139,7 +143,7 @@ export class Repository { getRemote(remote: string | Remote, callback: Function): Promise; fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; - mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise; + mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: Merge.PREFERENCE, mergeOptions: MergeOptions): Promise; rebaseBranches(branch: string, upstream: string, onto: string, signature: Signature, beforeNextFn: Function): Promise; continueRebase(signature: Signature, beforeNextFn: Function): Promise; getStatus(opts: any): Promise; diff --git a/types/nodegit/tag.d.ts b/types/nodegit/tag.d.ts new file mode 100644 index 0000000000..d8f98953a0 --- /dev/null +++ b/types/nodegit/tag.d.ts @@ -0,0 +1,27 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Object } from './object'; +import { Signature } from './signature'; +import { Strarray } from './str-array'; + +export class Tag { + static annotationCreate(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string): Promise; + static create(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string, force: number): Promise; + static createLightweight(repo: Repository, tag_name: string, target: Object, force: number): Promise; + static delete(repo: Repository, tag_name: string): Promise; + static list(repo: Repository): Promise; + static listMatch(tag_names: Strarray, pattern: string, repo: Repository): number; + static lookup(repo: Repository, id: string | Oid | Tag): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + + free(): void; + id(): Oid; + message(): string; + name(): string; + owner(): Repository; + peel(tag_target_out: Object): number; + tagger(): Signature; + target(): Object; + targetId(): Oid; + targetType(): number; +} diff --git a/types/nodegit/transfer-progress.d.ts b/types/nodegit/transfer-progress.d.ts new file mode 100644 index 0000000000..1589d4b6c6 --- /dev/null +++ b/types/nodegit/transfer-progress.d.ts @@ -0,0 +1,9 @@ +export class TransferProgress { + totalObjects: number; + indexedObjects: number; + receivedObjects: number; + localObjects: number; + totalDeltas: number; + indexedDeltas: number; + receivedBytes: number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index eec4787935..bfb1077c61 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -21,6 +21,7 @@ "buf.d.ts", "checkout-options.d.ts", "commit.d.ts", + "config.d.ts", "diff-delta.d.ts", "diff-file.d.ts", "diff-perf-data.d.ts", @@ -29,18 +30,27 @@ "fetch-options.d.ts", "index-entry.d.ts", "index.d.ts", + "merge-file-input.d.ts", + "merge-options.d.ts", + "merge.d.ts", "nodegit-tests.ts", "object.d.ts", "odb-object.d.ts", "odb.d.ts", + "oid-array.d.ts", "oid.d.ts", + "push-options.d.ts", + "ref-db.d.ts", + "ref-spec.d.ts", "reference.d.ts", "remote-callbacks.d.ts", "remote.d.ts", "repository.d.ts", "signature.d.ts", "str-array.d.ts", + "tag.d.ts", "time.d.ts", + "transfer-progress.d.ts", "tree-builder.d.ts", "tree-entry.d.ts", "tree.d.ts" From 314e6080f4a5a96bf7a03273e99a8f5f059adb99 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 4 Jun 2017 03:10:28 +0100 Subject: [PATCH 056/761] Added more files --- types/nodegit/convenient-patch.d.ts | 21 ++++++ types/nodegit/index.d.ts | 4 + types/nodegit/str-array.d.ts | 2 +- types/nodegit/submodule-update-options.d.ts | 9 +++ types/nodegit/submodule.d.ts | 81 +++++++++++++++++++++ types/nodegit/transport.d.ts | 14 ++++ types/nodegit/tsconfig.json | 4 + 7 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 types/nodegit/convenient-patch.d.ts create mode 100644 types/nodegit/submodule-update-options.d.ts create mode 100644 types/nodegit/submodule.d.ts create mode 100644 types/nodegit/transport.d.ts diff --git a/types/nodegit/convenient-patch.d.ts b/types/nodegit/convenient-patch.d.ts new file mode 100644 index 0000000000..8dee260aa0 --- /dev/null +++ b/types/nodegit/convenient-patch.d.ts @@ -0,0 +1,21 @@ +import { DiffFile } from './diff-file'; + +export class ConvenientPatch { + oldFile(): DiffFile; + newFile(): DiffFile; + size(): number; + hunks(): Promise; + status(): number; + lineStats(): any; + isUnmodified(): Boolean; + isAdded(): Boolean; + isDeleted(): Boolean; + isModified(): Boolean; + isRenamed(): Boolean; + isCopied(): Boolean; + isIgnored(): Boolean; + isUntracked(): Boolean; + isTypeChange(): Boolean; + isUnreadable(): Boolean; + isConflicted(): Boolean; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 10e7c3483a..11d274425f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -9,6 +9,7 @@ export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; export { Config } from './config'; +export { ConvenientPatch } from './convenient-patch'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; export { DiffPerfdata } from './diff-perf-data'; @@ -34,9 +35,12 @@ export { Remote } from './remote'; export { Repository } from './repository'; export { Signature } from './signature'; export { Strarray } from './str-array'; +export { SubmoduleUpdateOptions } from './submodule-update-options'; +export { Submodule } from './submodule'; export { Tag } from './tag'; export { Time } from './time'; export { TransferProgress } from './transfer-progress'; +export { Transport } from './transport'; export { Treebuilder } from './tree-builder'; export { TreeEntry } from './tree-entry'; export { Tree } from './tree'; diff --git a/types/nodegit/str-array.d.ts b/types/nodegit/str-array.d.ts index fc400448f2..525667fbcb 100644 --- a/types/nodegit/str-array.d.ts +++ b/types/nodegit/str-array.d.ts @@ -1,6 +1,6 @@ export class Strarray { copy(src: Strarray): number; free(): void; - strings: string; + strings: string[]; count: number; } diff --git a/types/nodegit/submodule-update-options.d.ts b/types/nodegit/submodule-update-options.d.ts new file mode 100644 index 0000000000..35bbd6b3f8 --- /dev/null +++ b/types/nodegit/submodule-update-options.d.ts @@ -0,0 +1,9 @@ +import { CheckoutOptions } from './checkout-options'; +import { FetchOptions } from './fetch-options'; + +export interface SubmoduleUpdateOptions { + version: number; + checkoutOpts: CheckoutOptions; + fetchOpts: FetchOptions; + cloneCheckoutStrategy: number; +} diff --git a/types/nodegit/submodule.d.ts b/types/nodegit/submodule.d.ts new file mode 100644 index 0000000000..b3c1576db4 --- /dev/null +++ b/types/nodegit/submodule.d.ts @@ -0,0 +1,81 @@ +import { Repository } from './repository'; +import { Buf } from './buf'; +import { Oid } from './oid'; +import { SubmoduleUpdateOptions } from './submodule-update-options'; + +export namespace Submodule { + enum IGNORE { + UNSPECIFIED = -1, + NONE = 1, + UNTRACKED = 2, + DIRTY = 3, + ALL = 4 + } + + enum RECURSE { + NO = 0, + YES = 1, + ONDEMAND = 2 + } + + enum STATUS { + IN_HEAD = 1, + IN_INDEX = 2, + IN_CONFIG = 4, + IN_WD = 8, + INDEX_ADDED = 16, + INDEX_DELETED = 32, + INDEX_MODIFIED = 64, + WD_UNINITIALIZED = 128, + WD_ADDED = 256, + WD_DELETED = 512, + WD_MODIFIED = 1024, + WD_INDEX_MODIFIED = 2048, + WD_WD_MODIFIED = 4096, + WD_UNTRACKED = 8192 + } + + enum UPDATE { + CHECKOUT = 1, + REBASE = 2, + MERGE = 3, + NONE = 4, + DEFAULT = 0 + } +} + +export class Submodule { + static addSetup(repo: Repository, url: string, path: string, use_gitlink: number): Promise; + static foreach(repo: Repository, callback: Function, payload: any): Promise; + static lookup(repo: Repository, name: string): Promise; + static resolveUrl(repo: Repository, url: string): Promise; + static setBranch(repo: Repository, name: string, branch: string): number; + static setFetchRecurseSubmodules(repo: Repository, name: string, fetch_recurse_submodules: number): number; + static setIgnore(repo: Repository, name: string, ignore: number): Promise; + static setUpdate(repo: Repository, name: string, update: number): Promise; + static setUrl(repo: Repository, name: string, url: string): Promise; + static status(repo: Repository, name: string, ignore: number): Promise; + static updateInitOptions(opts: SubmoduleUpdateOptions, version: number): number; + + addFinalize(): Promise; + addToIndex(write_index: number): Promise; + branch(): string; + fetchRecurseSubmodules(): number; + free(): void; + headId(): Oid; + ignore(): number; + indexId(): Oid; + init(overwrite: number): Promise; + location(): Promise; + name(): string; + open(): Promise; + owner(): Repository; + path(): string; + reload(force: number): number; + repoInit(use_gitlink: number): Promise; + sync(): Promise; + update(init: number, options: SubmoduleUpdateOptions): Promise; + updateStrategy(): number; + url(): string; + wdId(): Oid; +} diff --git a/types/nodegit/transport.d.ts b/types/nodegit/transport.d.ts new file mode 100644 index 0000000000..9d1a82b061 --- /dev/null +++ b/types/nodegit/transport.d.ts @@ -0,0 +1,14 @@ +import { Remote } from './remote'; +import { Strarray } from './str-array'; + +export namespace Transport { + enum FLAGS { + NONE = 0 + } +} + +export class Transport { + static sshWithPaths(owner: Remote, payload: Strarray): Promise; + static unregister(prefix: string): number; + init(version: number): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index bfb1077c61..483f995a50 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -22,6 +22,7 @@ "checkout-options.d.ts", "commit.d.ts", "config.d.ts", + "convenient-patch.d.ts", "diff-delta.d.ts", "diff-file.d.ts", "diff-perf-data.d.ts", @@ -48,9 +49,12 @@ "repository.d.ts", "signature.d.ts", "str-array.d.ts", + "submodule-update-options.d.ts", + "submodule.d.ts", "tag.d.ts", "time.d.ts", "transfer-progress.d.ts", + "transport.d.ts", "tree-builder.d.ts", "tree-entry.d.ts", "tree.d.ts" From 9db0ab843c9f8e4e12960d1438876b926d007c7e Mon Sep 17 00:00:00 2001 From: Christian Howe Date: Sun, 4 Jun 2017 00:01:24 -0400 Subject: [PATCH 057/761] [types/node] Add promisify to util A simple type definition that allows us to use the exciting util.promisify function. --- types/node/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 66f118d62c..12799c7686 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -3815,6 +3815,7 @@ declare module "util" { export function isSymbol(object: any): object is symbol; export function isUndefined(object: any): object is undefined; export function deprecate(fn: Function, message: string): Function; + export function promisify(fn: Function): Function; } declare module "assert" { From 9f15944c5d24284481fd64686e4b0a6bd245a41a Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 4 Jun 2017 11:44:25 +0200 Subject: [PATCH 058/761] Add "events" function to Job class for kue --- types/kue/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/kue/index.d.ts b/types/kue/index.d.ts index 4fc964b118..afd818c8f2 100644 --- a/types/kue/index.d.ts +++ b/types/kue/index.d.ts @@ -101,6 +101,7 @@ export declare class Job extends events.EventEmitter { save(fn?: Function): Job; update(fn?: Function): Job; subscribe(fn?: Function): Job; + events(events: boolean): Job; } declare class Worker extends events.EventEmitter { From c1400707cd6ed822a063cdb1471a21d1e5deda6a Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 4 Jun 2017 23:02:39 +0100 Subject: [PATCH 059/761] Status typings --- types/nodegit/index.d.ts | 4 +++ types/nodegit/status-entry.d.ts | 7 ++++ types/nodegit/status-list.d.ts | 11 ++++++ types/nodegit/status-options.d.ts | 8 +++++ types/nodegit/status.d.ts | 56 +++++++++++++++++++++++++++++++ types/nodegit/tsconfig.json | 4 +++ 6 files changed, 90 insertions(+) create mode 100644 types/nodegit/status-entry.d.ts create mode 100644 types/nodegit/status-list.d.ts create mode 100644 types/nodegit/status-options.d.ts create mode 100644 types/nodegit/status.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 11d274425f..6aa64e9e1f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -34,6 +34,10 @@ export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; export { Signature } from './signature'; +export { StatusEntry } from './status-entry'; +export { StatusList } from './status-list'; +export { StatusOptions } from './status-options'; +export { Status } from './status'; export { Strarray } from './str-array'; export { SubmoduleUpdateOptions } from './submodule-update-options'; export { Submodule } from './submodule'; diff --git a/types/nodegit/status-entry.d.ts b/types/nodegit/status-entry.d.ts new file mode 100644 index 0000000000..bc2ab62a12 --- /dev/null +++ b/types/nodegit/status-entry.d.ts @@ -0,0 +1,7 @@ +import { DiffDelta } from './diff-delta'; + +export class StatusEntry { + status: number; + headToIndex: DiffDelta; + indexToWorkdir: DiffDelta; +} diff --git a/types/nodegit/status-list.d.ts b/types/nodegit/status-list.d.ts new file mode 100644 index 0000000000..6d83044801 --- /dev/null +++ b/types/nodegit/status-list.d.ts @@ -0,0 +1,11 @@ +import { Repository } from './repository'; +import { DiffPerfdata } from './diff-perf-data'; +import { StatusOptions } from './status-options'; + +export class StatusList { + static create(repo: Repository, opts: StatusOptions): Promise; + + entrycount(): number; + free(): void; + getPerfdata(): Promise; +} diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts new file mode 100644 index 0000000000..c4296a5b92 --- /dev/null +++ b/types/nodegit/status-options.d.ts @@ -0,0 +1,8 @@ +import { Strarray } from './str-array'; + +export interface StatusOptions { + version: number; + show: number; + flags: number; + pathspec: Strarray; +} diff --git a/types/nodegit/status.d.ts b/types/nodegit/status.d.ts new file mode 100644 index 0000000000..92bbe564f3 --- /dev/null +++ b/types/nodegit/status.d.ts @@ -0,0 +1,56 @@ +import { Repository } from './repository'; +import { StatusList } from './status-list'; +import { StatusEntry } from './status-entry'; +import { StatusOptions } from './status-options'; + +export namespace Status { + enum STATUS { + CURRENT = 0, + INDEX_NEW = 1, + INDEX_MODIFIED = 2, + INDEX_DELETED = 4, + INDEX_RENAMED = 8, + INDEX_TYPECHANGE = 16, + WT_NEW = 128, + WT_MODIFIED = 256, + WT_DELETED = 512, + WT_TYPECHANGE = 1024, + WT_RENAMED = 2048, + WT_UNREADABLE = 4096, + IGNORED = 16384, + CONFLICTED = 32768 + } + + enum OPT { + INCLUDE_UNTRACKED = 1, + INCLUDE_IGNORED = 2, + INCLUDE_UNMODIFIED = 4, + EXCLUDE_SUBMODULES = 8, + RECURSE_UNTRACKED_DIRS = 16, + DISABLE_PATHSPEC_MATCH = 32, + RECURSE_IGNORED_DIRS = 64, + RENAMES_HEAD_TO_INDEX = 128, + RENAMES_INDEX_TO_WORKDIR = 256, + SORT_CASE_SENSITIVELY = 512, + SORT_CASE_INSENSITIVELY = 1024, + RENAMES_FROM_REWRITES = 2048, + NO_REFRESH = 4096, + UPDATE_INDEX = 8192, + INCLUDE_UNREADABLE = 16384, + INCLUDE_UNREADABLE_AS_UNTRACKED = 32768 + } + + enum SHOW { + INDEX_AND_WORKDIR = 0, + INDEX_ONLY = 1, + WORKDIR_ONLY = 2 + } +} + +export class Status { + static byIndex(statuslist: StatusList, idx: number): StatusEntry; + static file(repo: Repository, path: string): number; + static foreach(repo: Repository, callback: Function, payload: void): Promise; + static foreachExt(repo: Repository, opts: StatusOptions, callback: Function, payload: void): Promise; + static shouldIgnore(ignored: number, repo: Repository, path: string): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 483f995a50..40d020dd19 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -48,6 +48,10 @@ "remote.d.ts", "repository.d.ts", "signature.d.ts", + "status-entry.d.ts", + "status-list.d.ts", + "status-options.d.ts", + "status.d.ts", "str-array.d.ts", "submodule-update-options.d.ts", "submodule.d.ts", From 046c22fa46b0d4445347fb38a3d8c3eea0a72bfc Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 4 Jun 2017 23:09:57 +0100 Subject: [PATCH 060/761] Stash typings --- types/nodegit/index.d.ts | 1 + types/nodegit/stash.d.ts | 46 +++++++++++++++++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 48 insertions(+) create mode 100644 types/nodegit/stash.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 6aa64e9e1f..a4a90f07d2 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -34,6 +34,7 @@ export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; export { Signature } from './signature'; +export { Stash } from './stash'; export { StatusEntry } from './status-entry'; export { StatusList } from './status-list'; export { StatusOptions } from './status-options'; diff --git a/types/nodegit/stash.d.ts b/types/nodegit/stash.d.ts new file mode 100644 index 0000000000..5208fa7e5f --- /dev/null +++ b/types/nodegit/stash.d.ts @@ -0,0 +1,46 @@ +import { Repository } from './repository'; +import { Signature } from './signature'; +import { Oid } from './oid'; +import { CheckoutOptions } from './checkout-options'; + +export namespace Stash { + enum APPLY_FLAGS { + APPLY_DEFAULT = 0, + APPLY_REINSTATE_INDEX = 1 + } + + enum APPLY_PROGRESS { + NONE = 0, + LOADING_STASH = 1, + ANALYZE_INDEX = 2, + ANALYZE_MODIFIED = 3, + ANALYZE_UNTRACKED = 4, + CHECKOUT_UNTRACKED = 5, + CHECKOUT_MODIFIED = 6, + DONE = 7 + } + + enum FLAGS { + DEFAULT = 0, + KEEP_INDEX = 1, + INCLUDE_UNTRACKED = 2, + INCLUDE_IGNORED = 4 + } +} + +export interface StashApplyOptions { + version: number; + flags: number; + checkoutOptions: CheckoutOptions; + progressCb: Function; + progressPayload: void; +} + +export class Stash { + static apply(repo: Repository, index: number, options: StashApplyOptions): Promise; + static applyInitOptions(opts: StashApplyOptions, version: number): number; + static drop(repo: Repository, index: number): Promise; + static foreach(repo: Repository, callback: Function, payload: void): Promise; + static pop(repo: Repository, index: number, options: StashApplyOptions): Promise; + static save(repo: Repository, stasher: Signature, message: string, flags: number): Promise; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 40d020dd19..017b34314c 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -48,6 +48,7 @@ "remote.d.ts", "repository.d.ts", "signature.d.ts", + "stash.d.ts", "status-entry.d.ts", "status-list.d.ts", "status-options.d.ts", From a85c080ce2639b33a65f2c48c3f4ec7fda46eb7f Mon Sep 17 00:00:00 2001 From: Konstantin Vasilev Date: Mon, 5 Jun 2017 11:40:42 +0300 Subject: [PATCH 061/761] Upgrade react-swipeable to v4.0 --- types/react-swipeable/index.d.ts | 44 ++++++--------- .../react-swipeable/react-swipeable-tests.tsx | 56 +++++++++++++------ types/react-swipeable/tslint.json | 3 + 3 files changed, 58 insertions(+), 45 deletions(-) create mode 100644 types/react-swipeable/tslint.json diff --git a/types/react-swipeable/index.d.ts b/types/react-swipeable/index.d.ts index fadf0f057f..da72f528e3 100644 --- a/types/react-swipeable/index.d.ts +++ b/types/react-swipeable/index.d.ts @@ -1,29 +1,19 @@ -// Type definitions for react-swipeable 3.3.1 +// Type definitions for react-swipeable 4.0 // Project: https://www.npmjs.com/package/react-swipeable // Definitions by: Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.2 -/// +declare module 'react-swipeable' { + import * as React from 'react'; -declare namespace ReactSwipeableModule { - interface onSwipingCallback { - (event: React.TouchEvent, deltaX: number, deltaY: number, absX: number, absY: number, velocity: number): void; - } + type onSwipingCallback = (event: React.TouchEvent, deltaX: number, deltaY: number, absX: number, absY: number, velocity: number) => void; + type OnSwipedCallback = (event: React.TouchEvent, deltaX: number, deltaY: number, isFlick: boolean, velocity: number) => void; + type OnSwipedDirectionCallback = (event: React.TouchEvent, delta: number, isFlick: boolean) => void; + type OnSwipingDirectionCallback = (event: React.TouchEvent, delta: number) => void; + type OnTapCallback = (event: React.TouchEvent) => void; - interface OnSwipedCallback { - (event: React.TouchEvent, deltaX: number, deltaY: number, isFlick: boolean, velocity: number): void; - } - - interface OnSwipedDirectionCallback { - (event: React.TouchEvent, delta: number, isFlick: boolean): void; - } - - interface OnSwipingDirectionCallback { - (event: React.TouchEvent, delta: number): void; - } - - interface Props { + interface Props extends React.ClassAttributes, React.HTMLAttributes { onSwiped?: OnSwipedCallback; onSwiping?: onSwipingCallback; onSwipingUp?: OnSwipingDirectionCallback; @@ -34,18 +24,18 @@ declare namespace ReactSwipeableModule { onSwipedRight?: OnSwipedDirectionCallback; onSwipedDown?: OnSwipedDirectionCallback; onSwipedLeft?: OnSwipedDirectionCallback; + onTap?: OnTapCallback; flickThreshold?: number; delta?: number; preventDefaultTouchmoveEvent?: boolean; + stopPropagation?: boolean; nodeName?: string; + trackMouse?: boolean; + children?: React.ReactNode; } - interface ReactSwipeable extends React.ComponentClass { } + class ReactSwipeable extends React.Component {} + namespace ReactSwipeable {} -} - - -declare module "react-swipeable" { - let module: ReactSwipeableModule.ReactSwipeable; - export = module; + export = ReactSwipeable; } diff --git a/types/react-swipeable/react-swipeable-tests.tsx b/types/react-swipeable/react-swipeable-tests.tsx index 7e8682ade7..05e057c11f 100644 --- a/types/react-swipeable/react-swipeable-tests.tsx +++ b/types/react-swipeable/react-swipeable-tests.tsx @@ -1,26 +1,46 @@ -import Swipeable = require('react-swipeable'); -import React = require('react'); +import * as React from 'react'; +import * as Swipeable from 'react-swipeable'; -var SampleComponent = React.createClass({ - render: function () { +class SampleComponent extends React.PureComponent { + private handleSwiped = () => {}; + private handleSwiping = () => {}; + private handleSwipingUp = () => {}; + private handleSwipingRight = () => {}; + private handleSwipingDown = () => {}; + private handleSwipingLeft = () => {}; + private handleSwipedUp = () => {}; + private handleSwipedRight = () => {}; + private handleSwipedDown = () => {}; + private handleSwipedLeft = () => {}; + private handleTap = () => {}; + private handleClick = () => {}; + + render() { return ( + onSwiped={this.handleSwiped} + onSwiping={this.handleSwiping} + onSwipingUp={this.handleSwipingUp} + onSwipingRight={this.handleSwipingRight} + onSwipingDown={this.handleSwipingDown} + onSwipingLeft={this.handleSwipingLeft} + onSwipedUp={this.handleSwipedUp} + onSwipedRight={this.handleSwipedRight} + onSwipedDown={this.handleSwipedDown} + onSwipedLeft={this.handleSwipedLeft} + onTap={this.handleTap} + flickThreshold={10} + delta={10} + preventDefaultTouchmoveEvent + stopPropagation + nodeName="swipe" + trackMouse + onClick={this.handleClick} + >
This element can be swiped
- ) + ); } -}) +} diff --git a/types/react-swipeable/tslint.json b/types/react-swipeable/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-swipeable/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 52fbfebcb6051948ac425ac5e2c797c3ed3bc04b Mon Sep 17 00:00:00 2001 From: Konstantin Vasilev Date: Mon, 5 Jun 2017 12:01:17 +0300 Subject: [PATCH 062/761] fix single module declaration --- types/react-swipeable/index.d.ts | 62 ++++++++++++++++---------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/types/react-swipeable/index.d.ts b/types/react-swipeable/index.d.ts index da72f528e3..489964ee0c 100644 --- a/types/react-swipeable/index.d.ts +++ b/types/react-swipeable/index.d.ts @@ -4,38 +4,36 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -declare module 'react-swipeable' { - import * as React from 'react'; +import * as React from 'react'; - type onSwipingCallback = (event: React.TouchEvent, deltaX: number, deltaY: number, absX: number, absY: number, velocity: number) => void; - type OnSwipedCallback = (event: React.TouchEvent, deltaX: number, deltaY: number, isFlick: boolean, velocity: number) => void; - type OnSwipedDirectionCallback = (event: React.TouchEvent, delta: number, isFlick: boolean) => void; - type OnSwipingDirectionCallback = (event: React.TouchEvent, delta: number) => void; - type OnTapCallback = (event: React.TouchEvent) => void; +type onSwipingCallback = (event: React.TouchEvent, deltaX: number, deltaY: number, absX: number, absY: number, velocity: number) => void; +type OnSwipedCallback = (event: React.TouchEvent, deltaX: number, deltaY: number, isFlick: boolean, velocity: number) => void; +type OnSwipedDirectionCallback = (event: React.TouchEvent, delta: number, isFlick: boolean) => void; +type OnSwipingDirectionCallback = (event: React.TouchEvent, delta: number) => void; +type OnTapCallback = (event: React.TouchEvent) => void; - interface Props extends React.ClassAttributes, React.HTMLAttributes { - onSwiped?: OnSwipedCallback; - onSwiping?: onSwipingCallback; - onSwipingUp?: OnSwipingDirectionCallback; - onSwipingRight?: OnSwipingDirectionCallback; - onSwipingDown?: OnSwipingDirectionCallback; - onSwipingLeft?: OnSwipingDirectionCallback; - onSwipedUp?: OnSwipedDirectionCallback; - onSwipedRight?: OnSwipedDirectionCallback; - onSwipedDown?: OnSwipedDirectionCallback; - onSwipedLeft?: OnSwipedDirectionCallback; - onTap?: OnTapCallback; - flickThreshold?: number; - delta?: number; - preventDefaultTouchmoveEvent?: boolean; - stopPropagation?: boolean; - nodeName?: string; - trackMouse?: boolean; - children?: React.ReactNode; - } - - class ReactSwipeable extends React.Component {} - namespace ReactSwipeable {} - - export = ReactSwipeable; +interface Props extends React.ClassAttributes, React.HTMLAttributes { + onSwiped?: OnSwipedCallback; + onSwiping?: onSwipingCallback; + onSwipingUp?: OnSwipingDirectionCallback; + onSwipingRight?: OnSwipingDirectionCallback; + onSwipingDown?: OnSwipingDirectionCallback; + onSwipingLeft?: OnSwipingDirectionCallback; + onSwipedUp?: OnSwipedDirectionCallback; + onSwipedRight?: OnSwipedDirectionCallback; + onSwipedDown?: OnSwipedDirectionCallback; + onSwipedLeft?: OnSwipedDirectionCallback; + onTap?: OnTapCallback; + flickThreshold?: number; + delta?: number; + preventDefaultTouchmoveEvent?: boolean; + stopPropagation?: boolean; + nodeName?: string; + trackMouse?: boolean; + children?: React.ReactNode; } + +declare class ReactSwipeable extends React.Component {} +declare namespace ReactSwipeable {} + +export = ReactSwipeable; From f527af6ed365e87058480e22577e3e191a13fb42 Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Mon, 5 Jun 2017 15:10:34 -0400 Subject: [PATCH 063/761] Annotate `react-redux` more explicitly --- types/react-redux/index.d.ts | 22 ++++----- types/react-redux/react-redux-tests.tsx | 62 +++++++++++++++++++------ types/redux-form/redux-form-tests.tsx | 4 +- 3 files changed, 62 insertions(+), 26 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index bf810575cb..112b7e9c95 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -15,12 +15,12 @@ type Store = Redux.Store; type Dispatch = Redux.Dispatch; type ActionCreator = Redux.ActionCreator; -export interface DispatchProp { - dispatch: Dispatch +export interface DispatchProp { + dispatch: Dispatch; } -interface ComponentDecorator { - (component: Component<(TOwnProps & TMergedProps) | TOwnProps>): ComponentClass; +interface ComponentDecorator { + (component: Component): ComponentClass; } interface ComponentMergeDecorator { @@ -46,21 +46,21 @@ interface ComponentMergeDecorator { * @param mergeProps * @param options */ -export declare function connect(): ComponentDecorator>; +export declare function connect(): ComponentDecorator, {}>; export declare function connect( mapStateToProps: MapStateToPropsParam -): ComponentDecorator & TStateProps>; +): ComponentDecorator & TStateProps, TOwnProps>; export declare function connect( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam -): ComponentDecorator; +): ComponentDecorator; export declare function connect( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam -): ComponentDecorator; +): ComponentDecorator; export declare function connect( mapStateToProps: MapStateToPropsParam, @@ -91,21 +91,21 @@ export declare function connect( mapDispatchToProps: null | undefined, mergeProps: null | undefined, options: Options -): ComponentDecorator & TStateProps & TOwnProps>; +): ComponentDecorator & TStateProps, TOwnProps>; export declare function connect( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: null | undefined, options: Options -): ComponentDecorator; +): ComponentDecorator; export declare function connect( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: null | undefined, options: Options -): ComponentDecorator; +): ComponentDecorator; export declare function connect( mapStateToProps: MapStateToPropsParam, diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index d6742a3e43..5875fe9291 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -108,12 +108,7 @@ declare var store: Store; class MyRootComponent extends Component { } -class TodoApp extends Component, any> { - render (): null { - this.props.dispatch({ type: 'test' }) - return null - } -} +class TodoApp extends Component {} interface TodoState { todos: string[]|string; } @@ -156,9 +151,10 @@ ReactDOM.render( // Inject just dispatch and don't listen to store -const WrappedTodoApp = connect()<{}>(TodoApp); +const AppWrap = (props: DispatchProp & { children?: React.ReactNode }) =>
+const WrappedApp = connect()(AppWrap); - + // Inject dispatch and every field in the global state @@ -281,7 +277,7 @@ interface TestState { isLoaded: boolean; state1: number; } -class TestComponent extends Component { } +class TestComponent extends Component, TestState> { } const WrappedTestComponent = connect()(TestComponent); // return value of the connect()(TestComponent) is of the type TestComponent @@ -290,7 +286,6 @@ ATestComponent = TestComponent; ATestComponent = WrappedTestComponent; let anElement: ReactElement; -; ; ; @@ -348,7 +343,7 @@ namespace TestTOwnPropsInference { state: string; } - class OwnPropsComponent extends React.Component { + class OwnPropsComponent extends React.Component, void> { render() { return
; } @@ -370,13 +365,13 @@ namespace TestTOwnPropsInference { // React.createElement(ConnectedWithoutOwnProps, { anything: 'goes!' }); // This compiles, as expected. - React.createElement(ConnectedWithOwnProps, { state: 'string', own: 'string' }); + React.createElement(ConnectedWithOwnProps, { own: 'string' }); // This should not compile, which is good. // React.createElement(ConnectedWithOwnProps, { anything: 'goes!' }); // This compiles, as expected. - React.createElement(ConnectedWithTypeHint, { state: 'string', own: 'string' }); + React.createElement(ConnectedWithTypeHint, { own: 'string' }); // This should not compile, which is good. // React.createElement(ConnectedWithTypeHint, { anything: 'goes!' }); @@ -438,3 +433,44 @@ namespace TestMergedPropsInference { }), )(MergedPropsComponent); } + +namespace Issue16652 { + interface PassedProps { + commentIds: string[]; + } + + interface GeneratedStateProps { + comments: ({ id: string } | undefined)[]; + } + + class CommentList extends React.Component, void> {} + + const mapStateToProps = (state: any, ownProps: PassedProps): GeneratedStateProps => { + return { + comments: ownProps.commentIds.map(id => ({ id })), + }; + }; + + const ConnectedCommentList = connect(mapStateToProps)( + CommentList + ); + + +} + +namespace Issue15463 { + interface ISpinnerProps{ + showGlobalSpinner: boolean; + } + class SpinnerClass extends React.Component, undefined> { + render() { + return (
); + } + } + + export const Spinner = connect((state: any) => { + return { showGlobalSpinner: true }; + })(SpinnerClass); + + +} diff --git a/types/redux-form/redux-form-tests.tsx b/types/redux-form/redux-form-tests.tsx index d14b7a35cd..7615824b53 100644 --- a/types/redux-form/redux-form-tests.tsx +++ b/types/redux-form/redux-form-tests.tsx @@ -84,7 +84,7 @@ reduxForm({ // adapted from: http://redux-form.com/6.0.0-alpha.4/examples/initializeFromState/ -import { connect } from 'react-redux' +import { connect, DispatchProp } from 'react-redux' const { DOM: { input } } = React interface DataShape { @@ -125,7 +125,7 @@ const ConnectedDecoratedInitializeFromStateFormFunction = connect( // React ComponentClass instead of StatelessComponent -class InitializeFromStateFormClass extends React.Component { +class InitializeFromStateFormClass extends React.Component, {}> { render() { return InitializeFromStateFormFunction(this.props); } From 45795eeb3e7cf609dcc3a3b5f3681aca7f21faf7 Mon Sep 17 00:00:00 2001 From: Eli Young Date: Mon, 5 Jun 2017 14:57:40 -0700 Subject: [PATCH 064/761] [bunyan] Add LogLevel type --- types/bunyan/index.d.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts index f3c739a992..281e0d5c3f 100644 --- a/types/bunyan/index.d.ts +++ b/types/bunyan/index.d.ts @@ -16,8 +16,8 @@ declare class Logger extends EventEmitter { reopenFileStreams(): void; level(): string | number; - level(value: number | string): void; - levels(name: number | string, value: number | string): void; + level(value: Logger.LogLevel): void; + levels(name: number | string, value: Logger.LogLevel): void; fields: any; src: boolean; @@ -217,17 +217,19 @@ declare namespace Logger { const ERROR: number; const FATAL: number; + type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' | number; + const stdSerializers: StdSerializers; function createLogger(options: LoggerOptions): Logger; function safeCycles(): (key: string, value: any) => any; - function resolveLevel(value: number | string): number; + function resolveLevel(value: LogLevel): number; interface Stream { type?: string; - level?: number | string; + level?: LogLevel; path?: string; stream?: NodeJS.WritableStream | Stream; closeOnExit?: boolean; @@ -238,7 +240,7 @@ declare namespace Logger { interface LoggerOptions { name: string; streams?: Stream[]; - level?: string | number; + level?: LogLevel; stream?: NodeJS.WritableStream; serializers?: Serializers | StdSerializers; src?: boolean; From 33853d9ad97d4af4155675b4a6e41913bf072561 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Mon, 5 Jun 2017 17:50:52 -0600 Subject: [PATCH 065/761] Add ConnectionError and RequestError --- types/tedious/index.d.ts | 20 ++++++++++++++++++++ types/tedious/tedious-tests.ts | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/types/tedious/index.d.ts b/types/tedious/index.d.ts index b89ac58beb..b8cef4ad9c 100644 --- a/types/tedious/index.d.ts +++ b/types/tedious/index.d.ts @@ -548,3 +548,23 @@ export declare class Connection extends events.EventEmitter { close(): void; } + +/** + * Error emitted by Connection class 'error' event + */ +export declare class ConnectionError extends Error { + constructor(message?: string, code?: number); + + public message: string; + public code: number; +} + +/** + * Error emitted by Request class + */ +export declare class RequestError extends Error { + constructor(message?: string, code?: number); + + public message: string; + public code: number; +} diff --git a/types/tedious/tedious-tests.ts b/types/tedious/tedious-tests.ts index 297deb3e3d..726436c882 100644 --- a/types/tedious/tedious-tests.ts +++ b/types/tedious/tedious-tests.ts @@ -31,4 +31,12 @@ request.on("row", (row: tedious.ColumnValue[]): void => { }); connection.execSql(request); +var requestError = new tedious.RequestError(); +requestError.message = 'test'; +requestError.code = 1; +requestError = new tedious.RequestError('test', 50005); +var connectionError = new tedious.ConnectionError(); +connectionError.message = 'test'; +connectionError.code = 1; +connectionError = new tedious.ConnectionError('test', 50005); From b5521f8a97d2bf067dbe68ae091174bd4bc9c11f Mon Sep 17 00:00:00 2001 From: Eli Young Date: Mon, 5 Jun 2017 16:33:37 -0700 Subject: [PATCH 066/761] [bunyan] Clean things up --- types/bunyan/bunyan-tests.ts | 30 ++++----- types/bunyan/index.d.ts | 121 ++++++++++++++++------------------- types/bunyan/tslint.json | 7 ++ 3 files changed, 77 insertions(+), 81 deletions(-) create mode 100644 types/bunyan/tslint.json diff --git a/types/bunyan/bunyan-tests.ts b/types/bunyan/bunyan-tests.ts index acf382c7c2..e1d1e4571b 100644 --- a/types/bunyan/bunyan-tests.ts +++ b/types/bunyan/bunyan-tests.ts @@ -1,16 +1,15 @@ - import Logger = require('bunyan'); -var ringBufferOptions: Logger.RingBufferOptions = { +let ringBufferOptions: Logger.RingBufferOptions = { limit: 100 }; -var ringBuffer: Logger.RingBuffer = new Logger.RingBuffer(ringBufferOptions); +let ringBuffer: Logger.RingBuffer = new Logger.RingBuffer(ringBufferOptions); ringBuffer.write("hello"); ringBuffer.end(); ringBuffer.destroy(); ringBuffer.destroySoon(); -var level: number; +let level: number; level = Logger.resolveLevel("trace"); level = Logger.resolveLevel("debug"); level = Logger.resolveLevel("info"); @@ -24,7 +23,7 @@ level = Logger.resolveLevel(Logger.WARN); level = Logger.resolveLevel(Logger.ERROR); level = Logger.resolveLevel(Logger.FATAL); -var options: Logger.LoggerOptions = { +let options: Logger.LoggerOptions = { name: 'test-logger', serializers: Logger.stdSerializers, streams: [{ @@ -54,9 +53,9 @@ var options: Logger.LoggerOptions = { }] }; -var log = Logger.createLogger(options); +let log = Logger.createLogger(options); -var customSerializer = function(anything: any) { +let customSerializer = (anything: any) => { return { obj: anything}; }; @@ -70,7 +69,7 @@ log.addSerializers( } ); -var child = log.child({name: 'child'}); +let child = log.child({name: 'child'}); child.reopenFileStreams(); log.addStream({path: '/dev/null'}); child.level(Logger.DEBUG); @@ -80,9 +79,9 @@ child.levels(0, 'error'); child.levels('stream1', Logger.FATAL); child.levels('stream1', 'fatal'); -var buffer = new Buffer(0); -var error = new Error(''); -var object = { +let buffer = new Buffer(0); +let error = new Error(''); +let object = { test: 123 }; @@ -117,12 +116,11 @@ log.fatal(error); log.fatal(object); log.fatal('Hello, %s', 'world!'); -var recursive: any = { +let recursive: any = { hello: 'world', - whats: { - huh: recursive - } -} + whats: {} +}; +recursive.whats['huh'] = recursive; JSON.stringify(recursive, Logger.safeCycles()); diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts index 281e0d5c3f..aad597de4e 100644 --- a/types/bunyan/index.d.ts +++ b/types/bunyan/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-bunyan +// Type definitions for node-bunyan 1.8 // Project: https://github.com/trentm/node-bunyan // Definitions by: Alex Mikhalev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,18 +10,21 @@ import { EventEmitter } from 'events'; declare class Logger extends EventEmitter { constructor(options: Logger.LoggerOptions); addStream(stream: Logger.Stream): void; - addSerializers(serializers: Logger.Serializers | Logger.StdSerializers): void; - child(options: Logger.LoggerOptions, simple?: boolean): Logger; - child(obj: Object, simple?: boolean): Logger; + addSerializers(serializers: Logger.Serializers): void; + child(options: Object, simple?: boolean): Logger; reopenFileStreams(): void; - level(): string | number; + level(): number; level(value: Logger.LogLevel): void; + levels(): number[]; + levels(name: number | string): number; levels(name: number | string, value: Logger.LogLevel): void; fields: any; src: boolean; + /* tslint:disable:unified-signatures */ + /** * Returns a boolean: is the `trace` level enabled? * @@ -35,14 +38,7 @@ declare class Logger extends EventEmitter { * (including the stack) and sets `msg` to the exception * message or you can specify the `msg`. */ - trace(error: Error, format?: any, ...params: any[]): void; - - trace(buffer: Buffer, format?: any, ...params: any[]): void; - - /** - * Uses `util.format` for msg formatting. - */ - trace(format: string | number, ...params: any[]): void; + trace(error: Error, ...params: any[]): void; /** * The first field can optionally be a "fields" object, which @@ -51,7 +47,12 @@ declare class Logger extends EventEmitter { * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ - trace(obj: Object, format?: any, ...params: any[]): void; + trace(obj: Object, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + trace(format: any, ...params: any[]): void; /** * Returns a boolean: is the `debug` level enabled? @@ -66,14 +67,7 @@ declare class Logger extends EventEmitter { * (including the stack) and sets `msg` to the exception * message or you can specify the `msg`. */ - debug(error: Error, format?: any, ...params: any[]): void; - - debug(buffer: Buffer, format?: any, ...params: any[]): void; - - /** - * Uses `util.format` for msg formatting. - */ - debug(format: string | number, ...params: any[]): void; + debug(error: Error, ...params: any[]): void; /** * The first field can optionally be a "fields" object, which @@ -82,7 +76,12 @@ declare class Logger extends EventEmitter { * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ - debug(obj: Object, format?: any, ...params: any[]): void; + debug(obj: Object, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + debug(format: any, ...params: any[]): void; /** * Returns a boolean: is the `info` level enabled? @@ -97,14 +96,7 @@ declare class Logger extends EventEmitter { * (including the stack) and sets `msg` to the exception * message or you can specify the `msg`. */ - info(error: Error, format?: any, ...params: any[]): void; - - info(buffer: Buffer, format?: any, ...params: any[]): void; - - /** - * Uses `util.format` for msg formatting. - */ - info(format: string | number, ...params: any[]): void; + info(error: Error, ...params: any[]): void; /** * The first field can optionally be a "fields" object, which @@ -113,7 +105,12 @@ declare class Logger extends EventEmitter { * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ - info(obj: Object, format?: any, ...params: any[]): void; + info(obj: Object, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + info(format: any, ...params: any[]): void; /** * Returns a boolean: is the `warn` level enabled? @@ -128,14 +125,7 @@ declare class Logger extends EventEmitter { * (including the stack) and sets `msg` to the exception * message or you can specify the `msg`. */ - warn(error: Error, format?: any, ...params: any[]): void; - - warn(buffer: Buffer, format?: any, ...params: any[]): void; - - /** - * Uses `util.format` for msg formatting. - */ - warn(format: string | number, ...params: any[]): void; + warn(error: Error, ...params: any[]): void; /** * The first field can optionally be a "fields" object, which @@ -144,7 +134,12 @@ declare class Logger extends EventEmitter { * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ - warn(obj: Object, format?: any, ...params: any[]): void; + warn(obj: Object, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + warn(format: any, ...params: any[]): void; /** * Returns a boolean: is the `error` level enabled? @@ -159,14 +154,7 @@ declare class Logger extends EventEmitter { * (including the stack) and sets `msg` to the exception * message or you can specify the `msg`. */ - error(error: Error, format?: any, ...params: any[]): void; - - error(buffer: Buffer, format?: any, ...params: any[]): void; - - /** - * Uses `util.format` for msg formatting. - */ - error(format: string | number, ...params: any[]): void; + error(error: Error, ...params: any[]): void; /** * The first field can optionally be a "fields" object, which @@ -175,7 +163,12 @@ declare class Logger extends EventEmitter { * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ - error(obj: Object, format?: any, ...params: any[]): void; + error(obj: Object, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + error(format: any, ...params: any[]): void; /** * Returns a boolean: is the `fatal` level enabled? @@ -190,14 +183,7 @@ declare class Logger extends EventEmitter { * (including the stack) and sets `msg` to the exception * message or you can specify the `msg`. */ - fatal(error: Error, format?: any, ...params: any[]): void; - - fatal(buffer: Buffer, format?: any, ...params: any[]): void; - - /** - * Uses `util.format` for msg formatting. - */ - fatal(format: string | number, ...params: any[]): void; + fatal(error: Error, ...params: any[]): void; /** * The first field can optionally be a "fields" object, which @@ -206,7 +192,14 @@ declare class Logger extends EventEmitter { * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ - fatal(obj: Object, format?: any, ...params: any[]): void; + fatal(obj: Object, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + fatal(format: any, ...params: any[]): void; + + /* tslint:enable:unified-signatures */ } declare namespace Logger { @@ -242,20 +235,18 @@ declare namespace Logger { streams?: Stream[]; level?: LogLevel; stream?: NodeJS.WritableStream; - serializers?: Serializers | StdSerializers; + serializers?: Serializers; src?: boolean; [custom: string]: any; } - interface Serializer { - (input:any): any; - } + type Serializer = (input: any) => any; interface Serializers { - [key: string]: Serializer + [key: string]: Serializer; } - interface StdSerializers { + interface StdSerializers extends Serializers { err: Serializer; res: Serializer; req: Serializer; diff --git a/types/bunyan/tslint.json b/types/bunyan/tslint.json new file mode 100644 index 0000000000..09f94cd344 --- /dev/null +++ b/types/bunyan/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // ban-types needs to be disabled to support TypeScript <2.2 + "ban-types": false + } +} From 276c04e9dd96e8d8846b12fa64d73db22b93fa38 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Mon, 5 Jun 2017 17:56:27 -0600 Subject: [PATCH 067/761] Add name as contributor per README recommendations --- types/tedious/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/tedious/index.d.ts b/types/tedious/index.d.ts index b8cef4ad9c..ac589e0d66 100644 --- a/types/tedious/index.d.ts +++ b/types/tedious/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for tedious 1.8.0 // Project: https://pekim.github.io/tedious // Definitions by: Rogier Schouten +// Chris Thompson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From a9e528c77a5a595d2e09b63c387f2a330f5e96ff Mon Sep 17 00:00:00 2001 From: Eli Young Date: Mon, 5 Jun 2017 16:36:59 -0700 Subject: [PATCH 068/761] [bunyan] Reformat code --- types/bunyan/bunyan-tests.ts | 8 +-- types/bunyan/index.d.ts | 124 +++++++++++++++++------------------ 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/types/bunyan/bunyan-tests.ts b/types/bunyan/bunyan-tests.ts index e1d1e4571b..657a59c3a8 100644 --- a/types/bunyan/bunyan-tests.ts +++ b/types/bunyan/bunyan-tests.ts @@ -56,10 +56,10 @@ let options: Logger.LoggerOptions = { let log = Logger.createLogger(options); let customSerializer = (anything: any) => { - return { obj: anything}; + return { obj: anything }; }; -log.addSerializers({anything: customSerializer}); +log.addSerializers({ anything: customSerializer }); log.addSerializers(Logger.stdSerializers); log.addSerializers( { @@ -69,9 +69,9 @@ log.addSerializers( } ); -let child = log.child({name: 'child'}); +let child = log.child({ name: 'child' }); child.reopenFileStreams(); -log.addStream({path: '/dev/null'}); +log.addStream({ path: '/dev/null' }); child.level(Logger.DEBUG); child.level('debug'); child.levels(0, Logger.ERROR); diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts index aad597de4e..d46396023f 100644 --- a/types/bunyan/index.d.ts +++ b/types/bunyan/index.d.ts @@ -27,7 +27,7 @@ declare class Logger extends EventEmitter { /** * Returns a boolean: is the `trace` level enabled? - * + * * This is equivalent to `log.isTraceEnabled()` or `log.isEnabledFor(TRACE)` in log4j. */ trace(): boolean; @@ -43,7 +43,7 @@ declare class Logger extends EventEmitter { /** * The first field can optionally be a "fields" object, which * is merged into the log record. - * + * * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ @@ -56,7 +56,7 @@ declare class Logger extends EventEmitter { /** * Returns a boolean: is the `debug` level enabled? - * + * * This is equivalent to `log.isDebugEnabled()` or `log.isEnabledFor(DEBUG)` in log4j. */ debug(): boolean; @@ -72,7 +72,7 @@ declare class Logger extends EventEmitter { /** * The first field can optionally be a "fields" object, which * is merged into the log record. - * + * * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ @@ -85,7 +85,7 @@ declare class Logger extends EventEmitter { /** * Returns a boolean: is the `info` level enabled? - * + * * This is equivalent to `log.isInfoEnabled()` or `log.isEnabledFor(INFO)` in log4j. */ info(): boolean; @@ -101,7 +101,7 @@ declare class Logger extends EventEmitter { /** * The first field can optionally be a "fields" object, which * is merged into the log record. - * + * * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ @@ -114,7 +114,7 @@ declare class Logger extends EventEmitter { /** * Returns a boolean: is the `warn` level enabled? - * + * * This is equivalent to `log.isWarnEnabled()` or `log.isEnabledFor(WARN)` in log4j. */ warn(): boolean; @@ -130,7 +130,7 @@ declare class Logger extends EventEmitter { /** * The first field can optionally be a "fields" object, which * is merged into the log record. - * + * * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ @@ -143,7 +143,7 @@ declare class Logger extends EventEmitter { /** * Returns a boolean: is the `error` level enabled? - * + * * This is equivalent to `log.isErrorEnabled()` or `log.isEnabledFor(ERROR)` in log4j. */ error(): boolean; @@ -159,7 +159,7 @@ declare class Logger extends EventEmitter { /** * The first field can optionally be a "fields" object, which * is merged into the log record. - * + * * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ @@ -172,7 +172,7 @@ declare class Logger extends EventEmitter { /** * Returns a boolean: is the `fatal` level enabled? - * + * * This is equivalent to `log.isFatalEnabled()` or `log.isEnabledFor(FATAL)` in log4j. */ fatal(): boolean; @@ -188,7 +188,7 @@ declare class Logger extends EventEmitter { /** * The first field can optionally be a "fields" object, which * is merged into the log record. - * + * * To pass in an Error *and* other fields, use the `err` * field name for the Error instance. */ @@ -203,70 +203,70 @@ declare class Logger extends EventEmitter { } declare namespace Logger { - const TRACE: number; - const DEBUG: number; - const INFO: number; - const WARN: number; - const ERROR: number; - const FATAL: number; + const TRACE: number; + const DEBUG: number; + const INFO: number; + const WARN: number; + const ERROR: number; + const FATAL: number; - type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' | number; + type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' | number; - const stdSerializers: StdSerializers; + const stdSerializers: StdSerializers; - function createLogger(options: LoggerOptions): Logger; + function createLogger(options: LoggerOptions): Logger; - function safeCycles(): (key: string, value: any) => any; + function safeCycles(): (key: string, value: any) => any; - function resolveLevel(value: LogLevel): number; + function resolveLevel(value: LogLevel): number; - interface Stream { - type?: string; - level?: LogLevel; - path?: string; - stream?: NodeJS.WritableStream | Stream; - closeOnExit?: boolean; - period?: string; - count?: number; - } + interface Stream { + type?: string; + level?: LogLevel; + path?: string; + stream?: NodeJS.WritableStream | Stream; + closeOnExit?: boolean; + period?: string; + count?: number; + } - interface LoggerOptions { - name: string; - streams?: Stream[]; - level?: LogLevel; - stream?: NodeJS.WritableStream; - serializers?: Serializers; - src?: boolean; - [custom: string]: any; - } + interface LoggerOptions { + name: string; + streams?: Stream[]; + level?: LogLevel; + stream?: NodeJS.WritableStream; + serializers?: Serializers; + src?: boolean; + [custom: string]: any; + } - type Serializer = (input: any) => any; + type Serializer = (input: any) => any; - interface Serializers { - [key: string]: Serializer; - } + interface Serializers { + [key: string]: Serializer; + } - interface StdSerializers extends Serializers { - err: Serializer; - res: Serializer; - req: Serializer; - } + interface StdSerializers extends Serializers { + err: Serializer; + res: Serializer; + req: Serializer; + } - interface RingBufferOptions { - limit?: number; - } + interface RingBufferOptions { + limit?: number; + } - class RingBuffer extends EventEmitter implements NodeJS.WritableStream { - constructor(options: RingBufferOptions); + class RingBuffer extends EventEmitter implements NodeJS.WritableStream { + constructor(options: RingBufferOptions); - writable: boolean; - records: any[]; + writable: boolean; + records: any[]; - write(record: any): boolean; - end(record?: any): void; - destroy(): void; - destroySoon(): void; - } + write(record: any): boolean; + end(record?: any): void; + destroy(): void; + destroySoon(): void; + } } export = Logger; From 26c627e69b1630e1bbe76ccbe4c710a220002188 Mon Sep 17 00:00:00 2001 From: Thiago Lacerda Date: Mon, 5 Jun 2017 22:04:14 -0700 Subject: [PATCH 069/761] Add missing TinyMCE Setting props from latest docs Signed-off-by: Thiago Lacerda --- types/tinymce/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/tinymce/index.d.ts b/types/tinymce/index.d.ts index 7cc40943e7..99e7bbd2a9 100644 --- a/types/tinymce/index.d.ts +++ b/types/tinymce/index.d.ts @@ -74,8 +74,12 @@ export interface Settings { target?: Element; + branding?: boolean; + color_picker_callback?(callback: (hexColor: string) => void, value: string): void; + custom_ui_selector?: string; + elementpath?: boolean; event_root?: boolean; @@ -132,6 +136,8 @@ export interface Settings { content_style?: string; + inline_boundaries?: boolean; + visual_anchor_class?: string; visual_table_class?: string; From 76879cce23fcae9847a57bb61cc27432e2a20532 Mon Sep 17 00:00:00 2001 From: Konstantin Vasilev Date: Tue, 6 Jun 2017 10:04:43 +0300 Subject: [PATCH 070/761] export types references --- types/react-swipeable/index.d.ts | 58 ++++++++++--------- .../react-swipeable/react-swipeable-tests.tsx | 24 ++++---- 2 files changed, 42 insertions(+), 40 deletions(-) diff --git a/types/react-swipeable/index.d.ts b/types/react-swipeable/index.d.ts index 489964ee0c..b646a46268 100644 --- a/types/react-swipeable/index.d.ts +++ b/types/react-swipeable/index.d.ts @@ -1,39 +1,41 @@ // Type definitions for react-swipeable 4.0 // Project: https://www.npmjs.com/package/react-swipeable -// Definitions by: Giedrius Grabauskas +// Definitions by: Giedrius Grabauskas , +// Konstantin Vasilev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 import * as React from 'react'; -type onSwipingCallback = (event: React.TouchEvent, deltaX: number, deltaY: number, absX: number, absY: number, velocity: number) => void; -type OnSwipedCallback = (event: React.TouchEvent, deltaX: number, deltaY: number, isFlick: boolean, velocity: number) => void; -type OnSwipedDirectionCallback = (event: React.TouchEvent, delta: number, isFlick: boolean) => void; -type OnSwipingDirectionCallback = (event: React.TouchEvent, delta: number) => void; -type OnTapCallback = (event: React.TouchEvent) => void; +declare class ReactSwipeable extends React.Component {} -interface Props extends React.ClassAttributes, React.HTMLAttributes { - onSwiped?: OnSwipedCallback; - onSwiping?: onSwipingCallback; - onSwipingUp?: OnSwipingDirectionCallback; - onSwipingRight?: OnSwipingDirectionCallback; - onSwipingDown?: OnSwipingDirectionCallback; - onSwipingLeft?: OnSwipingDirectionCallback; - onSwipedUp?: OnSwipedDirectionCallback; - onSwipedRight?: OnSwipedDirectionCallback; - onSwipedDown?: OnSwipedDirectionCallback; - onSwipedLeft?: OnSwipedDirectionCallback; - onTap?: OnTapCallback; - flickThreshold?: number; - delta?: number; - preventDefaultTouchmoveEvent?: boolean; - stopPropagation?: boolean; - nodeName?: string; - trackMouse?: boolean; - children?: React.ReactNode; +declare namespace ReactSwipeable { + type OnSwipingCallback = (event: React.TouchEvent, deltaX: number, deltaY: number, absX: number, absY: number, velocity: number) => void; + type OnSwipedCallback = (event: React.TouchEvent, deltaX: number, deltaY: number, isFlick: boolean, velocity: number) => void; + type OnSwipedDirectionCallback = (event: React.TouchEvent, delta: number, isFlick: boolean) => void; + type OnSwipingDirectionCallback = (event: React.TouchEvent, delta: number) => void; + type OnTapCallback = (event: React.TouchEvent) => void; + + interface SwipeableProps extends React.ClassAttributes, React.HTMLAttributes { + onSwiped?: OnSwipedCallback; + onSwiping?: OnSwipingCallback; + onSwipingUp?: OnSwipingDirectionCallback; + onSwipingRight?: OnSwipingDirectionCallback; + onSwipingDown?: OnSwipingDirectionCallback; + onSwipingLeft?: OnSwipingDirectionCallback; + onSwipedUp?: OnSwipedDirectionCallback; + onSwipedRight?: OnSwipedDirectionCallback; + onSwipedDown?: OnSwipedDirectionCallback; + onSwipedLeft?: OnSwipedDirectionCallback; + onTap?: OnTapCallback; + flickThreshold?: number; + delta?: number; + preventDefaultTouchmoveEvent?: boolean; + stopPropagation?: boolean; + nodeName?: string; + trackMouse?: boolean; + children?: React.ReactNode; + } } -declare class ReactSwipeable extends React.Component {} -declare namespace ReactSwipeable {} - export = ReactSwipeable; diff --git a/types/react-swipeable/react-swipeable-tests.tsx b/types/react-swipeable/react-swipeable-tests.tsx index 05e057c11f..c75869bdb0 100644 --- a/types/react-swipeable/react-swipeable-tests.tsx +++ b/types/react-swipeable/react-swipeable-tests.tsx @@ -1,18 +1,18 @@ import * as React from 'react'; import * as Swipeable from 'react-swipeable'; -class SampleComponent extends React.PureComponent { - private handleSwiped = () => {}; - private handleSwiping = () => {}; - private handleSwipingUp = () => {}; - private handleSwipingRight = () => {}; - private handleSwipingDown = () => {}; - private handleSwipingLeft = () => {}; - private handleSwipedUp = () => {}; - private handleSwipedRight = () => {}; - private handleSwipedDown = () => {}; - private handleSwipedLeft = () => {}; - private handleTap = () => {}; +class SampleComponent extends React.PureComponent { + private handleSwiped: Swipeable.OnSwipedCallback = () => {}; + private handleSwiping: Swipeable.OnSwipingCallback = () => {}; + private handleSwipingUp: Swipeable.OnSwipingDirectionCallback = () => {}; + private handleSwipingRight: Swipeable.OnSwipingDirectionCallback = () => {}; + private handleSwipingDown: Swipeable.OnSwipingDirectionCallback = () => {}; + private handleSwipingLeft: Swipeable.OnSwipingDirectionCallback = () => {}; + private handleSwipedUp: Swipeable.OnSwipedDirectionCallback = () => {}; + private handleSwipedRight: Swipeable.OnSwipedDirectionCallback = () => {}; + private handleSwipedDown: Swipeable.OnSwipedDirectionCallback = () => {}; + private handleSwipedLeft: Swipeable.OnSwipedDirectionCallback = () => {}; + private handleTap: Swipeable.OnTapCallback = () => {}; private handleClick = () => {}; render() { From 8cb0a9fc2f288ce297ee89b1c1c555ce5676bb41 Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Mon, 5 Jun 2017 11:52:27 +0300 Subject: [PATCH 071/761] Fix requested changes. --- types/superagent-no-cache/index.d.ts | 2 +- types/superagent-no-cache/superagent-no-cache-tests.ts | 2 +- types/superagent-prefix/index.d.ts | 7 ++++++- types/superagent-prefix/superagent-prefix-tests.ts | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/types/superagent-no-cache/index.d.ts b/types/superagent-no-cache/index.d.ts index 9dcfc02005..c08b41af15 100644 --- a/types/superagent-no-cache/index.d.ts +++ b/types/superagent-no-cache/index.d.ts @@ -8,4 +8,4 @@ import * as request from 'superagent'; declare const plugin: request.Plugin; -export default plugin; +export = plugin; diff --git a/types/superagent-no-cache/superagent-no-cache-tests.ts b/types/superagent-no-cache/superagent-no-cache-tests.ts index 528eb4fd40..68e4e961a2 100644 --- a/types/superagent-no-cache/superagent-no-cache-tests.ts +++ b/types/superagent-no-cache/superagent-no-cache-tests.ts @@ -1,5 +1,5 @@ import * as request from 'superagent'; -import plugin from 'superagent-no-cache'; +import * as plugin from 'superagent-no-cache'; request .get('/some-url') diff --git a/types/superagent-prefix/index.d.ts b/types/superagent-prefix/index.d.ts index 238046dde9..8b7eb1d508 100644 --- a/types/superagent-prefix/index.d.ts +++ b/types/superagent-prefix/index.d.ts @@ -6,4 +6,9 @@ import * as request from 'superagent'; -export default function(prefix: string): request.Plugin; +declare function plugin(prefix: string): request.Plugin; + +declare namespace plugin { +} + +export = plugin; diff --git a/types/superagent-prefix/superagent-prefix-tests.ts b/types/superagent-prefix/superagent-prefix-tests.ts index 58101d8fda..01e4b52905 100644 --- a/types/superagent-prefix/superagent-prefix-tests.ts +++ b/types/superagent-prefix/superagent-prefix-tests.ts @@ -1,5 +1,5 @@ import * as request from 'superagent'; -import plugin from 'superagent-prefix'; +import * as plugin from 'superagent-prefix'; request .get('/some-url') From 67596b61d7f848328d80a02bdf1d385d917cdaf6 Mon Sep 17 00:00:00 2001 From: Konstantin Vasilev Date: Tue, 6 Jun 2017 16:24:59 +0300 Subject: [PATCH 072/761] remove unnecessary comma in authors section --- types/react-swipeable/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-swipeable/index.d.ts b/types/react-swipeable/index.d.ts index b646a46268..7692abd859 100644 --- a/types/react-swipeable/index.d.ts +++ b/types/react-swipeable/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-swipeable 4.0 // Project: https://www.npmjs.com/package/react-swipeable -// Definitions by: Giedrius Grabauskas , +// Definitions by: Giedrius Grabauskas // Konstantin Vasilev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 From 8acd40846bab351c602a05dc472c848f0ee950be Mon Sep 17 00:00:00 2001 From: Roman Resh Date: Tue, 6 Jun 2017 16:27:33 +0300 Subject: [PATCH 073/761] update to 16.1.12 (24-MAY-2017), 16.2.7 (24-MAY-2017), 17.1.3 (17-MAY-2017). (#16882) --- types/devexpress-web/README.md | 3 +- types/devexpress-web/devexpress-web-tests.ts | 21 +- types/devexpress-web/index.d.ts | 7596 +++- .../v161/devexpress-web-tests.ts | 418 + types/devexpress-web/v161/index.d.ts | 27630 +++++++++++++++ types/devexpress-web/v161/tsconfig.json | 27 + .../v162/devexpress-web-tests.ts | 418 + types/devexpress-web/v162/index.d.ts | 28635 ++++++++++++++++ types/devexpress-web/v162/tsconfig.json | 27 + 9 files changed, 63979 insertions(+), 796 deletions(-) create mode 100644 types/devexpress-web/v161/devexpress-web-tests.ts create mode 100644 types/devexpress-web/v161/index.d.ts create mode 100644 types/devexpress-web/v161/tsconfig.json create mode 100644 types/devexpress-web/v162/devexpress-web-tests.ts create mode 100644 types/devexpress-web/v162/index.d.ts create mode 100644 types/devexpress-web/v162/tsconfig.json diff --git a/types/devexpress-web/README.md b/types/devexpress-web/README.md index 341304e192..897ec236e1 100644 --- a/types/devexpress-web/README.md +++ b/types/devexpress-web/README.md @@ -2,8 +2,7 @@ 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 ``. +DevExpress ASP.NET or MVC controls. The API enclosed into the DevExpress ASP.NET/MVC TypeScript definition file fully corresponds to the API described in the DevExpress ASP.NET/MVC diff --git a/types/devexpress-web/devexpress-web-tests.ts b/types/devexpress-web/devexpress-web-tests.ts index 8a76a68f26..ef7eb8de37 100644 --- a/types/devexpress-web/devexpress-web-tests.ts +++ b/types/devexpress-web/devexpress-web-tests.ts @@ -1,5 +1,3 @@ -/// - declare var hiddenField: ASPxClientHiddenField; declare var mainCallbackPanel: ASPxClientCallbackPanel; declare var loginPopup: ASPxClientPopupControl; @@ -82,7 +80,6 @@ module DXDemo { export function onSearchComboBoxIndexChanged(s: ASPxClientComboBox, e: ASPxClientProcessingModeEventArgs): void { hideMenu(); - $("#IndexContent").addClass("search-extend"); searchButton.AdjustControl(); }; @@ -303,19 +300,14 @@ module DXDemo { } catch (e) { } ASPxClientUtils.AttachEventToElement(window, "resize", onWindowResize); if (ASPxClientUtils.iOSPlatform) { - $("form :input").blur(function () { - $('html, body').animate({ scrollTop: 0 }, 0); - }); + // animate } }; export function updateRatingLabels(ratingControl: ASPxClientTrackBar) { - $("#cpLeftLabelID").html(ratingControl.GetPositionStart().toString()); - $("#cpRightLabelID").html(ratingControl.GetPositionEnd().toString()); - }; - - export function onAboutWindowCloseUp(): void { - $(mainCallbackPanel.GetMainElement()).removeClass("show-about"); + var start = ratingControl.GetPositionStart().toString(); + var end = ratingControl.GetPositionEnd().toString(); + document.getElementById("cpLeftLabelID").innerHTML = start + " " + end; }; export function onRatingControlItemClick(s: ASPxClientRatingControl, e: ASPxClientRatingControlItemClickEventArgs): void { @@ -324,10 +316,8 @@ module DXDemo { export function onInputKeyDown(s: ASPxClientTextBox, e: ASPxClientEditKeyEventArgs): void { var keyCode = ASPxClientUtils.GetKeyCode(e.htmlEvent); - if (keyCode == 13) { - (jQuery).event.fix(e.htmlEvent).preventDefault(); + if (keyCode == 13) (s.GetInputElement()).blur(); - } }; function getCurrentPage(): string { @@ -339,7 +329,6 @@ module DXDemo { }; function showAboutWindow(): void { - $(mainCallbackPanel.GetMainElement()).addClass("show-about"); aboutWindow.ShowAtElementByID("MainCallbackPanel_ContentPane"); }; diff --git a/types/devexpress-web/index.d.ts b/types/devexpress-web/index.d.ts index 0da78411ac..466f002f36 100644 --- a/types/devexpress-web/index.d.ts +++ b/types/devexpress-web/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for DevExpress ASP.NET 16.1 +// Type definitions for DevExpress ASP.NET v171.3 // Project: http://devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -41,7 +41,7 @@ interface ASPxClientDashboardItemUnderlyingData { 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. + * Value: An array of string values that specify data member identifiers. */ DataMembers: string[]; /** @@ -71,23 +71,23 @@ interface ASPxClientDashboardItemRequestUnderlyingDataCompleted { (data: ASPxClientDashboardItemUnderlyingData): void; } /** - * References a method that will handle the ItemClick event. + * References a method that will handle the ItemClick events. */ interface ASPxClientDashboardItemClickEventHandler { /** - * References a method that will handle the ItemClick event. + * References a method that will handle the ItemClick events. * @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. + * Provides data for the ItemClick events. */ 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. + * Value: A string value that is the dashboard item name. */ ItemName: string; /** @@ -115,28 +115,28 @@ interface ASPxClientDashboardItemClickEventArgs extends ASPxClientEventArgs { /** * 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. + * @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. + * References a method that will handle the ItemVisualInteractivity events. */ interface ASPxClientDashboardItemVisualInteractivityEventHandler { /** - * References a method that will handle the ItemVisualInteractivity event. + * References a method that will handle the ItemVisualInteractivity events. * @param source The event source. * @param e A ASPxClientDashboardItemVisualInteractivityEventArgs object containing event data. */ (source: S, e: ASPxClientDashboardItemVisualInteractivityEventArgs): void; } /** - * Provides data for the ItemVisualInteractivity event. + * Provides data for the ItemVisualInteractivity events. */ 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. + * Value: A string value that is the component name of the dashboard item. */ ItemName: string; /** @@ -177,23 +177,23 @@ interface ASPxClientDashboardItemVisualInteractivityEventArgs extends ASPxClient SetDefaultSelection(values: ASPxClientDashboardItemDataAxisPointTuple[]): void; } /** - * References a method that will handle the ItemSelectionChanged event. + * References a method that will handle the ItemSelectionChanged events. */ interface ASPxClientDashboardItemSelectionChangedEventHandler { /** - * References a method that will handle the ItemSelectionChanged event. + * References a method that will handle the ItemSelectionChanged events. * @param source The event source. * @param e A ASPxClientDashboardItemSelectionChangedEventArgs object containing event data. */ (source: S, e: ASPxClientDashboardItemSelectionChangedEventArgs): void; } /** - * Provides data for the ItemSelectionChanged event. + * Provides data for the ItemSelectionChanged events. */ 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. + * Value: A string that is the component name of the dashboard item. */ ItemName: string; /** @@ -206,19 +206,19 @@ interface ASPxClientDashboardItemSelectionChangedEventArgs extends ASPxClientEve */ interface ASPxClientDashboardItemElementCustomColorEventHandler { /** - * References a method that will handle the ItemElementCustomColor event. + * References a method that will handle the ItemElementCustomColor events. * @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. + * Provides data for the ItemElementCustomColor events. */ 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. + * Value: A string value that is the component name of the dashboard item for which the event was raised. */ ItemName: string; /** @@ -240,11 +240,11 @@ interface ASPxClientDashboardItemElementCustomColorEventArgs extends ASPxClientE GetMeasures(): ASPxClientDashboardItemDataMeasure[]; } /** - * References a method that will handle the ItemWidgetCreated event. + * References a method that will handle the ItemWidgetCreated events. */ interface ASPxClientDashboardItemWidgetCreatedEventHandler { /** - * References a method that will handle the ItemWidgetCreated event. + * References a method that will handle the ItemWidgetCreated events. * @param source The event source. * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. */ @@ -273,11 +273,11 @@ interface ASPxClientDashboardItemWidgetUpdatedEventHandler { (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; } /** - * References a method that will handle the ItemBeforeWidgetDisposed event. + * References a method that will handle the ItemBeforeWidgetDisposed events. */ interface ASPxClientDashboardItemBeforeWidgetDisposedEventHandler { /** - * References a method that will handle the ItemBeforeWidgetDisposed event. + * References a method that will handle the ItemBeforeWidgetDisposed events. * @param source The event source. * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. */ @@ -289,7 +289,7 @@ interface ASPxClientDashboardItemBeforeWidgetDisposedEventHandler { 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. + * Value: A string value that is the component name of the dashboard item. */ ItemName: string; /** @@ -391,27 +391,27 @@ interface ASPxClientDashboardItemDataAxis { interface ASPxClientDashboardItemDataDimension { /** * Gets the dimension identifier. - * Value: A String that is the dimension identifier. + * Value: A string value 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. + * Value: A string value 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. + * 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. + * 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. + * Value: A string value that specifies the group interval for string values. */ TextGroupInterval: string; /** @@ -426,22 +426,22 @@ interface ASPxClientDashboardItemDataDimension { interface ASPxClientDashboardItemDataMeasure { /** * Gets the measure identifier. - * Value: A String that is the measure identifier. + * Value: A string value that is the measure identifier. */ Id: string; /** * Gets the name of the measure. - * Value: A String that is the name of the measure. + * Value: A string value 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. + * 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. + * Value: A string value that identifies the type of summary function calculated against the current measure. */ SummaryType: string; /** @@ -456,22 +456,22 @@ interface ASPxClientDashboardItemDataMeasure { interface ASPxClientDashboardItemDataDelta { /** * Gets the data item identifier. - * Value: A String that is 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. + * 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. + * 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. + * Value: A string value that is the measure identifier. */ TargetMeasureId: string; } @@ -611,55 +611,1040 @@ interface ASPxClientDashboardItemDataAxisPointTuple { GetAxisPoint(axisName: string): ASPxClientDashboardItemDataAxisPoint; } /** - * A client-side equivalent of the ASPxDashboardDesigner control. + * A range in the Range Filter dashboard item. */ -interface ASPxClientDashboardDesigner extends ASPxClientControl { +interface ASPxClientDashboardRangeFilterSelection { /** - * Occurs after the state of the dashboard displayed in the ASPxClientDashboardDesigner is changed. + * 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. */ - DashboardStateChanged: ASPxClientEvent>; + Maximum: Object; /** - * Occurs after another dashboard is loaded to the ASPxClientDashboardDesigner. + * 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. */ - DashboardChanged: ASPxClientEvent>; + 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 value that is the dashboard parameter name on the client side. + */ + Name: string; + /** + * Gets the dashboard parameter value on the client side. + * Value: A string value that specifies the dashboard parameter value on the client side. + */ + Value: Object; + /** + * Returns a parameter name. + */ + GetName(): string; + /** + * Returns a current parameter value(s). + */ + GetValue(): Object; + /** + * Specifies the current parameter value(s). + * @param value The current parameter value(s). + */ + 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 boolean 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; +} +/** + * Contains options related to exporting a dashboard/dashboard item to the PDF format. + */ +interface DashboardPdfExportOptions { + /** + * Gets or sets the type of paper for the exported document. + * Value: A DashboardExportPaperKind value that specifies the type of paper for the exported document. + */ + PaperKind: string; + /** + * Gets or sets the page orientation used to export a dashboard/dashboard item. + * Value: A DashboardExportPageLayout value that specifies the page orientation used to export a dashboard/dashboard item. + */ + PageLayout: string; + /** + * Gets or sets the mode for scaling a dashboard/dashboard item in the exported document. + * Value: A DashboardExportScaleMode value that specifies the mode for scaling a dashboard/dashboard item in the exported document. + */ + ScaleMode: string; + /** + * Gets or sets the scale factor (in fractions of 1), by which a dashboard/dashboard item is scaled in the exported document. + * Value: A Single value that specifies the scale factor by which a dashboard/dashboard item is scaled in the exported document. + */ + 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 boolean value that specifies whether a dashboard title (or dashboard item's caption) is included as the exported document title. + */ + ShowTitle: boolean; + /** + * Gets or sets whether to add the state of master filter items to the exported document. + * Value: true, to add the state of master filter items to the exported document; otherwise, false. + */ + ExportFilters: boolean; + /** + * Gets or sets whether to add current parameter values to the exported document. + * Value: true, to add current parameter values to the exported document; otherwise, false. + */ + ExportParameters: boolean; + /** + * Gets or sets whether to add current values of a hidden parameter to the exported document. + * Value: true, to add current values of a hidden parameter to the exported document; otherwise, false. + */ + IncludeHiddenParameters: boolean; + /** + * Gets or sets a position of the dashboard state (such as master filter or current parameter values) in the exported document. + * Value: A DashboardStateExportPosition object that specifies the position of the dashboard state in the exported document. + */ + DashboardStatePosition: string; + /** + * Gets or sets whether cards within the Card dashboard item are arranged automatically on the exported page. + * Value: true, to arrange cards automatically on the exported page; otherwise, false. + */ + CardAutoArrangeContent: boolean; + /** + * Gets or sets whether the page orientation used to export the Chart dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Chart dashboard item; otherwise, false. + */ + ChartAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Chart dashboard item. + * Value: A ChartExportSizeMode value that specifies the export size mode for the Chart dashboard item. + */ + ChartSizeMode: string; + /** + * Gets or sets whether gauges within the Gauge dashboard item are arranged automatically on the exported page. + * Value: true, to arrange gauges automatically on the exported page; otherwise, false. + */ + GaugeAutoArrangeContent: boolean; + /** + * 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. + */ + GridFitToPageWidth: boolean; + /** + * Gets or sets whether to add column headers of the Grid dashboard item to every page. + * Value: true, to add column headers to every page; otherwise, false. + */ + GridPrintHeadersOnEveryPage: boolean; + /** + * Gets or sets whether the page orientation used to export the Map dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Map dashboard item; otherwise, false. + */ + MapAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Map dashboard item. + * Value: A MapExportSizeMode value that specifies the export size mode for the Map dashboard item. + */ + MapSizeMode: string; + /** + * Gets or sets whether pies within the Pie dashboard item are arranged automatically on the exported page. + * Value: true, to arrange pies automatically on the exported page; otherwise, false. + */ + PieAutoArrangeContent: boolean; + /** + * Gets or sets whether to add column headers of the Pivot dashboard item to every page. + * Value: true, to add column headers to every page; otherwise, false. + */ + PivotPrintHeadersOnEveryPage: boolean; + /** + * Gets or sets whether the page orientation used to export the Range Filter dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Range Filter dashboard item; otherwise, false. + */ + RangeFilterAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Range Filter dashboard item. + * Value: A RangeFilterExportSizeMode value that specifies the export size mode for the Range Filter dashboard item. + */ + RangeFilterSizeMode: string; + /** + * Gets or sets whether the page orientation used to export the Treemap dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Treemap dashboard item; otherwise, false. + */ + TreemapAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Treemap dashboard item. + * Value: A TreemapExportSizeMode value that specifies the export size mode for the Treemap dashboard item. + */ + TreemapSizeMode: string; +} +/** + * Contains options related to exporting a dashboard/dashboard item to an image. + */ +interface DashboardImageExportOptions { + /** + * Gets or sets a 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: true, to include a dashboard title (or dashboard item's caption) as the exported document title; otherwise, false. + */ + ShowTitle: boolean; + /** + * Gets or sets whether to add the state of master filter items to the exported document. + * Value: true, to add the state of master filter items to the exported document; otherwise, false. + */ + ExportFilters: boolean; + /** + * Gets or sets whether to add current parameter values to the exported document. + * Value: true, to add current parameter values to the exported document; otherwise, false. + */ + ExportParameters: boolean; + /** + * Gets or sets whether to add current values of a hidden parameter to the exported document. + * Value: true, to add current values of a hidden parameter to the exported document; otherwise, false. + */ + IncludeHiddenParameters: boolean; + /** + * Gets or sets an image format in which the dashboard/dashboard item is exported. + * Value: A DashboardExportImageFormat value 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 to an image. + * Value: An integer value that specifies the resolution (in dpi) used to export a dashboard/dashboard item to an image. + */ + Resolution: number; + /** + * Gets or sets the scale factor (in fractions of 1), by which a dashboard/dashboard item is scaled in the exported document. + * Value: A string value that specifies the scale factor by which a dashboard/dashboard item is scaled in the exported document. + */ + ScaleFactor: number; +} +/** + * Contains options related to exporting a dashboard/dashboard item to the Excel format. + */ +interface DashboardExcelExportOptions { + /** + * Gets or sets the Excel format in which the dashboard item is exported. + * Value: A DashboardExportExcelFormat value 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; + /** + * Gets or sets whether to add the state of master filter items to the exported document. + * Value: true, to add the state of master filter items to the exported document; otherwise, false. + */ + ExportFilters: boolean; + /** + * Gets or sets whether to add current parameter values to the exported document. + * Value: true, to add current parameter values to the exported document; otherwise, false. + */ + ExportParameters: boolean; + /** + * Gets or sets whether to add current values of a hidden parameter to the exported document. + * Value: true, to add current values of a hidden parameter to the exported document; otherwise, false. + */ + IncludeHiddenParameters: boolean; + /** + * Gets or sets the position of the dashboard state (such as master filter or current parameter values) in the exported document. + * Value: A DashboardStateExcelExportPosition object that specifies the position of the dashboard state in the exported document. + */ + DashboardStatePosition: string; +} +/** + * A client-side equivalent of the ASPxDashboard control. + */ +interface ASPxClientDashboard extends ASPxClientControl { + /** + * Fires when a round trip to the server has been initiated by a call to the client PerformDataCallback method. + */ + CustomDataCallback: ASPxClientEvent>; + /** + * 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 state of the dashboard displayed in the ASPxClientDashboard is changed. + */ + DashboardStateChanged: ASPxClientEvent>; + /** + * Occurs after a new dashboard is displayed in the ASPxClientDashboard. + */ + DashboardChanged: ASPxClientEvent>; /** * For internal use. */ - CustomizeMenuItems: ASPxClientEvent>; - BeforeRender: ASPxClientEvent>; + CustomizeMenuItems: ASPxClientEvent>; /** - * Switches the ASPxClientDashboardDesigner to the viewer mode. + * Occurs before any element in the Web Dashboard control has been rendered. + */ + BeforeRender: 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>; + /** + * Occurs when a master filter state is changed. + */ + ItemMasterFilterStateChanged: ASPxClientEvent>; + /** + * Occurs when a drill-down/drill-up is performed. + */ + ItemDrillDownStateChanged: ASPxClientEvent>; + /** + * Occurs after the available interactivity actions have changed for the specific dashboard item. + */ + ActionAvailabilityChanged: ASPxClientEvent>; + /** + * Occurs after parameter values provided using a Dynamic List are loaded. + */ + DynamicLookUpValuesLoaded: ASPxClientEvent>; + /** + * Occurs when a dashboard item update is initiated. + */ + ItemBeginUpdate: ASPxClientEvent>; + /** + * Occurs after the dashboard item update is performed. + */ + ItemEndUpdate: ASPxClientEvent>; + /** + * Occurs when a dashboard update is initiated. + */ + DashboardBeginUpdate: ASPxClientEvent>; + /** + * Occurs after the dashboard update is performed. + */ + DashboardEndUpdate: ASPxClientEvent>; + /** + * 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; + /** + * Gets an inner part of the ASPxClientDashboard control. + */ + GetDashboardControl(): DashboardControl; + /** + * Switches the ASPxClientDashboard to the viewer mode. */ SwitchToViewer(): void; /** - * Switches the ASPxClientDashboardDesigner to the designer mode. + * Switches the ASPxClientDashboard to the designer mode. */ SwitchToDesigner(): void; /** - * Gets the current working mode of the Web Designer. + * Gets the current working mode of the Web Dashboard. */ GetWorkingMode(): string; /** - * Gets the identifier of the dashboard that is displayed in the ASPxClientDashboardDesigner. + * Gets the identifier of the dashboard that is displayed in the ASPxClientDashboard. */ GetDashboardId(): string; /** - * Gets the name of the dashboard that is displayed in the ASPxClientDashboardDesigner. + * Gets the name of the dashboard that is displayed in the ASPxClientDashboard. */ GetDashboardName(): string; /** - * Gets the state of the dashboard (for instance, the master filtering state) displayed in the ASPxClientDashboardDesigner. + * Gets the state of the dashboard displayed in the ASPxClientDashboard. */ GetDashboardState(): string; /** - * Loads a dashboard with the specified identifier. - * @param dashboardId A String value that specifies the dashboard identifier. + * Sets the state of the dashboard displayed in the ASPxClientDashboard. + * @param dashboardState A JSON object that specifies the dashboard state. + */ + SetDashboardState(dashboardState: Object): void; + /** + * Sets the state of the dashboard displayed in the ASPxClientDashboard. + * @param dashboardStateString A string value that specifies the state of the dashboard displayed in the ASPxClientDashboard. + */ + SetDashboardState(dashboardStateString: string): void; + /** + * Loads a dashboard with the specified identifier from the dashboard storage. + * @param dashboardId A string value that specifies the dashboard identifier. */ LoadDashboard(dashboardId: string): void; /** - * Saves a dashboard to the dashboard storage. + * Saves a current dashboard to the dashboard storage. */ SaveDashboard(): void; + /** + * Invokes the Dashboard Parameters dialog. + */ + ShowParametersDialog(): void; + /** + * Closes the Dashboard Parameters dialog. + */ + HideParametersDialog(): void; + /** + * Returns dashboard parameter settings and metadata. + */ + GetParameters(): ASPxClientDashboardParameters; + /** + * Invokes the dialog that allows end-users to export the entire dashboard to the specified format. + * @param format A string value that specifies the format. For instance, you can use 'PDF' or 'Image'. + */ + ShowExportDashboardDialog(format: string): void; + /** + * Invokes the dialog that allows end-users to export the dashboard item to the specified format. + * @param itemComponentName A string value that specifies the component name of the dashboard item to export. + * @param format A string value that specifies the format. For instance, you can use 'PDF, 'Image' or 'Excel'. Note that some items (i.e., ImageDashboardItem) do not support exporting to the 'Excel' format. + */ + ShowExportDashboardItemDialog(itemComponentName: string, format: string): void; + /** + * Hides the dialog that allows end-users to export the dashboard/dashboard item. + */ + HideExportDialog(): void; + /** + * Returns settings that specify parameters affecting how the dashboard is exported. + */ + GetExportOptions(): ASPxClientDashboardExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the PDF format. + */ + GetPdfExportOptions(): DashboardPdfExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to an image. + */ + GetImageExportOptions(): DashboardImageExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the Excel format. + */ + GetExcelExportOptions(): DashboardExcelExportOptions; + /** + * 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; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the PDF format. + * @param options A DashboardPdfExportOptions object containing options related to exporting a dashboard/dashboard item to the PDF format. + */ + SetPdfExportOptions(options: DashboardPdfExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to an image. + * @param options A DashboardImageExportOptions object containing options related to exporting a dashboard/dashboard item to an image. + */ + SetImageExportOptions(options: DashboardImageExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the Excel format. + * @param options A DashboardExcelExportOptions object containing options related to exporting a dashboard item to the Excel format. + */ + SetExcelExportOptions(options: DashboardExcelExportOptions): 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 DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportToPdf(options: DashboardPdfExportOptions): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: DashboardPdfExportOptions, fileName: string): 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions, fileName: string): 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 DashboardImageExportOptions object containing image-specific export options. + */ + ExportToImage(options: DashboardImageExportOptions): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: DashboardImageExportOptions, fileName: string): 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports dashboard data to the specified file in Excel format. + */ + ExportToExcel(): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + */ + ExportToExcel(options: DashboardExcelExportOptions): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportToExcel(options: DashboardExcelExportOptions, fileName: string): 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 A DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions): 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 A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions, fileName: 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): 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 A DashboardImageExportOptions object containing image-specific export options. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions): 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 A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions, fileName: 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 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. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): 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 A DashboardExcelExportOptions object containing Excel export options. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions): 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 A DashboardExcelExportOptions object containing Excel export options. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions, fileName: 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; + /** + * 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. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Returns whether or not master filtering can be applied in the current state of the specified master filter item. + * @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; + /** + * Selects required elements by their values in the specified master filter item. + * @param itemName A String that specifies 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 species 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 into 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 into 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 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[]; + /** + * 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; + /** + * Refreshes an entire dashboard displayed in the Web Dashboard control. + */ + Refresh(): void; + /** + * Refreshes the specific item from the dashboard displayed in the Web Dashboard control. + * @param itemName A string value that specifies the component name of the dashboard item to be refreshed. + */ + Refresh(itemName: string): void; + /** + * Refreshes specific items from the dashboard displayed in the Web Dashboard control. + * @param itemName An array of string values that specify the component names of the dashboard items to be refreshed. + */ + Refresh(itemName: string[]): void; + /** + * 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; + /** + * 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 ASPxClientDashboardRangeFilterSelection object that specifies a range to be selected. + */ + SetRange(itemName: string, range: ASPxClientDashboardRangeFilterSelection): void; + /** + * Selects a predefined range in the Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter. + * @param dateTimePeriodName A String value that specifies the predefined range name. + */ + SetPredefinedRange(itemName: string, dateTimePeriodName: string): void; + /** + * Returns names of the predefined ranges available for the specified Range Filter. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetAvailablePredefinedRanges(itemName: string): string[]; + /** + * Returns the name of the currently selected predefined range. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentPredefinedRange(itemName: string): string; } /** * References a method that will handle the DashboardStateChanged event. @@ -678,7 +1663,7 @@ interface ASPxClientDashboardStateChangedEventHandler { interface ASPxClientDashboardStateChangedEventArgs extends ASPxClientEventArgs { /** * Gets the current state of the dashboard. - * Value: A String that is the current state of the dashboard. + * Value: A string value that is the current state of the dashboard. */ DashboardState: string; } @@ -699,19 +1684,19 @@ interface ASPxClientDashboardChangedEventHandler { interface ASPxClientDashboardChangedEventArgs extends ASPxClientEventArgs { /** * Gets the identifier of a newly opened dashboard. - * Value: A String values that is an identifier of newly opened dashboard. + * Value: A string value 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. + * Value: A string value that is the name of newly opened dashboard. */ DashboardName: string; } -interface ASPxClientDashboardDesignerCustomizeMenuItemsEventHandler { - (source: S, e: ASPxClientDashboardDesignerCustomizeMenuItemsEventArgs): void; +interface ASPxClientDashboardCustomizeMenuItemsEventHandler { + (source: S, e: ASPxClientDashboardCustomizeMenuItemsEventArgs): void; } -interface ASPxClientDashboardDesignerMenuItem { +interface ASPxClientDashboardMenuItem { id: string; title: string; template: string; @@ -721,13 +1706,214 @@ interface ASPxClientDashboardDesignerMenuItem { click: Function; hotKey: number; } -interface ASPxClientDashboardDesignerCustomizeMenuItemsEventArgs extends ASPxClientEventArgs { - Items: ASPxClientDashboardDesignerMenuItem[]; - FindById(itemId: string): ASPxClientDashboardDesignerMenuItem; +interface ASPxClientDashboardCustomizeMenuItemsEventArgs extends ASPxClientEventArgs { + Items: ASPxClientDashboardMenuItem[]; + FindById(itemId: string): ASPxClientDashboardMenuItem; } -interface ASPxClientDashboardDesignerBeforeRenderEventHandler { +/** + * References a method that will handle the BeforeRender event. + */ +interface ASPxClientDashboardBeforeRenderEventHandler { + /** + * References a method that will handle the BeforeRender event. + * @param source The event source. + * @param e An ASPxClientEventArgs object that contains event data. + */ (source: S, e: ASPxClientEventArgs): void; } +/** + * Serves as the base class for classes that provide data for client-side events related to dashboard items. + */ +interface ASPxClientDashboardItemEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Returns whether or not the specified value is null. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is 'others'. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; +} +/** + * References a method that will handle the ItemMasterFilterStateChanged event. + */ +interface ASPxClientDashboardItemMasterFilterStateChangedEventHandler { + /** + * References a method that will handle the ItemMasterFilterStateChanged event. + * @param source The event source. + * @param e An ASPxClientDashboardItemMasterFilterStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemMasterFilterStateChangedEventArgs): void; +} +/** + * Provides data for the ItemMasterFilterStateChanged event. + */ +interface ASPxClientDashboardItemMasterFilterStateChangedEventArgs extends ASPxClientDashboardItemEventArgs { + /** + * Gets the currently selected values. + * Value: An array of objects that are the currently selected values. + */ + Values: Object[][]; +} +/** + * References a method that will handle the ItemDrillDownStateChanged event. + */ +interface ASPxClientDashboardItemDrillDownStateChangedEventHandler { + /** + * References a method that will handle the ItemDrillDownStateChanged event. + * @param source The event source. + * @param e An ASPxClientDashboardItemDrillDownStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemDrillDownStateChangedEventArgs): void; +} +/** + * Provides data for the ItemDrillDownStateChanged event. + */ +interface ASPxClientDashboardItemDrillDownStateChangedEventArgs extends ASPxClientDashboardItemEventArgs { + /** + * Gets the drill-down action performed in the dashboard item. + * Value: A string value that is the drill-down action performed in the dashboard item. + */ + Action: string; + /** + * Gets values from the current drill-down hierarchy. + * Value: An array of values from the current drill-down hierarchy. + */ + Values: Object[]; +} +/** + * References a method that will handle the ActionAvailabilityChanged event. + */ +interface ASPxClientActionAvailabilityChangedEventHandler { + /** + * References a method that will handle the ActionAvailabilityChanged event. + * @param source The event source. + * @param e A ASPxClientActionAvailabilityChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientActionAvailabilityChangedEventArgs): void; +} +/** + * Provides data for the ActionAvailabilityChanged event. + */ +interface ASPxClientActionAvailabilityChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the DynamicLookUpValuesLoaded event. + */ +interface ASPxClientDynamicLookUpValuesLoadedEventHandler { + /** + * References a method that will handle the DynamicLookUpValuesLoaded event. + * @param source The event source. + * @param e A ASPxClientDynamicLookUpValuesLoadedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDynamicLookUpValuesLoadedEventArgs): void; +} +/** + * Provides data for the DynamicLookUpValuesLoaded event. + */ +interface ASPxClientDynamicLookUpValuesLoadedEventArgs extends ASPxClientEventArgs { + /** + * Gets the dashboard parameter name whose values have been loaded. + * Value: A string value that is the dashboard parameter name whose values have been loaded. + */ + ParameterName: string; +} +/** + * References a method that will handle the ItemBeginUpdate event. + */ +interface ASPxClientItemBeginUpdateEventHandler { + /** + * References a method that will handle the ItemBeginUpdate event. + * @param source The event source. + * @param e A ASPxClientItemBeginUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientItemBeginUpdateEventArgs): void; +} +/** + * Provides data for the ItemBeginUpdate event. + */ +interface ASPxClientItemBeginUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the ItemEndUpdate event. + */ +interface ASPxClientItemEndUpdateEventHandler { + /** + * References a method that will handle the ItemEndUpdate event. + * @param source The event source. + * @param e A ASPxClientItemEndUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientItemEndUpdateEventArgs): void; +} +/** + * Provides data for the ItemEndUpdate event. + */ +interface ASPxClientItemEndUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the DashboardBeginUpdate event. + */ +interface ASPxClientDashboardBeginUpdateEventHandler { + /** + * References a method that will handle the DashboardBeginUpdate event. + * @param source The event source. + * @param e A ASPxClientDashboardBeginUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardBeginUpdateEventArgs): void; +} +/** + * Provides data for the DashboardBeginUpdate event. + */ +interface ASPxClientDashboardBeginUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the identifier of the dashboard for which the event was raised. + * Value: A string value that is the dashboard identifier. + */ + DashboardId: string; +} +/** + * References a method that will handle the DashboardEndUpdate event. + */ +interface ASPxClientDashboardEndUpdateEventHandler { + /** + * References a method that will handle the DashboardEndUpdate event. + * @param source The event source. + * @param e An ASPxClientDashboardEndUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardEndUpdateEventArgs): void; +} +/** + * Provides data for the DashboardEndUpdate event. + */ +interface ASPxClientDashboardEndUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the identifier of the dashboard for which the event was raised. + * Value: A string value that is the dashboard identifier. + */ + DashboardId: string; +} /** * A client-side equivalent of the ASPxDashboardViewer control. */ @@ -773,7 +1959,7 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { */ ItemClick: ASPxClientEvent>; /** - * Allows you to provide custom visual interactivity for data-bound dashboard items that support element selection and highlighting + * Allows you to provide custom visual interactivity for data-bound dashboard items that support element selection and highlighting. */ ItemVisualInteractivity: ASPxClientEvent>; /** @@ -834,15 +2020,25 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { /** * 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. + * @param range A ASPxClientDashboardRangeFilterSelection object that specifies a range to be selected. */ 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. + * Selects a predefined range in the Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter. + * @param dateTimePeriodName A String value that specifies the predefined range name. */ - SetRange(itemName: string, dateTimePeriodName: string): void; + SetPredefinedRange(itemName: string, dateTimePeriodName: string): void; + /** + * Returns names of the predefined ranges available for the specified Range Filter. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetAvailablePredefinedRanges(itemName: string): string[]; + /** + * Returns the name of the currently selected predefined range. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentPredefinedRange(itemName: string): string; /** * 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. @@ -870,7 +2066,7 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { 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 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. */ @@ -887,62 +2083,198 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { * Returns settings that specify parameters affecting how the dashboard is exported. */ GetExportOptions(): ASPxClientDashboardExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the PDF format. + */ + GetPdfExportOptions(): DashboardPdfExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to an image. + */ + GetImageExportOptions(): DashboardImageExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the Excel format. + */ + GetExcelExportOptions(): DashboardExcelExportOptions; /** * 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; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the PDF format. + * @param options A DashboardPdfExportOptions object containing options related to exporting a dashboard/dashboard item to the PDF format. + */ + SetPdfExportOptions(options: DashboardPdfExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to an image. + * @param options A DashboardImageExportOptions object containing options related to exporting a dashboard/dashboard item to an image. + */ + SetImageExportOptions(options: DashboardImageExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the Excel format. + * @param options A DashboardExcelExportOptions object containing options related to exporting a dashboard item to the Excel format. + */ + SetExcelExportOptions(options: DashboardExcelExportOptions): 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 DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportToPdf(options: DashboardPdfExportOptions): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: DashboardPdfExportOptions, fileName: string): 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions, fileName: string): 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 DashboardImageExportOptions object containing image-specific export options. + */ + ExportToImage(options: DashboardImageExportOptions): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: DashboardImageExportOptions, fileName: string): 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports dashboard data to the specified file in Excel format. + */ + ExportToExcel(): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + */ + ExportToExcel(options: DashboardImageExportOptions): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportToExcel(options: DashboardImageExportOptions, fileName: string): 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 A DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions): 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 A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions, fileName: 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): 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 A DashboardImageExportOptions object containing image-specific export options. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions): 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 A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions, fileName: 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 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. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): 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 A DashboardExcelExportOptions object containing Excel export options. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions): 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 A DashboardExcelExportOptions object containing Excel export options. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions, fileName: 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; + /** + * 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. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; /** * Returns the dashboard width. */ @@ -1023,326 +2355,10 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { 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. + * @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. */ @@ -1409,7 +2425,7 @@ interface ASPxClientDashboardDataLoadingErrorEventArgs extends ASPxClientEventAr interface ASPxClientDashboardItemAction { /** * Gets the name of the dashboard item. - * Value: A String that specifies the name of the dashboard item. + * Value: A string that specifies the name of the dashboard item. */ ItemName: string; /** @@ -1441,7 +2457,7 @@ interface ASPxClientDashboardMasterFilterSetEventHandler { interface ASPxClientDashboardMasterFilterSetEventArgs extends ASPxClientEventArgs { /** * Gets the name of the dashboard item. - * Value: A String that specifies the name of the dashboard item. + * Value: A string value that specifies the component name of the dashboard item. */ ItemName: string; /** @@ -1477,7 +2493,7 @@ interface ASPxClientDashboardMasterFilterClearedEventHandler { interface ASPxClientDashboardMasterFilterClearedEventArgs extends ASPxClientEventArgs { /** * Gets the name of the dashboard item. - * Value: A String that is the name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. */ ItemName: string; } @@ -1498,14 +2514,14 @@ interface ASPxClientDashboardDrillDownPerformedEventHandler { interface ASPxClientDashboardDrillDownPerformedEventArgs extends ASPxClientEventArgs { /** * Gets the name of the dashboard item. - * Value: A String that specifies 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. + * Gets values from the current drill-down hierarchy. + * Value: An array of values from the current drill-down hierarchy. */ - Value: Object[]; + Values: Object[]; /** * Returns whether or not the specified value is NullValue. * @param value The specified value. @@ -1534,10 +2550,434 @@ interface ASPxClientDashboardDrillUpPerformedEventHandler { interface ASPxClientDashboardDrillUpPerformedEventArgs extends ASPxClientEventArgs { /** * Gets the name of the dashboard item. - * Value: A String that is the name of the dashboard item. + * Value: A string that is the name of the dashboard item. */ ItemName: string; } +/** + * When implemented, represents the Web Dashboard extension. + */ +interface IExtension { + /** + * A unique name of a Web Dashboard extension. + * Value: A string value that is a unique name of a Web Dashboard extension. + */ + name: string; + /** + * Contains code that will be invoked when you register the dashboard extension. + */ + start(): void; + /** + * Contains code that will be invoked when you unregister the dashboard extension. + */ + stop(): void; +} +/** + * An inner part of the ASPxClientDashboard control. + */ +interface DashboardControl { + /** + * Gets or sets knockout templates that you can used in the Web Dashboard. + * Value: A object that is a knockout template. + */ + customTemplates: KnockoutObservableArray; + /** + * Provide an access to the collection of registered dashboard extensions. + * Value: An array of IExtension objects that are dashboard extensions. + */ + extensions: IExtension[]; + /** + * Initializes a new dashboard with the specified name and JSON model. + * @param id A string value that is a unique name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + */ + initializeDashboard(id: string, dashboardJson: string): void; + /** + * Initializes a new dashboard with the specified name, JSON model and initial state. + * @param id A string value that is a unique name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + * @param initialState A JSON object that specifies the dashboard state. + */ + initializeDashboard(id: string, dashboardJson: string, initialState: Object): void; + /** + * Allows you to register a dashboard extension to add its functionality to the Web Dashboard. + * @param extension An IExtension object that is a dashboard extension. + */ + registerExtension(extension: IExtension): void; + /** + * Allows you to get access to the extension. + * @param extensionName A string value that is the dashboard extension name. + */ + findExtension(extensionName: string): IExtension; + /** + * Allows you to unregister a dashboard extension to disable its functionality in the Web Dashboard. + * @param extensionName A string value that is a dashboard extension name. + */ + unregisterExtension(extensionName: string): void; +} +interface DashboardParameterDialogExtension extends IExtension { +} +interface DashboardExportExtension extends IExtension { +} +interface DashboardClientApiExtension extends IExtension { +} +interface DashboardCurrencyEditorExtension extends IExtension { +} +interface DataSourceBrowserExtension extends IExtension { +} +interface DataSourceWizardExtension extends IExtension { +} +interface DashboadItemMenuExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to keep track of all user actions, and cancel or repeat them. + */ +interface UndoRedoExtension extends IExtension { + /** + * Allows you to track whether the Web Dashboard has unsaved changes. + */ + isChanged(): boolean; +} +/** + * An extension that is the dashboard item's Binding menu allowing you to create and modify data binding. + */ +interface BindingPanelExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to configure color schemes. + */ +interface DashboardColorSchemeEditorExtension extends IExtension { +} +/** + * An extension that is the dashboard item's Convert To menu allowing you to convert or duplicate the current item. + */ +interface ConversionPanelExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to save the current dashboard. + */ +interface SaveDashboardExtension extends IExtension { + /** + * Allows you to save the current dashboard with a specified unique name and JSON model. + * @param dashboardId A string value that is a unique name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + */ + performSaveDashboard(dashboardId: string, dashboardJson: string): void; + /** + * Allows you to invoke a custom function while you save a dashboard. + * @param action A custom function that is invoked when the dashboard is about to be saved. + */ + ensureDashboardSaved(action: Function): void; + /** + * Saves the opened dashboard. + */ + saveDashboard(): void; +} +/** + * A Web Dashboard extension that allows you to create a new dashboard. + */ +interface CreateDashboardExtension extends IExtension { + /** + * Creates a new dashboard with a specified name and JSON model. + * @param dashboardName A string value that is the name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + */ + performCreateDashboard(dashboardName: string, dashboardJson: string): void; +} +/** + * A Web Dashboard extension that allows you to open the created dashboards. + */ +interface OpenDashboardExtension extends IExtension { + /** + * Loads a dashboard with the specified identifier from the dashboard storage. + * @param id A String value that specifies the unique dashboard name. + */ + loadDashboard(id: string): void; +} +/** + * An extension that is the dashboard item's Interactivity menu containing settings that affect on interaction between various dashboard items. + */ +interface InteractivityPanelExtension extends IExtension { +} +/** + * An extension that is the dashboard item's Options menu containing specific options and settings related to the current dashboard item. + */ +interface OptionsPanelExtension extends IExtension { +} +/** + * An extension that is the Web Dashboard title editor. + */ +interface DashboardTitleEditorExtension extends IExtension { +} +/** + * The Dashboard Panel extension that displays a list of available dashboards and lets you switch between the designer and viewer modes. + */ +interface DashboardPanelExtension extends IExtension { + /** + * Gets or sets the width of the Dashboard Panel extension. + * Value: An integer value that specifies the Dashboard Panel's width. + */ + panelWidth: number; + /** + * Allows you to control the Dashboard Panel's visibility. + * Value: true, to display the Dashboard Panel; otherwise, false. + */ + visible: KnockoutObservableBoolean; + /** + * Gets or sets whether you can switch into the designer mode. + * Value: true, to display the Edit in Designer button on the dashboard panel; otherwise, false. + */ + allowSwitchToDesigner: KnockoutObservableBoolean; +} +/** + * An extension that is a list of available data sources used to provide data to the Web Dashboard. + */ +interface AvailableDataSourcesExtension extends IExtension { +} +/** + * A dashboard menu item. + */ +interface DashboardMenuItem { + /** + * Gets or sets a unique id of a dashboard menu item. + * Value: A string value that is a menu item's unique name. + */ + id: string; + /** + * Gets or sets a dashboard menu item title. + * Value: A string value that is a dashboard menu item title. + */ + title: string; + /** + * Gets or sets a position of the dashboard menu item group within the dashboard menu. + * Value: A zero-based integer specifying the position of the current dashboard menu item. + */ + index: number; + /** + * Gets or sets a keyboard shortcut used to invoke the command. + * Value: An integer value that specifies a hotkey combination. + */ + hotKey: number; + /** + * Gets or sets a custom function that is invoked when a click occurs. + * Value: A custom function that is invoked when a click occurs. + */ + click: Function; + /** + * Gets or sets a knockout template for the extension. + * Value: A string value that is an id of the knockout template. + */ + template: string; + /** + * Gets or sets whether the dashboard menu item is selected. + * Value: true, if the dashboard menu item is selected; otherwise, false; + */ + selected: KnockoutObservableBoolean; + /** + * Gets or sets whether a dashboard menu item should be disabled. + * Value: true, if a dashboard menu item should be disabled; otherwise, false. + */ + disabled: KnockoutObservableBoolean; + /** + * Gets or sets whether a dashboard menu item has a separator. + * Value: true, if a dashboard menu item has a separator; otherwise, false. + */ + hasSeparator: boolean; + /** + * Gets or sets data that is used by a menu item. + * Value: An object that contains data used by a menu item. + */ + data: Object; +} +/** + * A toolbox item of the specified dashboard toolbox group. + */ +interface DashboardToolboxItem { + /** + * Gets or sets a dashboard item type. + * Value: A string value that is a dashboard item type. + */ + type: string; + /** + * Gets or sets an icon of the dashboard toolbox item. + * Value: A string value that is the icon id from the SVG definition. + */ + icon: string; + /** + * Gets or sets a unique name of the dashboard toolbox item. + * Value: A string value that is a toolbox item's unique name. + */ + name: string; + /** + * Gets or sets a dashboard toolbox item title. + * Value: A string value that is a dashboard toolbox item title. + */ + title: string; + /** + * Gets or sets whether a toolbox item should be disabled. + * Value: true, if a toolbox item should be disabled; otherwise, false. + */ + disabled: KnockoutObservableBoolean; + /** + * Gets or sets a custom function that is invoked when a click occurs. + * Value: A custom function that is invoked when a click occurs. + */ + click: Function; +} +/** + * A toolbar item of the specified dashboard toolbar group. + */ +interface DashboardToolbarItem { + /** + * Gets or sets an icon of the dashboard toolbar item. + * Value: A string value that is the icon id from the SVG definition. + */ + icon: string; + /** + * Gets or sets a unique name of the dashboard toolbar item. + * Value: A string value that is a unique toolbar item name. + */ + name: string; + /** + * Gets or sets a dashboard toolbar item title. + * Value: A string value that is a dashboard toolbar item title. + */ + title: string; + /** + * Gets or sets whether a toolbar item should be disabled. + * Value: true, if a toolbar item should be disabled; otherwise, false. + */ + disabled: KnockoutObservableBoolean; + /** + * Gets or sets a knockout extension template. + * Value: A string value that is an id of the knockout template. + */ + template: string; + /** + * Gets or sets a custom function that is invoked when a click occurs. + * Value: A custom function that is invoked when a click occurs. + */ + click: Function; +} +/** + * A toolbox group that contains dashboard toolbox items. + */ +interface DashboardToolboxGroup { + /** + * Gets or sets a unique name of the dashboard toolbox group. + * Value: A string value that is a unique toolbox group name. + */ + name: string; + /** + * Gets or sets a dashboard toolbox group title. + * Value: A string value that is a dashboard toolbox group title. + */ + title: string; + /** + * Gets or sets a position of the toolbox group within the Toolbox. + * Value: A zero-based integer specifying the position of the current toolbox group. + */ + index: number; + /** + * Provide an access to the collection of toolbox items obtained from the specified toolbox group. + * Value: A object that is an array of items obtained from the specified toolbox group. + */ + items: KnockoutObservableArray; +} +/** + * A toolbar group that contains dashboard toolbar items. + */ +interface DashboardToolbarGroup { + /** + * Gets or sets a unique name of the dashboard toolbar group. + * Value: A string value that is a unique toolbar group name. + */ + name: string; + /** + * Gets or sets a dashboard toolbar group title. + * Value: A string value that is a dashboard toolbar group title. + */ + title: string; + /** + * Gets or sets a position of the toolbar group within the Toolbox. + * Value: A zero-based integer specifying the position of the current toolbar group. + */ + index: number; + /** + * Provide an access to the collection of toolbox items obtained from the specified toolbar group. + * Value: A object that is an array of items obtained from the specified toolbar group. + */ + items: KnockoutObservableArray; +} +/** + * The Web Dashboard Toolbox extension that provides access to the dashboard menu and allows you to add dashboard items, as well as undo or repeat user actions. + */ +interface ToolboxExtension extends IExtension { + /** + * Gets or sets the visibility of the dashboard menu. + * Value: true, to display the dashboard menu; otherwise, false. + */ + menuVisible: KnockoutObservableBoolean; + /** + * Provide an access to the collection of menu items obtained from the dashboard menu. + * Value: A object that is a collection the dashboard menu items . + */ + menuItems: KnockoutObservableArray; + /** + * Provide an access to the collection of toolbox groups obtained from the Toolbox. + * Value: A object that is a collection the toolbox groups. + */ + toolboxGroups: KnockoutObservableArray; + /** + * Provide an access to the collection of toolbar groups obtained from the Toolbox. + * Value: A object that is a collection the toolbar groups. + */ + toolbarGroups: KnockoutObservableArray; + /** + * Allows you to add a specified menu item to the dashboard menu. + * @param menuItem A DashboardMenuItem object that is a dashboard menu item. + */ + addMenuItem(menuItem: DashboardMenuItem): void; + /** + * Removes the specified dashboard item from the dashboard menu. + * @param menuItemId A string value that is a unique dashboard item name. + */ + removeMenuItem(menuItemId: string): void; + /** + * Simulates a dashboard menu item selection. + * @param menuItem A DashboardMenuItem object that is a dashboard menu item. + */ + selectMenuItem(menuItem: DashboardMenuItem): void; + /** + * Allows you to add a specified toolbox item into a specified toolbox group. + * @param groupName A string value that is a toolbox group name. To get a toolbox group name, use the name property. + * @param toolboxItem A DashboardToolboxItem object that is a dashboard toolbox item. + */ + addToolboxItem(groupName: string, toolboxItem: DashboardToolboxItem): void; + /** + * Removes the specified toolbox item from the specified toolbox group. + * @param groupName A string value that is a unique toolbox group name. + * @param toolboxItemName A string value that is a unique toolbox item name. + */ + removeToolboxItem(groupName: string, toolboxItemName: string): void; + /** + * Allows you to add a specified toolbar item into a specified toolbar group. + * @param groupName A string value that is a toolbar group name. To get a toolbar group name, use the name property. + * @param toolbarItem A DashboardToolbarItem object that is a dashboard toolbar item. + */ + addToolbarItem(groupName: string, toolbarItem: DashboardToolbarItem): void; + /** + * Removes the specified toolbar item from the specified toolbar group. + * @param groupName A string value that is a unique toolbar group name. + * @param toolbarItemName A string value that is a unique toolbar item name. + */ + removeToolbarItem(groupName: string, toolbarItemName: string): void; +} +/** + * A Web Dashboard extension that allows you to create and edit dashboard parameters. + */ +interface DashboardParameterEditorExtension extends IExtension { +} /** * Serves as the base object for all the editors included in the client-side object model. */ @@ -2265,6 +3705,58 @@ interface ASPxClientComboBox extends ASPxClientDropDownEditBase { * @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; + /** + * Defines the HTML content for the specified combo box item. + * @param index An integer value specifying the zero-based index of the item. + * @param html A string value that is the HTML code defining the content of the combo box item. + */ + SetItemHtml(index: number, html: string): void; + /** + * Sets the tooltip text for the combo box editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTooltip(index: number, tooltip: string): void; + /** + * Sets the CSS class for a combo box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + AddItemCssClass(index: number, className: string): void; + /** + * Removes the CSS class from a combo box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + RemoveItemCssClass(index: number, className: string): void; + /** + * Defines the HTML content for the specified combo box item's text cell. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param html A string value that is the HTML code defining the content of the combo box item. + */ + SetItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + /** + * Sets the tooltip text for the text cell of the editor's item specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + /** + * Sets the CSS class for a combo box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + AddItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + /** + * Removes the CSS class from a combo box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + RemoveItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; } /** * Represents the client-side equivalent of the ASPxDateEdit control. @@ -2295,10 +3787,13 @@ interface ASPxClientDateEdit extends ASPxClientDropDownEditBase { */ GetTimeEdit(): ASPxClientTimeEdit; /** - * - * @param date + * Specifies the date for the editor. + * @param date A DateTime object that is the date. */ SetDate(date: Date): void; + /** + * Gets the date that is the editor's value. + */ GetDate(): Date; /** * Returns the number of days in a range selected within a date edit. @@ -2773,6 +4268,58 @@ interface ASPxClientListBox extends ASPxClientListEdit { * @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; + /** + * Defines the HTML content for the specified list box item. + * @param index An integer value specifying the zero-based index of the item. + * @param html A string value that is the HTML code defining the content of the list box item. + */ + SetItemHtml(index: number, html: string): void; + /** + * Sets the tooltip text for the list box editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTooltip(index: number, tooltip: string): void; + /** + * Sets the CSS class for a list box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + AddItemCssClass(index: number, className: string): void; + /** + * Removes the CSS class from a list box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + RemoveItemCssClass(index: number, className: string): void; + /** + * Defines the HTML content for the specified list box item's text cell. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param html A string value that is the HTML code defining the content of the list box item. + */ + SetItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + /** + * Sets the tooltip text for the text cell of the editor's item specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + /** + * Sets the CSS class for a list box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + AddItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + /** + * Removes the CSS class from a list box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + RemoveItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; } /** * Serves as the base type for the ASPxClientRadioButtonList objects. @@ -2997,10 +4544,13 @@ interface ASPxClientTimeEdit extends ASPxClientSpinEditBase { */ DateChanged: ASPxClientEvent>; /** - * - * @param date + * Specifies the date for the editor. + * @param date A DateTime object that is the date. */ SetDate(date: Date): void; + /** + * Gets the date that is the editor's value. + */ GetDate(): Date; } /** @@ -3407,16 +4957,82 @@ interface ASPxClientGaugeControl extends ASPxClientControl { */ PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; } +/** + * Lists values that specify the position relative to the target column in which a moved column should be placed. + */ +interface ASPxClientGridColumnMovingTargetPosition { + /** + * A moved column should be placed to the right of the target column. + */ + Right: number; + /** + * A moved column should be placed to the left of the target column. + */ + Left: number; + /** + * A moved column should be placed at the top of the target column. + */ + Top: number; + /** + * A moved column should be placed at the bottom of the target column. + */ + Bottom: number; +} /** * Represents the client ASPxGridView. */ interface ASPxClientGridBase extends ASPxClientControl { + /** + * Fires after a toolbar item has been clicked. + */ + ToolbarItemClick: ASPxClientEvent>; + /** + * Returns a toolbar specified by its name. + * @param name A string value specifying the toolbar name. + */ + GetToolbarByName(name: string): ASPxClientMenu; + /** + * Returns a grid's toolbar specified by its index. + * @param index An integer value specifying the zero-based index of the toolbar object to retrieve. + */ + GetToolbar(index: number): ASPxClientMenu; } /** * Serves as a base object implementing the client column functionality. */ interface ASPxClientGridColumnBase { } +/** + * A method that will handle the ToolbarItemClick event. + */ +interface ASPxClientGridToolbarItemClickEventHandler { + /** + * A method that will handle the ToolbarItemClick event. + * @param source The event source. + * @param e An ASPxClientGridToolbarItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridToolbarItemClickEventArgs): void; +} +/** + * Provides data for the ToolbarItemClick event. + */ +interface ASPxClientGridToolbarItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the toolbar index. + * Value: An integer value that is the toolbar index. + */ + toolbarIndex: number; + /** + * Gets the clicked toolbar item. + * Value: A ASPxClientMenuItem object that is the toolbar item. + */ + item: ASPxClientMenuItem; + /** + * 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; +} /** * The client-side equivalent of the ASPxGridLookup control. */ @@ -3503,6 +5119,10 @@ interface ASPxClientCardView extends ASPxClientGridBase { * Occurs on the client side before a card is deleted in batch edit mode. */ BatchEditCardDeleting: ASPxClientEvent>; + /** + * Occurs on the client side when the focused cell is about to be changed. + */ + FocusedCellChanging: ASPxClientEvent>; /** * Fires on the client when a card is clicked. */ @@ -3531,6 +5151,21 @@ interface ASPxClientCardView extends ASPxClientGridBase { * Fires after the customization window has been closed. */ CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * 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; /** * 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. @@ -3911,6 +5546,12 @@ interface ASPxClientCardView extends ASPxClientGridBase { * @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 event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; /** * Selects the specified page. * @param pageIndex An integer value that specifies the active page's index. @@ -4036,21 +5677,6 @@ interface ASPxClientCardView extends ASPxClientGridBase { * @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. @@ -4435,6 +6061,27 @@ interface ASPxClientCardViewBatchEditCardDeletingEventArgs extends ASPxClientCan */ cardValues: Object; } +/** + * A method that will handle the FocusedCellChanging event. + */ +interface ASPxClientCardViewFocusedCellChangingEventHandler { + /** + * A method that will handle the FocusedCellChanging event. + * @param source The event source. + * @param e An ASPxClientCardViewFocusedCellChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewFocusedCellChangingEventArgs): void; +} +/** + * Provides data for the FocusedCellChanging event. + */ +interface ASPxClientCardViewFocusedCellChangingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides information of a card's cell currently being focused. + * Value: A ASPxClientCardViewCellInfo object that provides information about the card's cell. + */ + cellInfo: ASPxClientCardViewCellInfo; +} /** * Provides members related to Batch Edit Mode */ @@ -4503,6 +6150,12 @@ interface ASPxClientCardViewBatchEditApi { * @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 a container holding a data cell content. + * @param visibleIndex An integer value that is the visible index. + * @param columnFieldNameOrId A string value that is the column's Field Name or ID. + */ + GetCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): Object; /** * Gets information about the cell currently being edited. */ @@ -4672,6 +6325,10 @@ interface ASPxClientGridView extends ASPxClientGridBase { * Occurs on the client side before a data row is deleted in batch edit mode. */ BatchEditRowDeleting: ASPxClientEvent>; + /** + * Occurs on the client side when the focused cell is about to be changed. + */ + FocusedCellChanging: ASPxClientEvent>; /** * Occurs when a callback for server-side processing is initiated. */ @@ -4688,6 +6345,55 @@ interface ASPxClientGridView extends ASPxClientGridBase { * Fires after the Customization Window has been closed. */ CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * 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; /** * 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. @@ -4763,6 +6469,11 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @param position An integer value specifying the horizontal scroll position. */ SetHorizontalScrollPosition(position: number): void; + /** + * Sets the scrollability of various types of grid rows when the grid displays fixed columns. + * @param scrollableRowSettings An object specifying which types of grid rows should or should not be scrollable. + */ + SetFixedColumnScrollableRows(scrollableRowSettings: Object): void; /** * Applies a filter specified in the filter row to the GridView. */ @@ -4827,6 +6538,12 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @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 event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; /** * Selects the specified page. * @param pageIndex An integer value that specifies the active page's index. @@ -5036,6 +6753,10 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @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; + /** + * Invokes the Customization Dialog and displays it over the grid. + */ + ShowCustomizationDialog(): void; /** * Sorts data by the specified data column's values. * @param column An ASPxClientGridViewColumn object that represents the data column. @@ -5219,6 +6940,38 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @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; + /** + * 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. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition): 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. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition): 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 targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + * @param moveToGroup true, to group the ASPxGridView'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, targetPosition: ASPxClientGridColumnMovingTargetPosition, 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 targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + * @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, targetPosition: ASPxClientGridColumnMovingTargetPosition, 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. @@ -5288,6 +7041,21 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @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; + /** + * Ungroups data by the values of a specified column. + * @param column A ASPxClientGridViewColumn object that is the grid column. + */ + Ungroup(column: ASPxClientGridViewColumn): void; + /** + * Ungroups data by the values of a specified column. + * @param columnIndex An integer value that is the column index. + */ + Ungroup(columnIndex: number): void; + /** + * Ungroups data by the values of a specified column. + * @param columnFieldNameOrId A string value that is the column's FieldName or ID. + */ + Ungroup(columnFieldNameOrId: string): void; /** * Expands all group rows. */ @@ -5415,55 +7183,6 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @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. @@ -6013,6 +7732,27 @@ interface ASPxClientGridViewBatchEditRowDeletingEventArgs extends ASPxClientCanc */ rowValues: Object; } +/** + * A method that will handle the FocusedCellChanging event. + */ +interface ASPxClientGridViewFocusedCellChangingEventHandler { + /** + * A method that will handle the FocusedCellChanging event. + * @param source The event source. + * @param e An ASPxClientGridViewFocusedCellChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewFocusedCellChangingEventArgs): void; +} +/** + * Provides data for the FocusedCellChanging event. + */ +interface ASPxClientGridViewFocusedCellChangingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides information on a cell currently being focused. + * Value: A ASPxClientGridViewCellInfo object that is the cell information. + */ + cellInfo: ASPxClientGridViewCellInfo; +} /** * Contains information on a grid cell. */ @@ -6096,6 +7836,12 @@ interface ASPxClientGridViewBatchEditApi { * @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 a container holding a data cell content. + * @param visibleIndex An integer value that is the visible index. + * @param columnFieldNameOrId A string value that is the column's Field Name or ID. + */ + GetCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): Object; /** * Gets information about the cell currently being edited. */ @@ -6190,6 +7936,10 @@ interface ASPxClientVerticalGrid extends ASPxClientGridBase { * Enables you to specify whether record data is valid and provide an error text. */ BatchEditRecordValidating: ASPxClientEvent>; + /** + * Occurs on the client side when the focused cell is about to be changed. + */ + FocusedCellChanging: ASPxClientEvent>; /** * Enables you to prevent rows from being sorted. */ @@ -6477,6 +8227,12 @@ interface ASPxClientVerticalGrid extends ASPxClientGridBase { * @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 event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; /** * Selects the specified page. * @param pageIndex An integer value that specifies the active page's index. @@ -7050,6 +8806,27 @@ interface ASPxClientVerticalGridBatchEditRecordDeletingEventArgs extends ASPxCli */ recordValues: Object; } +/** + * A method that will handle the FocusedCellChanging event. + */ +interface ASPxClientVerticalGridFocusedCellChangingEventHandler { + /** + * A method that will handle the FocusedCellChanging event. + * @param source The event source. + * @param e An ASPxClientVerticalGridFocusedCellChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridFocusedCellChangingEventArgs): void; +} +/** + * Provides data for the FocusedCellChanging event. + */ +interface ASPxClientVerticalGridFocusedCellChangingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides information on a cell currently being focused. + * Value: A ASPxClientVerticalGridCellInfo object that is the cell information. + */ + cellInfo: ASPxClientVerticalGridCellInfo; +} /** * Contains information on a cell that is being edited. */ @@ -7133,6 +8910,12 @@ interface ASPxClientVerticalGridBatchEditApi { * @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 a container holding the data cell content. + * @param visibleIndex An integer value that is the visible index. + * @param columnFieldNameOrId A string value that is the column's Field Name or ID. + */ + GetCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): Object; /** * Gets information about the cell currently being edited. */ @@ -7228,6 +9011,21 @@ interface ASPxClientHtmlEditorCommandStyleSettings { * Value: A string that specifies an element's left margin in any correct format. */ marginLeft: string; + /** + * Gets or sets a media element's background color. + * Value: A string that specifies a background color in any correct format. + */ + backgroundColor: string; + /** + * Gets or sets the element's text alignment. + * Value: A string value that specifies the element's text alignment in any correct format. + */ + textAlign: string; + /** + * Gets or sets the element's vertical alignment. + * Value: A string value that specifies the element's vertical alignment in any correct format. + */ + verticalAlign: string; } /** * The base class for parameters used in the ASPxHtmlEditor's client-side commands. @@ -7298,6 +9096,11 @@ interface ASPxClientHtmlEditorInsertLinkCommandArguments extends ASPxClientHtmlE * Value: A string value defining the title of the target link. */ title: string; + /** + * Contains the style settings defining the appearance of the target link element. + * Value: An object that contains the style settings defining the appearance of the target link element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; } /** * The base class for parameters related to inserting or changing media elements in the ASPxHtmlEditor. @@ -7443,6 +9246,101 @@ interface ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments extends ASPxCli */ interface ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments extends ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments { } +/** + * Contains settings related to the TABLEPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTablePropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings defining the appearance of the target table element. + * Value: An object that contains the style settings defining the appearance of the target table element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + /** + * Determines the position of the target table element. + * Value: A string value indicating the position of the target table element. + */ + align: string; + /** + * Gets or sets a table cell padding. + * Value: An integer value that is the cell padding. + */ + cellPadding: number; + /** + * Gets or sets the table cell spacing. + * Value: An integer value that is the table cell spacing. + */ + cellSpacing: number; + /** + * Gets or sets a value that is the table caption. + * Value: A string value that is the caption. + */ + caption: string; + /** + * Gets or sets a value indicating whether the first row/column serves as the table's header. + * Value: A string value that specifies whether the first row/column serves as the table's header. + */ + headers: string; + /** + * Gets or sets the table's summary. + * Value: A string value that is the table's summary. + */ + summary: string; +} +/** + * Contains settings related to the INSERTTABLE_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertTableCommandArguments extends ASPxClientHtmlEditorTablePropertiesCommandArguments { + /** + * Gets or sets the count of columns in the table. + * Value: An integer value that is the count of columns. + */ + columns: number; + /** + * Gets or sets the count of rows in the table. + * Value: An integer value that is the count of rows. + */ + rows: number; + /** + * Gets or sets a value indicating whether all table columns should have equal width. + * Value: true, to create equal widths for all columns; otherwise, false. + */ + isEqualColumnWidth: boolean; +} +/** + * Contains settings related to the TABLECELLPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTableCellPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings defining the appearance of the target cell element. + * Value: An object that contains the style settings defining the appearance of the target cell element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + /** + * Gets or sets a value that indicates whether the cell settings should be applied to all cells in the table. + * Value: true, if the cell settings should be applied to all cells in the table; otherwise, false. + */ + applyForAll: boolean; +} +/** + * Contains settings related to the TABLEROWPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTableRowPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings specifying the appearance of the specified table row. + * Value: An object that contains the style settings specifying the appearance of the specified table row. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * Contains settings related to the TABLECOLUMNPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTableColumnPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings defining the appearance of the target column element. + * Value: An object that contains the style settings defining the appearance of the target column element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} /** * A method that will handle the DialogInitialized client event. */ @@ -7463,6 +9361,68 @@ interface ASPxClientHtmlEditorDialogInitializedEventArgs extends ASPxClientEvent * Value: A string value that is the name of the initialized dialog. */ dialogName: string; + /** + * Gets a dialog object related to the event. + * Value: A ASPxClientHtmlEditorDialogBase object that is the dialog. + */ + dialog: ASPxClientHtmlEditorDialogBase; +} +/** + * Provides data for the event that fires when the HTML Editor dialogs are closed or are going to be closed. + */ +interface ASPxClientHtmlEditorDialogCloseEventArgs extends ASPxClientEventArgs { + /** + * Gets the dialog name related to the event. + * Value: A string value that is the dialog name. + */ + dialogName: string; + /** + * Gets the dialog object related to the event. + * Value: An ASPxClientHtmlEditorDialogBase object that is the dialog. + */ + dialog: ASPxClientHtmlEditorDialogBase; + /** + * 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: Object; +} +/** + * A method that will handle the DialogClosing event. + */ +interface ASPxClientHtmlEditorDialogClosingEventHandler { + /** + * A method that will handle the DialogClosing event. + * @param source The event source. + * @param e An ASPxClientHtmlEditorDialogClosingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorDialogClosingEventArgs): void; +} +/** + * Provides data for the DialogClosing event. + */ +interface ASPxClientHtmlEditorDialogClosingEventArgs extends ASPxClientHtmlEditorDialogCloseEventArgs { + /** + * 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 DialogClosed event. + */ +interface ASPxClientHtmlEditorDialogClosedEventHandler { + /** + * A method that will handle the DialogClosed event. + * @param source The event source. + * @param e An ASPxClientHtmlEditorDialogClosedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorDialogClosedEventArgs): void; +} +/** + * Provides data for the DialogClosed event. + */ +interface ASPxClientHtmlEditorDialogClosedEventArgs extends ASPxClientHtmlEditorDialogCloseEventArgs { } /** * A method that will handle the CommandExecuting event. @@ -7696,6 +9656,14 @@ interface ASPxClientHtmlEditor extends ASPxClientControl { * Occurs on the client side after a dialog has been initialized. */ DialogInitialized: ASPxClientEvent>; + /** + * Fires on the client side before a dialog is going to be closed. + */ + DialogClosing: ASPxClientEvent>; + /** + * Occurs on the client side after a dialog is closed. + */ + DialogClosed: ASPxClientEvent>; /** * Occurs before a default or custom command has been executed and allows you to cancel the action. */ @@ -7780,6 +9748,10 @@ interface ASPxClientHtmlEditor extends ASPxClientControl { * Returns the document object generated by an iframe element within a design view area. */ GetDesignViewDocument(): Object; + /** + * Provides access to the client ASPxPopupControl object that is a Html Editor's dialog. + */ + GetDialogPopupControl(): ASPxClientPopupControl; /** * Returns the document object generated by an iframe element within a preview area. */ @@ -7910,6 +9882,513 @@ interface ASPxClientHtmlEditor extends ASPxClientControl { */ PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; } +/** + * Provides client functionality for dialogs within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client ASPxFormLayout object that arranges all editors in the Html Editor's dialogs. + */ + GetFormLayout(): ASPxClientFormLayout; + /** + * Provides access to the client object of the "OK" button in the Html Editor's dialogs. + */ + GetOkButton(): ASPxClientButton; + /** + * Provides access to the client object of the "Cancel" button in the Html Editor's dialogs. + */ + GetCancelButton(): ASPxClientButton; +} +/** + * Provides client functionality for Html Editor's dialogs operated with the elements. + */ +interface ASPxClientHtmlEditorEditElementDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "Border style" combo box in the Html Editor's dialogs (Style Settings). + */ + GetBorderStyleComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Border width" spin editor in the Html Editor's dialogs (Style Settings). + */ + GetBorderWidthSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Border color" color editor in the Html Editor's dialogs (Style Settings). + */ + GetBorderColorColorEdit(): ASPxClientColorEdit; + /** + * Provides access to the client object of the "Top margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetTopMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Bottom margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetBottomMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Left margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetLeftMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Right margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetRightMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "CSS class" combo box in the Html Editor's dialogs (Style Settings). + */ + GetCssClassNameComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Change Element Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorChangeElementPropertiesDialog extends ASPxClientHtmlEditorEditElementDialog { + /** + * Provides access to the client object of the "ID" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetIdTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Title" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetTitleTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Direction" combo box in the Html Editor's "Change Element Properties" dialog. + */ + GetDirectionComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Value" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetValueTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Tab index" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetTabIndexTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Disabled" check box in the Html Editor's "Change Element Properties" dialog. + */ + GetDisabledCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Input type" combo box in the Html Editor's "Change Element Properties" dialog. + */ + GetInputTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "For" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetForTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Name" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetNameTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Method" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetMethodTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Action" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetActionTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Checked" check box in the Html Editor's "Change Element Properties" dialog. + */ + GetCheckedCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Max length" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetMaxLengthTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Size" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetSizeTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Readonly" check box in the Html Editor's "Change Element Properties" dialog. + */ + GetReadonlyCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Src" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetSrcTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Accept" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetAcceptTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Alt" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetAltTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Start" spin editor in the Html Editor's "Change Element Properties" dialog. + */ + GetStartSpinEdit(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Width" spin editor in the Html Editor's "Change Element Properties" dialog. + */ + GetWidthValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client ASPxComboBox object that allows you to specify the element width measurement unit in the Html Editor's "Change Element Properties" dialog. + */ + GetWidthValueTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Height" spin editor in the Html Editor's "Change Element Properties" dialog. + */ + GetHeightValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client ASPxComboBox object that allows to specify the element height measurement unit in the Html Editor's "Change Element Properties" dialog. + */ + GetHeightValueTypeComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Link dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorLinkDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "E-mail to" text box in the Html Editor's Link dialog. + */ + GetEmailTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Text" text box in the Html Editor's Link dialog. + */ + GetTextTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "ToolTip" text box in the Html Editor's Link dialog. + */ + GetTooltipTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Subject" text box in the Html Editor's Link dialog. + */ + GetSubjectTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "URL" text box in the Html Editor's Link dialog. + */ + GetUrlTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the file manager used in the Link dialog's "Select Document" popup window. + */ + GetFileManager(): ASPxClientFileManager; + /** + * Provides access to the client object of the "Cancel" button in the Link dialog's "Select Document" popup window. + */ + GetSelectDocumentPopupCancelButton(): ASPxClientButton; + /** + * Provides access to the client object of the "Select" button in the Link dialog's "Select Document" popup window. + */ + GetSelectDocumentPopupSelectButton(): ASPxClientButton; + /** + * Provides access to the client popup control object that is the "Select Document" popup window in the Html Editor's Link dialog. + */ + GetSelectDocumentPopupControl(): ASPxClientPopupControl; + /** + * Provides access to the client object of the "Open in new window" check box in the Html Editor's Link dialog. + */ + GetOpenInNewWindowCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client radio button list object used to specify the link type in the Html Editor's Link dialog. + */ + GetLinkTypeRadioButtonList(): ASPxClientRadioButtonList; +} +/** + * Provides client functionality for the Placeholder dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorPlaceholderDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the ASPxListBox client object that lists placeholder names in the Html Editor's Placeholder dialog. + */ + GetPlaceholderNameListBox(): ASPxClientListBox; +} +/** + * Provides client functionality for the Paste From Word dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorPasteFromWordDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "Remove font family" check box in the Html Editor's Flash dialog. + */ + GetRemoveFontFamilyCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the media dialogs within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorMediaDialogBase extends ASPxClientHtmlEditorEditElementDialog { + /** + * Provides access to the client object of the media file selector that allows you to insert/change media files in the Html Editor's Audio/Video/Flash dialogs. + */ + GetMediaFileSelector(): ASPxClientMediaFileSelector; + /** + * Provides access to the client object of the "More options" check box in the Html Editor's Audio/Video/Flash/Image dialogs. + */ + GetMoreOptionsCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Width" spin editor in the Html Editor's Audio/Video/Flash dialogs. + */ + GetWidthSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Height" spin editor in the Html Editor's Audio/Video/Flash dialogs. + */ + GetHeightSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Position" combo box in the Html Editor's Audio/Video/Flash/Image dialogs. + */ + GetPositionComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Image dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorImageDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Size" combo box in the Html Editor's Image dialog. + */ + GetSizeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Create thumbnail" check box in the Html Editor's Image dialog. + */ + GetCreateThumbnailCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "New image name" text box in the Html Editor's Image dialog. + */ + GetThumbnailNameTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Wrap text around image" check box in the Html Editor's Image dialog. + */ + GetWrapTextCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Description" text box in the Html Editor's Image dialog. + */ + GetDescriptionTextBox(): ASPxClientTextBox; +} +/** + * Provides client functionality for the Flash dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorFlashDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Quality" combo box in the Html Editor's Flash dialog. + */ + GetQualityComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Auto play" check box in the Html Editor's Flash dialog. + */ + GetAutoPlayCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Enable flash menu" check box in the Html Editor's Flash dialog. + */ + GetEnableFlashMenuCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Loop" check box in the Html Editor's Flash dialog. + */ + GetLoopCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Allow fullscreen" check box in the Html Editor's Flash dialog. + */ + GetAllowFullscreenCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Audio dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorAudioDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Auto play" check box in the Html Editor's Audio dialogs. + */ + GetAutoPlayCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Preload mode" combo box in the Html Editor's Audio dialogs. + */ + GetPreloadModeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Loop" check box in the Html Editor's Audio dialogs. + */ + GetLoopCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show player controls" check box in the Html Editor's Audio dialogs. + */ + GetShowPlayerControlsCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Video dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorVideoDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Auto play" check box in the Html Editor's Video dialog. + */ + GetAutoPlayCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Preload mode" combo box in the Html Editor's Video dialog. + */ + GetPreloadModeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Loop" check box in the Html Editor's Video dialog. + */ + GetLoopCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show player controls" check box in the Html Editor's Video dialog. + */ + GetShowPlayerControlsCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Poster URL" text box in the Html Editor's Video dialog. + */ + GetPosterTextBox(): ASPxClientTextBox; +} +/** + * Provides client functionality for the YouTube Video dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorYouTubeDialog extends ASPxClientHtmlEditorEditElementDialog { + /** + * Provides access to the client object of the "Enable privacy-enhanced mode" check box in the Html Editor's YouTube Video dialog. + */ + GetConfidentModeCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show suggested videos when the video finishes" check box in the Html Editor's YouTube Video dialog. + */ + GetShowSameVideosCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show video title and player actions" check box in the Html Editor's YouTube Video dialog. + */ + GetShowVideoNameCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show player controls" check box in the Html Editor's YouTube Video dialog. + */ + GetShowPlayerControlsCheckBox(): ASPxClientCheckBox; +} +/** + * Provides base client functionality for the Table dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableDialogBase extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "Background color" color editor in the Html Editor's Table dialogs. + */ + GetBackgroundColorColorEdit(): ASPxClientColorEdit; +} +/** + * Provides client functionality for the Table dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableDialog extends ASPxClientHtmlEditorTableDialogBase { + /** + * Provides access to the client object of the "Width" combo box in the Html Editor's Table dialogs. + */ + GetWidthTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the spin editor in the Html Editor's Table dialogs that allows you to specify the table width value. + */ + GetWidthValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the combo box in the Html Editor's Table dialogs that allows you to specify the table width measurement unit. + */ + GetWidthValueTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Height" combo box in the Html Editor's Table dialogs. + */ + GetHeightTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the spin editor in the Html Editor's Table dialogs that allows you specify the table height value. + */ + GetHeightValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the combo box in the Html Editor's Table dialogs that allows you to specify the table height measurement unit. + */ + GetHeightValueTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Cell padding" spin editor in the Html Editor's Table dialogs. + */ + GetCellPaddingSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Cell spacing" spin editor in the Html Editor's Table dialogs. + */ + GetCellSpacingSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Alignment" combo box in the Html Editor's Table dialogs. + */ + GetAlignmentComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Border Color" color editor in the Html Editor's Table dialogs. + */ + GetBorderColorColorEdit(): ASPxClientColorEdit; + /** + * Provides access to the client object of the "Border size" spin editor in the Html Editor's Table dialogs. + */ + GetBorderWidthSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Headers" combo box in the Html Editor's Table dialogs. + */ + GetHeadersComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Caption" text box in the Html Editor's Table dialogs. + */ + GetCaptionTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Summary" text box in the Html Editor's Table dialogs. + */ + GetSummaryTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Accessibility" check box related to the Html Editor's Table dialogs. + */ + GetAccessibilityCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Insert Table dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorInsertTableDialog extends ASPxClientHtmlEditorTableDialog { + /** + * Provides access to the client object of the "Columns" spin editor in the Html Editor's Table dialogs. + */ + GetColumnCountSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Rows" spin editor in the Html Editor's Table dialogs. + */ + GetRowCountSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Equal column widths" check box in the Html Editor's Table dialogs. + */ + GetEqualWidthCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for Table dialogs within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableElementPropertiesDialog extends ASPxClientHtmlEditorTableDialogBase { + /** + * Provides access to the client object of the "Horizontal" combo box in the Html Editor's Row/Column/Cell Properties dialog's Alignment group. + */ + GetHorizontalAlignmentComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Vertical" combo box in the Html Editor's Row/Column/Cell Properties dialog's Alignment group. + */ + GetVerticalAlignmentComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Cell Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableCellPropertiesDialog extends ASPxClientHtmlEditorTableElementPropertiesDialog { + /** + * Provides access to the client object of the "Apply to all cells in the table" check box in the Html Editor's Cell Properties dialog. + */ + GetApplyToAllCellsCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Row Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableRowPropertiesDialog extends ASPxClientHtmlEditorTableElementPropertiesDialog { + /** + * Provides access to the client object of the "Height" combo box in the Html Editor's "Row Properties" dialog. + */ + GetHeightTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client ASPxSpinEdit object that allows you to specify the row height in the Html Editor's "Row Properties" dialog. + */ + GetHeightValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client ASPxComboBox object that allows you to specify the row height measurement unit in the Html Editor's "Row Properties" dialog. + */ + GetHeightValueTypeComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Column Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableColumnPropertiesDialog extends ASPxClientHtmlEditorTableElementPropertiesDialog { + /** + * Provides access to the client object of the "Width" combo box in the Html Editor's "Column Properties" dialog. + */ + GetWidthTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the spin editor that allows you to set the column width value in the Html Editor's "Column Properties" dialog. + */ + GetWidthValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the combo box that allows you to specify the column width measurement unit in the Html Editor's "Column Properties" dialog. + */ + GetWidthValueTypeComboBox(): ASPxClientComboBox; +} /** * A selection in the ASPxHtmlEditor. */ @@ -7938,7 +10417,7 @@ interface ASPxClientHtmlEditorSelection { SetHtml(html: string, addToHistory: boolean): void; } /** - * A client-side equivalent of the ASPxPivotGrid control. + * The client-side equivalent of the ASPxPivotGrid control. */ interface ASPxClientPivotGrid extends ASPxClientControl { /** @@ -8246,6 +10725,10 @@ interface ASPxClientRichEdit extends ASPxClientControl { * Value: A object that lists methods to work with the selection. */ selection: RichEditSelection; + /** + * Gets a unit converter. + * Value: A object representing a unit converter. + */ unitConverter: RichEditUnitConverter; /** * Occurs after a custom command has been executed on the client side. @@ -8350,6 +10833,11 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ fileSaveAs: FileSaveAsCommand; + /** + * Gets a command to open the file's Save As dialog. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileSaveAsDialog: FileSaveAsDialogCommand; /** * 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. @@ -8620,6 +11108,10 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ deleteBookmark: DeleteBookmarkCommand; + /** + * Gets a command to navigate to the specified bookmark. + * Value: A object that provides methods for executing the command and checking its state. + */ goToBookmark: GoToBookmarkCommand; /** * Gets a command to invoke the Hyperlink dialog window. @@ -8671,6 +11163,10 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ changePageOrientation: ChangePageOrientationCommand; + /** + * Gets a command to define the page size dialog's settings. + * Value: A object that provides methods for executing the command and checking its state. + */ setPageSizeDialog: SetPageSizeDialogCommand; /** * Gets a command to invoke the Paper tab of the Page Setup dialog window. @@ -8752,6 +11248,16 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ delete: DeleteCommand; + /** + * Gets a command to remove the previous word. + * Value: A object that provides methods for executing the command and checking its state. + */ + removePrevWord: RemovePrevWordCommand; + /** + * Gets a command to remove the next word. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeNextWord: RemoveNextWordCommand; /** * 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. @@ -9022,6 +11528,10 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ changeTableCellPreferredWidth: ChangeTableCellPreferredWidthCommand; + /** + * Gets a command to toggle inside borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ toggleTableCellInsideBorders: ToggleTableCellInsideBordersCommand; /** * Gets a command to change the selected table columns' preferred width. @@ -9273,7 +11783,86 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ openSpellingDialog: OpenSpellingDialogCommand; + /** + * Gets a command to assign a shortcut to the specified client command. + * Value: A object that provides methods for executing the command and checking its state. + */ assignShortcut: AssignShortcutCommand; + /** + * Gets a command to invoke the Layout dialog window to customize the settings of a floating object. + * Value: A object that provides methods for executing the command and checking its state. + */ + openLayoutOptionsDialog: OpenLayoutOptionsDialogCommand; + /** + * Gets a command to insert a floating text box. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertFloatingTextBox: InsertFloatingTextBoxCommand; + /** + * Gets a command to modify a floating object's alignment position. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectAlignmentPosition: ChangeFloatingObjectAlignmentPositionCommand; + /** + * Gets a command to change a floating object's absolute position. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectAbsolutePosition: ChangeFloatingObjectAbsolutePositionCommand; + /** + * Gets a command to modify a floating object's relative position. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectRelativePosition: ChangeFloatingObjectRelativePositionCommand; + /** + * Gets a command to lock a floating object's anchor. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectLockAnchor: ChangeFloatingObjectLockAnchorCommand; + /** + * Gets a command to modify a floating object's text wrapping settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectTextWrapping: ChangeFloatingObjectTextWrappingCommand; + /** + * Gets a command to change a floating object's absolute size. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectAbsoluteSize: ChangeFloatingObjectAbsoluteSizeCommand; + /** + * Gets a command to modify a text box' relative size settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTextBoxRelativeSize: ChangeTextBoxRelativeSizeCommand; + /** + * Gets a command to rotate a floating object. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectRotation: ChangeFloatingObjectRotationCommand; + /** + * Gets a command to lock a floating object's aspect ratio. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectLockAspectRatio: ChangeFloatingObjectLockAspectRatioCommand; + /** + * Gets a command to modify a floating object's background fill color. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectFillColor: ChangeFloatingObjectFillColorCommand; + /** + * Gets a command to modify a floating object's outline color. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectOutlineColor: ChangeFloatingObjectOutlineColorCommand; + /** + * Gets a command to modify a floating object's outline width. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectOutlineWidth: ChangeFloatingObjectOutlineWidthCommand; + /** + * Gets a command to modify a text box' content margins. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTextBoxContentMargins: ChangeTextBoxContentMarginsCommand; } /** * Serves as a base for objects that implement different client command functionalities. @@ -9303,7 +11892,7 @@ interface CommandWithBooleanStateBase extends CommandBase { */ interface SimpleCommandState { /** - * Gets a value indicating whether the command's UI element is enabled. + * Gets a value indicating whether the command's UI element is enabled (within the ribbon and context menu). * Value: true, if the command's related UI element is enabled; otherwise, false. */ enabled: boolean; @@ -9357,6 +11946,10 @@ interface RichEditDocument { * Value: An array of TableStyle objects storing information about table styles. */ tableStylesInfo: TableStyle[]; + /** + * Provides information about spell checking in the current document. + * Value: A object. + */ spellingInfo: SpellingInfo; } /** @@ -9379,6 +11972,10 @@ interface Paragraph { * Value: An integer value specifying the start position. */ start: number; + /** + * Gets the text buffer interval occupied by the current paragraph element. + * Value: An object specifying the interval settings. + */ interval: Interval; /** * Gets the name of the paragraph style applied to the current paragraph (see name). @@ -9391,7 +11988,7 @@ interface Paragraph { */ listIndex: number; /** - * Gets or sets the index of the list level applied to the current paragraph in the numbering list. + * Gets 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; @@ -9410,6 +12007,20 @@ interface Field { * Value: An integer value specifying the field length. */ length: number; + /** + * Gets the text buffer interval occupied by the field code element. + * Value: An object specifying the interval settings. + */ + codeInterval: Interval; + /** + * Gets the text buffer interval occupied by the field result element. + * Value: An object specifying the interval settings. + */ + resultInterval: Interval; + /** + * Gets the text buffer interval occupied by the current field element. + * Value: An object specifying the interval settings. + */ interval: Interval; /** * Gets or sets a URI to navigate to when the hyperlink (represented by the current field) is activated. @@ -9426,6 +12037,10 @@ interface Field { * Value: A string representing the bookmark's name. */ hyperlinkAnchor: string; + /** + * Gets a value specifying whether a field's code or result is dispalyed. + * Value: true, if the field code is displayed; false, if the field result is displayed. + */ showCode: boolean; } /** @@ -9442,6 +12057,10 @@ interface Bookmark { * Value: An integer value specifying the length of the bookmark. */ length: number; + /** + * Gets the text buffer interval occupied by the current bookmark element. + * Value: An object specifying the interval settings. + */ interval: Interval; /** * Gets the name of a bookmark in the document. @@ -9463,6 +12082,10 @@ interface Section { * Value: An integer value specifying the element length in characters. */ length: number; + /** + * Gets the text buffer interval occupied by the current section element. + * Value: An object specifying the interval settings. + */ interval: Interval; /** * Provides access to the section's headers. @@ -9490,15 +12113,50 @@ interface HeaderFooter { */ subDocument: SubDocument; } +/** + * Contains in-line picture settings. + */ interface InlinePictureInfo { + /** + * Gets the image identifier. + * Value: An integer value specifying the image identifier. + */ id: number; + /** + * Gets the image position. + * Value: An integer value specifying the image position. + */ position: number; + /** + * Gets the initial image width. + * Value: An integer value specifying the image width. + */ initialWidth: number; + /** + * Gets the initial image height. + * Value: An integer value specifying the image height. + */ initialHeight: number; + /** + * Gets the X-scaling factor of the inline image. + * Value: An integer value specifying the scaling factor for the X-axis. + */ scaleX: number; + /** + * Gets the Y-scaling factor of the inline image. + * Value: An integer value specifying the scaling factor for the Y-axis. + */ scaleY: number; + /** + * Gets the actual image width. + * Value: An integer value specifying the image width. + */ actualWidth: number; - actualHeigth: number; + /** + * Gets the actual image height. + * Value: An integer value specifying the image height. + */ + actualHeight: number; } declare enum HeaderFooterType { First=0, @@ -9506,6 +12164,26 @@ declare enum HeaderFooterType { Primary=1, Even=2 } +/** + * Contains the settings defining a file to save to. + */ +interface RichEditFileInfo { + /** + * Gets or sets the file's folder name. + * Value: A string value specifying the folder name. + */ + folderPath: string; + /** + * Gets or sets the file name. + * Value: A string value specifying the file name. + */ + fileName: string; + /** + * Gets or sets the file's document format. + * Value: A DocumentFormat enumeration value. + */ + documentFormat: any; +} declare enum DocumentFormat { Undefined=0, PlainText=1, @@ -9523,11 +12201,19 @@ declare enum DocumentFormat { */ interface RichEditSelection { /** - * Gets or sets an array of document interval in the selection. + * Gets or sets an array of document intervals in the selection. * Value: An array of Interval objects. */ intervals: Interval[]; + /** + * Gets or sets a value specifying whether the current selection is collapsed (and represents the cursor position). + * Value: true, if the selection is collapsed; otherwise, false. + */ collapsed: boolean; + /** + * Gets the maximum position of a document interval in the selection. + */ + getIntervalMaxPosition(): number; /** * Moves the cursor to the next line. */ @@ -9667,6 +12353,24 @@ interface RichEditSelection { * Selects the paragraph in which the cursor is located. */ selectParagraph(): void; + /** + * Moves the cursor to the next page break mark. + */ + goToStartNextPageCommand(): void; + /** + * Moves the cursor to the next page break mark and extends the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToStartNextPageCommand(extendSelection: boolean): void; + /** + * Moves the cursor to the previous page break mark. + */ + goToStartPrevPageCommand(): void; + /** + * Moves the cursor to the previous page break mark and extends the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToStartPrevPageCommand(extendSelection: boolean): void; /** * Selects the table cell in which the cursor is located. */ @@ -9699,17 +12403,17 @@ interface RichEditSelection { */ selectAll(): void; /** - * Moves the cursor to the main sub-document. + * Makes the main sub-document active and moves the cursor to its beginning. */ setMainSubDocumentAsActive(): void; /** - * Moves the cursor to the footer of the specified document page. - * @param pageIndex An integer value specifying the page index. + * Creates a footer sub-document (if it was not created before) and sets the footer as the active sub-document. Moves the cursor to the footer's start position. + * @param pageIndex An integer value specifying the active page's index. */ setFooterSubDocumentAsActiveByPageIndex(pageIndex: number): void; /** - * Moves the cursor to the header of the specified document page. - * @param pageIndex An integer value specifying the page index. + * Creates a header sub-document (if it was not created before) and sets the header as the active sub-document. Moves the cursor to the header's start position. + * @param pageIndex An integer value specifying the active page's index. */ setHeaderSubDocumentAsActiveByPageIndex(pageIndex: number): void; } @@ -9728,8 +12432,19 @@ interface Interval { */ length: number; } +/** + * Contains spell checking related settings. + */ interface SpellingInfo { + /** + * Gets a value specifying the spell checking state. + * Value: One of the enumeration values. + */ spellCheckerState: any; + /** + * Provides access to an array containing misspelled intervals. + * Value: An array of objects. + */ misspelledIntervals: MisspelledInterval[]; } declare enum SpellCheckerState { @@ -9737,12 +12452,39 @@ declare enum SpellCheckerState { InProgress=1, Done=2 } +/** + * Contains the settings defining a misspelled interval. + */ interface MisspelledInterval { + /** + * Gets the start position of the misspelled word in the interval. + * Value: An integer value specifying the misspelled word's start position. + */ start: number; + /** + * Gets the length of the misspelled interval. + * Value: An integer value specifying the misspelled interval's length. + */ length: number; + /** + * Gets the text buffer interval occupied by the current element. + * Value: An object specifying the interval settings. + */ interval: Interval; + /** + * Gets the spelling error type. + * Value: One of the enumeration values. + */ errorType: any; + /** + * Gets an erroneous word found during spell check. + * Value: A string that is the erroneous or misspelled word. + */ word: string; + /** + * Gets a list of suggested words to replace the misspelled word. + * Value: A string array containing suggested words. + */ suggestions: string[]; } declare enum SpellingErrorType { @@ -9823,7 +12565,15 @@ interface TableStyle extends StyleBase { * Exposes the settings providing the information about the essential document functionality. */ interface SubDocument { + /** + * Gets the sub-document identifier. + * Value: An integer value specifying the sub-document identifier. + */ id: number; + /** + * Gets a value specifying the sub-document type. + * Value: One of the enumeration values. + */ type: any; /** * Provides information about paragraphs contained in the document. @@ -9845,6 +12595,10 @@ interface SubDocument { * Value: An array of Bookmark objects storing information about document bookmarks. */ bookmarksInfo: Bookmark[]; + /** + * Provides access to an array of objects containing in-line picture settings. + * Value: An array of objects. + */ inlinePicturesInfo: InlinePictureInfo[]; /** * Gets the document's textual representation. @@ -9877,6 +12631,10 @@ interface Table { * Value: A integer value specifying the character length of the table. */ length: number; + /** + * Gets the text buffer interval occupied by the current table element. + * Value: An object specifying the interval settings. + */ interval: Interval; /** * Provides access to a collection of table rows. @@ -9903,6 +12661,10 @@ interface TableRow { * Value: An integer value specifying the element length in characters. */ length: number; + /** + * Gets the text buffer interval occupied by the current table row element. + * Value: An object specifying the interval settings. + */ interval: Interval; /** * Provides information about the table row's cells. @@ -9924,18 +12686,65 @@ interface TableCell { * Value: An integer value specifying the element length in characters. */ length: number; + /** + * Gets the text buffer interval occupied by the current table cell element. + * Value: An object specifying the interval settings. + */ interval: Interval; } +/** + * Contains the method to convert different units of measurement. + */ interface RichEditUnitConverter { + /** + * Converts a measurement from pixels to twips. + * @param value The pixels value to be converted. + */ pixelsToTwips(value: number): number; + /** + * Converts a measurement from inches to twips. + * @param value The inches value (floating) to be converted. + */ inchesToTwips(value: number): number; + /** + * Converts a measurement from points to twips. + * @param value The points value to be converted. + */ pointsToTwips(value: number): number; + /** + * Converts a value in centimeters to twips. + * @param value A floating value specifying the value in centimeters to convert. + */ centimetersToTwips(value: number): number; + /** + * Converts a measurement from twips to centimeters. + * @param value The twips value to be converted. + */ twipsToCentimeters(value: number): number; + /** + * Converts a measurement from pixels to centimeters. + * @param value The pixels value to be converted. + */ pixelsToCentimeters(value: number): number; + /** + * Converts a measurement from twips to inches. + * @param value The twips value to be converted. + */ twipsToInches(value: number): number; + /** + * Converts a measurement from pixels to inches. + * @param value The pixels value to be converted. + */ pixelsToInches(value: number): number; + /** + * Converts a measurement from pixels to points. + * @param value The pixels value to be converted. + */ pixelsToPoints(value: number): number; + /** + * Converts a measurement from twips to points. + * @param value The twips value to be converted. + */ twipsToPoints(value: number): number; } /** @@ -10097,9 +12906,19 @@ interface GoToDataRecordCommand extends CommandBase { * @param activeRecordIndex An integer value specifying index of the next data record. */ execute(activeRecordIndex: number): boolean; + /** + * Gets information about the command state. + */ getState(): any; } +/** + * Contains the settings defining a data record. + */ interface DataRecordOptions { + /** + * Gets or sets the index of the active data record. + * Value: An integer value specifying the data record index. + */ activeRecordIndex: number; recordCount: number; } @@ -10190,12 +13009,23 @@ interface MailMergeAndDownloadCommand extends CommandBase { * @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 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 documentFormat One of the DocumentFormat enumeration values. + */ + execute(documentFormat: any): 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; + /** + * 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 documentFormat One of the DocumentFormat enumeration values. + * @param settings A MailMergeSettings object specifying the mail merge settings. + */ + execute(documentFormat: any, settings: MailMergeSettings): boolean; /** * Gets information about the command state. */ @@ -10212,10 +13042,10 @@ interface MailMergeAndSaveAsCommand extends CommandBase { 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. + * @param fileInfo A RichEditFileInfo object specifying a file to save to. + * @param settings A MailMergeSettings object specifying the mail merge settings. */ - execute(filePath: string, settings: MailMergeSettings): boolean; + execute(fileInfo: RichEditFileInfo, settings: MailMergeSettings): boolean; /** * Gets information about the command state. */ @@ -10311,6 +13141,11 @@ interface FileSaveAsCommand extends CommandWithSimpleStateBase { * @param path A string value specifying path to the saving file. */ execute(path: string): boolean; + /** + * 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 fileInfo A object specifying a file to save to. + */ + execute(fileInfo: RichEditFileInfo): boolean; } /** * A command to download the document file, specifying its extension. @@ -10321,6 +13156,20 @@ interface FileDownloadCommand extends CommandWithSimpleStateBase { * @param fileExtension A string value specifying the extension of the downloading file. */ execute(fileExtension: string): boolean; + /** + * 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 documentFormat A DocumentFormat enumeration value. + */ + execute(documentFormat: any): boolean; +} +/** + * A command to open the file's Save As dialog. + */ +interface FileSaveAsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileSaveAsDialogCommand 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 a browser-specific Print dialog allowing one to print the current document. @@ -10402,6 +13251,418 @@ interface ReplaceNextCommand extends CommandWithSimpleStateBase { */ execute(text: string, replaceText: string, matchCase: boolean): boolean; } +interface OpenLayoutOptionsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenLayoutOptionsDialogCommand 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 floating text box. + */ +interface InsertFloatingTextBoxCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertFloatingTextBoxCommand 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 lock a floating object's anchor. + */ +interface ChangeFloatingObjectLockAnchorCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectLockAnchorCommand 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 lockAnchor true to lock the anchor; false, otherwise. + */ + execute(lockAnchor: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's alignment position. + */ +interface ChangeFloatingObjectAlignmentPositionCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectAlignmentPositionCommand 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 FloatingObjectAlignmentPositionSettings object specifying alignment position settings. + */ + execute(settings: FloatingObjectAlignmentPositionSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change a floating object's absolute position. + */ +interface ChangeFloatingObjectAbsolutePositionCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectAbsolutePositionCommand 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 FloatingObjectAbsolutePositionSettings object specifying page margin settings. + */ + execute(settings: FloatingObjectAbsolutePositionSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's relative position. + */ +interface ChangeFloatingObjectRelativePositionCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectRelativePositionCommand 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 FloatingObjectRelativePositionSettings object specifying relative positioin settings. + */ + execute(settings: FloatingObjectRelativePositionSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's text wrapping settings. + */ +interface ChangeFloatingObjectTextWrappingCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectTextWrappingCommand 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 FloatingObjectTextWrappingSettings object specifying text wrapping settings. + */ + execute(settings: FloatingObjectTextWrappingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change a floating object's absolute size. + */ +interface ChangeFloatingObjectAbsoluteSizeCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectAbsoluteSizeCommand 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 FloatingObjectAbsoluteSizeSettings object specifying absolute size settings. + */ + execute(settings: FloatingObjectAbsoluteSizeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a text box' relative size settings. + */ +interface ChangeTextBoxRelativeSizeCommand extends CommandBase { + /** + * Executes the ChangeTextBoxRelativeSizeCommand 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 TextBoxRelativeSizeSettings object specifying relative size settings. + */ + execute(settings: TextBoxRelativeSizeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to rotate a floating object. + */ +interface ChangeFloatingObjectRotationCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectRotationCommand 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 rotation An integer value specifying the angle of rotation. + */ + execute(rotation: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to lock a floating object's aspect ratio. + */ +interface ChangeFloatingObjectLockAspectRatioCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectLockAspectRatioCommand 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 lockAspectRatio true to lock the aspect ratio and maintain the proportions; otherwise, false. + */ + execute(lockAspectRatio: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's background fill color. + */ +interface ChangeFloatingObjectFillColorCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectFillColorCommand 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 value specifying the color. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's outline color. + */ +interface ChangeFloatingObjectOutlineColorCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectOutlineColorCommand 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 value specifying the color. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's outline width. + */ +interface ChangeFloatingObjectOutlineWidthCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectOutlineWidthCommand 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 width An integer value specifying the outline width. + */ + execute(width: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a text box' content margins. + */ +interface ChangeTextBoxContentMarginsCommand extends CommandBase { + /** + * Executes the ChangeTextBoxContentMarginsCommand 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 Margins object specifying margin settings. + */ + execute(settings: Margins): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Contains alignment position settings for floating objects. + */ +interface FloatingObjectAlignmentPositionSettings { + /** + * Gets or sets a value specifying how a floating object is horizontally aligned relative to an element specified by the horizontalPositionAlignment property. + * Value: One of the enumeration values. + */ + horizontalPositionAlignment: any; + /** + * Gets or sets a value specifying to what element the horizontal alignment of a floating object is relative. + * Value: One of the enumeration values. + */ + horizontalPositionType: any; + /** + * Gets or sets a value specifying how a floating object is vertically aligned relative to an element specified by the verticalPositionAlignment property. + * Value: One of the enumeration values. + */ + verticalPositionAlignment: any; + /** + * Gets or sets a value specifying to what element the vertical alignment of a floating object is relative. + * Value: One of the enumeration values. + */ + verticalPositionType: any; +} +/** + * Contains page margin settings. + */ +interface FloatingObjectAbsolutePositionSettings { + /** + * Gets or sets a floating object's horizontal position relative to an element specified by the horizontalPositionType property. + * Value: An integer value specifying the position. + */ + horizontalAbsolutePosition: number; + /** + * Gets or sets a value specifying to what element the horizontal position of a floating object is relative. + * Value: One of the enumeration values. + */ + horizontalPositionType: any; + /** + * Gets or sets a floating object's vertical position relative to an element specified by the verticalPositionType property. + * Value: An integer value specifying the position. + */ + verticalAbsolutePosition: number; + /** + * Gets or sets a value specifying to what element the vertical position of a floating object is relative. + * Value: One of the enumeration values. + */ + verticalPositionType: any; +} +/** + * Contains relative position settings for floating objects. + */ +interface FloatingObjectRelativePositionSettings { + /** + * Gets or sets the horizontal distance between the edge of a floating object and the element specified by the horizontalRelativePosition property + * Value: An integer value specifying the horizontal position. + */ + horizontalRelativePosition: number; + /** + * Gets or sets a value specifying to what element the horizontal position of a floating object is relative. + * Value: One of the enumeration values. + */ + horizontalPositionType: any; + /** + * Gets or sets the horizontal distance between the edge of a floating object and the element specified by the verticalRelativePosition property + * Value: An integer value specifying the vertical position. + */ + verticalRelativePosition: number; + /** + * Gets or sets a value specifying to what element the vertical position of a floating object is relative. + * Value: One of the enumeration values. + */ + verticalPositionType: any; +} +/** + * Contains text wrapping settings for floating objects. + */ +interface FloatingObjectTextWrappingSettings { + /** + * Gets or sets a value specifying how text is wrapped around a floating object. + * Value: One of the enumeration values. + */ + floatingObjectTextWrapType: any; + /** + * Gets or sets a value specifying how text can wrap around a floating object's left and right sides. + * Value: One of the enumeration values. + */ + floatingObjectTextWrapSide: any; + /** + * Gets or sets the left offset of text wrapping. + * Value: An integer value specifying the left offset. + */ + leftDistance: number; + /** + * Gets or sets the right offset of text wrapping. + * Value: An integer value specifying the right offset. + */ + rightDistance: number; + /** + * Gets or sets the top offset of text wrapping. + * Value: An integer value specifying the top offset. + */ + topDistance: number; + /** + * Gets or sets the bottom offset of text wrapping. + * Value: An integer value specifying the bottom offset. + */ + bottomDistance: number; +} +/** + * Contains absolute size settings for floating objects. + */ +interface FloatingObjectAbsoluteSizeSettings { + /** + * Gets or sets a floating object's absolute width. + * Value: An integer value specifying the width. + */ + absoluteWidth: number; + /** + * Gets or sets a floating object's absolute height. + * Value: An integer value specifying the height. + */ + absoluteHeight: number; +} +/** + * Contains relative size settings for floating objects. + */ +interface TextBoxRelativeSizeSettings { + /** + * Gets or sets the percentage specifying a floating object's width relative to the element defined by the relativeWidthType property. + * Value: An integer value specifying the relative width, as a percentage. + */ + relativeWidth: number; + /** + * Gets or sets a value specifying to what element the floating object width is relative. + * Value: One of the enumeration values. + */ + relativeWidthType: any; + /** + * Gets or sets the percentage specifying a floating object's height relative to the element defined by the relativeHeightType property. + * Value: An integer value specifying the relative height, as a percentage. + */ + relativeHeight: number; + /** + * Gets or sets a value specifying to what element the floating object height is relative. + * Value: One of the enumeration values. + */ + relativeHeightType: any; +} +declare enum FloatingObjectRelativeWidthType { + Margin=0, + Page=1, + LeftMargin=2, + RightMargin=3, + InsideMargin=4, + OutsideMargin=5 +} +declare enum FloatingObjectRelativeHeightType { + Margin=0, + Page=1, + TopMargin=2, + BottomMargin=3, + InsideMargin=4, + OutsideMargin=5 +} +declare enum FloatingObjectTextWrapType { + None=0, + TopAndBottom=1, + Tight=2, + Through=3, + Square=4 +} +declare enum FloatingObjectTextWrapSide { + Both=0, + Left=1, + Right=2, + Largest=3 +} +declare enum FloatingObjectHorizontalPositionType { + Page=0, + Character=1, + Column=2, + Margin=3, + LeftMargin=4, + RightMargin=5, + InsideMargin=6, + OutsideMargin=7 +} +declare enum FloatingObjectHorizontalPositionAlignment { + None=0, + Left=1, + Center=2, + Right=3, + Inside=4, + Outside=5 +} +declare enum FloatingObjectVerticalPositionType { + Page=0, + Line=1, + Paragraph=2, + Margin=3, + TopMargin=4, + BottomMargin=5, + InsideMargin=6, + OutsideMargin=7 +} +declare enum FloatingObjectVerticalPositionAlignment { + None=0, + Top=1, + Center=2, + Bottom=3, + Inside=4, + Outside=5 +} /** * A command to cancel changes caused by the previous command. */ @@ -10696,6 +13957,10 @@ interface ListLevelSettings { * Value: One of the values. */ alignment: any; + /** + * Gets or sets the character inserted after the number for a numbered list item. + * Value: A string value that is the trailing character for the list level. + */ separator: string; /** * Gets or sets the left indent for text within the current list level's paragraph. @@ -10872,6 +14137,24 @@ interface DeleteCommand extends CommandWithSimpleStateBase { */ execute(): boolean; } +/** + * A command to remove the previous word. + */ +interface RemovePrevWordCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemovePrevWordCommand 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 the next word. + */ +interface RemoveNextWordCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveNextWordCommand 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. */ @@ -10973,8 +14256,8 @@ interface OpenPageMarginsDialogCommand extends CommandWithSimpleStateBase { */ interface ChangePageOrientationCommand extends CommandBase { /** - * - * @param isPortrait + * Executes the ChangePageOrientationCommand 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 isPortrait One of the Orientation enumeration values. */ execute(isPortrait: any): boolean; /** @@ -11048,8 +14331,8 @@ interface OpenSectionColumnsDialogCommand extends CommandWithSimpleStateBase { */ interface ChangeSectionColumnsCommand extends CommandBase { /** - * - * @param columns + * Executes the ChangeSectionColumnsCommand 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 columns An array of SectionColumn objects. */ execute(columns: SectionColumn[]): boolean; /** @@ -11588,10 +14871,24 @@ declare enum ParagraphFirstLineIndent { Indented=1, Hanging=2 } +/** + * A command to assign a shortcut to the specified client command. + */ interface AssignShortcutCommand extends CommandWithSimpleStateBase { + /** + * Executes the AssignShortcutCommand 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 keyCode An integer value specifying the code uniquely identifying the key combination. + * @param callback A callback function to execute on pressing the shortcut. + */ execute(keyCode: number, callback: (arg1: string) => void): boolean; } +/** + * A command to invoke the Spelling dialog window. + */ interface OpenSpellingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenSpellingDialogCommand 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; } /** @@ -11991,7 +15288,13 @@ interface ToggleTableCellBottomBorderCommand extends CommandWithBooleanStateBase */ execute(): boolean; } +/** + * A command to toggle left borders for selected cells on/off. + */ interface ToggleTableCellLeftBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellLeftBorderCommand 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; } /** @@ -12522,6 +15825,10 @@ interface TableHeightUnit { * Value: An integer value specifying the table height. */ value: number; + /** + * Gets or sets the unit type for the table height. + * Value: One of the enumeration values. + */ type: any; } declare enum TableHeightUnitType { @@ -12851,6 +16158,10 @@ interface FontFormattingSettings { * Value: true, if characters are italicized; otherwise, false. */ italic: boolean; + /** + * Gets or sets a value specifying whether the strikeout formatting is applied to a character(s). + * Value: true if the strikeout formatting is applied; otherwise, false. + */ strikeout: boolean; /** * Gets or sets whether only word characters are underlined. @@ -13239,9 +16550,9 @@ interface ASPxClientRecurrenceInfo { 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. + * @param dayNumber A positive integer value that specifies the day number within a month. */ - SetDayNumber(dayNubmer: number): void; + SetDayNumber(dayNumber: number): void; /** * Gets the ordinal number of a day within a defined month. */ @@ -13547,7 +16858,7 @@ interface DefaultRecurrenceRuleValuesAccessor { */ GetMonth(): number; /** - * Gets the days of the week to which a weekly recurrent appointment is scheduled. + * Gets the days of the week on which a weekly recurrent appointment is scheduled. */ GetWeekDays(): ASPxClientWeekDays; /** @@ -13577,7 +16888,7 @@ interface WeeklyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAcce */ GetPeriodicity(): number; /** - * Gets the days of the week to which a weekly recurrent appointment is scheduled. + * Gets the days of the week on which a weekly recurrent appointment is scheduled. */ GetWeekDays(): ASPxClientWeekDays; } @@ -13586,7 +16897,7 @@ interface WeeklyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAcce */ interface MonthlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { /** - * Gets the number of the month's day in which the appointment is scheduled. + * Gets the day of the month on which the appointment is scheduled. */ GetDayNumber(): number; /** @@ -13594,7 +16905,7 @@ interface MonthlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAcc */ GetPeriodicity(): number; /** - * Gets the days of the week to which a monthly recurrent appointment is scheduled. + * Gets the days of the week on which a monthly recurrent appointment is scheduled. */ GetWeekDays(): ASPxClientWeekDays; /** @@ -13607,7 +16918,7 @@ interface MonthlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAcc */ interface YearlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { /** - * Gets the number of the month's day in which the appointment is scheduled. + * Gets the day of the month on which the appointment is scheduled. */ GetDayNumber(): number; /** @@ -13615,7 +16926,7 @@ interface YearlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAcce */ GetMonth(): number; /** - * Gets the days of the week to which a yearly recurrent appointment is scheduled. + * Gets the days of the week on which a yearly recurrent appointment is scheduled. */ GetWeekDays(): ASPxClientWeekDays; /** @@ -13789,6 +17100,10 @@ interface ASPxClientScheduler extends ASPxClientControl { * Client-side event. Occurs after the active view of the ASPxScheduler has been changed. */ ActiveViewChanged: ASPxClientEvent>; + /** + * Occurs when an end-user pressers a keyboard shortcut. + */ + Shortcut: ASPxClientEvent>; /** * Occurs when the end-user clicks an appointment. */ @@ -13797,6 +17112,14 @@ interface ASPxClientScheduler extends ASPxClientControl { * Occurs when the end-user double clicks on an appointment. */ AppointmentDoubleClick: ASPxClientEvent>; + /** + * Occurs when an end-user clicks a time cell. + */ + CellClick: ASPxClientEvent>; + /** + * Occurs when and end-user double-clicks a time cell. + */ + CellDoubleClick: ASPxClientEvent>; /** * Occurs on the client side when the user selects an appointment. */ @@ -13825,6 +17148,14 @@ interface ASPxClientScheduler extends ASPxClientControl { * Client-side event that occurs after an appointment has been dragged and dropped. */ AppointmentDrop: ASPxClientEvent>; + /** + * A client-side event that occurs when an appointment is being dragged. + */ + AppointmentDrag: ASPxClientEvent>; + /** + * A client-side event that occurs when an appointment is being resized. + */ + AppointmentResizing: ASPxClientEvent>; /** * Client-side event that occurs when an appointment is resized. */ @@ -13901,6 +17232,10 @@ interface ASPxClientScheduler extends ASPxClientControl { * Client-side function that returns the ResourceId of selected time cell's resource. */ GetSelectedResource(): string; + /** + * Gets a collection of visible appointments. + */ + GetVisibleAppointments(): ASPxClientAppointment[]; /** * Client-side function that returns an appointment with the specified ID. * @param id An appointment's identifier. @@ -14102,6 +17437,11 @@ interface ASPxSchedulerViewType { * Value: A string "FullWeek", indicating the FullWeekView. */ FullWeek: string; + /** + * Gets a string representation equivalent to the Agenda enumeration for use in client scripts. + * Value: A string "Agenda", indicating the AgendaView. + */ + Agenda: string; } /** * Represents a client-side equivalent of the SchedulerGroupType enumeration. @@ -14220,6 +17560,37 @@ interface AppointmentsSelectionEventArgs extends ASPxClientEventArgs { */ appointmentIds: string[]; } +/** + * A method that will handle the Shortcut event. + */ +interface ShortcutEventHandler { + /** + * A method that will handle the Shortcut event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A ShortcutEventArgs object that contains event data. + */ + (source: S, e: ShortcutEventArgs): void; +} +/** + * Provides data for the client-side Shortcut event. + */ +interface ShortcutEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of a command associated with the keyboard shortcut. + * Value: A string containing a command name. + */ + commandName: string; + /** + * Gets an object containing information about a keyboard shortcut event. + * Value: An object containing event data. + */ + htmlEvent: 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 ActiveViewChanging event. */ @@ -14313,21 +17684,55 @@ interface MenuItemClickedEventArgs extends ASPxClientEventArgs { */ handled: boolean; } -interface AppointmentDropEventHandler { +/** + * A method that will handle the AppointmentDrag event. + */ +interface AppointmentDragEventHandler { /** - * A method that will handle the AppointmentDrop event. - * @param source The event sender (typically an ASPxClientScheduler control). + * A method that will handle the AppointmentDrag event. + * @param source The event sender (typically an ASPxClientScheduler object). * @param e A ASPxClientAppointmentDragEventArgs object that contains event data. */ (source: S, e: ASPxClientAppointmentDragEventArgs): void; } /** - * Provides data for the AppointmentDrop event. + * Provides data for the AppointmentDrag 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. + * Specifies whether or not appointments can be dropped into the intervals over which they are currently dragged. + * Value: true to allow dropping appointments; otherwise, false. + */ + allow: boolean; + /** + * Gets a mouse event object related to the current drag operation. + * Value: An object providing event properties specific to mouse events. + */ + mouseEvent: Object; + /** + * Provides information about dragged appointments. + * Value: An array of ASPxClientAppointmentDragInfo objects storing information about dragged appointments. + */ + dragInformation: ASPxClientAppointmentDragInfo[]; +} +/** + * A method that will handle the AppointmentDrop event. + */ +interface AppointmentDropEventHandler { + /** + * A method that will handle the AppointmentDrop event. + * @param source The event sender (typically an ASPxClientScheduler object). + * @param e A ASPxClientAppointmentDropEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentDropEventArgs): void; +} +/** + * Provides data for the AppointmentDrop event. + */ +interface ASPxClientAppointmentDropEventArgs 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; /** @@ -14336,8 +17741,8 @@ interface ASPxClientAppointmentDragEventArgs extends ASPxClientEventArgs { */ operation: ASPxClientAppointmentOperation; /** - * Provides information about dragged appointments. - * Value: An array of ASPxClientAppointmentDragInfo objects storing information about dragged appointments. + * Provides information about dropped appointments. + * Value: An array of ASPxClientAppointmentDragInfo objects storing information about dropped appointments. */ dragInformation: ASPxClientAppointmentDragInfo[]; } @@ -14379,6 +17784,47 @@ interface ASPxClientAppointmentResizeEventArgs extends ASPxClientEventArgs { */ newInterval: ASPxClientTimeInterval; } +/** + * A method that will handle the AppointmentResizing event. + */ +interface AppointmentResizingEventHandler { + /** + * A method that will handle the AppointmentResizing event. + * @param source The event sender (typically an ASPxClientScheduler object). + * @param e A ASPxClientAppointmentResizingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentResizingEventArgs): void; +} +/** + * Provides data for the AppointmentResizing event. + */ +interface ASPxClientAppointmentResizingEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not an appointment can be resized to the new time interval. + * Value: true to allow resizing the appointment; otherwise, false. + */ + allow: boolean; + /** + * Gets a mouse event object related to the current appointment resizing operation. + * Value: An object providing event properties specific to mouse events. + */ + mouseEvent: Object; + /** + * Gets the resized appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before resizing. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets the appointment's interval after resizing. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; +} /** * Stores information about an appointment drag operation. */ @@ -14409,6 +17855,37 @@ interface ASPxClientAppointmentDragInfo { */ newResources: string[]; } +/** + * A method that will handle the CellDoubleClick events. + */ +interface CellClickEventHandler { + /** + * A method that will handle the CellClick event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A CellClickEventArgs object that contains event data. + */ + (source: S, e: CellClickEventArgs): void; +} +/** + * Provides data for the CellDoubleClick events. + */ +interface CellClickEventArgs extends ASPxClientEventArgs { + /** + * Provides access to an object containing information about an HTML element representing the clicked time cell. + * Value: An object containing information about an HTML element. + */ + htmlElement: Object; + /** + * Provides access to a time interval occupied by the clicked time cell. + * Value: An object. + */ + interval: ASPxClientTimeInterval; + /** + * Gets the name of a resource to which the clicked time cell belongs. + * Value: A string containing the name of a resource. + */ + resource: string; +} /** * Contains information about a client tooltip. */ @@ -14560,6 +18037,11 @@ interface ASPxClientSpellCheckerAfterCheckEventArgs extends ASPxClientEventArgs * Value: A string, containing checked text. */ checkedText: string; + /** + * Gets a value specifying whether spell checking is finished or stopped by the user. + * Value: A string value identifying the reason ("Default" or "User"). + */ + reason: string; } /** * Represents an object that will handle the client-side WordChanged event. @@ -14572,6 +18054,15 @@ interface ASPxClientWordChangedEventHandler { */ (source: S, e: ASPxClientSpellCheckerAfterCheckEventArgs): void; } +declare enum ASPxClientSpreadsheetPopupMenuType { + ColumnHeading=0, + RowHeading=1, + SheetTab=3, + Picture=4, + Chart=5, + Cell=7, + AutoFilter=8 +} /** * A method that will handle the CustomCommandExecuted event. */ @@ -14597,6 +18088,9 @@ interface ASPxClientSpreadsheetCustomCommandExecutedEventArgs extends ASPxClient * Value: A string value containing additional information about the processed command. */ parameter: string; + /** + * This property is now obsolete. Use the commandName property instead. + */ item: ASPxClientRibbonItem; } /** @@ -14667,6 +18161,32 @@ interface ASPxClientSpreadsheetHyperlinkClickEventArgs extends ASPxClientEventAr */ targetUri: string; } +/** + * A method that will handle the PopupMenuShowing event. + */ +interface ASPxClientSpreadsheetPopupMenuShowingEventHandler { + /** + * A method that will handle the PopupMenuShowing event. + * @param source The event sender (typically an ASPxClientSpreadsheet object). + * @param e A ASPxClientSpreadsheetPopupMenuShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetPopupMenuShowingEventArgs): void; +} +/** + * Provides data for the PopupMenuShowing event. + */ +interface ASPxClientSpreadsheetPopupMenuShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides access to a collection of menu items in the context menu being invoked. + * Value: A object representing the context menu's item collection. + */ + menuItems: ASPxClientSpreadsheetPopupMenuItemCollection; + /** + * Gets the currently displayed context menu's type. + * Value: One of the enumeration values. + */ + menuType: any; +} /** * A client-side equivalent of the ASPxSpreadsheet object. */ @@ -14707,6 +18227,10 @@ interface ASPxClientSpreadsheet extends ASPxClientControl { * Occurs on the client side after a hyperlink is clicked within the Spreadsheet's document. */ HyperlinkClick: ASPxClientEvent>; + /** + * Occurs before the context menu is displayed and allows menu customization. + */ + PopupMenuShowing: ASPxClientEvent>; /** * Sets input focus to the Spreadsheet. */ @@ -14734,6 +18258,12 @@ interface ASPxClientSpreadsheet extends ASPxClientControl { * @param rowModelIndex An integer value specifying the cell's row index. */ GetCellValue(colModelIndex: number, rowModelIndex: number): Object; + /** + * Returns the comment associated with the specified data cell. + * @param colModelIndex An integer value specifying the data cell's column index. + * @param rowModelIndex An integer value specifying the data cell's row index. + */ + GetCellComment(colModelIndex: number, rowModelIndex: number): Object; /** * Gets the value of the currently active cell. */ @@ -14815,6 +18345,123 @@ interface ASPxClientSpreadsheetSelection { */ bottomRowIndex: number; } +/** + * Represents an individual item of the Spreadsheet's context menu. + */ +interface ASPxClientSpreadsheetPopupMenuItem { + /** + * Gets the immediate parent menu item to which the current menu item belongs. + * Value: A ASPxClientSpreadsheetPopupMenuItem object representing the menu item's immediate parent. + */ + parent: ASPxClientSpreadsheetPopupMenuItem; + /** + * Gets or sets the unique identifier name for the current menu item. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; + /** + * Gets or sets the text content of the current menu item. + * Value: A string value that specifies the text content of the menu item. + */ + text: string; + /** + * Gets or sets a value that indicates whether the menu item is enabled, allowing the item to respond to end-user interactions. + * Value: true if the item is enabled; otherwise, false. + */ + enabled: boolean; + /** + * Gets or sets the CSS class name defining the menu item's image. + * Value: A string value specifying the class name. + */ + imageClassName: string; + /** + * Gets or sets an URL which defines the navigation location. + * Value: A string value which represents an URL where the client web browser will navigate. + */ + navigateUrl: string; + /** + * Gets or sets the URL of the menu item's image. + * Value: A string value that specifies the location of an image. + */ + imageUrl: string; + /** + * Gets or sets a value that specifies whether the current menu item starts a group. + * Value: true if the current menu item starts a group; otherwise, false. + */ + beginGroup: boolean; + /** + * Gets or sets the current menu item's tooltip text. + * Value: A string which specifies the text content of the current menu item's tooltip. + */ + tooltip: string; + /** + * Gets or sets the window or frame at which to target the contents of the URL associated with the current menu item. + * Value: A string which identifies the window or frame at which to target the URL content. + */ + target: string; + /** + * Gets a collection that contains the submenu items of the current menu item. + */ + GetSubItems(): ASPxClientSpreadsheetPopupMenuItemCollection; + /** + * Returns the menu item's sub-item with the specified index. + * @param index An integer value specifying the index of the sub-item within a collection of the current menu item's submenu items. + */ + GetItem(index: number): ASPxClientSpreadsheetPopupMenuItem; + /** + * Returns the menu item's sub-item with the specified name property value. + * @param name A string value specifying the name property value of the sub-item to find. + */ + GetItemByName(name: string): ASPxClientSpreadsheetPopupMenuItem; + /** + * Returns the total number of the menu item's child items (submenu items). + */ + GetItemCount(): number; +} +/** + * Represents a collection of items in the Spreadhseet's context menu. + */ +interface ASPxClientSpreadsheetPopupMenuItemCollection { + /** + * Adds the specified menu item to the end of the collection. + * @param item An ASPxClientSpreadsheetPopupMenuItem object specifying the item to be added to the collection. + */ + Add(item: ASPxClientSpreadsheetPopupMenuItem): void; + /** + * Removes a menu item specified by its index within the collection. + * @param index An integer value specifying the index of the menu item to remove. + */ + Remove(index: number): void; + /** + * Removes a menu item specified by its name. + * @param name A string value specifying the name property value of a menu item to remove from the collection. + */ + RemoveByName(name: string): void; + /** + * Adds the specified item to the specified position within the collection. + * @param index An integer value that specifies the zero-based index at which the specified item should be inserted. + * @param item An ASPxClientSpreadsheetPopupMenuItem object to insert. + */ + Insert(index: number, item: ASPxClientSpreadsheetPopupMenuItem): void; + /** + * Returns the total number of menu items in the collection. + */ + GetCount(): number; + /** + * Returns an item object with the specified name property value. + * @param name A string value representing the name property value of the required item. + */ + GetByName(name: string): ASPxClientSpreadsheetPopupMenuItem; + /** + * Returns a menu item specified by its index in the collection. + * @param index An integer value that is the zero-based index of the to retrieve from the ASPxClientSpreadsheetPopupMenuItemCollection. + */ + Get(index: number): ASPxClientSpreadsheetPopupMenuItem; + /** + * Removes all menu items from the collection. + */ + Clear(): void; +} /** * Represents the client ASPxTreeList. */ @@ -14839,6 +18486,10 @@ interface ASPxClientTreeList extends ASPxClientControl { * Occurs when a custom command button has been clicked. */ CustomButtonClick: ASPxClientEvent>; + /** + * Fires after a toolbar item has been clicked. + */ + ToolbarItemClick: ASPxClientEvent>; /** * Fires before the focused node has been changed. */ @@ -14899,6 +18550,16 @@ interface ASPxClientTreeList extends ASPxClientControl { * Gets the Popup Edit Form. */ GetPopupEditForm(): ASPxClientPopupControl; + /** + * Returns a toolbar specified by its name. + * @param name A string value specifying the toolbar name. + */ + GetToolbarByName(name: string): ASPxClientMenu; + /** + * Returns a toolbar specified by its index. + * @param index An integer value specifying the zero-based index of the toolbar object to retrieve. + */ + GetToolbar(index: number): ASPxClientMenu; /** * Returns the focused node's key value. */ @@ -15374,7 +19035,7 @@ interface ASPxClientTreeListContextMenuEventArgs extends ASPxClientEventArgs { htmlEvent: Object; /** * Gets or sets whether to invoke the browser's context menu. - * Value: true to show the browser's context menu; otherwise, false. + * Value: true to hide the browser's context menu; otherwise, false. */ cancel: boolean; } @@ -15514,6 +19175,679 @@ interface ASPxClientTreeListColumnResizedEventHandler { */ (source: S, e: ASPxClientTreeListColumnResizedEventArgs): void; } +/** + * Provides data for the ToolbarItemClick event. + */ +interface ASPxClientTreeListToolbarItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the toolbar index related to the event. + * Value: An integer value that is the toolbar index. + */ + toolbarIndex: number; + /** + * Gets the toolbar item related to the event. + * Value: An ASPxClientMenuItem object that is the toolbar item. + */ + item: ASPxClientMenuItem; + /** + * 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; +} +/** + * A method that will handle the ToolbarItemClick event. + */ +interface ASPxClientTreeListToolbarItemClickEventHandler { + /** + * A method that will handle the ToolbarItemClick event. + * @param source The event source. + * @param e An ASPxClientTreeListToolbarItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListToolbarItemClickEventArgs): void; +} +/** + * Represents a client-side equivalent of the BootstrapAccordion control. + */ +interface BootstrapClientAccordion extends ASPxClientNavBar { +} +interface BootstrapClientBinaryImage extends ASPxClientHyperLink { +} +/** + * Represents a client-side equivalent of the BootstrapButton control. + */ +interface BootstrapClientButton extends ASPxClientButton { + /** + * 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; +} +/** + * Represents a client-side equivalent of the BootstrapCalendar control. + */ +interface BootstrapClientCalendar extends ASPxClientCalendar { +} +/** + * Represents a client-side equivalent of the BootstrapCallbackPanel control. + */ +interface BootstrapClientCallbackPanel 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 BootstrapClientCallbackPanel. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns the HTML code that specifies the contents of the control's window. + */ + GetContentHtml(): string; + /** + * 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 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; +} +/** + * Serves as the base type for the BootstrapClientPieChart objects. + */ +interface BootstrapClientChartBase extends ASPxClientControl { + Done: ASPxClientEvent>; + LegendClick: ASPxClientEvent>; + PointClick: ASPxClientEvent>; + PointHoverChanged: ASPxClientEvent>; + PointSelectionChanged: ASPxClientEvent>; + TooltipHidden: ASPxClientEvent>; + TooltipShown: ASPxClientEvent>; + ArgumentAxisClick: ASPxClientEvent>; + SeriesClick: ASPxClientEvent>; + SeriesHoverChanged: ASPxClientEvent>; + SeriesSelectionChanged: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the BootstrapChart control. + */ +interface BootstrapClientChart extends BootstrapClientChartBase { + ZoomStart: ASPxClientEvent>; + ZoomEnd: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the BootstrapPolarChart control. + */ +interface BootstrapClientPolarChart extends BootstrapClientChartBase { +} +/** + * Represents a client-side equivalent of the BootstrapPieChart control. + */ +interface BootstrapClientPieChart extends BootstrapClientChartBase { +} +interface BootstrapClientChartBaseDoneEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapClientChartBaseLegendClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartArgumentAxisClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientChartBasePointClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientChartBasePointHoverChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartBasePointSelectionChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartBaseTooltipHiddenEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartBaseTooltipShownEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartSeriesClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartSeriesHoverChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartSeriesSelectionChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartZoomStartEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapClientChartZoomEndEventHandler { + (source: S, e: BootstrapClientChartZoomEndEventArgs): void; +} +interface BootstrapUIWidgetEventArgsBase extends ASPxClientEventArgs { + component: Object; + element: Object; +} +interface BootstrapClientChartZoomEndEventArgs extends BootstrapUIWidgetEventArgsBase { + rangeStart: Object; + rangeEnd: Object; +} +/** + * Represents a client-side equivalent of the BootstrapCheckBox control. + */ +interface BootstrapClientCheckBox 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 + */ + 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 + */ + SetCheckState(checkState: string): void; + /** + * Sets the text to be displayed within the editor. + * @param text + */ + SetText(text: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapRadioButton control. + */ +interface BootstrapClientRadioButton extends BootstrapClientCheckBox { +} +/** + * Represents a client-side equivalent of the BootstrapComboBox control. + */ +interface BootstrapClientComboBox extends ASPxClientComboBox { + /** + * Returns the combo box editor's selected item. + */ + GetSelectedItem(): BootstrapClientListBoxItem; + /** + * Sets the combo box editor's selected item. + * @param item + */ + SetSelectedItem(item: BootstrapClientListBoxItem): void; + /** + * Returns an item specified by its index within the combo box editor's item collection. + * @param index + */ + GetItem(index: number): BootstrapClientListBoxItem; + /** + * Returns a combo box item by its text. + * @param text + */ + FindItemByText(text: string): BootstrapClientListBoxItem; + /** + * Returns a combo box item by its value. + * @param value + */ + FindItemByValue(value: Object): BootstrapClientListBoxItem; + /** + * 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 fields within the editor's Fields collection. + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + * @param iconCssClass + */ + AddItem(texts: string[], value: Object, iconCssClass: string): number; + /** + * Adds a new item to the editor specifying the item's display text and returns the index of the added item. + * @param 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 + * @param value + */ + 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 + * @param value + * @param iconCssClass + */ + AddItem(text: string, value: Object, iconCssClass: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param value + * @param iconCssClass + */ + InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param 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 + * @param texts + */ + InsertItem(index: number, texts: string[]): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param text + * @param value + * @param iconCssClass + */ + InsertItem(index: number, text: string, value: Object, iconCssClass: 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 + * @param text + * @param value + */ + 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 + * @param text + */ + InsertItem(index: number, text: string): void; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; +} +/** + * Represents a client-side equivalent of the BootstrapDateEdit control. + */ +interface BootstrapClientDateEdit extends ASPxClientDateEdit { +} +/** + * Represents a client-side equivalent of the BootstrapDropDownEdit control. + */ +interface BootstrapClientDropDownEdit extends ASPxClientDropDownEdit { +} +/** + * Represents a client-side equivalent of the BootstrapFormLayout control. + */ +interface BootstrapClientFormLayout extends ASPxClientFormLayout { +} +/** + * Represents a client-side equivalent of the BootstrapGridView control. + */ +interface BootstrapClientGridView extends ASPxClientGridView { +} +/** + * Represents a client-side equivalent of the BootstrapHyperLink control. + */ +interface BootstrapClientHyperLink extends ASPxClientHyperLink { +} +interface BootstrapClientImage extends ASPxClientImage { +} +/** + * Represents the client-side equivalent of the BootstrapListEditItem object. + */ +interface BootstrapClientListBoxItem extends ASPxClientListEditItem { + /** + * This member is not in effect for this class. It is overridden only for the purpose of preventing it from appearing in Microsoft Visual Studio designer tools. + */ + imageUrl: string; + iconCssClass: string; + /** + * + * @param columnIndex + */ + GetColumnText(columnIndex: number): string; + /** + * + * @param columnName + */ + GetColumnText(columnName: string): string; + /** + * + * @param fieldIndex + */ + GetFieldText(fieldIndex: number): string; + /** + * + * @param fieldName + */ + GetFieldText(fieldName: string): string; +} +/** + * Represents a client-side equivalent of the BootstrapListBox control. + */ +interface BootstrapClientListBox extends ASPxClientListBox { + /** + * Returns the list box editor's selected item. + */ + GetSelectedItem(): BootstrapClientListBoxItem; + /** + * Sets the list box editor's selected item. + * @param item + */ + SetSelectedItem(item: BootstrapClientListBoxItem): void; + /** + * Returns an item specified by its index within the list box editor's item collection. + * @param index + */ + GetItem(index: number): BootstrapClientListBoxItem; + /** + * Returns an array of the list editor's selected items. + */ + GetSelectedItems(): BootstrapClientListBoxItem[]; + /** + * Selects the specified items within a list box. + * @param items + */ + SelectItems(items: BootstrapClientListBoxItem[]): void; + /** + * Unselects an array of the specified list box items. + * @param items + */ + UnselectItems(items: BootstrapClientListBoxItem[]): void; + /** + * Returns a list box item by its text. + * @param text + */ + FindItemByText(text: string): BootstrapClientListBoxItem; + /** + * Returns a list box item by its value. + * @param value + */ + FindItemByValue(value: Object): BootstrapClientListBoxItem; + /** + * 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 + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + * @param iconCssClass + */ + AddItem(texts: string[], value: Object, iconCssClass: string): number; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param 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 + * @param value + */ + 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 + * @param value + * @param iconCssClass + */ + AddItem(text: string, value: Object, iconCssClass: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param value + * @param iconCssClass + */ + InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param 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 + * @param texts + */ + InsertItem(index: number, texts: string[]): void; + /** + * 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 + * @param text + * @param value + * @param iconCssClass + */ + InsertItem(index: number, text: string, value: Object, iconCssClass: 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 + * @param text + * @param value + */ + 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 + * @param text + */ + InsertItem(index: number, text: string): 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; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; +} +/** + * Represents a client-side equivalent of the BootstrapCheckBoxList control. + */ +interface BootstrapClientCheckBoxList extends ASPxClientCheckBoxList { +} +/** + * Represents a client-side equivalent of the BootstrapRadioButtonList control. + */ +interface BootstrapClientRadioButtonList extends ASPxClientRadioButtonList { +} +/** + * Represents a client-side equivalent of the BootstrapMenu control. + */ +interface BootstrapClientMenu extends ASPxClientMenu { +} +/** + * Represents a client-side equivalent of the BootstrapPager control. + */ +interface BootstrapClientPager extends ASPxClientPager { +} +/** + * Represents a client-side equivalent of the BootstrapPopupControl control. + */ +interface BootstrapClientPopupControl extends ASPxClientPopupControl { + /** + * + * @param selector + */ + SetPopupElementCssSelector(selector: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapPopupMenu control. + */ +interface BootstrapClientPopupMenu extends ASPxClientPopupMenu { + /** + * + * @param selector + */ + SetPopupElementCssSelector(selector: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapProgressBar control. + */ +interface BootstrapClientProgressBar extends ASPxClientProgressBar { +} +/** + * Represents a client-side equivalent of the BootstrapSpinEdit control. + */ +interface BootstrapClientSpinEdit extends ASPxClientSpinEdit { +} +/** + * Represents a client-side equivalent of the BootstrapTabControl control. + */ +interface BootstrapClientTabControl extends ASPxClientTabControl { +} +/** + * Represents a client-side equivalent of the BootstrapPageControl control. + */ +interface BootstrapClientPageControl extends ASPxClientPageControl { +} +/** + * Represents a client-side equivalent of the BootstrapTextBox control. + */ +interface BootstrapClientTextBox extends ASPxClientTextBox { +} +/** + * Represents a client-side equivalent of the BootstrapMemo control. + */ +interface BootstrapClientMemo extends ASPxClientMemo { +} +/** + * Represents a client-side equivalent of the BootstrapButtonEdit control. + */ +interface BootstrapClientButtonEdit extends ASPxClientButtonEdit { +} +/** + * Represents a client-side equivalent of the BootstrapTreeView control. + */ +interface BootstrapClientTreeView extends ASPxClientTreeView { +} +interface BootstrapUIWidgetBase extends ASPxClientControl { + Init: ASPxClientEvent>; + Drawn: ASPxClientEvent>; + Disposing: ASPxClientEvent>; + OptionChanged: ASPxClientEvent>; + Exporting: ASPxClientEvent>; + Exported: ASPxClientEvent>; + FileSaving: ASPxClientEvent>; + IncidentOccurred: ASPxClientEvent>; + GetInstance(): Object; + SetOptions(options: Object): void; + ExportTo(format: string, fileName: string): void; + Print(): void; +} +interface BootstrapUIWidgetInitializedEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetDrawnEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetDisposingEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetExportedEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetOptionChangedEventHandler { + (source: S, e: BootstrapUIWidgetOptionChangedEventArgs): void; +} +interface BootstrapUIWidgetOptionChangedEventArgs extends BootstrapUIWidgetEventArgsBase { + fullName: string; + name: string; + previousValue: Object; + value: Object; +} +interface BootstrapUIWidgetExportingEventHandler { + (source: S, e: BootstrapUIWidgetExportEventArgs): void; +} +interface BootstrapUIWidgetFileSavingEventHandler { + (source: S, e: BootstrapUIWidgetExportEventArgs): void; +} +interface BootstrapUIWidgetExportEventArgs extends BootstrapUIWidgetEventArgsBase { + cancel: boolean; + data: Object; + fileName: string; + format: string; +} +interface BootstrapUIWidgetErrorEventHandler { + (source: S, e: BootstrapUIWidgetErrorEventArgs): void; +} +interface BootstrapUIWidgetErrorEventArgs extends BootstrapUIWidgetEventArgsBase { + target: Object; +} +interface BootstrapUIWidgetElementActionEventArgs extends BootstrapUIWidgetEventArgsBase { + target: Object; +} +interface BootstrapUIWidgetElementClickEventArgs extends BootstrapUIWidgetElementActionEventArgs { + jQueryEvent: Object; +} +/** + * Represents a client-side equivalent of the BootstrapUploadControl. + */ +interface BootstrapClientUploadControl extends ASPxClientUploadControl { +} /** * A client-side counterpart of the Calendar and CalendarFor extensions. */ @@ -15584,6 +19918,12 @@ interface MVCxClientCardView extends ASPxClientCardView { * @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 event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): 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. @@ -15796,6 +20136,12 @@ interface MVCxClientGridView extends ASPxClientGridView { * @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 event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): 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. @@ -16176,9 +20522,9 @@ interface MVCxClientSchedulerTemplateToolTip extends ASPxClientToolTipBase { */ interface MVCxClientSchedulerToolTipDisplayingEventHandler { /** - * - * @param source - * @param e + * A method that will handle the ToolTipDisplaying event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientSchedulerToolTipDisplayingEventArgs object that contains the related arguments. */ (source: S, e: MVCxClientSchedulerToolTipDisplayingEventArgs): void; } @@ -16429,6 +20775,12 @@ interface MVCxClientVerticalGrid extends ASPxClientVerticalGrid { * @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 event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): 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. @@ -16458,6 +20810,11 @@ interface ASPxClientControlBase { * Returns an HTML element that is the root of the control's hierarchy. */ GetMainElement(): Object; + /** + * Specifies the text that Assistive Technologies (screen readers or braille display, for example) will provide to a user. + * @param message A String value that specifies a text. + */ + SendMessageToAssistiveTechnology(message: string): void; /** * Returns a value specifying whether a control is displayed. */ @@ -16576,10 +20933,66 @@ interface ASPxClientCallbackCompleteEventArgs extends ASPxClientEventArgs { */ result: string; } +/** + * 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 ASPxCallbackPanel control. */ -interface ASPxClientCallbackPanel extends ASPxClientControl { +interface ASPxClientCallbackPanel extends ASPxClientPanel { /** * Occurs when a callback for server-side processing is initiated. */ @@ -16721,6 +21134,16 @@ interface ASPxClientProcessingModeCancelEventArgs extends ASPxClientProcessingMo */ cancel: boolean; } +/** + * Provides access to an observable boolean, that allows you to detect and respond to changes. + */ +interface KnockoutObservableBoolean { +} +/** + * Provides access to observable arrays that allow you to detect and respond to changes in a collection of things. + */ +interface KnockoutObservableArray { +} /** * Represents a JavaScript function which receives callback data obtained via a call to a specific client method (such as the PerformDataCallback). */ @@ -16986,17 +21409,23 @@ interface ASPxClientControlsInitializedEventArgs extends ASPxClientEventArgs { */ isCallback: boolean; } +/** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + */ interface ASPxClientControlPredicate { /** - * - * @param control + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + * @param control An object to compare against the criteria defined within the method. */ (control: Object): boolean; } +/** + * Represents a JavaScript function which receives the action to perform for a control when the client ForEachControl method is called. + */ interface ASPxClientControlAction { /** - * - * @param control + * Represents a JavaScript function which receives the action to perform for a control when the client ForEachControl method is called. + * @param control An object that specifies a control. */ (control: Object): void; } @@ -17585,7 +22014,7 @@ interface ASPxClientDockPanel extends ASPxClientPopupControlBase { */ 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. + * Gets a value specifying the position of the current panel, amongst the visible panels within a zone. */ GetVisibleIndex(): number; /** @@ -17855,6 +22284,10 @@ interface ASPxClientFileManager extends ASPxClientControl { * Occurs on the client side after upload of all selected files has been completed. */ FilesUploaded: ASPxClientEvent>; + /** + * Enables you to specify whether the selected file(s) are valid and provide an error text. + */ + FileUploadValidationErrorOccurred: ASPxClientEvent>; /** * Fires on the client side before a file download starts, and allows you to cancel the action. */ @@ -18892,6 +23325,229 @@ interface ASPxClientHiddenField extends ASPxClientControl { */ Contains(propertyName: string): boolean; } +/** + * Represents the client-side equivalent of the ASPxHint control. + */ +interface ASPxClientHint extends ASPxClientControl { + /** + * Occurs on the client side when a hint is about to be shown. + */ + Showing: ASPxClientEvent; + /** + * Occurs on the client side when a hint is about to be hidden. + */ + Hiding: ASPxClientEvent; + /** + * This method is not in effect for a ASPxClientHint object. + */ + GetMainElement(): Object; + /** + * Invokes a hint. + * @param targetElement A HTML DOM element near to which the hint is displayed in response to user interaction. + */ + Show(targetElement: Object): ASPxClientHintWindow; + /** + * Invokes a hint. + * @param targetSelector A string value that is the CSS selector used to specify for which UI elements on a web page a hint is displayed. + */ + Show(targetSelector: string): ASPxClientHintWindow; +} +/** + * Represents the client-side equivalent of the ASPxHint's window. + */ +interface ASPxClientHintWindow { + /** + * Forces the ASPxClientHint's window to recalculate its position. + */ + UpdatePosition(): void; +} +/** + * A method that will handle the Showing event. + */ +interface ASPxClientHintShowingEventHandler { + /** + * A method that will handle the Showing event. + * @param sender The event source. + * @param e A ASPxClientHintShowingEventArgs object that contains the required data. + */ + (sender: ASPxClientHintWindow, e: ASPxClientHintShowingEventArgs): void; +} +/** + * Provides data for the Showing event. + */ +interface ASPxClientHintShowingEventArgs extends ASPxClientEventArgs { + /** + * Gets the object that is the hint's target element. + * Value: An object representing the hint's target element related to the event. + */ + targetElement: Object; + /** + * Gets the object that is the hint. + * Value: An object representing the hint related to the event. + */ + hintElement: Object; + /** + * Gets the object that is the hint's content. + * Value: An object representing the hint's content element related to the event. + */ + contentElement: Object; + /** + * Gets the object that is the hint's title. + * Value: An object representing the hint's title element related to the event. + */ + titleElement: Object; +} +/** + * A method that will handle the Hiding event. + */ +interface ASPxClientHintHidingEventHandler { + /** + * A method that will handle the Hiding event. + * @param sender The event source. + * @param e A ASPxClientHintHidingEventArgs object that contains the required data. + */ + (sender: ASPxClientHintWindow, e: ASPxClientHintHidingEventArgs): void; +} +/** + * Provides data for the Hiding event. + */ +interface ASPxClientHintHidingEventArgs extends ASPxClientEventArgs { + /** + * Gets the object that is the hint's target element. + * Value: An object representing the hint's target element. + */ + targetElement: Object; + /** + * Gets the object that is the hint element. + * Value: An object representing the hint related to the event. + */ + hintElement: Object; + /** + * Gets the object that is the hint's content. + * Value: An object representing the hint's content element related to the event. + */ + contentElement: Object; + /** + * Gets the object that is the hint's title. + * Value: An object representing the hint's title element related to the event. + */ + titleElement: Object; + /** + * Gets or sets a value indicating whether the event should be canceled. + * Value: true, if the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * The hint control's options. + */ +interface ASPxClientHintOptions { + /** + * Gets or sets which user action triggers a hint. + * Value: A string value that is a user action. + */ + triggerAction: string; + /** + * Gets or sets the delay in displaying the hint. + * Value: An integer value that specifies the time interval, in milliseconds, after which a hint is displayed. + */ + appearAfter: number; + /** + * Gets or sets the duration after which a hint disappears when the mouse pointer is no longer positioned over the target element. + * Value: The length of time (in milliseconds) a hint is displayed after the mouse pointer is no longer positioned over the target element. + */ + disappearAfter: number; + /** + * Gets or sets a value that specifies whether a hint is displayed in a callout box. + * Value: true, to display a hint in a callout box; otherwise, false. + */ + showCallout: boolean; + /** + * Gets or sets where a hint should be positioned. + * Value: A string value that specifies a hint position. + */ + position: string; + /** + * Gets or sets a custom CSS class name that will be assigned to the root ASPxHint element. + * Value: A string value that is the CSS class name. + */ + className: string; + /** + * Gets or sets the attribute name. + * Value: A string value that is the attribute name. + */ + contentAttribute: string; + /** + * Gets or sets the attribute name. + * Value: A string value that is the attribute name. + */ + titleAttribute: string; + /** + * Gets or sets the hint's content. + * Value: A string value that is the hint's content. + */ + content: string; + /** + * Gets or sets a value that is the hint's title. + * Value: A string value that is the title text. + */ + title: string; + /** + * Gets or sets a value that is the HTML DOM-element. + * Value: A string that is the DOM-element. + */ + container: string; + /** + * A handler for the Showing event. + * Value: An delegate method allowing you to implement custom processing. + */ + onShowing: ASPxClientHintShowingEventHandler; + /** + * A handler for the Hiding event. + * Value: An delegate method allowing you to implement custom processing. + */ + onHiding: ASPxClientHintHidingEventHandler; + /** + * Gets or sets a value that is the hint's width. + * Value: A string value that is the hint's width. + */ + width: string; + /** + * Gets or sets a value that is the hint's height. + * Value: A string value that is the hint's height. + */ + height: string; + /** + * Gets or sets the X coordinate. + * Value: An integer value that is the X coordinate. + */ + x: number; + /** + * Gets or sets the Y coordinate. + * Value: An integer value that is the Y coordinate. + */ + y: number; + /** + * Gets or sets a value that specifies whether to flip the hint to the opposite position relative to the target element. + * Value: true, to flip the hint; otherwise, false. + */ + allowFlip: boolean; + /** + * Gets or sets a value that specifies whether to shift a hint if its content and title are hidden outside of the client area. + * Value: true, to shift the hint; otherwise, false. + */ + allowShift: boolean; + /** + * Gets or sets whether it should use animation effects when a hint appears. + * Value: true if animation is enabled; otherwise false. + */ + animation: any; + /** + * Gets the offset of a hint. + * Value: An integer value. + */ + offset: number; +} /** * The client-side equivalent of the ASPxImageGallery control. */ @@ -19163,6 +23819,20 @@ interface ASPxClientLoadingPanel extends ASPxClientControl { */ Hide(): void; } +/** + * Represents the client-side equivalent of the area that is used within the Html Editor's media dialogs. + */ +interface ASPxClientMediaFileSelector extends ASPxClientControl { + /** + * Returns a URL text from the URL text box in Html Editor's media dialogs. + */ + GetUrl(): string; + /** + * Sets a URL text in the Html Editor's media dialogs. + * @param url A string value that is the Url text. + */ + SetUrl(url: string): void; +} /** * Serves as the base type for the ASPxClientPopupMenu objects. */ @@ -19839,60 +24509,9 @@ interface ASPxClientFlashScriptCommandEventArgs extends ASPxClientEventArgs { interface ASPxClientOfficeDocumentLinkType { } /** - * Serves as the base class for controls that implement panel functionality. + * Represents the client-side equivalent of the ASPxPager control. */ -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; +interface ASPxClientPager extends ASPxClientControl { } /** * Represents a client-side equivalent of the ASPxPopupControl control. @@ -21728,6 +26347,10 @@ interface ASPxClientUploadControl extends ASPxClientControl { * Occurs on the client side when the file input elements count is changed. */ FileInputCountChanged: ASPxClientEvent>; + /** + * Enables you to specify whether the selected file(s) are valid and provide an error text. + */ + ValidationErrorOccurred: ASPxClientEvent>; /** * Fires when the mouse enters a drop zone or an external drop zone element while dragging a file. */ @@ -21736,6 +26359,10 @@ interface ASPxClientUploadControl extends ASPxClientControl { * Fires when the mouse leaves a drop zone or an external drop zone element while dragging a file. */ DropZoneLeave: ASPxClientEvent>; + /** + * Specifies whether the upload control's Advanced mode is enabled. + */ + IsAdvancedModeEnabled(): boolean; /** * Initiates uploading of the specified file to the web server's memory. */ @@ -21754,6 +26381,16 @@ interface ASPxClientUploadControl extends ASPxClientControl { * @param fileIndex An integer value that is the zero-based index of an item in the file list. */ RemoveFileFromSelection(fileIndex: number): void; + /** + * Removes the specified file from the list of files selected for uploading in the upload control. + * @param file An ASPxClientUploadControl object that is the file to be removed from the list of files. + */ + RemoveFileFromSelection(file: ASPxClientUploadControlFile): void; + /** + * Returns files selected for uploading within the specified file input. + * @param inputIndex An integer value that specifies the index of a file input. Default value is "0". + */ + GetSelectedFiles(inputIndex: number): ASPxClientUploadControlFile[]; /** * 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. @@ -21973,6 +26610,112 @@ interface ASPxClientUploadControlUploadingProgressChangedEventArgs extends ASPxC */ progress: number; } +/** + * A method that will handle the ValidationErrorOccurred client event. + */ +interface ASPxClientUploadControlValidationErrorOccurredEventHandler { + /** + * A method that will handle the ValidationErrorOccurred event. + * @param source The event source. + * @param e An ASPxClientUploadControlValidationErrorOccurredEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlValidationErrorOccurredEventArgs): void; +} +/** + * Provides data for the ValidationErrorOccurred event. + */ +interface ASPxClientUploadControlValidationErrorOccurredEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets the error text. + * Value: A string value that represents the error text. + */ + errorText: string; + /** + * Gets or sets a value specifying whether an alert message is displayed when the ValidationErrorOccurred event fires. + * Value: true, to display an alert message; otherwise, false. + */ + showAlert: boolean; + /** + * Gets the validation settings for the selected files. + * Value: An ASPxClientUploadControlValidationSettings object that provides validation settings. + */ + validationSettings: ASPxClientUploadControlValidationSettings; + /** + * Returns an array of invalid files. + * Value: An array of the ASPxClientUploadControlInvalidFileInfo objects. + */ + invalidFiles: ASPxClientUploadControlInvalidFileInfo[]; +} +/** + * Contains settings that relate to the ValidationErrorOccurred client event. + */ +interface ASPxClientUploadControlValidationSettings { + /** + * Gets the maximum file size. + * Value: An value that specifies the maximum file size, in bytes. + */ + maxFileSize: any; + /** + * Gets the maximum count of files that can be selected for uploading at once. + * Value: An integer value that specifies the maximum count of files. + */ + maxFileCount: number; + /** + * Gets the allowed file extensions. + * Value: An array of string values that contains file extensions that are allowed. + */ + allowedFileExtensions: string[]; + /** + * Gets which characters in a file name are not allowed. + * Value: An array of string values that contains characters that are not allowed. + */ + invalidFileNameCharacters: string[]; +} +/** + * Contains settings of the file that hasn't passed validation. + */ +interface ASPxClientUploadControlInvalidFileInfo { + /** + * Gets the name of the invalid file. + * Value: A string value that specifies the file name. + */ + fileName: string; + /** + * Gets the size of the invalid file. + * Value: An integer value that specifies the file size. + */ + fileSize: number; + /** + * Gets the error type. + * Value: An ASPxClientUploadControlValidationErrorTypeConsts object that provides possible types of errors. + */ + errorType: ASPxClientUploadControlValidationErrorTypeConsts; +} +/** + * Declares client constants containing codes of validation errors that can occur while selecting files for uploading. + */ +interface ASPxClientUploadControlValidationErrorTypeConsts { +} +/** + * Represents a client file that corresponds to a particular file selected for uploading in the upload control. + */ +interface ASPxClientUploadControlFile { + /** + * Gets the name of the file selected for uploading. + * Value: A string value that specifies the file's name. + */ + name: string; + /** + * Gets the size of the file selected for uploading. + * Value: An Int64 value specifying the file's size, in bytes. + */ + size: any; + /** + * Provides access to the file as a native Javascript object. + * Value: A JavaScript object that is the file selected for uploading. + */ + sourceFileObject: any; +} /** * A method that will handle the DropZoneEnter event. */ @@ -22919,6 +27662,12 @@ interface ASPxClientXYDiagram2D extends ASPxClientXYDiagramBase { * @param pane An ASPxClientXYDiagramPane object, representing the pane. */ DiagramToPoint(argument: Object, value: Object, axisX: ASPxClientAxis2D, axisY: ASPxClientAxis2D, pane: ASPxClientXYDiagramPane): ASPxClientControlCoordinates; + /** + * Shows the Crosshair Cursor at the point with the specified coordinates. + * @param screenX The horizontal coordinate that is related to the top-left angle of the chart. + * @param screenY The vertical coordinate that is related to the top-left angle of the chart. + */ + ShowCrosshair(screenX: number, screenY: number): void; } /** * Represents the client-side equivalent of the XYDiagram class. @@ -23941,6 +28690,16 @@ interface ASPxClientCrosshairOptions extends ASPxClientWebChartEmptyElement { * Value: A String, which represents the group header's pattern. */ groupHeaderPattern: string; + /** + * Gets a value that specifies whether the Crosshair cursor should show points that are out of visual range. + * Value: true if the out of visual range points should be shown in the Crosshair label; otherwise false. + */ + showOutOfRangePoints: boolean; + /** + * Gets the identifier specifying the behavior of the selection of points shown in the crosshair label. + * Value: The selection behavior identifier. + */ + valueSelectionMode: string; /** * Gets the color of a crosshair argument line. * Value: A String value, specifying the color of a crosshair argument line. @@ -24267,69 +29026,9 @@ 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. + * @param e An ASPxClientCustomizeMenuActionsEventArgs 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; + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; } /** * The client-side equivalent of the Web Report Designer control. @@ -24352,7 +29051,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ SaveCommandExecute: ASPxClientEvent>; /** - * Enables you to customize the menu actions of a Web Report Designer. + * Enables you to customize the menu actions of the Web Report Designer. */ CustomizeMenuActions: ASPxClientEvent>; /** @@ -24367,6 +29066,78 @@ interface ASPxClientReportDesigner extends ASPxClientControl { * Occurs on the client side when the Report Designer is being closed. */ ExitDesigner: ASPxClientEvent>; + /** + * Occurs when a report is about to be saved in the Web Report Designer. + */ + ReportSaving: ASPxClientEvent>; + /** + * Occurs when a report has been saved in the Web Report Designer. + */ + ReportSaved: ASPxClientEvent>; + /** + * Occurs when a report is about to be opened in the Web Report Designer. + */ + ReportOpening: ASPxClientEvent>; + /** + * Occurs when a report has been opened in the Web Report Designer. + */ + ReportOpened: ASPxClientEvent>; + /** + * Occurs on the client each time a server-side error raises. + */ + OnServerError: ASPxClientEvent>; + /** + * Occurs after a component has been added to the report currently being edited in the Web Report Designer. + */ + ComponentAdded: ASPxClientEvent>; + /** + * Enables you to customize UI elements of the Web Report Designer. + */ + CustomizeElements: ASPxClientEvent>; + /** + * Enables you to customize the Save dialog of the Web Report Designer. + */ + CustomizeSaveDialog: ASPxClientEvent>; + /** + * Enables you to customize the Save Report dialog of the Web Report Designer. + */ + CustomizeSaveAsDialog: ASPxClientEvent>; + /** + * Enables you to customize the Open Report dialog of the Web Report Designer. + */ + CustomizeOpenDialog: ASPxClientEvent>; + /** + * Enables you to customize the Toolbox of the Web Report Designer. + */ + CustomizeToolbox: ASPxClientEvent>; + /** + * Occurs after a report has been switched to Print Preview. + */ + PreviewDocumentReady: ASPxClientEvent>; + /** + * Occurs each time a value of an editing field changes in Print Preview. + */ + PreviewEditingFieldChanged: ASPxClientEvent>; + /** + * Enables you to customize UI elements of a Document Viewer built into a Web Report Designer. + */ + PreviewCustomizeElements: ASPxClientEvent>; + /** + * Enables you to customize the actions of a Document Viewer built into a Web Report Designer. + */ + PreviewCustomizeMenuActions: ASPxClientEvent>; + /** + * Occurs when the left mouse button has been clicked over a report document in Print Preview. + */ + PreviewClick: ASPxClientEvent>; + /** + * Occurs after report parameter values have been reset to their default values in Print Preview. + */ + PreviewParametersReset: ASPxClientEvent>; + /** + * Occurs after report parameter values have been submitted in Print Preview. + */ + PreviewParametersSubmitted: ASPxClientEvent>; /** * Sends a callback to the server with the specified argument. * @param arg A String value, specifying the callback argument. @@ -24387,16 +29158,30 @@ interface ASPxClientReportDesigner extends ASPxClientControl { * Returns the object model of a Web Report Designer. */ GetDesignerModel(): Object; + /** + * Provides access to the preview model of the ASPxClientReportDesigner. + */ + GetPreviewModel(): Object; + /** + * Returns information about the specified property of the specified control. + * @param controlType A string that specifies the control type. + * @param path A string that specifies the path to the property. + */ + GetPropertyInfo(controlType: string, path: string): ASPxDesignerElementSerializationInfo; + /** + * Returns information about the specified properties of the specified control. + * @param controlType A string that specifies the control type. + * @param path An array of strings that specify paths to properties. + */ + GetPropertyInfo(controlType: string, path: string[]): ASPxDesignerElementSerializationInfo; + /** + * Returns actions performed by buttons available in the menu and toolbar of the Web Report Designer. + */ + GetButtonStorage(): 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. */ @@ -24405,6 +29190,76 @@ interface ASPxClientReportDesigner extends ASPxClientControl { * Resets the value returned by the IsModified method. */ ResetIsModified(): void; + /** + * Adds a custom property to the Properties Panel. + * @param groupName A string that specifies the name of group to which a property should be added. + * @param property An object that provides information required to serialize a property. + */ + AddToPropertyGrid(groupName: string, property: ASPxDesignerElementSerializationInfo): void; + /** + * Adds a custom parameter type to the Web End-User Report Designer. + * @param parameterInfo An object that provides information about a parameter type to be added. + * @param editorOptions An object that provides information about an editor used to specify parameter values in design mode. + */ + AddParameterType(parameterInfo: ASPxDesignerParameterType, editorOptions: ASPxDesignerEditorOptions): void; + /** + * Removes the specified parameter type from the Web End-User Report Designer. + * @param parameterType A string that specifies a parameter type to be deleted. + */ + RemoveParameterType(parameterType: string): void; + /** + * Returns an object that contains information on the specified parameter type. + * @param parameterType A string that specifies a parameter type. + */ + GetParameterInfo(parameterType: string): ASPxDesignerParameterType; + /** + * Returns a value editor associated with the specified parameter type. + * @param parameterType A string that specifies a parameter type. + */ + GetParameterEditor(parameterType: string): ASPxDesignerEditorOptions; + /** + * Returns the report layout stored in a report storage under the specified URL. + * @param url A string that specifies the report URL. + */ + ReportStorageGetData(url: string): any; + /** + * Stores the specified report to a report storage using the specified URL. + * @param reportLayout A string that specifies the report layout to be saved. + * @param url A string that specifies the URL used to save a report. + */ + ReportStorageSetData(reportLayout: string, url: string): any; + /** + * Stores the specified report to a report storage using a new URL. + * @param reportLayout A string that specifies the report layout to be saved. + * @param url A string that specifies the default report URL. + */ + ReportStorageSetNewData(reportLayout: string, url: string): any; + /** + * Saves the current report. + */ + SaveReport(): any; + /** + * Closes the report tab currently being opened in the Web Report Designer. + */ + CloseCurrentTab(): void; + /** + * Saves the current report under a new name. + * @param reportName A string that specifies the report name. + */ + SaveNewReport(reportName: string): any; + /** + * Returns the report URLs and display names existing in a report storage. + */ + ReportStorageGetUrls(): any; + /** + * Opens the specified report on the client side of the Web Report Designer. + * @param url A string that specifies the URL of a report to be opened. + */ + OpenReport(url: string): void; + /** + * Switches the Web Report Designer to the preview mode. + */ + ShowPreview(): void; } /** * A method that will handle the SaveCommandExecute event. @@ -24427,6 +29282,114 @@ interface ASPxClientReportDesignerSaveCommandExecuteEventArgs extends ASPxClient */ handled: boolean; } +/** + * Provides data for the ExitDesigner event. + */ +interface ASPxClientReportDesignerExitDesignerEventArgs extends ASPxClientEventArgs { +} +/** + * Provides data for the events related to opening and saving reports in the Web Report Designer. + */ +interface ASPxClientReportDesignerDialogEventArgs extends ASPxClientEventArgs { + /** + * Specifies the URL of the report currently being processed. + * Value: A string that specifies the URL of the report currently being processed. + */ + Url: string; + /** + * Specifies the report currently being processed. + * Value: An object that specifies the report currently being processed. + */ + Report: Object; + /** + * Specifies whether or not the operation performed with a report should be canceled. + * Value: true, if the operation should be canceled; otherwise, false. + */ + Cancel: boolean; +} +/** + * Provides data for the OnServerError event. + */ +interface ASPxClientReportDesignerErrorEventArgs extends ASPxClientEventArgs { + /** + * Provides access to information about a server-side error. + * Value: An object that provides information about an error. + */ + Error: Object; +} +/** + * Provides data for the ComponentAdded event. + */ +interface ASPxClientReportDesignerComponentAddedEventArgs extends ASPxClientEventArgs { + /** + * Gets the model of a component that has been added to a report. + * Value: An object that specifies the component model. + */ + Model: Object; + /** + * Gets the parent of a component that has been added to a report. + * Value: An object that specifies the component parent. + */ + Parent: Object; +} +/** + * Provides data for the CustomizeSaveDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveDialogEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the Save dialog. + * Value: An object that specifies the Save dialog. + */ + Popup: ASPxDesignerSaveDialog; + /** + * Customizes the Save dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model A model of the Save dialog. + */ + Customize(template: string, model: ASPxDesignerDialogModel): void; +} +/** + * Provides data for the CustomizeSaveAsDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveAsDialogEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the Save Report dialog. + * Value: An object that specifies the Save Report dialog. + */ + Popup: ASPxDesignerSaveAsDialog; + /** + * Customizes the Save Report dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model A model of the Save Report dialog. + */ + Customize(template: string, model: ASPxDesignerDialogModel): void; +} +/** + * Provides data for the CustomizeOpenDialog event. + */ +interface ASPxClientReportDesignerCustomizeOpenDialogEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the Open Report dialog. + * Value: An object that specifies the Open Report dialog. + */ + Popup: ASPxDesignerOpenDialog; + /** + * Customizes the Open Report dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model A model of the Open Report dialog. + */ + Customize(template: string, model: ASPxDesignerDialogModel): void; +} +/** + * Provides data for the CustomizeToolbox event. + */ +interface ASPxClientReportDesignerCustomizeToolboxEventArgs extends ASPxClientEventArgs { + /** + * Provides information about all controls available in the Toolbox. + * Value: An ASPxDesignerControlsFactory object that provides information about toolbox controls. + */ + ControlsFactory: ASPxDesignerControlsFactory; +} /** * A method that will handle the CustomizeMenuActions event. */ @@ -24434,76 +29397,19 @@ 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. + * @param e An ASPxClientCustomizeMenuActionsEventArgs object that contains data related to the event. */ - (source: S, e: ASPxClientReportDesignerCustomizeMenuActionsEventArgs): void; + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; } /** - * Provides settings to the actions listed in a Web Report Designer menu. + * A method that will handle the CustomizeParameterLookUpSource event. */ -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 { -} interface ASPxClientReportDesignerCustomizeParameterLookUpSourceEventHandler { + /** + * A method that will handle the CustomizeParameterLookUpSource event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterLookUpSourceEventArgs object that contains data related to the event. + */ (source: S, e: ASPxClientCustomizeParameterLookUpSourceEventArgs): void; } /** @@ -24517,6 +29423,17 @@ interface ASPxClientReportDesignerCustomizeParameterEditorsEventHandler { */ (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; } +/** + * A method that will handle the CustomizeElements event. + */ +interface ASPxClientReportDesignerCustomizeElementsEventHandler { + /** + * A method that will handle the CustomizeElements event. + * @param source The event sender. + * @param e An ASPxClientCustomizeElementsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeElementsEventArgs): void; +} /** * A method that will handle the ExitDesigner event. */ @@ -24528,6 +29445,422 @@ interface ASPxClientReportDesignerExitDesignerEventHandler { */ (source: S, e: ASPxClientReportDesignerExitDesignerEventArgs): void; } +/** + * A method that will handle the ReportSaving event. + */ +interface ASPxClientReportDesignerReportSavingEventHandler { + /** + * A method that will handle the ReportSaving event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the ReportSaved event. + */ +interface ASPxClientReportDesignerReportSavedEventHandler { + /** + * A method that will handle the ReportSaved event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the ReportOpening event. + */ +interface ASPxClientReportDesignerReportOpeningEventHandler { + /** + * A method that will handle the ReportOpening event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the ReportOpened event. + */ +interface ASPxClientReportDesignerReportOpenedEventHandler { + /** + * A method that will handle the ReportOpened event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the OnServerError event. + */ +interface ASPxClientReportDesignerErrorEventHandler { + /** + * A method that will handle the OnServerError event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerErrorEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerErrorEventArgs): void; +} +/** + * A method that will handle the ComponentAdded event. + */ +interface ASPxClientReportDesignerComponentAddedEventHandler { + /** + * A method that will handle the ComponentAdded event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerComponentAddedEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerComponentAddedEventArgs): void; +} +/** + * A method that will handle the CustomizeSaveDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveDialogEventHandler { + /** + * A method that will handle the CustomizeSaveDialog event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeSaveDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeSaveDialogEventArgs): void; +} +/** + * A method that will handle the CustomizeSaveAsDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveAsDialogEventHandler { + /** + * A method that will handle the CustomizeSaveAsDialog event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeSaveAsDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeSaveAsDialogEventArgs): void; +} +/** + * A method that will handle the CustomizeOpenDialog event. + */ +interface ASPxClientReportDesignerCustomizeOpenDialogEventHandler { + /** + * A method that will handle the CustomizeOpenDialog event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeOpenDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeOpenDialogEventArgs): void; +} +/** + * A method that will handle the CustomizeToolbox event. + */ +interface ASPxClientReportDesignerCustomizeToolboxEventHandler { + /** + * A method that will handle the CustomizeToolbox event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeToolboxEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeToolboxEventArgs): void; +} +/** + * Provides information about a value editor used in the Property Grid. + */ +interface ASPxDesignerEditorOptions { + /** + * Provides access to the name of an HTML template specifying the editor and header of a complex object. + * Value: A string that specifies the HTML template. + */ + header: string; + /** + * Provides access to the name of an HTML template used by a complex object's editor. + * Value: A string that specifies the name of an HTML template. + */ + content: string; + /** + * Provides access to the type of the editor model. + * Value: An object that specifies the editor type. + */ + editorType: Object; +} +/** + * Provides functionality to an undo/redo engine in the Web Report Designer. + */ +interface ASPxDesignerUndoEngine { + /** + * Provides access to a value that specifies whether or not the redo action can currently be performed. + * Value: A knockout observable boolean object, whose value is true if the redo action can be performed, and false otherwise. + */ + redoEnabled: any; + /** + * Provides access to a value that specifies whether or not the undo action can currently be performed. + * Value: A knockout observable boolean object, whose value is true if the undo action can be performed, and false otherwise. + */ + undoEnabled: any; + /** + * Provides access to a value that specifies whether or not a report has been changed. + * Value: A knockout observable boolean object, whose value is true if the report has been modified, and false otherwise. + */ + isDirty: any; + /** + * Undoes all changes made to a report. + */ + undoAll(): void; + /** + * Clears information about edit operations made to a report, so they cannot not be undone. + */ + clearHistory(): void; + /** + * Undoes the last edit action in a report. + */ + undo(): void; + /** + * Reverses the results of the last undo action. + */ + redo(): void; +} +/** + * Provides functionality for a tab displayed a report in the Web Report Designer. + */ +interface ASPxDesignerNavigateTab { + /** + * Provides access to a value that specifies the display name of the current tab. + * Value: A knockout computed string that specifies the tab's display name. + */ + displayName: any; + /** + * Provides access to a value that specifies whether or not the report in the current tab has been changed. + * Value: A knockout computed boolean object, whose value is true if the report has been modified, and false otherwise. + */ + isDirty: any; + /** + * Provides access to a report opened in the current tab. + * Value: A knockout observable object that specifies a report opened in the current tab. + */ + report: any; + /** + * Provides access to an engine that manages undo and redo operations in the Web Report Designer. + * Value: An object that specifies an undo/redo engine. + */ + undoEngine: ASPxDesignerUndoEngine; + /** + * Provides access to the URL of a report opened in the current tab. + * Value: A knockout observable string that specifies the report URL. + */ + url: any; +} +/** + * A model of dialogs used to save and open reports in the Web Report Designer. + */ +interface ASPxDesignerDialogModel { + /** + * Provides access to the collection of buttons displayed in a dialog. + * Value: An array of objects that specify buttons displayed in a dialog. + */ + popupButtons: Object[]; + /** + * Specifies a function that gets the report URL. + */ + getUrl(): string; + /** + * Specifies a function that sets the report URL. + * @param url A string that specifies the report URL. + */ + setUrl(url: string): void; + /** + * Specifies a function to be executed when showing a dialog. + * @param tab An object that specifies the report tab for which a dialog is invoked. + */ + onShow(tab: ASPxDesignerNavigateTab): void; +} +/** + * Provides the base functionality for dialogs used to open and save reports on the client side of the Web Report Designer. + */ +interface ASPxDesignerReportDialogBase { + /** + * Provides access to a dialog's width. + * Value: A knockout observable object that specifies a dialog's width. + */ + width: any; + /** + * Provides access to a dialog's height. + * Value: A knockout observable object that specifies a dialog's height. + */ + height: any; + /** + * Provides access to the name of an HTML template used by a dialog. + * Value: A knockout observable string that specifies the name of the HTML template used by a dialog. + */ + template: any; + /** + * Provides access to buttons displayed in a dialog. + * Value: An array of objects that specify buttons displayed in the dialog. + */ + buttons: Object[]; + /** + * Provides access to a dialog's model. + * Value: A knockout observable object of the ASPxDesignerDialogModel type. + */ + model: any; + /** + * Provides access to a report tab for which a dialog appears. + * Value: A knockout observable object of the ASPxDesignerNavigateTab type. + */ + tab: any; + /** + * Provides access to a value that specifies a dialog's visibility state. + * Value: true, if the dialog is visible; otherwise, false; + */ + visible: any; + /** + * Provides access to a dialog's title. + * Value: A string that specifies a dialog's title. + */ + title: string; + /** + * Shows the dialog for the specified report tab. + * @param tab A report tab for which the dialog should be shown. + */ + show(tab: ASPxDesignerNavigateTab): void; + /** + * Customizes the dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model An object that specifies the dialog model. + */ + customize(template: string, model: ASPxDesignerDialogModel): void; + /** + * Cancels the dialog. + */ + cancel(): void; +} +/** + * Provides functionality for the Save dialog on the client side of the Web Report Designer. + */ +interface ASPxDesignerSaveDialog extends ASPxDesignerReportDialogBase { + /** + * Provides access to the Save Report dialog that appears if a user selected to save changes in the Save dialog. + * Value: An object that specifies the Save As dialog. + */ + saveReportDialog: ASPxDesignerSaveAsDialog; + /** + * Saves the report with the specified URL. + * @param url A string that specifies an URL of the report to be saved. + */ + save(url: string): void; + /** + * Closes the dialog without saving the current report. + */ + notSave(): void; +} +/** + * Provides functionality for the Save Report dialog on the client side of the Web Report Designer. + */ +interface ASPxDesignerSaveAsDialog extends ASPxDesignerReportDialogBase { + /** + * Saves the report with the specified URL. + * @param url A string that specifies a URL of the report to be saved. + */ + save(url: string): void; +} +/** + * Provides functionality for the Open Report dialog on the client side of the Web Report Designer. + */ +interface ASPxDesignerOpenDialog extends ASPxDesignerReportDialogBase { + /** + * Opens the report with the specified URL. + * @param url A string that specifies an URL of the report to be opened. + */ + open(url: string): void; +} +/** + * Provides information about a toolbox control item. + */ +interface ASPxDesignerToolboxItem { + /** + * Provides access to information required to serialize a toolbox control. + * Value: An array of ASPxDesignerElementSerializationInfo objects that provide information required to serialize an element. + */ + info: ASPxDesignerElementSerializationInfo[]; + /** + * Provides access to a surface type of toolbox control. + * Value: A surface type of toolbox control. + */ + surfaceType: any; + /** + * Provides access to a toolbox control type. + * Value: A toolbox control type. + */ + type: any; + /** + * Provides access to a zero-based index of a control in the toolbox. + * Value: An integer value that specifies a control index in the toolbox. + */ + toolboxIndex: number; + /** + * Provides access to the default property values used for a toolbox control. + * Value: An object that specifies default propery values. + */ + defaultVal: Object; + /** + * Provides access to popular properties of a toolbox control. + * Value: An array of strings that specify names of popular properties. + */ + popularProperties: string[]; + /** + * Gets whether a control item is displayed in a toolbox. + * Value: true, if the control is available in the toolbox; otherwise, false. + */ + isToolboxItem: boolean; +} +/** + * Enables you to customize controls available in the Toolbox of the Web Report Designer. + */ +interface ASPxDesignerControlsFactory { + /** + * Returns information about the specified toolbox control. + * @param controlType A string that specifies the control type. + */ + getControlInfo(controlType: string): ASPxDesignerToolboxItem; + /** + * Returns a control type by the specified model. + * @param model An object that specifies the control model. + */ + getControlType(model: Object): string; + /** + * Registers the specified control in the Toolbox of the Web Report Designer. + * @param typeName A string that specifies the name of a custom control. + * @param metadata An ASPxDesignerToolboxItem object that provides information about a toolbox item. + */ + registerControl(typeName: string, metadata: ASPxDesignerToolboxItem): void; + /** + * Returns information about the specified property of the specified control. + * @param controlType A string that specifies the control type. + * @param propertyDisplayName A string that specifies the property display name. + */ + getPropertyInfo(controlType: string, propertyDisplayName: string): ASPxDesignerElementSerializationInfo; +} +/** + * Provides information about a report parameter type. + */ +interface ASPxDesignerParameterType { + /** + * Provides access to an actual parameter type. + * Value: A string that specifies the parameter type. + */ + value: string; + /** + * Provides access to a text displayed to end-users when creating parameters of the current type. + * Value: A string displayed to end-users. + */ + displayValue: string; + /** + * Provides access to the default value for parameters of the current type. + * Value: An object that specifies the default value. + */ + defaultVal: Object; + /** + * Provides access to the specifics of a current parameter type. + * Value: Parameter type specifics. + */ + specifics: string; + /** + * Converts the specified parameter value to the current parameter type. + * @param val An object that specifies the parameter value to be converted. + */ + valueConverter(val: Object): Object; +} /** * The client-side equivalent of the ASPxClientDocumentViewer control's Document Map. */ @@ -24562,8 +29895,19 @@ interface ASPxClientReportParametersPanel extends ASPxClientControl { */ GetEditorByParameterName(parameterName: string): ASPxClientControl; } +/** + * Provides information about a report parameter on the client side. + */ interface ASPxClientReportParameterInfo { + /** + * Specifies the parameter path, relative to its parent container (e.g., "subreport1.subreportParameter1" for a subreport's parameter, or "parameter1" for a report's parameter). + * Value: A String value, specifying the parameter path (e.g., "subreport1.subreportParameter1"). + */ Path: string; + /** + * Provides access to a parameter value on the client. + * Value: A Object value. + */ Value: Object; } /** @@ -24638,11 +29982,19 @@ interface ASPxClientReportViewer extends ASPxClientControl { */ IsSearchAllowed(): boolean; } +/** + * A method that will handle the PageLoad events. + */ interface ASPxClientReportViewerPageLoadEventHandler { + /** + * A method that will handle the PageLoad event. + * @param source The event sender. + * @param e An ASPxClientReportViewerPageLoadEventArgs object that contains data related to the event. + */ (source: S, e: ASPxClientReportViewerPageLoadEventArgs): void; } /** - * Provides data for a Report Viewer's PageLoad event on the client side. + * Provides data for the PageLoad events on the client side. */ interface ASPxClientReportViewerPageLoadEventArgs extends ASPxClientEventArgs { /** @@ -24679,11 +30031,116 @@ interface ASPxClientCustomizeParameterEditorsEventArgs extends ASPxClientEventAr */ info: ASPxDesignerElementSerializationInfo; } +/** + * Provides data for the CustomizeParameterLookUpSource events. + */ interface ASPxClientCustomizeParameterLookUpSourceEventArgs extends ASPxClientEventArgs { + /** + * Provides access to an object that stores information about a parameter. + * Value: An ASPxDesignerElementParameterDescriptor object that stores information about the parameter. + */ parameter: ASPxDesignerElementParameterDescriptor; + /** + * Provides access to the collection of look-up parameter values. + * Value: An array of ASPxDesignerElementEditorItem objects that store information about look-up parameter values. + */ items: ASPxDesignerElementEditorItem[]; + /** + * Specifies the data source that provides look-up values for the parameter editor. + * Value: An Object specifying the data source that provides look-up values to the parameter editor. + */ dataSource: Object; } +/** + * Provides information about a command available in the toolbar or menu. + */ +interface ASPxClientMenuAction { + /** + * Provides access to the text for the command. + * Value: A string that is the command text. + */ + text: string; + /** + * Provides access to the CSS class of the command's glyph. + * Value: A string that specifies the name of the CSS class. + */ + imageClassName: string; + /** + * Provides access to the action performed when a 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 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: An ASPxClientMenuActionHotKey object that specifies the keyboard shortcut. + */ + hotKey: ASPxClientMenuActionHotKey; + /** + * 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 a value that specifies the command location. + * Value: A string that specifies the command location. + */ + container: string; +} +/** + * Provides information about a hot key used to perform an action assigned to a menu item. + */ +interface ASPxClientMenuActionHotKey { + /** + * Provides access to a hot key code. + * Value: An integer value that specifies the hot key code. + */ + keyCode: number; + /** + * Provides access to a value that specifies whether the CTRL key is used in combination with a hot key. + * Value: true, if the CTRL key is included into the key combination; otherwise, false. + */ + ctrlKey: boolean; +} +/** + * Provides data for the CustomizeMenuActions. + */ +interface ASPxClientCustomizeMenuActionsEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the collection of actions available in the toolbar and menu. + * Value: An array of ASPxClientMenuAction objects. + */ + Actions: ASPxClientMenuAction[]; + /** + * Returns a menu action with the specified ID. + * @param actionId A String value that specifies the action ID. + */ + GetById(actionId: string): ASPxClientMenuAction; +} +/** + * Provides data for the CustomizeElements events. + */ +interface ASPxClientCustomizeElementsEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the collection of UI elements. + * Value: An array of the ASPxReportUIElement objects. + */ + Elements: ASPxReportUIElement[]; + /** + * Returns UI elements with the specified ID. + * @param templateId A string that specifies the element ID. + */ + GetById(templateId: string): ASPxReportUIElement[]; +} /** * Provides general information about a report parameter. */ @@ -24793,6 +30250,11 @@ interface ASPxDesignerElementEditor { * Value: A String value. */ content: string; + /** + * Gets additional options for DevExtreme UI widgets. + * Value: An object that provides editor options. + */ + extendedOptions: Object; /** * Gets a nullable value, specifying the type of the editor's model. * Value: A Object value. @@ -24814,10 +30276,251 @@ interface ASPxDesignerElementEditorItem { */ displayValue: string; } +/** + * Provides information about a UI element of the Web Report Designer or Web Document Viewer. + */ +interface ASPxReportUIElement { + /** + * Provides access to an element model. + * Value: An object that specifies the element model. + */ + model: Object; + /** + * Provides access to the name of an HTML template used by an element. + * Value: A string that specifies the name of the HTML template. + */ + templateName: string; +} +/** + * Provides data for the PreviewDocumentReady events. + */ +interface ASPxClientWebDocumentViewerDocumentReadyEventArgs extends ASPxClientEventArgs { + /** + * Specifies the report ID. + */ + ReportId: string; + /** + * Specifies the report document ID. + */ + DocumentId: string; + /** + * Specifies the total number of pages in a report document. + */ + PageCount: number; +} +/** + * Provides data for the PreviewEditingFieldChanged events. + */ +interface ASPxClientWebDocumentViewerEditingFieldChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets an editing field whose value has been changed. + * Value: An object that specifies an editing field whose content has been changed. + */ + Field: ASPxClientWebDocumentViewerEditingField; + /** + * Provides access to a previous value of an editing field. + * Value: An object that specifies an editing field's previous value. + */ + OldValue: Object; + /** + * Provides access to a new value of an editing field. + * Value: An object that specifies an editing field's new value. + */ + NewValue: Object; +} +/** + * Provides functionality for a field whose content can be edited in the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerEditingField { + /** + * Provides access to a value that specifies whether or not an editing field's content can be customized in Print Preview. + * Returns: true, if a field cannot be edited in Print Preview; otherwise, false. + */ + readOnly: any; + /** + * Provides access to the current value of an editing field. + * Returns: An object that specifies the current field value. + */ + editValue: any; + /** + * Returns the unique identifier of an editing field. + */ + id(): string; + /** + * Returns the ID of a logical group to which an editing field for a check box belongs. + */ + groupID(): string; + /** + * Returns the name of an editor used to change a field value in Print Preview. + */ + editorName(): string; + /** + * Returns the index of the page on which an editing field is located. + */ + pageIndex(): number; +} +/** + * Provides data for the PreviewParametersSubmitted events. + */ +interface ASPxClientParametersSubmittedEventArgs extends ASPxClientEventArgs { + /** + * Provides access to a View Model for report parameters. + * Value: A View Model object. + */ + ParametersViewModel: Object; + /** + * Provides access to report parameters and their submitted values. + * Value: A dictionary containing the parameter names along with their values. + */ + Parameters: { [key: string]: Object; }; +} +/** + * Provides data for the PreviewParametersReset events. + */ +interface ASPxClientParametersResetEventArgs extends ASPxClientEventArgs { + /** + * Provides access to a View Model for report parameters. + * Value: A View Model object. + */ + ParametersViewModel: Object; + /** + * Provides access to report parameters whose values have been reset. + * Value: An ASPxClientWebDocumentViewerParameter array. + */ + Parameters: ASPxClientWebDocumentViewerParameter[]; +} +/** + * Provides general information about a report parameter on the client-side of the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerParameter { + /** + * Provides access to the current value of a report parameter. + * Value: An object that specifies the report parameter's current value. + */ + value: Object; + /** + * Provides access to a report parameter's value type. + * Value: An object that specifies the report parameter type. + */ + type: Object; + /** + * Provides access to a value that specifies whether or not a parameter can have multiple values. + * Value: true, if a parameter can have multiple values; otherwise, false. + */ + isMultiValue: boolean; + /** + * Returns an object that provides general information about a report parameter. + */ + getParameterDescriptor(): ASPxDesignerElementParameterDescriptor; +} +/** + * Provides data for the PreviewClick events. + */ +interface ASPxClientPreviewClickEventArgs extends ASPxClientEventArgs { + /** + * Gets a value specifying the zero-based index of the page that has been clicked. + * Value: An integer value that specifies a page index. + */ + PageIndex: number; + /** + * Provides information on a visual brick representing content of a report control that has been clicked. + * Value: An object that provides information on a visual brick. + */ + Brick: ASPxClientWebDocumentViewerBrick; + /** + * Specifies whether or not the event was handled and no default processing is required. + * Value: true, if the event is completely handled by custom code and no default processing is required; otherwise, false. + */ + Handled: boolean; + /** + * Specifies the default function used to handle the PreviewClick event. + */ + DefaultHandler(): void; + /** + * Returns the text displayed by the Brick. + */ + GetBrickText(): string; + /** + * Returns a string providing additional information on the Brick. + */ + GetBrickValue(): string; +} +/** + * Provides information about a visual brick used to render a report control to construct a document in the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerBrick { + /** + * Provides access to a brick's content. + * Value: A dictionary that stores content keys along with the corresponding contents. + */ + content: { [key: string]: string; }; + /** + * Provides access to navigation settings of the current brick. + * Value: An object that provides a brick's navigation settings. + */ + navigation: ASPxClientWebDocumentViewerBrickNavigation; + /** + * Provides access to a brick's top vertical coordinate. + * Value: An integer value that specifies the brick's top coordinate. + */ + top: number; + /** + * Provides access to a brick's left horizontal coordinate. + * Value: An integer value that specifies the brick's left coordinate. + */ + left: number; + /** + * Provides access to a brick's width. + * Value: An integer value that specifies the brick width. + */ + width: number; + /** + * Provides access to a brick's height. + * Value: An integer value that specifies the brick height. + */ + height: number; + /** + * Provides access to a value that specifies whether or not the right-to-left feature is enabled for a brick. + * Value: true, if the right-to-left feature is enabled; otherwise, false. + */ + rtl: boolean; +} +/** + * Provides navigation settings for a brick used to construct a document in the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerBrickNavigation { + /** + * Provides access to the URL to navigate to when a brick is a clicked. + * Value: A string that specifies the URL. + */ + url: string; + /** + * Provides access to a value that specifies the target window or frame in which to display the linked Web page's content when the brick is clicked. + * Value: A string that specifies the window or frame to which to target the URL's content. + */ + target: string; + /** + * Provides access to a drill-down key. + * Value: A string that specifies a drill-down key. + */ + drillDownKey: string; +} /** * A client-side equivalent of the ASPxWebDocumentViewer class. */ interface ASPxClientWebDocumentViewer extends ASPxClientControl { + /** + * Occurs after a report document has been loaded to the Web Document Viewer. + */ + DocumentReady: ASPxClientEvent>; + /** + * Occurs each time a value of an editing field changes. + */ + EditingFieldChanged: ASPxClientEvent>; + /** + * Enables you to customize UI elements of the Web Document Viewer. + */ + CustomizeElements: ASPxClientEvent>; /** * Enables you to customize the menu actions of a Web Document Viewer. */ @@ -24830,14 +30533,31 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { * Occurs each time a look-up editor is created for a report parameter. */ CustomizeParameterLookUpSource: ASPxClientEvent>; + /** + * Occurs when the left mouse button has been clicked over a report document. + */ + PreviewClick: ASPxClientEvent>; + /** + * Occurs after report parameter values have been reset to their default values. + */ + ParametersReset: ASPxClientEvent>; + /** + * Occurs after report parameter values have been submitted. + */ + ParametersSubmitted: ASPxClientEvent>; /** * Provides access to the preview model of the ASPxClientWebDocumentViewer. */ GetPreviewModel(): Object; /** - * Opens the specified report in the HTML5 Document Viewer. + * Returns a model for a report parameter. */ - OpenReport(): Object; + GetParametersModel(): Object; + /** + * Opens the specified report on the client side of the Web Document Viewer. + * @param url A string that specifies the URL of a report to be opened. + */ + OpenReport(url: string): any; /** * Prints the current document. */ @@ -24853,9 +30573,36 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { 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'. + * @param format A String value, specifying the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'docx', 'txt', 'xls', and 'xlsx'. */ ExportTo(format: string): void; + /** + * Exports the document to a specified file format. + * @param format A String value that specifies the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'docx', 'txt', 'xls', and 'xlsx'. + * @param inlineResult true, to try opening the result file in a new browser tab without a download; otherwise, false. + */ + ExportTo(format: string, inlineResult: boolean): void; + /** + * Returns the zero-based index of the currently displayed page. + */ + GetCurrentPageIndex(): number; + /** + * Displays the report page with the specified page index. + * @param pageIndex A zero-based integer value that specifies the index of a page to be displayed. + */ + GoToPage(pageIndex: number): void; + /** + * Closes the document currently being opened in the Web Document Viewer. + */ + Close(): void; + /** + * Resets the values of report parameters to their default values. + */ + ResetParameters(): void; + /** + * Starts building a report document. + */ + StartBuild(): void; /** * Updates the localization settings of the ASPxClientWebDocumentViewer properties. * @param localization A dictionary containing the property names, along with their localized equivalents. @@ -24863,64 +30610,37 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { UpdateLocalization(localization: { [key: string]: string; }): void; } /** - * Provides settings to the actions listed in a Web Document Viewer menu. + * A method that will handle the EditingFieldChanged event. */ -interface ASPxClientWebDocumentViewerMenuAction { +interface ASPxClientWebDocumentViewerEditingFieldChangedEventHandler { /** - * Provides access to the text for the command. - * Value: A String value. + * A method that will handle the PreviewEditingFieldChanged event. + * @param source The event sender. + * @param e An ASPxClientWebDocumentViewerEditingFieldChangedEventArgs object that contains data related to the event. */ - 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; + (source: S, e: ASPxClientWebDocumentViewerEditingFieldChangedEventArgs): void; } /** - * Provides data for the CustomizeMenuActions event. + * A method that will handle the DocumentReady event. */ -interface ASPxClientWebDocumentViewerCustomizeMenuActionsEventArgs extends ASPxClientEventArgs { +interface ASPxClientWebDocumentViewerDocumentReadyEventHandler { /** - * Returns the collection of customized menu actions. - * Value: An ASPxClientWebDocumentViewerMenuAction array. + * A method that will handle the PreviewDocumentReady event. + * @param source The event sender. + * @param e An ASPxClientWebDocumentViewerDocumentReadyEventArgs object that contains data related to the event. */ - Actions: ASPxClientWebDocumentViewerMenuAction[]; + (source: S, e: ASPxClientWebDocumentViewerDocumentReadyEventArgs): void; +} +/** + * A method that will handle the CustomizeElements event. + */ +interface ASPxClientWebDocumentViewerCustomizeElementsEventHandler { /** - * Returns a menu action with the specified ID. - * @param actionId A String value, specifying the action ID. + * A method that will handle the PreviewCustomizeElements event. + * @param source The event sender. + * @param e An ASPxClientCustomizeElementsEventArgs object that contains data related to the event. */ - GetById(actionId: string): ASPxClientWebDocumentViewerMenuAction; + (source: S, e: ASPxClientCustomizeElementsEventArgs): void; } /** * A method that will handle the CustomizeMenuActions event. @@ -24929,9 +30649,9 @@ 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. + * @param e An ASPxClientCustomizeMenuActionsEventArgs object that contains data related to the event. */ - (source: S, e: ASPxClientWebDocumentViewerCustomizeMenuActionsEventArgs): void; + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; } /** * A method that will handle the CustomizeParameterEditors event. @@ -24944,8 +30664,49 @@ interface ASPxClientWebDocumentViewerCustomizeParameterEditorsEventHandler { */ (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; } +/** + * A method that will handle the CustomizeParameterLookUpSource event. + */ interface ASPxClientWebDocumentViewerCustomizeParameterLookUpSourceEventHandler { - (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; + /** + * A method that will handle the CustomizeParameterLookUpSource event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterLookUpSourceEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterLookUpSourceEventArgs): void; +} +/** + * A method that will handle the PreviewClick event. + */ +interface ASPxClientWebDocumentViewerPreviewClickEventHandler { + /** + * A method that will handle the PreviewClick event. + * @param source The event sender. + * @param e An ASPxClientPreviewClickEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientPreviewClickEventArgs): void; +} +/** + * A method that will handle the ParametersReset event. + */ +interface ASPxClientWebDocumentViewerParametersResetEventHandler { + /** + * A method that will handle the PreviewParametersReset event. + * @param source The event sender. + * @param e An ASPxClientParametersResetEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientParametersResetEventArgs): void; +} +/** + * A method that will handle the ParametersSubmitted event. + */ +interface ASPxClientWebDocumentViewerParametersSubmittedEventHandler { + /** + * A method that will handle the PreviewParametersSubmitted event. + * @param source The event sender. + * @param e An ASPxClientParametersSubmittedEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientParametersSubmittedEventArgs): void; } interface MVCxClientDashboardViewerStatic extends ASPxClientDashboardViewerStatic { @@ -25014,15 +30775,6 @@ interface DashboardSpecialValuesStatic { */ 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. @@ -25091,6 +30843,26 @@ interface DashboardExportFilterStateStatic { */ SeparatePage: string; } +interface DashboardStateExportPositionStatic { + /** + * The dashboard state is placed below the exported dashboard/dashboard item. + */ + Below: string; + /** + * The dashboard state is placed on a separate page. + */ + SeparatePage: string; +} +interface DashboardStateExcelExportPositionStatic { + /** + * The dashboard state is placed below the exported data. + */ + Below: string; + /** + * The dashboard state is placed on a separate sheet. + */ + SeparateSheet: string; +} interface DashboardExportImageFormatStatic { /** * The PNG image format. @@ -25105,6 +30877,11 @@ interface DashboardExportImageFormatStatic { */ Jpg: string; } +interface ExcelExportFilterStateStatic { + none: string; + below: string; + separatePage: string; +} interface DashboardExportExcelFormatStatic { /** * The Excel 97 - Excel 2003 (XLS) file format. @@ -25143,6 +30920,16 @@ interface MapExportSizeModeStatic { */ Zoom: string; } +interface TreemapExportSizeModeStatic { + /** + * For internal use. + */ + none: string; + /** + * For internal use. + */ + zoom: string; +} interface RangeFilterExportSizeModeStatic { /** * A Range Filter dashboard item is exported in a size identical to that shown on the dashboard. @@ -25162,6 +30949,15 @@ interface DashboardSelectionModeStatic { Single: string; Multiple: string; } +interface ASPxClientDashboardStatic 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 ASPxClientEditBaseStatic extends ASPxClientControlStatic { } interface ASPxClientEditStatic extends ASPxClientEditBaseStatic { @@ -25605,6 +31401,10 @@ interface ASPxClientGridViewCallbackCommandStatic { * Default value: "APPLYSEARCHPANELFILTER" */ ApplySearchPanelFilter: string; + /** + * Default value: "APPLYCUSTOMIZATIONDIALOGCHANGES" + */ + ApplyCustomizationDialogChanges: string; /** * Default value: "FILTERROWMENU" */ @@ -25673,6 +31473,10 @@ interface ASPxClientGridViewCallbackCommandStatic { * Default value: "CONTEXTMENU" */ ContextMenu: string; + /** + * Default value: "TOOLBAR" + */ + Toolbar: string; /** * Default value: "CUSTOMVALUES" */ @@ -26284,9 +32088,9 @@ interface ASPxSchedulerDateTimeHelperStatic { */ ToDayTime(date: Date): any; /** - * - * @param date - * @param dayCount + * Adds the specified number of days to a DateTime object and returns the result. + * @param date A DateTime object to which to add days. + * @param dayCount The number of days to add. */ AddDays(date: Date, dayCount: number): Date; /** @@ -26340,6 +32144,16 @@ interface ASPxClientSpellCheckerStatic extends ASPxClientControlStatic { */ Cast(obj: Object): ASPxClientSpellChecker; } +interface ASPxClientSpellCheckerStopCheckingReasonStatic { + /** + * Spell checking is finished normally. + */ + Default: string; + /** + * The user stopped spell checking. + */ + User: string; +} interface ASPxClientSpreadsheetStatic 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. @@ -26354,6 +32168,76 @@ interface ASPxClientTreeListStatic extends ASPxClientControlStatic { */ Cast(obj: Object): ASPxClientTreeList; } +interface BootstrapClientAccordionStatic extends ASPxClientNavBarStatic { +} +interface BootstrapClientBinaryImageStatic extends ASPxClientHyperLinkStatic { +} +interface BootstrapClientButtonStatic extends ASPxClientButtonStatic { +} +interface BootstrapClientCalendarStatic extends ASPxClientCalendarStatic { +} +interface BootstrapClientCallbackPanelStatic extends ASPxClientControlStatic { +} +interface BootstrapClientChartBaseStatic extends ASPxClientControlStatic { +} +interface BootstrapClientChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientPolarChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientPieChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientCheckBoxStatic extends ASPxClientEditStatic { +} +interface BootstrapClientRadioButtonStatic extends BootstrapClientCheckBoxStatic { +} +interface BootstrapClientComboBoxStatic extends ASPxClientComboBoxStatic { +} +interface BootstrapClientDateEditStatic extends ASPxClientDateEditStatic { +} +interface BootstrapClientDropDownEditStatic extends ASPxClientDropDownEditStatic { +} +interface BootstrapClientFormLayoutStatic extends ASPxClientFormLayoutStatic { +} +interface BootstrapClientGridViewStatic extends ASPxClientGridViewStatic { +} +interface BootstrapClientHyperLinkStatic extends ASPxClientHyperLinkStatic { +} +interface BootstrapClientImageStatic extends ASPxClientImageStatic { +} +interface BootstrapClientListBoxStatic extends ASPxClientListBoxStatic { +} +interface BootstrapClientCheckBoxListStatic extends ASPxClientCheckBoxListStatic { +} +interface BootstrapClientRadioButtonListStatic extends ASPxClientRadioButtonListStatic { +} +interface BootstrapClientMenuStatic extends ASPxClientMenuStatic { +} +interface BootstrapClientPagerStatic extends ASPxClientPagerStatic { +} +interface BootstrapClientPopupControlStatic extends ASPxClientPopupControlStatic { +} +interface BootstrapClientPopupMenuStatic extends ASPxClientPopupMenuStatic { +} +interface BootstrapClientProgressBarStatic extends ASPxClientProgressBarStatic { +} +interface BootstrapClientSpinEditStatic extends ASPxClientSpinEditStatic { +} +interface BootstrapClientTabControlStatic extends ASPxClientTabControlStatic { +} +interface BootstrapClientPageControlStatic extends ASPxClientPageControlStatic { +} +interface BootstrapClientTextBoxStatic extends ASPxClientTextBoxStatic { +} +interface BootstrapClientMemoStatic extends ASPxClientMemoStatic { +} +interface BootstrapClientButtonEditStatic extends ASPxClientButtonEditStatic { +} +interface BootstrapClientTreeViewStatic extends ASPxClientTreeViewStatic { +} +interface BootstrapUIWidgetBaseStatic extends ASPxClientControlStatic { +} +interface BootstrapClientUploadControlStatic extends ASPxClientUploadControlStatic { +} 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. @@ -26501,8 +32385,17 @@ interface MVCxClientSchedulerStatic extends ASPxClientSchedulerStatic { Cast(obj: Object): MVCxClientScheduler; } interface MVCxSchedulerToolTipTypeStatic { + /** + * The tooltip is displayed for a selected appointment. + */ Appointment: number; + /** + * The tooltip is displayed for a dragged appointment. + */ AppointmentDrag: number; + /** + * The tooltip is displayed for a selected time interval. + */ Selection: number; } interface MVCxClientSpreadsheetStatic extends ASPxClientSpreadsheetStatic { @@ -26629,7 +32522,21 @@ interface ASPxClientCallbackStatic extends ASPxClientControlStatic { */ Cast(obj: Object): ASPxClientCallback; } -interface ASPxClientCallbackPanelStatic extends ASPxClientControlStatic { +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 ASPxClientCallbackPanelStatic extends ASPxClientPanelStatic { /** * 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. @@ -26774,6 +32681,82 @@ interface ASPxClientHiddenFieldStatic extends ASPxClientControlStatic { */ Cast(obj: Object): ASPxClientHiddenField; } +interface ASPxClientHintStatic extends ASPxClientControlStatic { + /** + * Forces the hint to reselect target UI elements according to the specified CSS selector. + */ + Update(): void; + /** + * Forces the hint to recalculate its position. + */ + UpdatePosition(): void; + /** + * Forces the hint to recalculate its position. + * @param hintElementOrTargetElement An object that is the hint element or the target element. + */ + UpdatePosition(hintElementOrTargetElement: Object): void; + /** + * Registers a hint's functionality with the specified settings. + * @param targetSelector A string value that is the CSS selector. Specifies to which UI elements the hint is displayed. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Register(targetSelector: string, options: ASPxClientHintOptions): ASPxClientHint; + /** + * + * @param targetSelector + * @param contentAttribute + */ + Register(targetSelector: string, contentAttribute: string): ASPxClientHint; + /** + * + * @param targetSelector + * @param onShowing + */ + Register(targetSelector: string, onShowing: ASPxClientHintShowingEventHandler): ASPxClientHint; + /** + * Invokes a hint. + * @param targetSelector A string value that is the CSS selector. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Show(targetSelector: string, options: ASPxClientHintOptions): void; + /** + * Invokes a hint. + * @param targetSelector A string value that is the CSS selector used to specify for which UI elements on a web page a hint is displayed. + * @param content A string value that is the hint's content. + */ + Show(targetSelector: string, content: string): void; + /** + * Invokes a hint. + * @param targetElement An object that is the target element. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Show(targetElement: Object, options: ASPxClientHintOptions): void; + /** + * Invokes a hint. + * @param targetElement A HTML DOM element near to which the hint is displayed in response to user interaction. + * @param content A string value that is the hint's content. + */ + Show(targetElement: Object, content: string): void; + /** + * Invokes a hint. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Show(options: ASPxClientHintOptions): void; + /** + * Hides a hint window. + * @param targetSelector A string value that is the CSS selector. + */ + Hide(targetSelector: string): void; + /** + * Hides a hint window. + * @param targetElementOrHintElement An object that is the target element or hint element. + */ + Hide(targetElementOrHintElement: Object): void; + /** + * Hides all hints. + */ + HideAll(): void; +} 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. @@ -26799,6 +32782,8 @@ interface ASPxClientLoadingPanelStatic extends ASPxClientControlStatic { */ Cast(obj: Object): ASPxClientLoadingPanel; } +interface ASPxClientMediaFileSelectorStatic extends ASPxClientControlStatic { +} interface ASPxClientMenuBaseStatic extends ASPxClientControlStatic { /** * Returns a collection of client menu objects. @@ -26857,19 +32842,7 @@ interface ASPxClientObjectContainerStatic extends ASPxClientControlStatic { */ 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 ASPxClientPagerStatic extends ASPxClientControlStatic { } interface ASPxClientPopupControlStatic extends ASPxClientPopupControlBaseStatic { /** @@ -27019,6 +32992,24 @@ interface ASPxClientUploadControlStatic extends ASPxClientControlStatic { */ Cast(obj: Object): ASPxClientUploadControl; } +interface ASPxClientUploadControlValidationErrorTypeConstsStatic { + /** + * The allowed maximum file size is exceeded. Return Value: 1 + */ + MaxFileSizeExceeded: number; + /** + * The file's extension is not allowed. Return Value: 2 + */ + NotAllowedFileExtension: number; + /** + * The allowed maximum count of the files is exceeded. Return Value: 3 + */ + MaxFileCountExceeded: number; + /** + * A file name contains invalid character.Return Value: 4 + */ + FileNameContainsInvalidCharacter: number; +} interface ASPxClientUtilsStatic { /** * Gets the user-agent string, which identifies the client browser and provides certain system details of the client computer. @@ -27363,6 +33354,11 @@ interface ASPxClientUtilsStatic { * @param str A string value representing the string for trimming. */ TrimEnd(str: string): string; + /** + * Specifies the text that Assistive Technologies (screen readers or braille display, for example) will provide to a user. + * @param message A String value that specifies a text. + */ + SendMessageToAssistiveTechnology(message: string): void; } interface ASPxClientChartDesignerStatic extends ASPxClientControlStatic { /** @@ -27428,18 +33424,22 @@ interface ASPxClientWebDocumentViewerStatic extends ASPxClientControlStatic { 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 DashboardStateExportPosition: DashboardStateExportPositionStatic; +declare var DashboardStateExcelExportPosition: DashboardStateExcelExportPositionStatic; declare var DashboardExportImageFormat: DashboardExportImageFormatStatic; +declare var ExcelExportFilterState: ExcelExportFilterStateStatic; declare var DashboardExportExcelFormat: DashboardExportExcelFormatStatic; declare var ChartExportSizeMode: ChartExportSizeModeStatic; declare var MapExportSizeMode: MapExportSizeModeStatic; +declare var TreemapExportSizeMode: TreemapExportSizeModeStatic; declare var RangeFilterExportSizeMode: RangeFilterExportSizeModeStatic; declare var DashboardSelectionMode: DashboardSelectionModeStatic; +declare var ASPxClientDashboard: ASPxClientDashboardStatic; +declare var ASPxClientDashboardViewer: ASPxClientDashboardViewerStatic; declare var ASPxClientEditBase: ASPxClientEditBaseStatic; declare var ASPxClientEdit: ASPxClientEditStatic; declare var ASPxClientBinaryImage: ASPxClientBinaryImageStatic; @@ -27503,8 +33503,44 @@ declare var ASPxClientRecurrenceTypeEdit: ASPxClientRecurrenceTypeEditStatic; declare var ASPxClientTimeInterval: ASPxClientTimeIntervalStatic; declare var ASPxClientScheduler: ASPxClientSchedulerStatic; declare var ASPxClientSpellChecker: ASPxClientSpellCheckerStatic; +declare var ASPxClientSpellCheckerStopCheckingReason: ASPxClientSpellCheckerStopCheckingReasonStatic; declare var ASPxClientSpreadsheet: ASPxClientSpreadsheetStatic; declare var ASPxClientTreeList: ASPxClientTreeListStatic; +declare var BootstrapClientAccordion: BootstrapClientAccordionStatic; +declare var BootstrapClientBinaryImage: BootstrapClientBinaryImageStatic; +declare var BootstrapClientButton: BootstrapClientButtonStatic; +declare var BootstrapClientCalendar: BootstrapClientCalendarStatic; +declare var BootstrapClientCallbackPanel: BootstrapClientCallbackPanelStatic; +declare var BootstrapClientChartBase: BootstrapClientChartBaseStatic; +declare var BootstrapClientChart: BootstrapClientChartStatic; +declare var BootstrapClientPolarChart: BootstrapClientPolarChartStatic; +declare var BootstrapClientPieChart: BootstrapClientPieChartStatic; +declare var BootstrapClientCheckBox: BootstrapClientCheckBoxStatic; +declare var BootstrapClientRadioButton: BootstrapClientRadioButtonStatic; +declare var BootstrapClientComboBox: BootstrapClientComboBoxStatic; +declare var BootstrapClientDateEdit: BootstrapClientDateEditStatic; +declare var BootstrapClientDropDownEdit: BootstrapClientDropDownEditStatic; +declare var BootstrapClientFormLayout: BootstrapClientFormLayoutStatic; +declare var BootstrapClientGridView: BootstrapClientGridViewStatic; +declare var BootstrapClientHyperLink: BootstrapClientHyperLinkStatic; +declare var BootstrapClientImage: BootstrapClientImageStatic; +declare var BootstrapClientListBox: BootstrapClientListBoxStatic; +declare var BootstrapClientCheckBoxList: BootstrapClientCheckBoxListStatic; +declare var BootstrapClientRadioButtonList: BootstrapClientRadioButtonListStatic; +declare var BootstrapClientMenu: BootstrapClientMenuStatic; +declare var BootstrapClientPager: BootstrapClientPagerStatic; +declare var BootstrapClientPopupControl: BootstrapClientPopupControlStatic; +declare var BootstrapClientPopupMenu: BootstrapClientPopupMenuStatic; +declare var BootstrapClientProgressBar: BootstrapClientProgressBarStatic; +declare var BootstrapClientSpinEdit: BootstrapClientSpinEditStatic; +declare var BootstrapClientTabControl: BootstrapClientTabControlStatic; +declare var BootstrapClientPageControl: BootstrapClientPageControlStatic; +declare var BootstrapClientTextBox: BootstrapClientTextBoxStatic; +declare var BootstrapClientMemo: BootstrapClientMemoStatic; +declare var BootstrapClientButtonEdit: BootstrapClientButtonEditStatic; +declare var BootstrapClientTreeView: BootstrapClientTreeViewStatic; +declare var BootstrapUIWidgetBase: BootstrapUIWidgetBaseStatic; +declare var BootstrapClientUploadControl: BootstrapClientUploadControlStatic; declare var MVCxClientCalendar: MVCxClientCalendarStatic; declare var MVCxClientCallbackPanel: MVCxClientCallbackPanelStatic; declare var MVCxClientCardView: MVCxClientCardViewStatic; @@ -27542,6 +33578,8 @@ declare var MVCxClientWebDocumentViewer: MVCxClientWebDocumentViewerStatic; declare var ASPxClientControlBase: ASPxClientControlBaseStatic; declare var ASPxClientControl: ASPxClientControlStatic; declare var ASPxClientCallback: ASPxClientCallbackStatic; +declare var ASPxClientPanelBase: ASPxClientPanelBaseStatic; +declare var ASPxClientPanel: ASPxClientPanelStatic; declare var ASPxClientCallbackPanel: ASPxClientCallbackPanelStatic; declare var ASPxClientCloudControl: ASPxClientCloudControlStatic; declare var ASPxClientDataView: ASPxClientDataViewStatic; @@ -27554,19 +33592,20 @@ declare var ASPxClientFileManagerCommandConsts: ASPxClientFileManagerCommandCons declare var ASPxClientFileManagerErrorConsts: ASPxClientFileManagerErrorConstsStatic; declare var ASPxClientFormLayout: ASPxClientFormLayoutStatic; declare var ASPxClientHiddenField: ASPxClientHiddenFieldStatic; +declare var ASPxClientHint: ASPxClientHintStatic; declare var ASPxClientImageGallery: ASPxClientImageGalleryStatic; declare var ASPxClientImageSlider: ASPxClientImageSliderStatic; declare var ASPxClientImageZoomNavigator: ASPxClientImageZoomNavigatorStatic; declare var ASPxClientImageZoom: ASPxClientImageZoomStatic; declare var ASPxClientLoadingPanel: ASPxClientLoadingPanelStatic; +declare var ASPxClientMediaFileSelector: ASPxClientMediaFileSelectorStatic; 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 ASPxClientPager: ASPxClientPagerStatic; declare var ASPxClientPopupControl: ASPxClientPopupControlStatic; declare var ASPxClientPopupControlResizeState: ASPxClientPopupControlResizeStateStatic; declare var ASPxClientPopupControlCloseReason: ASPxClientPopupControlCloseReasonStatic; @@ -27583,6 +33622,7 @@ declare var ASPxClientTimer: ASPxClientTimerStatic; declare var ASPxClientTitleIndex: ASPxClientTitleIndexStatic; declare var ASPxClientTreeView: ASPxClientTreeViewStatic; declare var ASPxClientUploadControl: ASPxClientUploadControlStatic; +declare var ASPxClientUploadControlValidationErrorTypeConsts: ASPxClientUploadControlValidationErrorTypeConstsStatic; declare var ASPxClientUtils: ASPxClientUtilsStatic; declare var ASPxClientChartDesigner: ASPxClientChartDesignerStatic; declare var ASPxClientWebChartControl: ASPxClientWebChartControlStatic; diff --git a/types/devexpress-web/v161/devexpress-web-tests.ts b/types/devexpress-web/v161/devexpress-web-tests.ts new file mode 100644 index 0000000000..ef7eb8de37 --- /dev/null +++ b/types/devexpress-web/v161/devexpress-web-tests.ts @@ -0,0 +1,418 @@ +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; + +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); + }; + + 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; + } + }; + + export function onLoginButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + loginPopup.Hide(); + showAboutWindow(); + }; + + 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 + }); + } + }; + + export function onSearchComboBoxIndexChanged(s: ASPxClientComboBox, e: ASPxClientProcessingModeEventArgs): void { + hideMenu(); + searchButton.AdjustControl(); + }; + + 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); + }; + + export function onLogoClick(): void { + showPage("", null, false); + }; + + export function onMenuNavButtonCheckedChanged(s: ASPxClientCheckBox, e: ASPxClientProcessingModeEventArgs): void { + var mainContainer = mainCallbackPanel.GetMainElement(); + if (s.GetChecked()) { + backSlider.Pause(); + showMenu(); + } + else { + hideMenu(); + backSlider.Play(); + } + }; + + 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; + } + }; + + 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); + }; + + export function onBookHotelButtonClick(hotelID: string): void { + var queryParams = getCurrentQueryParams(); + queryParams["hotelID"] = hotelID; + showPage("ShowRooms", queryParams); + }; + + export function onDetailsHotelButtonClick(hotelID: string): void { + var queryParams = getCurrentQueryParams(); + queryParams["hotelID"] = hotelID; + showPage("ShowDetails", queryParams); + }; + + 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) { + // animate + } + }; + + export function updateRatingLabels(ratingControl: ASPxClientTrackBar) { + var start = ratingControl.GetPositionStart().toString(); + var end = ratingControl.GetPositionEnd().toString(); + document.getElementById("cpLeftLabelID").innerHTML = start + " " + end; + }; + + 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) + (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 { + 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/types/devexpress-web/v161/index.d.ts b/types/devexpress-web/v161/index.d.ts new file mode 100644 index 0000000000..331718afb0 --- /dev/null +++ b/types/devexpress-web/v161/index.d.ts @@ -0,0 +1,27630 @@ +// Type definitions for DevExpress ASP.NET v161.12 +// Project: http://devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * 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 another dashboard is loaded to the ASPxClientDashboardDesigner. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * + * @param date + */ + SetDate(date: Date): void; + GetDate(): Date; + /** + * 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>; + /** + * + * @param date + */ + SetDate(date: Date): void; + GetDate(): Date; +} +/** + * 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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 contained in the cards when the CardView operates in Batch Edit mode. + * @param validateOnlyModified true, if only modified cards should be validated; otherwise, false. + */ + ValidateCards(validateOnlyModified?: boolean): 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 contained in all rows when the grid operates in Batch Edit mode. + * @param validateOnlyModified true, if only modified rows should be validated; otherwise, false. + */ + ValidateRows(validateOnlyModified?: boolean): 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 contained in all records when the grid operates in batch edit mode. + * @param validateOnlyModified true, if only modified records should be validated; otherwise, false. + */ + ValidateRecords(validateOnlyModified?: boolean): 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + unitConverter: RichEditUnitConverter; + /** + * 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + fileSaveAsDialog: FileSaveAsDialogCommand; + /** + * 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; + goToBookmark: GoToBookmarkCommand; + /** + * 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; + setPageSizeDialog: SetPageSizeDialogCommand; + /** + * 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; + toggleTableCellInsideBorders: ToggleTableCellInsideBordersCommand; + /** + * 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; + /** + * Gets a command to toggle left borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + 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; + /** + * Gets a command to invoke the Spelling dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openSpellingDialog: OpenSpellingDialogCommand; + assignShortcut: AssignShortcutCommand; +} +/** + * 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[]; + spellingInfo: SpellingInfo; +} +/** + * An abstract numbering list definition that defines the appearance and behavior of numbered paragraphs in a document. + */ +interface AbstractNumberingList { + deleted: boolean; +} +/** + * 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; + interval: Interval; + /** + * 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; + codeInterval: Interval; + resultInterval: Interval; + interval: Interval; + /** + * 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; + showCode: boolean; +} +/** + * 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; + interval: Interval; + /** + * 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; + interval: Interval; + /** + * 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; +} +interface InlinePictureInfo { + id: number; + position: number; + initialWidth: number; + initialHeight: number; + scaleX: number; + scaleY: number; + actualWidth: number; + actualHeight: number; +} +declare enum HeaderFooterType { + First=0, + Odd=1, + Primary=1, + Even=2 +} +interface RichEditFileInfo { + folderPath: string; + fileName: string; + documentFormat: any; +} +declare enum DocumentFormat { + Undefined=0, + PlainText=1, + Rtf=2, + Html=3, + OpenXml=4, + Mht=5, + WordML=6, + OpenDocument=7, + ePub=9, + Doc=10 +} +/** + * 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; + getIntervalMaxPosition(): number; + /** + * 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; + /** + * Moves the cursor to the main sub-document. + */ + setMainSubDocumentAsActive(): void; + /** + * Moves the cursor to the footer of the specified document page. + * @param pageIndex An integer value specifying the page index. + */ + setFooterSubDocumentAsActiveByPageIndex(pageIndex: number): void; + /** + * Moves the cursor to the header of the specified document page. + * @param pageIndex An integer value specifying the page index. + */ + setHeaderSubDocumentAsActiveByPageIndex(pageIndex: number): 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; +} +interface SpellingInfo { + spellCheckerState: any; + misspelledIntervals: MisspelledInterval[]; +} +declare enum SpellCheckerState { + Disabled=0, + InProgress=1, + Done=2 +} +interface MisspelledInterval { + start: number; + length: number; + interval: Interval; + errorType: any; + word: string; + suggestions: string[]; +} +declare enum SpellingErrorType { + Misspelling=0, + Repeating=1 +} +/** + * 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; +} +/** + * Exposes the settings providing the information about the essential document functionality. + */ +interface SubDocument { + id: number; + type: any; + /** + * 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[]; + inlinePicturesInfo: InlinePictureInfo[]; + /** + * 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; +} +declare enum SubDocumentType { + Main=0, + Header=1, + Footer=2, + TextBox=3 +} +/** + * 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; + interval: Interval; + /** + * 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; + interval: Interval; + /** + * 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; + interval: Interval; +} +interface RichEditUnitConverter { + pixelsToTwips(value: number): number; + inchesToTwips(value: number): number; + pointsToTwips(value: number): number; + centimetersToTwips(value: number): number; + twipsToCentimeters(value: number): number; + pixelsToCentimeters(value: number): number; + twipsToInches(value: number): number; + pixelsToInches(value: number): number; + pixelsToPoints(value: number): number; + twipsToPoints(value: number): 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; + getState(): any; +} +interface DataRecordOptions { + activeRecordIndex: number; + recordCount: number; +} +/** + * 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; + /** + * + * @param documentFormat + */ + execute(documentFormat: any): 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; + /** + * + * @param documentFormat + * @param settings + */ + execute(documentFormat: any, 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; + /** + * + * @param fileInfo + * @param settings + */ + execute(fileInfo: RichEditFileInfo, 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; +} +/** + * 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; + /** + * + * @param fileInfo + */ + execute(fileInfo: RichEditFileInfo): boolean; +} +interface FileSaveAsDialogCommand extends CommandWithSimpleStateBase { + execute(): 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; + /** + * + * @param documentFormat + */ + execute(documentFormat: any): 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, + DecimalEnclosedParentheses=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 { + /** + * + * @param columns + */ + execute(columns: SectionColumn[]): 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 AssignShortcutCommand extends CommandWithSimpleStateBase { + execute(keyCode: number, callback: (arg1: string) => void): boolean; +} +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, + Apples=26, + ArchedScallops=27, + BabyPacifier=28, + BabyRattle=29, + Balloons3Colors=30, + BalloonsHotAir=31, + BasicBlackDashes=32, + BasicBlackDots=33, + BasicBlackSquares=34, + BasicThinLines=35, + BasicWhiteDashes=36, + BasicWhiteDots=37, + BasicWhiteSquares=38, + BasicWideInline=39, + BasicWideMidline=40, + BasicWideOutline=41, + Bats=42, + Birds=43, + BirdsFlight=44, + Cabins=45, + CakeSlice=46, + CandyCorn=47, + CelticKnotwork=48, + CertificateBanner=49, + ChainLink=50, + ChampagneBottle=51, + CheckedBarBlack=52, + CheckedBarColor=53, + Checkered=54, + ChristmasTree=55, + CirclesLines=56, + CirclesRectangles=57, + ClassicalWave=58, + Clocks=59, + Compass=60, + Confetti=61, + ConfettiGrays=62, + ConfettiOutline=63, + ConfettiStreamers=64, + ConfettiWhite=65, + CornerTriangles=66, + CouponCutoutDashes=67, + CouponCutoutDots=68, + CrazyMaze=69, + CreaturesButterfly=70, + CreaturesFish=71, + CreaturesInsects=72, + CreaturesLadyBug=73, + CrossStitch=74, + Cup=75, + DecoArch=76, + DecoArchColor=77, + DecoBlocks=78, + DiamondsGray=79, + DoubleD=80, + DoubleDiamonds=81, + Earth1=82, + Earth2=83, + EclipsingSquares1=84, + EclipsingSquares2=85, + EggsBlack=86, + Fans=87, + Film=88, + Firecrackers=89, + FlowersBlockPrint=90, + FlowersDaisies=91, + FlowersModern1=92, + FlowersModern2=93, + FlowersPansy=94, + FlowersRedRose=95, + FlowersRoses=96, + FlowersTeacup=97, + FlowersTiny=98, + Gems=99, + GingerbreadMan=100, + Gradient=101, + Handmade1=102, + Handmade2=103, + HeartBalloon=104, + HeartGray=105, + Hearts=106, + HeebieJeebies=107, + Holly=108, + HouseFunky=109, + Hypnotic=110, + IceCreamCones=111, + LightBulb=112, + Lightning1=113, + Lightning2=114, + MapleLeaf=115, + MapleMuffins=116, + MapPins=117, + Marquee=118, + MarqueeToothed=119, + Moons=120, + Mosaic=121, + MusicNotes=122, + Northwest=123, + Ovals=124, + Packages=125, + PalmsBlack=126, + PalmsColor=127, + PaperClips=128, + Papyrus=129, + PartyFavor=130, + PartyGlass=131, + Pencils=132, + People=133, + PeopleHats=134, + PeopleWaving=135, + Poinsettias=136, + PostageStamp=137, + Pumpkin1=138, + PushPinNote1=139, + PushPinNote2=140, + Pyramids=141, + PyramidsAbove=142, + Quadrants=143, + Rings=144, + Safari=145, + Sawtooth=146, + SawtoothGray=147, + ScaredCat=148, + Seattle=149, + ShadowedSquares=150, + SharksTeeth=151, + ShorebirdTracks=152, + Skyrocket=153, + SnowflakeFancy=154, + Snowflakes=155, + Sombrero=156, + Southwest=157, + Stars=158, + Stars3d=159, + StarsBlack=160, + StarsShadowed=161, + StarsTop=162, + Sun=163, + Swirligig=164, + TornPaper=165, + TornPaperBlack=166, + Trees=167, + TriangleParty=168, + Triangles=169, + Tribal1=170, + Tribal2=171, + Tribal3=172, + Tribal4=173, + Tribal5=174, + Tribal6=175, + TwistedLines1=176, + TwistedLines2=177, + Vine=178, + Waveline=179, + WeavingAngles=180, + WeavingBraid=181, + WeavingRibbon=182, + WeavingStrips=183, + WhiteFlowers=184, + Woodwork=185, + XIllusions=186, + ZanyTriangles=187, + ZigZag=188, + ZigZagStitch=189, + 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; + strikeout: 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 dayNumber A positive integer value that specifies the day number within a month. + */ + SetDayNumber(dayNumber: 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; + /** + * Provides information about dragged appointments. + * Value: An array of ASPxClientAppointmentDragInfo objects storing information about dragged appointments. + */ + dragInformation: ASPxClientAppointmentDragInfo[]; +} +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; + /** + * Gets the resized appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before resizing. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets the appointment's interval after resizing. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; +} +/** + * Stores information about an appointment drag operation. + */ +interface ASPxClientAppointmentDragInfo { + /** + * Gets the dragged appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before the drag operation. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets resources that were associated with the appointment before the drag operation. + * Value: A array of strings containing resource identifiers. + */ + oldResources: string[]; + /** + * Gets the appointment's interval after the drag operation. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; + /** + * Gets resources associated with the appointment after the drag operation. + * Value: An array of strings containing resource identifiers. + */ + newResources: string[]; +} +/** + * 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * Gets the Popup Edit Form. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param data A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * Sends a callback with parameters to update the popup window by processing the related popup window and the passed information on the server. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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 { + /** + * + * @param control + */ + (control: Object): boolean; +} +interface ASPxClientControlAction { + /** + * + * @param control + */ + (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; + /** + * Returns all controls in the collection that satisfy the specified predicate. + * @param predicate An ASPxClientControlPredicate object that is a predicate used to search for controls in the collection. + */ + GetControlsByPredicate(predicate: ASPxClientControlPredicate): Object[]; + /** + * Returns all controls of the specified type. + * @param type The object specifying the client control type. + */ + GetControlsByType(type: Object): Object[]; + /** + * Performs the specified action for each control in the collection. + * @param action An ASPxClientControlAction object specifying an action to perform. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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 { + /** + * Gets a value specifying whether an item is a parent folder. + * Value: true if an item is a parent folder; false if an item is a file or folder. + */ + 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 { + /** + * Recalculates the position of visible sub menus. + */ + 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; + /** + * Sends a callback with parameters to update the popup window by processing the related popup window and the passed information on the server. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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 each time a look-up editor is created for a report parameter. + */ + CustomizeParameterLookUpSource: 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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 { +} +interface ASPxClientReportDesignerCustomizeParameterLookUpSourceEventHandler { + (source: S, e: ASPxClientCustomizeParameterLookUpSourceEventArgs): void; +} +/** + * 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; +} +interface ASPxClientCustomizeParameterLookUpSourceEventArgs extends ASPxClientEventArgs { + parameter: ASPxDesignerElementParameterDescriptor; + items: ASPxDesignerElementEditorItem[]; + dataSource: Object; +} +/** + * 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>; + /** + * Occurs each time a look-up editor is created for a report parameter. + */ + CustomizeParameterLookUpSource: 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; +} +/** + * 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 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; +} +/** + * 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; +} +interface ASPxClientWebDocumentViewerCustomizeParameterLookUpSourceEventHandler { + (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; +} + +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 { + /** + * 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): ASPxClientTokenBox; +} +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 { + /** + * 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): ASPxClientRichEdit; +} +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; + /** + * + * @param date + * @param dayCount + */ + AddDays(date: Date, dayCount: number): 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 { + /** + * 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): ASPxClientSpreadsheet; +} +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 { + /** + * 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): ASPxClientFormLayout; +} +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/types/devexpress-web/v161/tsconfig.json b/types/devexpress-web/v161/tsconfig.json new file mode 100644 index 0000000000..a64418f9b0 --- /dev/null +++ b/types/devexpress-web/v161/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "devexpress-web": ["devexpress-web/v161"], + "devexpress-web/*": ["devexpress-web/v161/*"] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "devexpress-web-tests.ts" + ] +} \ No newline at end of file diff --git a/types/devexpress-web/v162/devexpress-web-tests.ts b/types/devexpress-web/v162/devexpress-web-tests.ts new file mode 100644 index 0000000000..ef7eb8de37 --- /dev/null +++ b/types/devexpress-web/v162/devexpress-web-tests.ts @@ -0,0 +1,418 @@ +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; + +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); + }; + + 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; + } + }; + + export function onLoginButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + loginPopup.Hide(); + showAboutWindow(); + }; + + 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 + }); + } + }; + + export function onSearchComboBoxIndexChanged(s: ASPxClientComboBox, e: ASPxClientProcessingModeEventArgs): void { + hideMenu(); + searchButton.AdjustControl(); + }; + + 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); + }; + + export function onLogoClick(): void { + showPage("", null, false); + }; + + export function onMenuNavButtonCheckedChanged(s: ASPxClientCheckBox, e: ASPxClientProcessingModeEventArgs): void { + var mainContainer = mainCallbackPanel.GetMainElement(); + if (s.GetChecked()) { + backSlider.Pause(); + showMenu(); + } + else { + hideMenu(); + backSlider.Play(); + } + }; + + 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; + } + }; + + 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); + }; + + export function onBookHotelButtonClick(hotelID: string): void { + var queryParams = getCurrentQueryParams(); + queryParams["hotelID"] = hotelID; + showPage("ShowRooms", queryParams); + }; + + export function onDetailsHotelButtonClick(hotelID: string): void { + var queryParams = getCurrentQueryParams(); + queryParams["hotelID"] = hotelID; + showPage("ShowDetails", queryParams); + }; + + 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) { + // animate + } + }; + + export function updateRatingLabels(ratingControl: ASPxClientTrackBar) { + var start = ratingControl.GetPositionStart().toString(); + var end = ratingControl.GetPositionEnd().toString(); + document.getElementById("cpLeftLabelID").innerHTML = start + " " + end; + }; + + 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) + (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 { + 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/types/devexpress-web/v162/index.d.ts b/types/devexpress-web/v162/index.d.ts new file mode 100644 index 0000000000..89d0b0d657 --- /dev/null +++ b/types/devexpress-web/v162/index.d.ts @@ -0,0 +1,28635 @@ +// Type definitions for DevExpress ASP.NET v162.7 +// Project: http://devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * 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 events. + */ +interface ASPxClientDashboardItemClickEventHandler { + /** + * References a method that will handle the ItemClick events. + * @param source The event source. + * @param e A ASPxClientDashboardItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemClickEventArgs): void; +} +/** + * Provides data for the ItemClick events. + */ +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 events. + */ +interface ASPxClientDashboardItemVisualInteractivityEventHandler { + /** + * References a method that will handle the ItemVisualInteractivity events. + * @param source The event source. + * @param e A ASPxClientDashboardItemVisualInteractivityEventArgs object containing event data. + */ + (source: S, e: ASPxClientDashboardItemVisualInteractivityEventArgs): void; +} +/** + * Provides data for the ItemVisualInteractivity events. + */ +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 events. + */ +interface ASPxClientDashboardItemSelectionChangedEventHandler { + /** + * References a method that will handle the ItemSelectionChanged events. + * @param source The event source. + * @param e A ASPxClientDashboardItemSelectionChangedEventArgs object containing event data. + */ + (source: S, e: ASPxClientDashboardItemSelectionChangedEventArgs): void; +} +/** + * Provides data for the ItemSelectionChanged events. + */ +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 events. + * @param source The event source. + * @param e An ASPxClientDashboardItemElementCustomColorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemElementCustomColorEventArgs): void; +} +/** + * Provides data for the ItemElementCustomColor events. + */ +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 events. + */ +interface ASPxClientDashboardItemWidgetCreatedEventHandler { + /** + * References a method that will handle the ItemWidgetCreated events. + * @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 events. + */ +interface ASPxClientDashboardItemBeforeWidgetDisposedEventHandler { + /** + * References a method that will handle the ItemBeforeWidgetDisposed events. + * @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 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(s). + */ + GetValue(): Object; + /** + * Specifies the current parameter value(s). + * @param value The current parameter value(s). + */ + 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; +} +/** + * A client-side equivalent of the ASPxDashboard control. + */ +interface ASPxClientDashboard extends ASPxClientControl { + /** + * Fires when a round trip to the server has been initiated by a call to the client PerformDataCallback method. + */ + CustomDataCallback: ASPxClientEvent>; + /** + * 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 state of the dashboard displayed in the ASPxClientDashboard is changed. + */ + DashboardStateChanged: ASPxClientEvent>; + /** + * Occurs after a new dashboard is displayed in the ASPxClientDashboard. + */ + DashboardChanged: ASPxClientEvent>; + /** + * For internal use. + */ + CustomizeMenuItems: ASPxClientEvent>; + /** + * For internal use. + */ + BeforeRender: 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>; + /** + * Occurs when a master filter state is changed. + */ + ItemMasterFilterStateChanged: ASPxClientEvent>; + /** + * Occurs when a drill-down/drill-up is performed. + */ + ItemDrillDownStateChanged: ASPxClientEvent>; + /** + * 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; + /** + * Switches the ASPxClientDashboard to the viewer mode. + */ + SwitchToViewer(): void; + /** + * Switches the ASPxClientDashboard to the designer mode. + */ + SwitchToDesigner(): void; + /** + * Gets the current working mode of the Web Dashboard. + */ + GetWorkingMode(): string; + /** + * Gets the identifier of the dashboard that is displayed in the ASPxClientDashboard. + */ + GetDashboardId(): string; + /** + * Gets the name of the dashboard that is displayed in the ASPxClientDashboard. + */ + GetDashboardName(): string; + /** + * Gets the state of the dashboard displayed in the ASPxClientDashboard. + */ + 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 current dashboard to the dashboard storage. + */ + SaveDashboard(): void; + /** + * Invokes the Dashboard Parameters dialog. + */ + ShowParametersDialog(): void; + /** + * Closes the Dashboard Parameters dialog. + */ + HideParametersDialog(): void; + /** + * Returns dashboard parameter settings and metadata. + */ + GetParameters(): ASPxClientDashboardParameters; + /** + * Invokes the dialog that allows end-users to export the entire dashboard to the specified format. + * @param format A string value that specifies the format. For instance, you can use 'PDF' or 'Image'. + */ + ShowExportDashboardDialog(format: string): void; + /** + * Invokes the dialog that allows end-users to export the dashboard item to the specified format. + * @param itemComponentName A string value that specifies the component name of the dashboard item to export. + * @param format A string value that specifies the format. For instance, you can use 'PDF, 'Image' or 'Excel'. + */ + ShowExportDashboardItemDialog(itemComponentName: string, format: string): void; + /** + * Hides the dialog that allows end-users to export the dashboard/dashboard item. + */ + HideExportDialog(): 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions, fileName: string): 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: ASPxClientDashboardExportOptions, fileName: string): 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): 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 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. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): 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; + /** + * 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. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Returns whether or not master filtering can be applied in the current state of the specified master filter item. + * @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; + /** + * Selects required elements by their values in the specified master filter item. + * @param itemName A String that specifies 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 species 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 into 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 into 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 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[]; + /** + * 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; + /** + * Refreshes an entire dashboard displayed in the Web Dashboard control. + */ + Refresh(): void; + /** + * Refreshes the specific item from the dashboard displayed in the Web Dashboard control. + * @param itemName A string value that specifies the component name of the dashboard item to be refreshed. + */ + Refresh(itemName: string): void; + /** + * Refreshes specific items from the dashboard displayed in the Web Dashboard control. + * @param itemName An array of string values that specify the component names of the dashboard items to be refreshed. + */ + Refresh(itemName: string[]): void; + /** + * 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; + /** + * 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 a predefined range in the Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter. + * @param dateTimePeriodName A String value that specifies the predefined range name. + */ + SetPredefinedRange(itemName: string, dateTimePeriodName: string): 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 value that is the name of newly opened dashboard. + */ + DashboardName: string; +} +interface ASPxClientDashboardCustomizeMenuItemsEventHandler { + (source: S, e: ASPxClientDashboardCustomizeMenuItemsEventArgs): void; +} +interface ASPxClientDashboardMenuItem { + id: string; + title: string; + template: string; + selected: boolean; + disabled: boolean; + hasSeparator: boolean; + click: Function; + hotKey: number; +} +interface ASPxClientDashboardCustomizeMenuItemsEventArgs extends ASPxClientEventArgs { + Items: ASPxClientDashboardMenuItem[]; + FindById(itemId: string): ASPxClientDashboardMenuItem; +} +interface ASPxClientDashboardBeforeRenderEventHandler { + (source: S, e: ASPxClientEventArgs): void; +} +/** + * Serves as the base class for classes that provide data for client-side events related to dashboard items. + */ +interface ASPxClientDashboardItemEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Returns whether or not the specified value is null. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is 'others'. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; +} +/** + * References a method that will handle the ItemMasterFilterStateChanged event. + */ +interface ASPxClientDashboardItemMasterFilterStateChangedEventHandler { + /** + * References a method that will handle the ItemMasterFilterStateChanged event. + * @param source The event source. + * @param e An ASPxClientDashboardItemMasterFilterStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemMasterFilterStateChangedEventArgs): void; +} +/** + * Provides data for the ItemMasterFilterStateChanged event. + */ +interface ASPxClientDashboardItemMasterFilterStateChangedEventArgs extends ASPxClientDashboardItemEventArgs { + /** + * Gets the currently selected values. + * Value: An array of objects that are the currently selected values. + */ + Values: Object[][]; +} +/** + * References a method that will handle the ItemDrillDownStateChanged event. + */ +interface ASPxClientDashboardItemDrillDownStateChangedEventHandler { + /** + * References a method that will handle the ItemDrillDownStateChanged event. + * @param source The event source. + * @param e An ASPxClientDashboardItemDrillDownStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemDrillDownStateChangedEventArgs): void; +} +/** + * Provides data for the ItemDrillDownStateChanged event. + */ +interface ASPxClientDashboardItemDrillDownStateChangedEventArgs extends ASPxClientDashboardItemEventArgs { + /** + * Gets the drill-down action performed in the dashboard item. + * Value: A string value that is the drill-down action performed in the dashboard item. + */ + Action: string; + /** + * Gets values from the current drill-down hierarchy. + * Value: An array of values from the current drill-down hierarchy. + */ + Values: Object[]; +} +/** + * 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 a predefined range in the Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter. + * @param dateTimePeriodName A String value that specifies the predefined range name. + */ + SetPredefinedRange(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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions, fileName: string): 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: ASPxClientDashboardExportOptions, fileName: string): 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 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. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): 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 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. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): 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; + /** + * 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. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): 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; +} +/** + * 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 values from the current drill-down hierarchy. + * Value: An array of values from the current drill-down hierarchy. + */ + 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 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * Defines the HTML content for the specified combo box item. + * @param index An integer value specifying the zero-based index of the item. + * @param html A string value that is the HTML code defining the content of the combo box item. + */ + SetItemHtml(index: number, html: string): void; + /** + * Sets the tooltip text for the combo box editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTooltip(index: number, tooltip: string): void; + /** + * Sets the CSS class for a combo box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + AddItemCssClass(index: number, className: string): void; + /** + * Removes the CSS class from a combo box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + RemoveItemCssClass(index: number, className: string): void; + /** + * Defines the HTML content for the specified combo box item's text cell. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param html A string value that is the HTML code defining the content of the combo box item. + */ + SetItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + /** + * Sets the tooltip text for the text cell of the editor's item specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + /** + * Sets the CSS class for a combo box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + AddItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + /** + * Removes the CSS class from a combo box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + RemoveItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): 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; + /** + * Specifies the date for the editor. + * @param date A DateTime object that is the date. + */ + SetDate(date: Date): void; + /** + * Gets the date that is the editor's value. + */ + GetDate(): Date; + /** + * 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; + /** + * Defines the HTML content for the specified list box item. + * @param index An integer value specifying the zero-based index of the item. + * @param html A string value that is the HTML code defining the content of the list box item. + */ + SetItemHtml(index: number, html: string): void; + /** + * Sets the tooltip text for the list box editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTooltip(index: number, tooltip: string): void; + /** + * Sets the CSS class for a list box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + AddItemCssClass(index: number, className: string): void; + /** + * Removes the CSS class from a list box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + RemoveItemCssClass(index: number, className: string): void; + /** + * Defines the HTML content for the specified list box item's text cell. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param html A string value that is the HTML code defining the content of the list box item. + */ + SetItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + /** + * Sets the tooltip text for the text cell of the editor's item specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + /** + * Sets the CSS class for a list box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + AddItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + /** + * Removes the CSS class from a list box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + RemoveItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: 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>; + /** + * Specifies the date for the editor. + * @param date A DateTime object that is the date. + */ + SetDate(date: Date): void; + /** + * Gets the date that is the editor's value. + */ + GetDate(): Date; +} +/** + * 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * Lists values that specify the position relative to the target column in which a moved column should be placed. + */ +interface ASPxClientGridColumnMovingTargetPosition { + /** + * A moved column should be placed to the right of the target column. + */ + Right: number; + /** + * A moved column should be placed to the left of the target column. + */ + Left: number; + /** + * A moved column should be placed at the top of the target column. + */ + Top: number; + /** + * A moved column should be placed at the bottom of the target column. + */ + Bottom: number; +} +/** + * 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>; + /** + * 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 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; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): 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; +} +/** + * 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 contained in the cards when the CardView operates in Batch Edit mode. + * @param validateOnlyModified true, if only modified cards should be validated; otherwise, false. + */ + ValidateCards(validateOnlyModified?: boolean): 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>; + /** + * 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; + /** + * 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; + /** + * Sets the scrollability of various types of grid rows when the grid displays fixed columns. + * @param scrollableRowSettings An object specifying which types of grid rows should or should not be scrollable. + */ + SetFixedColumnScrollableRows(scrollableRowSettings: Object): 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; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): 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; + /** + * 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. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition): 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. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition): 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 targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + * @param moveToGroup true, to group the ASPxGridView'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, targetPosition: ASPxClientGridColumnMovingTargetPosition, 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 targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + * @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, targetPosition: ASPxClientGridColumnMovingTargetPosition, 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; +} +/** + * 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 contained in all rows when the grid operates in Batch Edit mode. + * @param validateOnlyModified true, if only modified rows should be validated; otherwise, false. + */ + ValidateRows(validateOnlyModified?: boolean): 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; + /** + * + * @param args + * @param onSuccess + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): 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 contained in all records when the grid operates in batch edit mode. + * @param validateOnlyModified true, if only modified records should be validated; otherwise, false. + */ + ValidateRecords(validateOnlyModified?: boolean): 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; + backgroundColor: string; + textAlign: string; + verticalAlign: 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; + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * 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 { +} +interface ASPxClientHtmlEditorTablePropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + align: string; + cellPadding: number; + cellSpacing: number; + caption: string; + headers: string; + summary: string; +} +interface ASPxClientHtmlEditorInsertTableCommandArguments extends ASPxClientHtmlEditorTablePropertiesCommandArguments { + columns: number; + rows: number; + isEqualColumnWidth: boolean; +} +interface ASPxClientHtmlEditorTableCellPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + applyForAll: boolean; +} +interface ASPxClientHtmlEditorTableRowPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +interface ASPxClientHtmlEditorTableColumnPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * 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; +} +/** + * The 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + unitConverter: RichEditUnitConverter; + /** + * 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + fileSaveAsDialog: FileSaveAsDialogCommand; + /** + * 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 navigate to the specified bookmark. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToBookmark: GoToBookmarkCommand; + /** + * 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 define the page size dialog's settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + setPageSizeDialog: SetPageSizeDialogCommand; + /** + * 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 remove the previous word. + * Value: A object that provides methods for executing the command and checking its state. + */ + removePrevWord: RemovePrevWordCommand; + /** + * Gets a command to remove the next word. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeNextWord: RemoveNextWordCommand; + /** + * 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 toggle inside borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellInsideBorders: ToggleTableCellInsideBordersCommand; + /** + * 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; + /** + * Gets a command to toggle left borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + 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; + /** + * Gets a command to invoke the Spelling dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openSpellingDialog: OpenSpellingDialogCommand; + /** + * Gets a command to assign a shortcut to the specified client command. + * Value: A object that provides methods for executing the command and checking its state. + */ + assignShortcut: AssignShortcutCommand; +} +/** + * 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 (within the ribbon and context menu). + * 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[]; + /** + * Provides information about spell checking in the current document. + * Value: A object. + */ + spellingInfo: SpellingInfo; +} +/** + * An abstract numbering list definition that defines the appearance and behavior of numbered paragraphs in a document. + */ +interface AbstractNumberingList { + deleted: boolean; +} +/** + * 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; + interval: Interval; + /** + * 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 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; + codeInterval: Interval; + resultInterval: Interval; + interval: Interval; + /** + * 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; + /** + * Gets a value specifying whether a field's code or result is dispalyed. + * Value: true, if the field code is displayed; false, if the field result is displayed. + */ + showCode: boolean; +} +/** + * 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; + interval: Interval; + /** + * 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; + interval: Interval; + /** + * 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; +} +interface InlinePictureInfo { + id: number; + position: number; + initialWidth: number; + initialHeight: number; + scaleX: number; + scaleY: number; + /** + * Gets the actual image width. + */ + actualWidth: number; + /** + * Gets the actual image height. + */ + actualHeight: number; +} +declare enum HeaderFooterType { + First=0, + Odd=1, + Primary=1, + Even=2 +} +interface RichEditFileInfo { + folderPath: string; + fileName: string; + documentFormat: any; +} +declare enum DocumentFormat { + Undefined=0, + PlainText=1, + Rtf=2, + Html=3, + OpenXml=4, + Mht=5, + WordML=6, + OpenDocument=7, + ePub=9, + Doc=10 +} +/** + * 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[]; + /** + * Gets or sets a value specifying whether the current selection is collapsed (and represents the cursor position). + * Value: true, if the selection is collapsed; otherwise, false. + */ + collapsed: boolean; + getIntervalMaxPosition(): number; + /** + * 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; + /** + * Moves the cursor to the next page break mark. + */ + goToStartNextPageCommand(): void; + /** + * Moves the cursor to the next page break mark and extends the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToStartNextPageCommand(extendSelection: boolean): void; + /** + * Moves the cursor to the previous page break mark. + */ + goToStartPrevPageCommand(): void; + /** + * Moves the cursor to the previous page break mark and extends the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToStartPrevPageCommand(extendSelection: boolean): 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; + /** + * Makes the main sub-document active and moves the cursor to its beginning. + */ + setMainSubDocumentAsActive(): void; + /** + * Creates a footer sub-document (if it was not created before) and sets the footer as the active sub-document. Moves the cursor to the footer's start position. + * @param pageIndex An integer value specifying the active page's index. + */ + setFooterSubDocumentAsActiveByPageIndex(pageIndex: number): void; + /** + * Creates a header sub-document (if it was not created before) and sets the header as the active sub-document. Moves the cursor to the header's start position. + * @param pageIndex An integer value specifying the active page's index. + */ + setHeaderSubDocumentAsActiveByPageIndex(pageIndex: number): 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; +} +interface SpellingInfo { + spellCheckerState: any; + misspelledIntervals: MisspelledInterval[]; +} +declare enum SpellCheckerState { + Disabled=0, + InProgress=1, + Done=2 +} +interface MisspelledInterval { + start: number; + length: number; + interval: Interval; + errorType: any; + word: string; + suggestions: string[]; +} +declare enum SpellingErrorType { + Misspelling=0, + Repeating=1 +} +/** + * 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; +} +/** + * Exposes the settings providing the information about the essential document functionality. + */ +interface SubDocument { + id: number; + type: any; + /** + * 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[]; + inlinePicturesInfo: InlinePictureInfo[]; + /** + * 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; +} +declare enum SubDocumentType { + Main=0, + Header=1, + Footer=2, + TextBox=3 +} +/** + * 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; + interval: Interval; + /** + * 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; + interval: Interval; + /** + * 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; + interval: Interval; +} +interface RichEditUnitConverter { + /** + * + * @param value + */ + pixelsToTwips(value: number): number; + /** + * + * @param value + */ + inchesToTwips(value: number): number; + /** + * + * @param value + */ + pointsToTwips(value: number): number; + /** + * Converts a value on centimeters to twips. + * @param value + */ + centimetersToTwips(value: number): number; + /** + * + * @param value + */ + twipsToCentimeters(value: number): number; + /** + * + * @param value + */ + pixelsToCentimeters(value: number): number; + /** + * + * @param value + */ + twipsToInches(value: number): number; + /** + * + * @param value + */ + pixelsToInches(value: number): number; + /** + * + * @param value + */ + pixelsToPoints(value: number): number; + /** + * + * @param value + */ + twipsToPoints(value: number): 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; + getState(): any; +} +interface DataRecordOptions { + /** + * Gets or sets the index of the active data record. + */ + activeRecordIndex: number; + recordCount: number; +} +/** + * 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; + /** + * + * @param documentFormat + */ + execute(documentFormat: any): 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; + /** + * + * @param documentFormat + * @param settings + */ + execute(documentFormat: any, 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; + /** + * + * @param fileInfo + * @param settings + */ + execute(fileInfo: RichEditFileInfo, 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; +} +/** + * 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; + /** + * + * @param fileInfo + */ + execute(fileInfo: RichEditFileInfo): boolean; +} +interface FileSaveAsDialogCommand extends CommandWithSimpleStateBase { + execute(): 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; + /** + * + * @param documentFormat + */ + execute(documentFormat: any): 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, + DecimalEnclosedParentheses=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; +} +interface RemovePrevWordCommand extends CommandWithSimpleStateBase { + execute(): boolean; +} +interface RemoveNextWordCommand extends CommandWithSimpleStateBase { + 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 { + /** + * + * @param columns + */ + execute(columns: SectionColumn[]): 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 AssignShortcutCommand extends CommandWithSimpleStateBase { + /** + * + * @param keyCode + * @param callback + */ + execute(keyCode: number, callback: (arg1: string) => void): boolean; +} +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, + Apples=26, + ArchedScallops=27, + BabyPacifier=28, + BabyRattle=29, + Balloons3Colors=30, + BalloonsHotAir=31, + BasicBlackDashes=32, + BasicBlackDots=33, + BasicBlackSquares=34, + BasicThinLines=35, + BasicWhiteDashes=36, + BasicWhiteDots=37, + BasicWhiteSquares=38, + BasicWideInline=39, + BasicWideMidline=40, + BasicWideOutline=41, + Bats=42, + Birds=43, + BirdsFlight=44, + Cabins=45, + CakeSlice=46, + CandyCorn=47, + CelticKnotwork=48, + CertificateBanner=49, + ChainLink=50, + ChampagneBottle=51, + CheckedBarBlack=52, + CheckedBarColor=53, + Checkered=54, + ChristmasTree=55, + CirclesLines=56, + CirclesRectangles=57, + ClassicalWave=58, + Clocks=59, + Compass=60, + Confetti=61, + ConfettiGrays=62, + ConfettiOutline=63, + ConfettiStreamers=64, + ConfettiWhite=65, + CornerTriangles=66, + CouponCutoutDashes=67, + CouponCutoutDots=68, + CrazyMaze=69, + CreaturesButterfly=70, + CreaturesFish=71, + CreaturesInsects=72, + CreaturesLadyBug=73, + CrossStitch=74, + Cup=75, + DecoArch=76, + DecoArchColor=77, + DecoBlocks=78, + DiamondsGray=79, + DoubleD=80, + DoubleDiamonds=81, + Earth1=82, + Earth2=83, + EclipsingSquares1=84, + EclipsingSquares2=85, + EggsBlack=86, + Fans=87, + Film=88, + Firecrackers=89, + FlowersBlockPrint=90, + FlowersDaisies=91, + FlowersModern1=92, + FlowersModern2=93, + FlowersPansy=94, + FlowersRedRose=95, + FlowersRoses=96, + FlowersTeacup=97, + FlowersTiny=98, + Gems=99, + GingerbreadMan=100, + Gradient=101, + Handmade1=102, + Handmade2=103, + HeartBalloon=104, + HeartGray=105, + Hearts=106, + HeebieJeebies=107, + Holly=108, + HouseFunky=109, + Hypnotic=110, + IceCreamCones=111, + LightBulb=112, + Lightning1=113, + Lightning2=114, + MapleLeaf=115, + MapleMuffins=116, + MapPins=117, + Marquee=118, + MarqueeToothed=119, + Moons=120, + Mosaic=121, + MusicNotes=122, + Northwest=123, + Ovals=124, + Packages=125, + PalmsBlack=126, + PalmsColor=127, + PaperClips=128, + Papyrus=129, + PartyFavor=130, + PartyGlass=131, + Pencils=132, + People=133, + PeopleHats=134, + PeopleWaving=135, + Poinsettias=136, + PostageStamp=137, + Pumpkin1=138, + PushPinNote1=139, + PushPinNote2=140, + Pyramids=141, + PyramidsAbove=142, + Quadrants=143, + Rings=144, + Safari=145, + Sawtooth=146, + SawtoothGray=147, + ScaredCat=148, + Seattle=149, + ShadowedSquares=150, + SharksTeeth=151, + ShorebirdTracks=152, + Skyrocket=153, + SnowflakeFancy=154, + Snowflakes=155, + Sombrero=156, + Southwest=157, + Stars=158, + Stars3d=159, + StarsBlack=160, + StarsShadowed=161, + StarsTop=162, + Sun=163, + Swirligig=164, + TornPaper=165, + TornPaperBlack=166, + Trees=167, + TriangleParty=168, + Triangles=169, + Tribal1=170, + Tribal2=171, + Tribal3=172, + Tribal4=173, + Tribal5=174, + Tribal6=175, + TwistedLines1=176, + TwistedLines2=177, + Vine=178, + Waveline=179, + WeavingAngles=180, + WeavingBraid=181, + WeavingRibbon=182, + WeavingStrips=183, + WhiteFlowers=184, + Woodwork=185, + XIllusions=186, + ZanyTriangles=187, + ZigZag=188, + ZigZagStitch=189, + 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; + strikeout: 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 dayNumber A positive integer value that specifies the day number within a month. + */ + SetDayNumber(dayNumber: 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 on 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 on 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 day of the month on which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets the number of months between appointment occurrences. + */ + GetPeriodicity(): number; + /** + * Gets the days of the week on 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 day of the month on which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets or sets the month's number. + */ + GetMonth(): number; + /** + * Gets the days of the week on 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>; + /** + * A client-side event that occurs when an appointment is being dragged. + */ + AppointmentDrag: ASPxClientEvent>; + /** + * A client-side event that occurs when an appointment is being resized. + */ + AppointmentResizing: 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 AppointmentDragEventHandler { + /** + * + * @param source + * @param e + */ + (source: S, e: ASPxClientAppointmentDragEventArgs): void; +} +/** + * Provides data for the AppointmentDrag event. + */ +interface ASPxClientAppointmentDragEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not appointments can be dropped into the intervals over which they are currently dragged. + * Value: true to allow dropping appointments; otherwise, false. + */ + allow: boolean; + /** + * Gets a mouse event object related to the current drag operation. + * Value: An object providing event properties specific to mouse events. + */ + mouseEvent: Object; + /** + * Provides information about dragged appointments. + * Value: An array of ASPxClientAppointmentDragInfo objects storing information about dragged appointments. + */ + dragInformation: ASPxClientAppointmentDragInfo[]; +} +interface AppointmentDropEventHandler { + /** + * + * @param source + * @param e + */ + (source: S, e: ASPxClientAppointmentDropEventArgs): void; +} +/** + * Provides data for the AppointmentDrop event. + */ +interface ASPxClientAppointmentDropEventArgs 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; + /** + * 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; + /** + * Provides information about dropped appointments. + * Value: An array of ASPxClientAppointmentDragInfo objects storing information about dropped appointments. + */ + dragInformation: ASPxClientAppointmentDragInfo[]; +} +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; + /** + * Gets the resized appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before resizing. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets the appointment's interval after resizing. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; +} +interface AppointmentResizingEventHandler { + /** + * + * @param source + * @param e + */ + (source: S, e: ASPxClientAppointmentResizingEventArgs): void; +} +/** + * Provides data for the AppointmentResizing event. + */ +interface ASPxClientAppointmentResizingEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not an appointment can be resized to the new time interval. + * Value: true to allow resizing the appointment; otherwise, false. + */ + allow: boolean; + /** + * Gets a mouse event object related to the current appointment resizing operation. + * Value: An object providing event properties specific to mouse events. + */ + mouseEvent: Object; + /** + * Gets the resized appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before resizing. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets the appointment's interval after resizing. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; +} +/** + * Stores information about an appointment drag operation. + */ +interface ASPxClientAppointmentDragInfo { + /** + * Gets the dragged appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before the drag operation. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets resources that were associated with the appointment before the drag operation. + * Value: A array of strings containing resource identifiers. + */ + oldResources: string[]; + /** + * Gets the appointment's interval after the drag operation. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; + /** + * Gets resources associated with the appointment after the drag operation. + * Value: An array of strings containing resource identifiers. + */ + newResources: string[]; +} +/** + * 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; + reason: 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * Gets the Popup Edit Form. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; +} +/** + * Represents a client-side equivalent of the BootstrapAccordion control. + */ +interface BootstrapClientAccordion extends ASPxClientNavBar { +} +/** + * Represents a client-side equivalent of the BootstrapButton control. + */ +interface BootstrapClientButton extends ASPxClientButton { + /** + * 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; +} +/** + * Represents a client-side equivalent of the BootstrapCalendar control. + */ +interface BootstrapClientCalendar extends ASPxClientCalendar { +} +/** + * Represents a client-side equivalent of the BootstrapCheckBox control. + */ +interface BootstrapClientCheckBox 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 + */ + 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 + */ + SetCheckState(checkState: string): void; + /** + * Sets the text to be displayed within the editor. + * @param text + */ + SetText(text: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapRadioButton control. + */ +interface BootstrapClientRadioButton extends BootstrapClientCheckBox { +} +/** + * Represents a client-side equivalent of the BootstrapComboBox control. + */ +interface BootstrapClientComboBox extends ASPxClientComboBox { +} +/** + * Represents a client-side equivalent of the BootstrapDateEdit control. + */ +interface BootstrapClientDateEdit extends ASPxClientDateEdit { +} +/** + * Represents a client-side equivalent of the BootstrapDropDownEdit control. + */ +interface BootstrapClientDropDownEdit extends ASPxClientDropDownEdit { +} +/** + * Represents a client-side equivalent of the BootstrapFormLayout control. + */ +interface BootstrapClientFormLayout extends ASPxClientFormLayout { +} +/** + * Represents a client-side equivalent of the BootstrapGridView control. + */ +interface BootstrapClientGridView extends ASPxClientGridView { +} +/** + * Represents a client-side equivalent of the BootstrapHyperLink control. + */ +interface BootstrapClientHyperLink extends ASPxClientHyperLink { +} +/** + * Represents a client-side equivalent of the BootstrapListBox control. + */ +interface BootstrapClientListBox extends ASPxClientListBox { +} +interface BootstrapClientCheckBoxList extends ASPxClientCheckBoxList { +} +interface BootstrapClientRadioButtonList extends ASPxClientRadioButtonList { +} +/** + * Represents a client-side equivalent of the BootstrapMenu control. + */ +interface BootstrapClientMenu extends ASPxClientMenu { +} +/** + * Represents a client-side equivalent of the BootstrapPopupControl control. + */ +interface BootstrapClientPopupControl extends ASPxClientPopupControl { +} +/** + * Represents a client-side equivalent of the BootstrapPopupMenu control. + */ +interface BootstrapClientPopupMenu extends ASPxClientPopupMenu { +} +/** + * Represents a client-side equivalent of the BootstrapProgressBar control. + */ +interface BootstrapClientProgressBar extends ASPxClientProgressBar { +} +/** + * Represents a client-side equivalent of the BootstrapSpinEdit control. + */ +interface BootstrapClientSpinEdit extends ASPxClientSpinEdit { +} +/** + * Represents a client-side equivalent of the BootstrapTabControl control. + */ +interface BootstrapClientTabControl extends ASPxClientTabControl { +} +/** + * Represents a client-side equivalent of the BootstrapPageControl control. + */ +interface BootstrapClientPageControl extends ASPxClientPageControl { +} +/** + * Represents a client-side equivalent of the BootstrapTextBox control. + */ +interface BootstrapClientTextBox extends ASPxClientTextBox { +} +/** + * Represents a client-side equivalent of the BootstrapMemo control. + */ +interface BootstrapClientMemo extends ASPxClientMemo { +} +/** + * Represents a client-side equivalent of the BootstrapButtonEdit control. + */ +interface BootstrapClientButtonEdit extends ASPxClientButtonEdit { +} +/** + * Represents a client-side equivalent of the BootstrapTreeView control. + */ +interface BootstrapClientTreeView extends ASPxClientTreeView { +} +/** + * 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * + * @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. + * @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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param data A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * + * @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. + * @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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * Sends a callback with parameters to update the popup window by processing the related popup window and the passed information on the server. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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 { + /** + * A method that will handle the ToolTipDisplaying event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientSchedulerToolTipDisplayingEventArgs object that contains the related arguments. + */ + (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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * + * @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. + * @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; + /** + * Specifies the text that Assistive Technologies (screen readers or braille display, for example) will provide to a user. + * @param message A String value that specifies a text. + */ + SendMessageToAssistiveTechnology(message: string): void; + /** + * 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; +} +/** + * 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 ASPxCallbackPanel control. + */ +interface ASPxClientCallbackPanel extends ASPxClientPanel { + /** + * 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; +} +/** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + */ +interface ASPxClientControlPredicate { + /** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + * @param control An object to compare against the criteria defined within the method. + */ + (control: Object): boolean; +} +/** + * Represents a JavaScript function which receives the action to perform for a control when the client ForEachControl method is called. + */ +interface ASPxClientControlAction { + /** + * Represents a JavaScript function which receives the action to perform for a control when the client ForEachControl method is called. + * @param control An object that specifies a control. + */ + (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; + /** + * Returns all controls in the collection that satisfy the specified predicate. + * @param predicate An ASPxClientControlPredicate object that is a predicate used to search for controls in the collection. + */ + GetControlsByPredicate(predicate: ASPxClientControlPredicate): Object[]; + /** + * Returns all controls of the specified type. + * @param type The object specifying the client control type. + */ + GetControlsByType(type: Object): Object[]; + /** + * Performs the specified action for each control in the collection. + * @param action An ASPxClientControlAction object specifying an action to perform. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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 { + /** + * Gets a value specifying whether an item is a parent folder. + * Value: true if an item is a parent folder; false if an item is a file or folder. + */ + 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 { + /** + * Recalculates the position of visible sub menus. + */ + 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 { +} +interface ASPxClientPager extends ASPxClientControl { +} +/** + * 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; + /** + * Sends a callback with parameters to update the popup window by processing the related popup window and the passed information on the server. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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; + /** + * Shows the Crosshair Cursor at the point with the specified coordinates. + * @param screenX The horizontal coordinate that is related to the top-left angle of the chart. + * @param screenY The vertical coordinate that is related to the top-left angle of the chart. + */ + ShowCrosshair(screenX: number, screenY: number): void; +} +/** + * 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 a value that specifies whether the Crosshair cursor should show points that are out of visual range. + * Value: true if the out of visual range points should be shown in the Crosshair label; otherwise false. + */ + showOutOfRangePoints: boolean; + /** + * Gets the identifier specifying the behavior of the selection of points shown in the crosshair label. + * Value: The selection behavior identifier. + */ + valueSelectionMode: 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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 { + /** + * + * @param source + * @param e + */ + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; +} +/** + * 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 each time a look-up editor is created for a report parameter. + */ + CustomizeParameterLookUpSource: 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; + /** + * 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. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + 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 { + /** + * + * @param source + * @param e + */ + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; +} +/** + * Provides data for the ExitDesigner event. + */ +interface ASPxClientReportDesignerExitDesignerEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the CustomizeParameterLookUpSource event. + */ +interface ASPxClientReportDesignerCustomizeParameterLookUpSourceEventHandler { + /** + * A method that will handle the CustomizeParameterLookUpSource event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterLookUpSourceEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterLookUpSourceEventArgs): void; +} +/** + * 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; +} +/** + * Provides information about a report parameter on the client side. + */ +interface ASPxClientReportParameterInfo { + /** + * Specifies the parameter path, relative to its parent container (e.g., "subreport1.subreportParameter1" for a subreport's parameter, or "parameter1" for a report's parameter). + * Value: A String value, specifying the parameter path (e.g., "subreport1.subreportParameter1"). + */ + Path: string; + /** + * Provides access to a parameter value on the client. + * Value: A Object value. + */ + 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; +} +/** + * A method that will handle the PageLoad events. + */ +interface ASPxClientReportViewerPageLoadEventHandler { + /** + * A method that will handle the PageLoad event. + * @param source The event sender. + * @param e An ASPxClientReportViewerPageLoadEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportViewerPageLoadEventArgs): void; +} +/** + * Provides data for the PageLoad events 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 data for the CustomizeParameterLookUpSource events. + */ +interface ASPxClientCustomizeParameterLookUpSourceEventArgs extends ASPxClientEventArgs { + /** + * Provides access to an object that stores information about a parameter. + * Value: An ASPxDesignerElementParameterDescriptor object that stores information about the parameter. + */ + parameter: ASPxDesignerElementParameterDescriptor; + /** + * Provides access to the collection of look-up parameter values. + * Value: An array of ASPxDesignerElementEditorItem objects that store information about look-up parameter values. + */ + items: ASPxDesignerElementEditorItem[]; + /** + * Specifies the data source that provides look-up values for the parameter editor. + * Value: An Object specifying the data source that provides look-up values to the parameter editor. + */ + dataSource: Object; +} +interface ASPxClientCustomizeMenuActionsEventArgs extends ASPxClientEventArgs { + Actions: ASPxClientMenuAction[]; + GetById(actionId: string): ASPxClientMenuAction; +} +interface ASPxClientMenuAction { + text: string; + imageClassName: string; + clickAction: Function; + disabled: boolean; + visible: boolean; + hotKey: ASPxClientMenuActionHotKey; + hasSeparator: string; + container: string; +} +interface ASPxClientMenuActionHotKey { + keyCode: number; + ctrlKey: boolean; +} +/** + * 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; + extendedOptions: Object; + /** + * 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>; + /** + * Occurs each time a look-up editor is created for a report parameter. + */ + CustomizeParameterLookUpSource: 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 { + /** + * + * @param source + * @param e + */ + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; +} +/** + * 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; +} +/** + * A method that will handle the CustomizeParameterLookUpSource event. + */ +interface ASPxClientWebDocumentViewerCustomizeParameterLookUpSourceEventHandler { + /** + * A method that will handle the CustomizeParameterLookUpSource event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterLookUpSourceEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterLookUpSourceEventArgs): void; +} + +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 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 ASPxClientDashboardStatic 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 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 { + /** + * 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): ASPxClientTokenBox; +} +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 { + /** + * 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): ASPxClientRichEdit; +} +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. + * @param dayCount The number of days to add. + */ + AddDays(date: Date, dayCount: number): 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 ASPxClientSpellCheckerStopCheckingReasonStatic { + Default: string; + User: string; +} +interface ASPxClientSpreadsheetStatic 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): ASPxClientSpreadsheet; +} +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 BootstrapClientAccordionStatic extends ASPxClientNavBarStatic { +} +interface BootstrapClientButtonStatic extends ASPxClientButtonStatic { +} +interface BootstrapClientCalendarStatic extends ASPxClientCalendarStatic { +} +interface BootstrapClientCheckBoxStatic extends ASPxClientEditStatic { +} +interface BootstrapClientRadioButtonStatic extends BootstrapClientCheckBoxStatic { +} +interface BootstrapClientComboBoxStatic extends ASPxClientComboBoxStatic { +} +interface BootstrapClientDateEditStatic extends ASPxClientDateEditStatic { +} +interface BootstrapClientDropDownEditStatic extends ASPxClientDropDownEditStatic { +} +interface BootstrapClientFormLayoutStatic extends ASPxClientFormLayoutStatic { +} +interface BootstrapClientGridViewStatic extends ASPxClientGridViewStatic { +} +interface BootstrapClientHyperLinkStatic extends ASPxClientHyperLinkStatic { +} +interface BootstrapClientListBoxStatic extends ASPxClientListBoxStatic { +} +interface BootstrapClientCheckBoxListStatic extends ASPxClientCheckBoxListStatic { +} +interface BootstrapClientRadioButtonListStatic extends ASPxClientRadioButtonListStatic { +} +interface BootstrapClientMenuStatic extends ASPxClientMenuStatic { +} +interface BootstrapClientPopupControlStatic extends ASPxClientPopupControlStatic { +} +interface BootstrapClientPopupMenuStatic extends ASPxClientPopupMenuStatic { +} +interface BootstrapClientProgressBarStatic extends ASPxClientProgressBarStatic { +} +interface BootstrapClientSpinEditStatic extends ASPxClientSpinEditStatic { +} +interface BootstrapClientTabControlStatic extends ASPxClientTabControlStatic { +} +interface BootstrapClientPageControlStatic extends ASPxClientPageControlStatic { +} +interface BootstrapClientTextBoxStatic extends ASPxClientTextBoxStatic { +} +interface BootstrapClientMemoStatic extends ASPxClientMemoStatic { +} +interface BootstrapClientButtonEditStatic extends ASPxClientButtonEditStatic { +} +interface BootstrapClientTreeViewStatic extends ASPxClientTreeViewStatic { +} +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 { + /** + * The tooltip is displayed for a selected appointment. + */ + Appointment: number; + /** + * The tooltip is displayed for a dragged appointment. + */ + AppointmentDrag: number; + /** + * The tooltip is displayed for a selected time interval. + */ + 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 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 ASPxClientCallbackPanelStatic extends ASPxClientPanelStatic { + /** + * 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 { + /** + * 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): ASPxClientFormLayout; +} +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 ASPxClientPagerStatic extends ASPxClientControlStatic { +} +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; + /** + * Specifies the text that Assistive Technologies (screen readers or braille display, for example) will provide to a user. + * @param message A String value that specifies a text. + */ + SendMessageToAssistiveTechnology(message: string): void; +} +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 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 ASPxClientDashboard: ASPxClientDashboardStatic; +declare var ASPxClientDashboardViewer: ASPxClientDashboardViewerStatic; +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 ASPxClientSpellCheckerStopCheckingReason: ASPxClientSpellCheckerStopCheckingReasonStatic; +declare var ASPxClientSpreadsheet: ASPxClientSpreadsheetStatic; +declare var ASPxClientTreeList: ASPxClientTreeListStatic; +declare var BootstrapClientAccordion: BootstrapClientAccordionStatic; +declare var BootstrapClientButton: BootstrapClientButtonStatic; +declare var BootstrapClientCalendar: BootstrapClientCalendarStatic; +declare var BootstrapClientCheckBox: BootstrapClientCheckBoxStatic; +declare var BootstrapClientRadioButton: BootstrapClientRadioButtonStatic; +declare var BootstrapClientComboBox: BootstrapClientComboBoxStatic; +declare var BootstrapClientDateEdit: BootstrapClientDateEditStatic; +declare var BootstrapClientDropDownEdit: BootstrapClientDropDownEditStatic; +declare var BootstrapClientFormLayout: BootstrapClientFormLayoutStatic; +declare var BootstrapClientGridView: BootstrapClientGridViewStatic; +declare var BootstrapClientHyperLink: BootstrapClientHyperLinkStatic; +declare var BootstrapClientListBox: BootstrapClientListBoxStatic; +declare var BootstrapClientCheckBoxList: BootstrapClientCheckBoxListStatic; +declare var BootstrapClientRadioButtonList: BootstrapClientRadioButtonListStatic; +declare var BootstrapClientMenu: BootstrapClientMenuStatic; +declare var BootstrapClientPopupControl: BootstrapClientPopupControlStatic; +declare var BootstrapClientPopupMenu: BootstrapClientPopupMenuStatic; +declare var BootstrapClientProgressBar: BootstrapClientProgressBarStatic; +declare var BootstrapClientSpinEdit: BootstrapClientSpinEditStatic; +declare var BootstrapClientTabControl: BootstrapClientTabControlStatic; +declare var BootstrapClientPageControl: BootstrapClientPageControlStatic; +declare var BootstrapClientTextBox: BootstrapClientTextBoxStatic; +declare var BootstrapClientMemo: BootstrapClientMemoStatic; +declare var BootstrapClientButtonEdit: BootstrapClientButtonEditStatic; +declare var BootstrapClientTreeView: BootstrapClientTreeViewStatic; +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 ASPxClientPanelBase: ASPxClientPanelBaseStatic; +declare var ASPxClientPanel: ASPxClientPanelStatic; +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 ASPxClientPager: ASPxClientPagerStatic; +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/types/devexpress-web/v162/tsconfig.json b/types/devexpress-web/v162/tsconfig.json new file mode 100644 index 0000000000..7014b0435c --- /dev/null +++ b/types/devexpress-web/v162/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "devexpress-web": ["devexpress-web/v162"], + "devexpress-web/*": ["devexpress-web/v162/*"] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "devexpress-web-tests.ts" + ] +} \ No newline at end of file From 1c93aa3906dec160a7ce96d6684c57c734295d0f Mon Sep 17 00:00:00 2001 From: Wilco Bakker <99027394@mydavinci.nl> Date: Tue, 6 Jun 2017 15:31:33 +0200 Subject: [PATCH 074/761] @types/node: Added emitWarning method to process. (#16718) * Added emitWarning method to process. * Added emitWarning to @types/node/index.d.ts as well. --- types/node/index.d.ts | 2 ++ types/node/v6/index.d.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index c080762611..31e068cec8 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -5,6 +5,7 @@ // Parambir Singh // Roberto Desideri // Christian Vaagland Tellnes +// Wilco Bakker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -392,6 +393,7 @@ declare namespace NodeJS { abort(): void; chdir(directory: string): void; cwd(): string; + emitWarning(warning: string | Error, name?: string, ctor?: Function): void; env: any; exit(code?: number): never; exitCode: number; diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index d42ba89944..d0c3a44311 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Node.js v6.x // Project: http://nodejs.org/ -// Definitions by: Microsoft TypeScript , DefinitelyTyped +// Definitions by: Microsoft TypeScript , DefinitelyTyped , Wilco Bakker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -385,6 +385,7 @@ declare namespace NodeJS { abort(): void; chdir(directory: string): void; cwd(): string; + emitWarning(warning: string | Error, name?: string, ctor?: Function): void; env: any; exit(code?: number): void; exitCode: number; From ca10f0d24de7f083523e3f85f71f7448e6015109 Mon Sep 17 00:00:00 2001 From: LebedenkoN Date: Tue, 6 Jun 2017 16:32:27 +0300 Subject: [PATCH 075/761] @types/three: Wring typings for ObjectLoader.parseImages #16914 (#16915) * Update three-core.d.ts fixed typings for THREE.ObjectLoader.parseImages * Update three-core.d.ts Changed result of ObjectLoader.parseImages function to more specific type --- types/three/three-core.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index f99485b8dd..5679c4e8c7 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -2208,7 +2208,7 @@ export class ObjectLoader { parseGeometries(json: any): any[]; // Array of BufferGeometry or Geometry or Geometry2. parseMaterials(json: any, textures: Texture[]): Material[]; // Array of Classes that inherits from Matrial. parseAnimations(json: any): AnimationClip[]; - parseImages(json: any, onLoad: () => void): any[]; + parseImages(json: any, onLoad: () => void): { [key: string]: HTMLImageElement }; parseTextures(json: any, images: any): Texture[]; parseObject(data: any, geometries: any[], materials: Material[]): T; } From 71b90dcce74d5fbe9f20c85d9e322d5e1b6bf41e Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Tue, 6 Jun 2017 16:13:40 +0200 Subject: [PATCH 076/761] fix tests and dtslint and improve typings --- types/heredatalens/heredatalens-tests.ts | 73 ++++++++++-------------- types/heredatalens/index.d.ts | 14 ++++- 2 files changed, 41 insertions(+), 46 deletions(-) diff --git a/types/heredatalens/heredatalens-tests.ts b/types/heredatalens/heredatalens-tests.ts index 51fa56b380..37f20f2f84 100644 --- a/types/heredatalens/heredatalens-tests.ts +++ b/types/heredatalens/heredatalens-tests.ts @@ -6,10 +6,6 @@ * are not intended as functional tests. */ -import './index'; - - -let service: H.datalens.Service; let serviceOptions: H.datalens.Service.Options = { subDomain: 'sub', version: 'version', @@ -31,27 +27,24 @@ let queryTileProviderOptions: H.datalens.QueryTileProvider.Options = { tileParamNames: queryTileProviderTileParamNames }; +let service: H.datalens.Service = new H.datalens.Service(serviceOptions); +service.request('method', 'endpoint', 'params', 'body', (result: any) => {}, (error: any) => {}).then((data: any) => {}); +service.fetchQueryData('id', 'params', (result: any) => {}, (error: any) => {}).then((data: any) => {}); +service.fetchQueryStats('id', 'query', (result: any) => {}, (error: any) => {}).then((data: any) => {}); +service.fetchLayer('name', 'params', (result: any) => {}, (error: any) => {}).then((data: any) => {}); +service.fetchLayerTile('name', 1, 2, 3, 'params', (result: any) => {}, (error: any) => {}).then((data: any) => {}); +service.setTokens('token', 'refresh_token'); +service.configure('app_id', 'app_code', true, true, new H.service.Url('scheme', 'host')); + let queryTileProvider = new H.datalens.QueryTileProvider(service, queryTileProviderOptions); queryTileProvider.setQueryId('some id'); queryTileProvider.setQueryParams('some params'); queryTileProvider.setTileParamNames(queryTileProviderTileParamNames); - -service = new H.datalens.Service(serviceOptions); -service.request('method', 'endpoint', 'params', 'body', function(result) {}, function(error) {}).then(data => {}); -service.fetchQueryData('id', 'params', function(result) {}, function(error) {}).then(data => {}); -service.fetchQueryStats('id', 'query', function(result) {}, function(error) {}).then(data => {}); -service.fetchLayer('name', 'params', function(result) {}, function(error) {}).then(data => {}); -service.fetchLayerTile('name', 1, 2, 3, 'params', function(result) {}, function(error) {}).then(data => {}); -service.setTokens('token', 'refresh_token'); -service.configure('app_id', 'app_code', true, true, new H.service.Url('scheme', 'host')); - - let provider = new H.datalens.Provider({ columns: ['1', '2'], rows: [[], []]}); provider.getData(); provider.setData({ columns: ['3', '4'], rows: [[], []]}); - let queryProviderOptions: H.datalens.QueryProvider.Options = { queryId: 'id', queryParams: 'params' @@ -63,26 +56,24 @@ queryProvider.reload(); queryProvider.getData(); queryProvider.setData({ columns: ['3', '4'], rows: [[], []]}); - let rasterLayerOptions: H.datalens.RasterLayer.Options = { - dataToRows: (): H.datalens.RasterLayer.Row[] => { return []; }, - rowToTilePoint: (): H.datalens.RasterLayer.TilePoint => { return { x: 1, y: 2 }; }, - buffer: (): number => { return 1; }, + dataToRows: (): H.datalens.RasterLayer.Row[] => [], + rowToTilePoint: (): H.datalens.RasterLayer.TilePoint => ({ x: 1, y: 2 }), + buffer: (): number => 1, renderTile: () => {} }; let rasterLayer = new H.datalens.RasterLayer(); rasterLayer.redraw(); - let heatmapLayerOptions: H.datalens.HeatmapLayer.Options = { - dataToRows: (): H.datalens.HeatmapLayer.Row[] => { return []; }, - rowToTilePoint: (): H.datalens.HeatmapLayer.TilePoint => { return { x: 1, y: 2, value: 5, count: 5 }; }, + dataToRows: (): H.datalens.HeatmapLayer.Row[] => [], + rowToTilePoint: (): H.datalens.HeatmapLayer.TilePoint => ({ x: 1, y: 2, value: 5, count: 5 }), bandwidth: 5, - valueRange: (): number[] => { return []; }, - countRange: (): number[] => { return []; }, - colorScale: (): string => { return '2'; }, - alphaScale: (): number => { return 1; }, + valueRange: (): number[] => [], + countRange: (): number[] => [], + colorScale: (): string => '2', + alphaScale: (): number => 1, aggregation: H.datalens.HeatmapLayer.Aggregation.SUM, inputScale: H.datalens.HeatmapLayer.InputScale.LINEAR }; @@ -92,29 +83,27 @@ heatmapLayer.getOptionsPerZoom(5); heatmapLayer.dispose(); heatmapLayer.redraw(); - let objectLayerOptions: H.datalens.ObjectLayer.Options = { - dataToRows: (): H.datalens.ObjectLayer.Row[] => { return []; }, - rowToMapObject: (): H.map.Object => { return new H.map.Object() }, - rowToStyle: (): H.datalens.ObjectLayer.ObjectStyleOptions => { return { icon: new H.map.Icon('x'), style: {}, arrows: {}, zIndex: 1 }; }, + dataToRows: (): H.datalens.ObjectLayer.Row[] => [], + rowToMapObject: (): H.map.Object => new H.map.Object(), + rowToStyle: (): H.datalens.ObjectLayer.ObjectStyleOptions => ({ icon: new H.map.Icon('x'), style: {}, arrows: {}, zIndex: 1 }), dataDomains: 2, - clustering: { rowToDataPoint: (): H.clustering.DataPoint => { return; }, options: (): H.clustering.Provider.ClusteringOptions => { return {}; } } -} + clustering: { rowToDataPoint: (): H.clustering.DataPoint => ({ lat: 12.1, lng: 1.12, alt: 5, ctx: H.geo.AltitudeContext.GL, wt: 2, data: {} }), + options: (): H.clustering.Provider.ClusteringOptions => ({}) } +}; let objectLayer = new H.datalens.ObjectLayer(provider, objectLayerOptions); objectLayer.redraw(); -objectLayer.updateObjectStyle(new H.map.Object, { icon: new H.map.Icon('x'), style: {}, arrows: {}, zIndex: 1 }); - +objectLayer.updateObjectStyle(new H.map.Object(), { icon: new H.map.Icon('x'), style: {}, arrows: {}, zIndex: 1 }); let rawDataProviderOptions: H.datalens.RawDataProvider.Options = { dataUrl: 'url', - dataToFeatures: (): H.datalens.RawDataProvider.Feature[] => { return []; }, - featuresToRows: (): H.datalens.ObjectLayer.Row[] => { return []; } + dataToFeatures: (): H.datalens.RawDataProvider.Feature[] => [], + featuresToRows: (): H.datalens.ObjectLayer.Row[] => [] }; let rawDataProvider = new H.datalens.RawDataProvider(rawDataProviderOptions); - let spatialTileProviderOptions: H.datalens.SpatialTileProvider.Options = { layerName: 'name', queryParams: 'params' @@ -123,14 +112,12 @@ let spatialTileProviderOptions: H.datalens.SpatialTileProvider.Options = { let spatialProvider: H.datalens.SpatialTileProvider = new H.datalens.SpatialTileProvider(service, spatialTileProviderOptions); let spatialLayerOptions: H.datalens.SpatialLayer.Options = { - dataToRows: (): H.datalens.SpatialLayer.Row[] => { return []; }, - rowToSpatialId: (): string => { return 'asd'; }, - featureToSpatialId: (): string => { return 'asd'; }, + dataToRows: (): H.datalens.SpatialLayer.Row[] => [], + rowToSpatialId: (): string => 'asd', + featureToSpatialId: (): string => 'asd', rowToStyle: (): any => { return; }, defaultStyle: (): any => { return; }, transformFeature: 1 }; let spatialLayer = new H.datalens.SpatialLayer(provider, spatialProvider, spatialLayerOptions); - - diff --git a/types/heredatalens/index.d.ts b/types/heredatalens/index.d.ts index 9c7c5d910c..9b3ff44431 100644 --- a/types/heredatalens/index.d.ts +++ b/types/heredatalens/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for HERE Data Lens API for JavaScript v2.3.0-31 +// Type definitions for HERE Data Lens API for JavaScript 2.3 // Project: https://developer.here.com/ // Definitions by: Bernd Hacker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -521,7 +521,11 @@ declare namespace H { * Each row is transformed into TilePoint and then rendered on a heat map. By default each row is an Object where property names correspond to data column names. * This representation can be changed with the dataToRows callback. */ - type Row = number; + interface Row { + tx?: number; + ty?: number; + count?: number; + } /** * Defines a constant for the bandwidth @@ -678,7 +682,11 @@ declare namespace H { * Each row is translated to map objects with the rowToMapObject callback. By default each row is an Object where property names correspond to data column names. * This representation can be changed with the dataToRows callback. */ - type Row = number; + interface Row { + getPosition(): H.geo.Point; + lat: number; + lng: number; + } /** * User defined modification of a data-driven style From 7d863884d0dc482dbe6934c336f61e331427a193 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Jun 2017 16:57:30 +0100 Subject: [PATCH 077/761] Added revwalk --- types/nodegit/index.d.ts | 1 + types/nodegit/rev-walk.d.ts | 36 ++++++++++++++++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 38 insertions(+) create mode 100644 types/nodegit/rev-walk.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index a4a90f07d2..14d88297c4 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -33,6 +33,7 @@ export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; +export { Revwalk } from './rev-walk'; export { Signature } from './signature'; export { Stash } from './stash'; export { StatusEntry } from './status-entry'; diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts new file mode 100644 index 0000000000..ad54969164 --- /dev/null +++ b/types/nodegit/rev-walk.d.ts @@ -0,0 +1,36 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Commit } from './commit'; + +export namespace Revwalk { + enum SORT { + NONE = 0, + TOPOLOGICAL = 1, + TIME = 2, + REVERSE = 4 + } +} + +export class Revwalk { + static create(repo: Repository): Revwalk; + + hide(commit_id: Oid): number; + hideGlob(glob: string): number; + hideHead(): number; + hideRef(refname: string): number; + next(): Promise; + push(id: Oid): number; + pushGlob(glob: string): number; + pushHead(): number; + pushRange(range: string): number; + pushRef(refname: string): number; + repository(): Repository; + reset(): void; + simplifyFirstParent(): void; + sorting(sort: number): any; + fastWalk(max_count: number): Promise; + fileHistoryWalk(filePath: string, max_count: number): Promise; + walk(oid: Oid, callback: Function): Commit; + getCommitsUntil(checkFn: Function): Promise; + getCommits(count: number): Promise; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 017b34314c..9e3fa9285a 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -47,6 +47,7 @@ "remote-callbacks.d.ts", "remote.d.ts", "repository.d.ts", + "rev-walk.d.ts", "signature.d.ts", "stash.d.ts", "status-entry.d.ts", From 4106095ad7a5cd1f1508e732d037e1b9601e2e23 Mon Sep 17 00:00:00 2001 From: rainshen49 Date: Tue, 6 Jun 2017 12:05:02 -0400 Subject: [PATCH 078/761] UnparseConfig individually optional --- types/papaparse/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/papaparse/index.d.ts b/types/papaparse/index.d.ts index a529cb845e..76f7c224b3 100644 --- a/types/papaparse/index.d.ts +++ b/types/papaparse/index.d.ts @@ -78,13 +78,13 @@ declare namespace PapaParse { complete?(results: ParseResult, file?: File): void; // default: undefined error?(error: ParseError, file?: File): void; // default: undefined chunk?(results: ParseResult, parser: Parser): void; // default: undefined - beforeFirstChunk?(chunk: string): string|void; // default: undefined + beforeFirstChunk?(chunk: string): string | void; // default: undefined } interface UnparseConfig { - quotes: boolean; // default: false - delimiter: string; // default: "," - newline: string; // default: "\r\n" + quotes?: boolean; // default: false + delimiter?: string; // default: "," + newline?: string; // default: "\r\n" } interface UnparseObject { @@ -123,7 +123,7 @@ declare namespace PapaParse { /** * Parser */ - interface ParserConstructor { new(config: ParseConfig): Parser; } + interface ParserConstructor { new (config: ParseConfig): Parser; } interface Parser { // Parses the input parse(input: string, baseIndex: number, ignoreLastRow: boolean): any; From a282f4bc9aa60c8880444effae2fa7f4a76ab138 Mon Sep 17 00:00:00 2001 From: rainshen49 Date: Tue, 6 Jun 2017 12:08:34 -0400 Subject: [PATCH 079/761] added test cases and author name --- types/papaparse/index.d.ts | 2 +- types/papaparse/papaparse-tests.ts | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/types/papaparse/index.d.ts b/types/papaparse/index.d.ts index 76f7c224b3..35353f3aba 100644 --- a/types/papaparse/index.d.ts +++ b/types/papaparse/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for PapaParse v4.1 // Project: https://github.com/mholt/PapaParse -// Definitions by: Pedro Flemming +// Definitions by: Pedro Flemming , Rain Shen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace PapaParse { diff --git a/types/papaparse/papaparse-tests.ts b/types/papaparse/papaparse-tests.ts index 32de7e109f..a432fc7f09 100644 --- a/types/papaparse/papaparse-tests.ts +++ b/types/papaparse/papaparse-tests.ts @@ -13,7 +13,7 @@ Papa.parse("3,3,3", { delimiter: ';', comments: false, - step: function(results, p) { + step: function (results, p) { p.abort(); results.data.length; } @@ -22,7 +22,7 @@ Papa.parse("3,3,3", { var file = new File(null, null, null); Papa.parse(file, { - complete: function(a, b) { + complete: function (a, b) { a.meta.fields; b.name; } @@ -31,13 +31,19 @@ Papa.parse(file, { /** * Unparsing */ -Papa.unparse([{a: 1, b: 1, c: 1}]); +Papa.unparse([{ a: 1, b: 1, c: 1 }]); Papa.unparse([[1, 2, 3], [4, 5, 6]]); Papa.unparse({ fields: ["3"], data: [] }); +Papa.unparse([{ a: 1, b: 1, c: 1 }], { quotes: false }); +Papa.unparse([[1, 2, 3], [4, 5, 6]], { delimiter: "," }); +Papa.unparse({ + fields: ["3"], + data: [] +}, { newline: "\n" }); /** From ca3a06d9f3c59ea60593087269632e9b4a214ad5 Mon Sep 17 00:00:00 2001 From: Dan Corder Date: Tue, 6 Jun 2017 17:46:46 +0100 Subject: [PATCH 080/761] Revert history version change as discussed on pull request 16912 --- types/react-router-redux/v4/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-router-redux/v4/tsconfig.json b/types/react-router-redux/v4/tsconfig.json index 93628aea73..83cf349881 100644 --- a/types/react-router-redux/v4/tsconfig.json +++ b/types/react-router-redux/v4/tsconfig.json @@ -13,8 +13,8 @@ "../../" ], "paths": { - "history": ["history/v2"], - "history/*": ["history/v2/*"], + "history": ["history/v3"], + "history/*": ["history/v3/*"], "react-router-redux": ["react-router-redux/v4"] }, "types": [], From dcfbea5aeb8838c9a1f6a670ab6adea8e1f04a99 Mon Sep 17 00:00:00 2001 From: marshall007 Date: Tue, 6 Jun 2017 12:08:25 -0500 Subject: [PATCH 081/761] @types/bull: updates for API changes in v3 --- types/bull/bull-tests.tsx | 104 ++++++------ types/bull/index.d.ts | 310 +++++++++++++++++++++++----------- types/bull/v2/bull-tests.tsx | 115 +++++++++++++ types/bull/v2/index.d.ts | 316 +++++++++++++++++++++++++++++++++++ types/bull/v2/tsconfig.json | 26 +++ 5 files changed, 723 insertions(+), 148 deletions(-) create mode 100644 types/bull/v2/bull-tests.tsx create mode 100644 types/bull/v2/index.d.ts create mode 100644 types/bull/v2/tsconfig.json diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index fcf339b3c3..2ff4579931 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -4,68 +4,69 @@ import * as Queue from "bull" -var videoQueue = Queue( 'video transcoding', 6379, '127.0.0.1' ); -var audioQueue = Queue( 'audio transcoding', 6379, '127.0.0.1' ); -var imageQueue = Queue( 'image transcoding', 6379, '127.0.0.1' ); +var videoQueue = new Queue('video transcoding', 'redis://127.0.0.1:6379'); +var audioQueue = new Queue('audio transcoding', {redis: {port: 6379, host: '127.0.0.1'}}); // Specify Redis connection using object +var imageQueue = new Queue('image transcoding'); +var pdfQueue = new Queue('pdf transcoding'); -videoQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { +videoQueue.process(function(job, done){ // job.data contains the custom data passed when the job was created // job.jobId contains id of this job. // transcode video asynchronously and report progress - job.progress( 42 ); + job.progress(42); // call done when finished done(); // or give a error if error - done( Error( 'error transcoding' ) ); + done(new Error('error transcoding')); // or pass it a result - done( null, { framerate: 29.5 /* etc... */ } ); + done(null, { framerate: 29.5 /* etc... */ }); // If the job throws an unhandled exception it is also handled correctly - throw (Error( 'some unexpected error' )); -} ); + throw new Error('some unexpected error'); +}); -audioQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { +audioQueue.process(function(job, done){ // transcode audio asynchronously and report progress - job.progress( 42 ); + job.progress(42); // call done when finished done(); // or give a error if error - done( Error( 'error transcoding' ) ); + done(new Error('error transcoding')); // or pass it a result - done( null, { samplerate: 48000 /* etc... */ } ); + done(null, { samplerate: 48000 /* etc... */ }); // If the job throws an unhandled exception it is also handled correctly - throw (Error( 'some unexpected error' )); -} ); + throw new Error('some unexpected error'); +}); -imageQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { +imageQueue.process(function(job, done){ // transcode image asynchronously and report progress - job.progress( 42 ); + job.progress(42); // call done when finished done(); // or give a error if error - done( Error( 'error transcoding' ) ); + done(new Error('error transcoding')); // or pass it a result - done( null, { width: 1280, height: 720 /* etc... */ } ); + done(null, { width: 1280, height: 720 /* etc... */ }); // If the job throws an unhandled exception it is also handled correctly - throw (Error( 'some unexpected error' )); -} ); + throw new Error('some unexpected error'); +}); -videoQueue.add( { video: 'http://example.com/video1.mov' } ); -audioQueue.add( { audio: 'http://example.com/audio1.mp3' } ); -imageQueue.add( { image: 'http://example.com/image1.tiff' } ); +videoQueue.add({video: 'http://example.com/video1.mov'}); +audioQueue.add({audio: 'http://example.com/audio1.mp3'}); +imageQueue.add({image: 'http://example.com/image1.tiff'}); ////////////////////////////////////////////////////////////////////////////////// @@ -74,42 +75,43 @@ imageQueue.add( { image: 'http://example.com/image1.tiff' } ); // ////////////////////////////////////////////////////////////////////////////////// -const fetchVideo = ( url: string ): Promise => { return null } -const transcodeVideo = ( data: any ): Promise => { return null } -interface VideoJob extends Queue.Job { - data: {url: string} -} +pdfQueue.process(function(job){ + // Processors can also return promises instead of using the done callback + return Promise.resolve(); +}); -videoQueue.process( ( job: VideoJob ) => { // don't forget to remove the done callback! - // Simply return a promise - fetchVideo( job.data.url ).then( transcodeVideo ); - - // Handles promise rejection - Promise.reject( new Error( 'error transcoding' ) ); - - // Passes the value the promise is resolved with to the "completed" event - Promise.resolve( { framerate: 29.5 /* etc... */ } ); - - // same as - Promise.reject( new Error( 'some unexpected error' ) ); - - // If the job throws an unhandled exception it is also handled correctly - throw new Error( 'some unexpected error' ); -} ); - - -var addVideo1Job = videoQueue.add( { video: 'http://example.com/video1.mov' } ); - -addVideo1Job.then((video1Job) => { +videoQueue.add({ video: 'http://example.com/video1.mov' }, { jobId: 1 }) +.then((video1Job) => { // When job has successfully be placed in the queue the job is returned // then wait for completion return video1Job.finished(); }) .then(() => { - // video1Job completed successfully + // completed successfully }) .catch((err) => { // error }); + + +////////////////////////////////////////////////////////////////////////////////// +// +// Typed Event Handlers +// +////////////////////////////////////////////////////////////////////////////////// + + +pdfQueue +.on('ready', () => undefined) +.on('error', (err: Error) => undefined) +.on('active', (job: Queue.Job, jobPromise: Queue.JobPromise) => jobPromise.cancel()) +.on('active', (job: Queue.Job) => undefined) +.on('stalled', (job: Queue.Job) => undefined) +.on('progress', (job: Queue.Job) => undefined) +.on('completed', (job: Queue.Job) => undefined) +.on('failed', (job: Queue.Job) => undefined) +.on('paused', () => undefined) +.on('resumed', () => undefined) +.on('cleaned', (jobs: Queue.Job[], status: Queue.JobStatus) => undefined) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 3c89655101..3c49109903 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for bull 2.1.2 +// Type definitions for bull v.3.0.0-rc.2 // Project: https://github.com/OptimalBits/bull -// Definitions by: Bruno Grieder , Cameron Crothers +// Definitions by: Bruno Grieder +// Cameron Crothers +// Marshall Cottrell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -14,22 +16,72 @@ declare module "bull" { * It creates a new Queue that is persisted in Redis. * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session. */ - function Bull(queueName: string, redisPort: number, redisHost: string, redisOpt?: Redis.ClientOpts): Bull.Queue; + var Bull: { + (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + (queueName: string, url?: string): Bull.Queue; + new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + new (queueName: string, url?: string): Bull.Queue; + } namespace Bull { - export interface DoneCallback { - (error?: Error, value?: any): void + export interface QueueOptions { + + /** + * Options passed directly to the `ioredis` constructor + */ + redis?: Redis.ClientOpts; + + /** + * Prefix to use for all redis keys + */ + prefix?: string; + + settings?: AdvancedSettings; } + export interface AdvancedSettings { + + /** + * Key expiration time for job locks + */ + lockDuration?: number; + + /** + * How often check for stalled jobs (use 0 for never checking) + */ + stalledInterval?: number; + + /** + * Max amount of times a stalled job will be re-processed + */ + maxStalledCount?: number; + + /** + * Poll interval for delayed jobs and added jobs + */ + guardInterval?: number; + + /** + * Delay before processing next job in case of internal error + */ + retryProcessDelay?: number; + } + + export interface DoneCallback { + (error?: Error | null, value?: any): void + } + + export type JobId = number | string; + export interface Job { - jobId: string + id: JobId; /** - * The custom data passed when the job was created - */ - data: Object; + * The custom data passed when the job was created + */ + data: any; /** * Report progress on a job @@ -37,13 +89,13 @@ declare module "bull" { progress(value: any): Promise; /** - * Removes a Job from the queue from all the lists where it may be included. + * Removes a job from the queue and from any lists it may be included in. * @returns {Promise} A promise that resolves when the job is removed. */ remove(): Promise; /** - * Rerun a Job that has failed. + * Re-run a job that has failed. * @returns {Promise} A promise that resolves when the job is scheduled for retry. */ retry(): Promise; @@ -56,12 +108,14 @@ declare module "bull" { finished(): Promise; } - export interface Backoff { + export type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed'; + + export interface BackoffOptions { /** * Backoff type, which can be either `fixed` or `exponential` */ - type: string + type: 'fixed' | 'exponential'; /** * Backoff delay, in milliseconds @@ -69,22 +123,52 @@ declare module "bull" { delay: number; } - export interface AddOptions { + export interface RepeatOptions { + + /** + * Cron pattern specifying when the job should execute + */ + cron: string; + + /** + * Timezone + */ + tz?: string; + + /** + * End date when the repeat job should stop repeating + */ + endDate?: Date | string | number; + } + + export interface JobOptions { + + /** + * Optional priority value. ranges from 1 (highest priority) to MAX_INT (lowest priority). + * Note that using priorities has a slight impact on performance, so do not use it if not required + */ + priority?: number; + /** * An amount of miliseconds to wait until this job can be processed. - * Note that for accurate delays, both server and clients should have their clocks synchronized + * Note that for accurate delays, both server and clients should have their clocks synchronized. [optional] */ delay?: number; /** - * A number of attempts to retry if the job fails [optional] + * The total number of attempts to try the job until it completes */ attempts?: number; + /** + * Repeat job according to a cron specification + */ + repeat?: RepeatOptions; + /** * Backoff setting for automatic retries if the job fails */ - backoff?: number | Backoff + backoff?: number | BackoffOptions; /** * A boolean which, if true, adds the job to the right @@ -96,6 +180,35 @@ declare module "bull" { * The number of milliseconds after which the job should be fail with a timeout error */ timeout?: number; + + /** + * Override the job ID - by default, the job ID is a unique + * integer, but you can use this setting to override it. + * If you use this option, it is up to you to ensure the + * jobId is unique. If you attempt to add a job with an id that + * already exists, it will not be added. + */ + jobId?: JobId; + + /** + * A boolean which, if true, removes the job when it successfully completes. + * Default behavior is to keep the job in the completed set. + */ + removeOnComplete?: boolean; + + /** + * A boolean which, if true, removes the job when it fails after all attempts + * Default behavior is to keep the job in the completed set. + */ + removeOnFail?: boolean; + } + + export interface JobCounts { + wait: number; + active: number; + completed: number; + failed: number; + delayed: number; } export interface Queue { @@ -112,7 +225,7 @@ declare module "bull" { * results, as a second argument to the "completed" event. * * concurrency: Bull will then call you handler in parallel respecting this max number. - */ + */ process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; /** @@ -125,7 +238,7 @@ declare module "bull" { * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. * Errors will be passed as a second argument to the "failed" event; * results, as a second argument to the "completed" event. - */ + */ process(callback: (job: Job, done: DoneCallback) => void): void; /** @@ -139,7 +252,7 @@ declare module "bull" { * If it is resolved, its value will be the "completed" event's second argument. * * concurrency: Bull will then call you handler in parallel respecting this max number. - */ + */ process(concurrency: number, callback: (job: Job) => void): Promise; /** @@ -151,17 +264,15 @@ declare module "bull" { * A promise must be returned to signal job completion. * If the promise is rejected, the error will be passed as a second argument to the "failed" event. * If it is resolved, its value will be the "completed" event's second argument. - */ + */ process(callback: (job: Job) => void): Promise; - // process(callback: (job: Job, done?: DoneCallback) => void): Promise; - /** * Creates a new job and adds it to the queue. * If the queue is empty the job will be executed directly, * otherwise it will be placed in the queue and executed as soon as possible. */ - add(data: Object, opts?: AddOptions): Promise; + add(data: Object, opts?: JobOptions): Promise; /** * Returns a promise that resolves when the queue is paused. @@ -204,113 +315,118 @@ declare module "bull" { * Returns a promise that will return the job instance associated with the jobId parameter. * If the specified job cannot be located, the promise callback parameter will be set to null. */ - getJob(jobId: string): Promise; + getJob(jobId: JobId): Promise; + + /** + * Returns a promise that resolves with the job counts for the given queue + */ + getJobCounts(): Promise; /** * Tells the queue remove all jobs created outside of a grace period in milliseconds. * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. */ - clean(gracePeriod: number, jobsState?: string): Promise; + clean(grace: number, status?: JobStatus, limit?: number): Promise; /** * Listens to queue events - * 'ready', 'error', 'activ', 'progress', 'completed', 'failed', 'paused', 'resumed', 'cleaned' */ - on(eventName: string, callback: EventCallback): void; + on(event: string, callback: (...args: any[]) => void): this; + + /** + * Redis is connected and the queue is ready to accept jobs + */ + on(event: 'ready', callback: EventCallback): this; + + /** + * An error occured + */ + on(event: 'error', callback: ErrorEventCallback): this; + + /** + * A job has started. You can use `jobPromise.cancel()` to abort it + */ + on(event: 'active', callback: ActiveEventCallback): this; + + /** + * A job has been marked as stalled. + * This is useful for debugging job workers that crash or pause the event loop. + */ + on(event: 'stalled', callback: StalledEventCallback): this; + + /** + * A job's progress was updated + */ + on(event: 'progress', callback: ProgressEventCallback): this; + + /** + * A job successfully completed with a `result` + */ + on(event: 'completed', callback: CompletedEventCallback): this; + + /** + * A job failed with `err` as the reason + */ + on(event: 'failed', callback: FailedEventCallback): this; + + /** + * The queue has been paused + */ + on(event: 'paused', callback: EventCallback): this; + + /** + * The queue has been resumed + */ + on(event: 'resumed', callback: EventCallback): this; + + /** + * Old jobs have been cleaned from the queue. + * `jobs` is an array of jobs that were removed, and `type` is the type of those jobs. + * + * @see Queue#clean() for details + */ + on(event: 'cleaned', callback: CleanedEventCallback): this; } - interface EventCallback { - (...args: any[]): void - } - - interface ReadyEventCallback extends EventCallback { + export interface EventCallback { (): void; } - interface ErrorEventCallback extends EventCallback { + export interface ErrorEventCallback { (error: Error): void; } - interface JobPromise { + export interface JobPromise { /** * Abort this job */ cancel(): void } - interface ActiveEventCallback extends EventCallback { - (job: Job, jobPromise: JobPromise): void; + export interface ActiveEventCallback { + (job: Job, jobPromise?: JobPromise): void; } - interface ProgressEventCallback extends EventCallback { + export interface StalledEventCallback { + (job: Job): void; + } + + export interface ProgressEventCallback { (job: Job, progress: any): void; } - interface CompletedEventCallback extends EventCallback { - (job: Job, result: Object): void; + export interface CompletedEventCallback { + (job: Job, result: any): void; } - interface FailedEventCallback extends EventCallback { + export interface FailedEventCallback { (job: Job, error: Error): void; } - interface PausedEventCallback extends EventCallback { - (): void; - } - - interface ResumedEventCallback extends EventCallback { - (job?: Job): void; - } - - /** - * @see clean() for details - */ - interface CleanedEventCallback extends EventCallback { - (jobs: Job[], type: string): void; + export interface CleanedEventCallback { + (jobs: Job[], status: JobStatus): void; } } export = Bull; -} - -declare module "bull/lib/priority-queue" { - - import * as Bull from "bull"; - import * as Redis from "redis"; - - /** - * This is the Queue constructor of priority queue. - * - * It works same a normal queue, with same function and parameters. - * The only difference is that the Queue#add() allow an options opts.priority - * that could take ["low", "normal", "medium", "hight", "critical"]. If no options provider, "normal" will be taken. - * - * The priority queue will process more often highter priority jobs than lower. - */ - function PQueue(queueName: string, redisPort: number, redisHost: string, redisOpt?: Redis.ClientOpts): PQueue.PriorityQueue; - - namespace PQueue { - - export interface AddOptions extends Bull.AddOptions { - - /** - * "low", "normal", "medium", "high", "critical" - */ - priority?: string; - } - - - export interface PriorityQueue extends Bull.Queue { - - /** - * Creates a new job and adds it to the queue. - * If the queue is empty the job will be executed directly, - * otherwise it will be placed in the queue and executed as soon as possible. - */ - add(data: Object, opts?: PQueue.AddOptions): Promise; - - } - } - - export = PQueue; -} +} \ No newline at end of file diff --git a/types/bull/v2/bull-tests.tsx b/types/bull/v2/bull-tests.tsx new file mode 100644 index 0000000000..fcf339b3c3 --- /dev/null +++ b/types/bull/v2/bull-tests.tsx @@ -0,0 +1,115 @@ +/** + * Created by Bruno Grieder + */ + +import * as Queue from "bull" + +var videoQueue = Queue( 'video transcoding', 6379, '127.0.0.1' ); +var audioQueue = Queue( 'audio transcoding', 6379, '127.0.0.1' ); +var imageQueue = Queue( 'image transcoding', 6379, '127.0.0.1' ); + +videoQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { + + // job.data contains the custom data passed when the job was created + // job.jobId contains id of this job. + + // transcode video asynchronously and report progress + job.progress( 42 ); + + // call done when finished + done(); + + // or give a error if error + done( Error( 'error transcoding' ) ); + + // or pass it a result + done( null, { framerate: 29.5 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw (Error( 'some unexpected error' )); +} ); + +audioQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { + // transcode audio asynchronously and report progress + job.progress( 42 ); + + // call done when finished + done(); + + // or give a error if error + done( Error( 'error transcoding' ) ); + + // or pass it a result + done( null, { samplerate: 48000 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw (Error( 'some unexpected error' )); +} ); + +imageQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { + // transcode image asynchronously and report progress + job.progress( 42 ); + + // call done when finished + done(); + + // or give a error if error + done( Error( 'error transcoding' ) ); + + // or pass it a result + done( null, { width: 1280, height: 720 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw (Error( 'some unexpected error' )); +} ); + +videoQueue.add( { video: 'http://example.com/video1.mov' } ); +audioQueue.add( { audio: 'http://example.com/audio1.mp3' } ); +imageQueue.add( { image: 'http://example.com/image1.tiff' } ); + + +////////////////////////////////////////////////////////////////////////////////// +// +// Using Promises +// +////////////////////////////////////////////////////////////////////////////////// + +const fetchVideo = ( url: string ): Promise => { return null } +const transcodeVideo = ( data: any ): Promise => { return null } + +interface VideoJob extends Queue.Job { + data: {url: string} +} + + +videoQueue.process( ( job: VideoJob ) => { // don't forget to remove the done callback! + // Simply return a promise + fetchVideo( job.data.url ).then( transcodeVideo ); + + // Handles promise rejection + Promise.reject( new Error( 'error transcoding' ) ); + + // Passes the value the promise is resolved with to the "completed" event + Promise.resolve( { framerate: 29.5 /* etc... */ } ); + + // same as + Promise.reject( new Error( 'some unexpected error' ) ); + + // If the job throws an unhandled exception it is also handled correctly + throw new Error( 'some unexpected error' ); +} ); + + +var addVideo1Job = videoQueue.add( { video: 'http://example.com/video1.mov' } ); + +addVideo1Job.then((video1Job) => { + // When job has successfully be placed in the queue the job is returned + // then wait for completion + return video1Job.finished(); +}) +.then(() => { + // video1Job completed successfully +}) +.catch((err) => { + // error +}); diff --git a/types/bull/v2/index.d.ts b/types/bull/v2/index.d.ts new file mode 100644 index 0000000000..3c89655101 --- /dev/null +++ b/types/bull/v2/index.d.ts @@ -0,0 +1,316 @@ +// Type definitions for bull 2.1.2 +// Project: https://github.com/OptimalBits/bull +// Definitions by: Bruno Grieder , Cameron Crothers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "bull" { + + import * as Redis from "redis"; + + /** + * This is the Queue constructor. + * It creates a new Queue that is persisted in Redis. + * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session. + */ + function Bull(queueName: string, redisPort: number, redisHost: string, redisOpt?: Redis.ClientOpts): Bull.Queue; + + namespace Bull { + + export interface DoneCallback { + (error?: Error, value?: any): void + } + + export interface Job { + + jobId: string + + /** + * The custom data passed when the job was created + */ + data: Object; + + /** + * Report progress on a job + */ + progress(value: any): Promise; + + /** + * Removes a Job from the queue from all the lists where it may be included. + * @returns {Promise} A promise that resolves when the job is removed. + */ + remove(): Promise; + + /** + * Rerun a Job that has failed. + * @returns {Promise} A promise that resolves when the job is scheduled for retry. + */ + retry(): Promise; + + /** + * Returns a promise the resolves when the job has been finished. + * TODO: Add a watchdog to check if the job has finished periodically. + * since pubsub does not give any guarantees. + */ + finished(): Promise; + } + + export interface Backoff { + + /** + * Backoff type, which can be either `fixed` or `exponential` + */ + type: string + + /** + * Backoff delay, in milliseconds + */ + delay: number; + } + + export interface AddOptions { + /** + * An amount of miliseconds to wait until this job can be processed. + * Note that for accurate delays, both server and clients should have their clocks synchronized + */ + delay?: number; + + /** + * A number of attempts to retry if the job fails [optional] + */ + attempts?: number; + + /** + * Backoff setting for automatic retries if the job fails + */ + backoff?: number | Backoff + + /** + * A boolean which, if true, adds the job to the right + * of the queue instead of the left (default false) + */ + lifo?: boolean; + + /** + * The number of milliseconds after which the job should be fail with a timeout error + */ + timeout?: number; + } + + export interface Queue { + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + * + * concurrency: Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + */ + process(callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * concurrency: Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job) => void): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + */ + process(callback: (job: Job) => void): Promise; + + // process(callback: (job: Job, done?: DoneCallback) => void): Promise; + + /** + * Creates a new job and adds it to the queue. + * If the queue is empty the job will be executed directly, + * otherwise it will be placed in the queue and executed as soon as possible. + */ + add(data: Object, opts?: AddOptions): Promise; + + /** + * Returns a promise that resolves when the queue is paused. + * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. + * A paused queue will not process new jobs until resumed, + * but current jobs being processed will continue until they are finalized. + * + * Pausing a queue that is already paused does nothing. + */ + pause(): Promise; + + /** + * Returns a promise that resolves when the queue is resumed after being paused. + * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. + * + * Resuming a queue that is not paused does nothing. + */ + resume(): Promise; + + /** + * Returns a promise that returns the number of jobs in the queue, waiting or paused. + * Since there may be other processes adding or processing jobs, this value may be true only for a very small amount of time. + */ + count(): Promise; + + /** + * Empties a queue deleting all the input lists and associated jobs. + */ + empty(): Promise; + + /** + * Closes the underlying redis client. Use this to perform a graceful shutdown. + * + * `close` can be called from anywhere, with one caveat: + * if called from within a job handler the queue won't close until after the job has been processed + */ + close(): Promise; + + /** + * Returns a promise that will return the job instance associated with the jobId parameter. + * If the specified job cannot be located, the promise callback parameter will be set to null. + */ + getJob(jobId: string): Promise; + + /** + * Tells the queue remove all jobs created outside of a grace period in milliseconds. + * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. + */ + clean(gracePeriod: number, jobsState?: string): Promise; + + /** + * Listens to queue events + * 'ready', 'error', 'activ', 'progress', 'completed', 'failed', 'paused', 'resumed', 'cleaned' + */ + on(eventName: string, callback: EventCallback): void; + } + + interface EventCallback { + (...args: any[]): void + } + + interface ReadyEventCallback extends EventCallback { + (): void; + } + + interface ErrorEventCallback extends EventCallback { + (error: Error): void; + } + + interface JobPromise { + /** + * Abort this job + */ + cancel(): void + } + + interface ActiveEventCallback extends EventCallback { + (job: Job, jobPromise: JobPromise): void; + } + + interface ProgressEventCallback extends EventCallback { + (job: Job, progress: any): void; + } + + interface CompletedEventCallback extends EventCallback { + (job: Job, result: Object): void; + } + + interface FailedEventCallback extends EventCallback { + (job: Job, error: Error): void; + } + + interface PausedEventCallback extends EventCallback { + (): void; + } + + interface ResumedEventCallback extends EventCallback { + (job?: Job): void; + } + + /** + * @see clean() for details + */ + interface CleanedEventCallback extends EventCallback { + (jobs: Job[], type: string): void; + } + } + + export = Bull; +} + +declare module "bull/lib/priority-queue" { + + import * as Bull from "bull"; + import * as Redis from "redis"; + + /** + * This is the Queue constructor of priority queue. + * + * It works same a normal queue, with same function and parameters. + * The only difference is that the Queue#add() allow an options opts.priority + * that could take ["low", "normal", "medium", "hight", "critical"]. If no options provider, "normal" will be taken. + * + * The priority queue will process more often highter priority jobs than lower. + */ + function PQueue(queueName: string, redisPort: number, redisHost: string, redisOpt?: Redis.ClientOpts): PQueue.PriorityQueue; + + namespace PQueue { + + export interface AddOptions extends Bull.AddOptions { + + /** + * "low", "normal", "medium", "high", "critical" + */ + priority?: string; + } + + + export interface PriorityQueue extends Bull.Queue { + + /** + * Creates a new job and adds it to the queue. + * If the queue is empty the job will be executed directly, + * otherwise it will be placed in the queue and executed as soon as possible. + */ + add(data: Object, opts?: PQueue.AddOptions): Promise; + + } + } + + export = PQueue; +} diff --git a/types/bull/v2/tsconfig.json b/types/bull/v2/tsconfig.json new file mode 100644 index 0000000000..2948048b1e --- /dev/null +++ b/types/bull/v2/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "paths": { + "bull": [ "bull/v2" ], + "bull/*": [ "bull/v2/*" ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bull-tests.tsx" + ] +} \ No newline at end of file From 7b31b3d5c3fab990005a8a78e57f986e22195798 Mon Sep 17 00:00:00 2001 From: marshall007 Date: Tue, 6 Jun 2017 12:21:02 -0500 Subject: [PATCH 082/761] @types/bull: add tslint config --- types/bull/tslint.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 types/bull/tslint.json diff --git a/types/bull/tslint.json b/types/bull/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/bull/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From a5e5a19585a95b34388986493568cfd147180cd0 Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Tue, 6 Jun 2017 10:27:15 -0700 Subject: [PATCH 083/761] Address PR: feedback --- types/react-leaflet/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index fe209f0327..d86a25d066 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -196,13 +196,13 @@ export interface TileLayerProps extends TileLayerEvents, Leaflet.TileLayerOption children?: Children; url: string; } -export class TileLayer

extends GridLayer { } +export class TileLayer

extends GridLayer { } export interface WMSTileLayerProps extends TileLayerEvents, Leaflet.WMSOptions { children?: Children; url: string; } -export class WMSTileLayer

extends GridLayer { } +export class WMSTileLayer

extends GridLayer { } export interface ImageOverlayProps extends Leaflet.ImageOverlayOptions { bounds: Leaflet.LatLngBoundsExpression; @@ -320,7 +320,7 @@ export interface LayersControlProps extends LayersControlEvents, Leaflet.Control children?: Children; overlays?: Leaflet.Control.LayersObject; } -export class LayersControl

extends MapControl { } +export class LayersControl

extends MapControl { } export namespace LayersControl { interface BaseControlledLayerProps { @@ -348,4 +348,4 @@ export type ScaleControlProps = Leaflet.Control.ScaleOptions; export class ScaleControl

extends MapControl { } export type ZoomControlProps = Leaflet.Control.ZoomOptions; -export class ZoomControl

extends MapControl { } +export class ZoomControl

extends MapControl { } From 1894877f40151983d301c551b30d0dfd7745a184 Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Tue, 6 Jun 2017 10:27:41 -0700 Subject: [PATCH 084/761] Add missing options : http://leafletjs.com/reference-1.0.3.html#layer --- types/leaflet/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 135fa8b93f..80adf4bc3f 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -390,6 +390,7 @@ declare namespace L { interface LayerOptions { pane?: string; + attribution?: string; } interface InteractiveLayerOptions extends LayerOptions { From ab6511d99b355c765296bbe364cdd0db29229d6b Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 6 Jun 2017 13:44:17 -0400 Subject: [PATCH 085/761] Implement write-json-file definition --- types/write-json-file/index.d.ts | 17 +++++++++++++ types/write-json-file/tsconfig.json | 22 ++++++++++++++++ types/write-json-file/tslint.json | 1 + .../write-json-file/write-json-file-tests.ts | 25 +++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 types/write-json-file/index.d.ts create mode 100644 types/write-json-file/tsconfig.json create mode 100644 types/write-json-file/tslint.json create mode 100644 types/write-json-file/write-json-file-tests.ts diff --git a/types/write-json-file/index.d.ts b/types/write-json-file/index.d.ts new file mode 100644 index 0000000000..4c76d4e7e2 --- /dev/null +++ b/types/write-json-file/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for write-json-file 2.2 +// Project: https://github.com/sindresorhus/write-json-file +// Definitions by: Denis Carriere +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function writeJsonFile(filepath: string, data: any, options?: writeJsonFile.Options): Promise; +declare namespace writeJsonFile { + interface Options { + indent?: string | number; + detectIndent?: boolean; + sortKeys?: boolean; + replacer?: Function; + mode?: number; + } + function sync(filepath: string, data: any, options?: Options): void; +} +export = writeJsonFile; diff --git a/types/write-json-file/tsconfig.json b/types/write-json-file/tsconfig.json new file mode 100644 index 0000000000..27df25f1f7 --- /dev/null +++ b/types/write-json-file/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "write-json-file-tests.ts" + ] +} diff --git a/types/write-json-file/tslint.json b/types/write-json-file/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/write-json-file/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/write-json-file/write-json-file-tests.ts b/types/write-json-file/write-json-file-tests.ts new file mode 100644 index 0000000000..62fc49d6da --- /dev/null +++ b/types/write-json-file/write-json-file-tests.ts @@ -0,0 +1,25 @@ +import * as write from 'write-json-file'; + +// Basic +write('foo.json', {foo: true}).then(() => { }); +write.sync('foo.json', {foo: true}); + +// JSON.stringify replacer +function replacer(key: any, value: any) { + // Filtering out properties + if (typeof value === 'string') { + return undefined; + } + return value; +} + +// With options +const options: write.Options = { + indent: ' ', + detectIndent: true, + sortKeys: true, + replacer, + mode: 0o666 +}; +write('foo.json', {foo: true}, options).then(() => { }); +write.sync('foo.json', {foo: true}, options); From 22722dd7f9b301d55e1d9c90d6f41ba638b0d722 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 6 Jun 2017 13:55:43 -0400 Subject: [PATCH 086/761] Update replacer function --- types/write-json-file/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/write-json-file/index.d.ts b/types/write-json-file/index.d.ts index 4c76d4e7e2..397572305e 100644 --- a/types/write-json-file/index.d.ts +++ b/types/write-json-file/index.d.ts @@ -9,7 +9,7 @@ declare namespace writeJsonFile { indent?: string | number; detectIndent?: boolean; sortKeys?: boolean; - replacer?: Function; + replacer?: (key: string, value: any) => any; mode?: number; } function sync(filepath: string, data: any, options?: Options): void; From 92f5e11c43d6867f9138b0c16309bbf4fb670008 Mon Sep 17 00:00:00 2001 From: marshall007 Date: Tue, 6 Jun 2017 13:20:16 -0500 Subject: [PATCH 087/761] @types/bull: fix all linting issues --- types/bull/bull-tests.tsx | 26 +- types/bull/index.d.ts | 813 ++++++++++++++++++-------------------- 2 files changed, 404 insertions(+), 435 deletions(-) diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index 2ff4579931..1552febf85 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -2,15 +2,14 @@ * Created by Bruno Grieder */ -import * as Queue from "bull" +import * as Queue from "bull"; -var videoQueue = new Queue('video transcoding', 'redis://127.0.0.1:6379'); -var audioQueue = new Queue('audio transcoding', {redis: {port: 6379, host: '127.0.0.1'}}); // Specify Redis connection using object -var imageQueue = new Queue('image transcoding'); -var pdfQueue = new Queue('pdf transcoding'); - -videoQueue.process(function(job, done){ +const videoQueue = new Queue('video transcoding', 'redis://127.0.0.1:6379'); +const audioQueue = new Queue('audio transcoding', {redis: {port: 6379, host: '127.0.0.1'}}); // Specify Redis connection using object +const imageQueue = new Queue('image transcoding'); +const pdfQueue = new Queue('pdf transcoding'); +videoQueue.process((job, done) => { // job.data contains the custom data passed when the job was created // job.jobId contains id of this job. @@ -30,7 +29,7 @@ videoQueue.process(function(job, done){ throw new Error('some unexpected error'); }); -audioQueue.process(function(job, done){ +audioQueue.process((job, done) => { // transcode audio asynchronously and report progress job.progress(42); @@ -47,7 +46,7 @@ audioQueue.process(function(job, done){ throw new Error('some unexpected error'); }); -imageQueue.process(function(job, done){ +imageQueue.process((job, done) => { // transcode image asynchronously and report progress job.progress(42); @@ -68,20 +67,17 @@ videoQueue.add({video: 'http://example.com/video1.mov'}); audioQueue.add({audio: 'http://example.com/audio1.mp3'}); imageQueue.add({image: 'http://example.com/image1.tiff'}); - ////////////////////////////////////////////////////////////////////////////////// // // Using Promises // ////////////////////////////////////////////////////////////////////////////////// - -pdfQueue.process(function(job){ +pdfQueue.process((job) => { // Processors can also return promises instead of using the done callback return Promise.resolve(); }); - videoQueue.add({ video: 'http://example.com/video1.mov' }, { jobId: 1 }) .then((video1Job) => { // When job has successfully be placed in the queue the job is returned @@ -95,14 +91,12 @@ videoQueue.add({ video: 'http://example.com/video1.mov' }, { jobId: 1 }) // error }); - ////////////////////////////////////////////////////////////////////////////////// // // Typed Event Handlers // ////////////////////////////////////////////////////////////////////////////////// - pdfQueue .on('ready', () => undefined) .on('error', (err: Error) => undefined) @@ -114,4 +108,4 @@ pdfQueue .on('failed', (job: Queue.Job) => undefined) .on('paused', () => undefined) .on('resumed', () => undefined) -.on('cleaned', (jobs: Queue.Job[], status: Queue.JobStatus) => undefined) +.on('cleaned', (jobs: Queue.Job[], status: Queue.JobStatus) => undefined); diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 3c49109903..7959629044 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -1,432 +1,407 @@ -// Type definitions for bull v.3.0.0-rc.2 +// Type definitions for bull 3.0 // Project: https://github.com/OptimalBits/bull // Definitions by: Bruno Grieder // Cameron Crothers // Marshall Cottrell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import * as Redis from "redis"; -declare module "bull" { +/** + * This is the Queue constructor. + * It creates a new Queue that is persisted in Redis. + * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session. + */ +declare var Bull: { + // tslint:disable:unified-signatures + (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + (queueName: string, url?: string): Bull.Queue; + new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + new (queueName: string, url?: string): Bull.Queue; + // tslint:enable:unified-signatures +}; - import * as Redis from "redis"; +declare namespace Bull { + interface QueueOptions { + /** + * Options passed directly to the `ioredis` constructor + */ + redis?: Redis.ClientOpts; - /** - * This is the Queue constructor. - * It creates a new Queue that is persisted in Redis. - * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session. - */ - var Bull: { - (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - (queueName: string, url?: string): Bull.Queue; - new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - new (queueName: string, url?: string): Bull.Queue; + /** + * Prefix to use for all redis keys + */ + prefix?: string; + + settings?: AdvancedSettings; } - namespace Bull { - - export interface QueueOptions { - - /** - * Options passed directly to the `ioredis` constructor - */ - redis?: Redis.ClientOpts; - - /** - * Prefix to use for all redis keys - */ - prefix?: string; - - settings?: AdvancedSettings; - } - - export interface AdvancedSettings { - - /** - * Key expiration time for job locks - */ - lockDuration?: number; - - /** - * How often check for stalled jobs (use 0 for never checking) - */ - stalledInterval?: number; - - /** - * Max amount of times a stalled job will be re-processed - */ - maxStalledCount?: number; - - /** - * Poll interval for delayed jobs and added jobs - */ - guardInterval?: number; - - /** - * Delay before processing next job in case of internal error - */ - retryProcessDelay?: number; - } - - export interface DoneCallback { - (error?: Error | null, value?: any): void - } - - export type JobId = number | string; - - export interface Job { - - id: JobId; - - /** - * The custom data passed when the job was created - */ - data: any; - - /** - * Report progress on a job - */ - progress(value: any): Promise; - - /** - * Removes a job from the queue and from any lists it may be included in. - * @returns {Promise} A promise that resolves when the job is removed. - */ - remove(): Promise; - - /** - * Re-run a job that has failed. - * @returns {Promise} A promise that resolves when the job is scheduled for retry. - */ - retry(): Promise; - - /** - * Returns a promise the resolves when the job has been finished. - * TODO: Add a watchdog to check if the job has finished periodically. - * since pubsub does not give any guarantees. - */ - finished(): Promise; - } - - export type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed'; - - export interface BackoffOptions { - - /** - * Backoff type, which can be either `fixed` or `exponential` - */ - type: 'fixed' | 'exponential'; - - /** - * Backoff delay, in milliseconds - */ - delay: number; - } - - export interface RepeatOptions { - - /** - * Cron pattern specifying when the job should execute - */ - cron: string; - - /** - * Timezone - */ - tz?: string; - - /** - * End date when the repeat job should stop repeating - */ - endDate?: Date | string | number; - } - - export interface JobOptions { - - /** - * Optional priority value. ranges from 1 (highest priority) to MAX_INT (lowest priority). - * Note that using priorities has a slight impact on performance, so do not use it if not required - */ - priority?: number; - - /** - * An amount of miliseconds to wait until this job can be processed. - * Note that for accurate delays, both server and clients should have their clocks synchronized. [optional] - */ - delay?: number; - - /** - * The total number of attempts to try the job until it completes - */ - attempts?: number; - - /** - * Repeat job according to a cron specification - */ - repeat?: RepeatOptions; - - /** - * Backoff setting for automatic retries if the job fails - */ - backoff?: number | BackoffOptions; - - /** - * A boolean which, if true, adds the job to the right - * of the queue instead of the left (default false) - */ - lifo?: boolean; - - /** - * The number of milliseconds after which the job should be fail with a timeout error - */ - timeout?: number; - - /** - * Override the job ID - by default, the job ID is a unique - * integer, but you can use this setting to override it. - * If you use this option, it is up to you to ensure the - * jobId is unique. If you attempt to add a job with an id that - * already exists, it will not be added. - */ - jobId?: JobId; - - /** - * A boolean which, if true, removes the job when it successfully completes. - * Default behavior is to keep the job in the completed set. - */ - removeOnComplete?: boolean; - - /** - * A boolean which, if true, removes the job when it fails after all attempts - * Default behavior is to keep the job in the completed set. - */ - removeOnFail?: boolean; - } - - export interface JobCounts { - wait: number; - active: number; - completed: number; - failed: number; - delayed: number; - } - - export interface Queue { - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * The done callback can be called with an Error instance, to signal that the job did not complete successfully, - * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. - * Errors will be passed as a second argument to the "failed" event; - * results, as a second argument to the "completed" event. - * - * concurrency: Bull will then call you handler in parallel respecting this max number. - */ - process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * The done callback can be called with an Error instance, to signal that the job did not complete successfully, - * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. - * Errors will be passed as a second argument to the "failed" event; - * results, as a second argument to the "completed" event. - */ - process(callback: (job: Job, done: DoneCallback) => void): void; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * If the promise is rejected, the error will be passed as a second argument to the "failed" event. - * If it is resolved, its value will be the "completed" event's second argument. - * - * concurrency: Bull will then call you handler in parallel respecting this max number. - */ - process(concurrency: number, callback: (job: Job) => void): Promise; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * If the promise is rejected, the error will be passed as a second argument to the "failed" event. - * If it is resolved, its value will be the "completed" event's second argument. - */ - process(callback: (job: Job) => void): Promise; - - /** - * Creates a new job and adds it to the queue. - * If the queue is empty the job will be executed directly, - * otherwise it will be placed in the queue and executed as soon as possible. - */ - add(data: Object, opts?: JobOptions): Promise; - - /** - * Returns a promise that resolves when the queue is paused. - * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. - * A paused queue will not process new jobs until resumed, - * but current jobs being processed will continue until they are finalized. - * - * Pausing a queue that is already paused does nothing. - */ - pause(): Promise; - - /** - * Returns a promise that resolves when the queue is resumed after being paused. - * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. - * - * Resuming a queue that is not paused does nothing. - */ - resume(): Promise; - - /** - * Returns a promise that returns the number of jobs in the queue, waiting or paused. - * Since there may be other processes adding or processing jobs, this value may be true only for a very small amount of time. - */ - count(): Promise; - - /** - * Empties a queue deleting all the input lists and associated jobs. - */ - empty(): Promise; - - /** - * Closes the underlying redis client. Use this to perform a graceful shutdown. - * - * `close` can be called from anywhere, with one caveat: - * if called from within a job handler the queue won't close until after the job has been processed - */ - close(): Promise; - - /** - * Returns a promise that will return the job instance associated with the jobId parameter. - * If the specified job cannot be located, the promise callback parameter will be set to null. - */ - getJob(jobId: JobId): Promise; - - /** - * Returns a promise that resolves with the job counts for the given queue - */ - getJobCounts(): Promise; - - /** - * Tells the queue remove all jobs created outside of a grace period in milliseconds. - * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. - */ - clean(grace: number, status?: JobStatus, limit?: number): Promise; - - /** - * Listens to queue events - */ - on(event: string, callback: (...args: any[]) => void): this; - - /** - * Redis is connected and the queue is ready to accept jobs - */ - on(event: 'ready', callback: EventCallback): this; - - /** - * An error occured - */ - on(event: 'error', callback: ErrorEventCallback): this; - - /** - * A job has started. You can use `jobPromise.cancel()` to abort it - */ - on(event: 'active', callback: ActiveEventCallback): this; - - /** - * A job has been marked as stalled. - * This is useful for debugging job workers that crash or pause the event loop. - */ - on(event: 'stalled', callback: StalledEventCallback): this; - - /** - * A job's progress was updated - */ - on(event: 'progress', callback: ProgressEventCallback): this; - - /** - * A job successfully completed with a `result` - */ - on(event: 'completed', callback: CompletedEventCallback): this; - - /** - * A job failed with `err` as the reason - */ - on(event: 'failed', callback: FailedEventCallback): this; - - /** - * The queue has been paused - */ - on(event: 'paused', callback: EventCallback): this; - - /** - * The queue has been resumed - */ - on(event: 'resumed', callback: EventCallback): this; - - /** - * Old jobs have been cleaned from the queue. - * `jobs` is an array of jobs that were removed, and `type` is the type of those jobs. - * - * @see Queue#clean() for details - */ - on(event: 'cleaned', callback: CleanedEventCallback): this; - } - - export interface EventCallback { - (): void; - } - - export interface ErrorEventCallback { - (error: Error): void; - } - - export interface JobPromise { - /** - * Abort this job - */ - cancel(): void - } - - export interface ActiveEventCallback { - (job: Job, jobPromise?: JobPromise): void; - } - - export interface StalledEventCallback { - (job: Job): void; - } - - export interface ProgressEventCallback { - (job: Job, progress: any): void; - } - - export interface CompletedEventCallback { - (job: Job, result: any): void; - } - - export interface FailedEventCallback { - (job: Job, error: Error): void; - } - - export interface CleanedEventCallback { - (jobs: Job[], status: JobStatus): void; - } + interface AdvancedSettings { + /** + * Key expiration time for job locks + */ + lockDuration?: number; + + /** + * How often check for stalled jobs (use 0 for never checking) + */ + stalledInterval?: number; + + /** + * Max amount of times a stalled job will be re-processed + */ + maxStalledCount?: number; + + /** + * Poll interval for delayed jobs and added jobs + */ + guardInterval?: number; + + /** + * Delay before processing next job in case of internal error + */ + retryProcessDelay?: number; } - export = Bull; -} \ No newline at end of file + type DoneCallback = (error?: Error | null, value?: any) => void; + + type JobId = number | string; + + interface Job { + id: JobId; + + /** + * The custom data passed when the job was created + */ + data: any; + + /** + * Report progress on a job + */ + progress(value: any): Promise; + + /** + * Removes a job from the queue and from any lists it may be included in. + * @returns {Promise} A promise that resolves when the job is removed. + */ + remove(): Promise; + + /** + * Re-run a job that has failed. + * @returns {Promise} A promise that resolves when the job is scheduled for retry. + */ + retry(): Promise; + + /** + * Returns a promise the resolves when the job has been finished. + * TODO: Add a watchdog to check if the job has finished periodically. + * since pubsub does not give any guarantees. + */ + finished(): Promise; + } + + type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed'; + + interface BackoffOptions { + /** + * Backoff type, which can be either `fixed` or `exponential` + */ + type: 'fixed' | 'exponential'; + + /** + * Backoff delay, in milliseconds + */ + delay: number; + } + + interface RepeatOptions { + /** + * Cron pattern specifying when the job should execute + */ + cron: string; + + /** + * Timezone + */ + tz?: string; + + /** + * End date when the repeat job should stop repeating + */ + endDate?: Date | string | number; + } + + interface JobOptions { + /** + * Optional priority value. ranges from 1 (highest priority) to MAX_INT (lowest priority). + * Note that using priorities has a slight impact on performance, so do not use it if not required + */ + priority?: number; + + /** + * An amount of miliseconds to wait until this job can be processed. + * Note that for accurate delays, both server and clients should have their clocks synchronized. [optional] + */ + delay?: number; + + /** + * The total number of attempts to try the job until it completes + */ + attempts?: number; + + /** + * Repeat job according to a cron specification + */ + repeat?: RepeatOptions; + + /** + * Backoff setting for automatic retries if the job fails + */ + backoff?: number | BackoffOptions; + + /** + * A boolean which, if true, adds the job to the right + * of the queue instead of the left (default false) + */ + lifo?: boolean; + + /** + * The number of milliseconds after which the job should be fail with a timeout error + */ + timeout?: number; + + /** + * Override the job ID - by default, the job ID is a unique + * integer, but you can use this setting to override it. + * If you use this option, it is up to you to ensure the + * jobId is unique. If you attempt to add a job with an id that + * already exists, it will not be added. + */ + jobId?: JobId; + + /** + * A boolean which, if true, removes the job when it successfully completes. + * Default behavior is to keep the job in the completed set. + */ + removeOnComplete?: boolean; + + /** + * A boolean which, if true, removes the job when it fails after all attempts + * Default behavior is to keep the job in the completed set. + */ + removeOnFail?: boolean; + } + + interface JobCounts { + wait: number; + active: number; + completed: number; + failed: number; + delayed: number; + } + + interface Queue { + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + * + * concurrency: Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + */ + process(callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * concurrency: Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job) => void): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + */ + process(callback: (job: Job) => void): Promise; + + /** + * Creates a new job and adds it to the queue. + * If the queue is empty the job will be executed directly, + * otherwise it will be placed in the queue and executed as soon as possible. + */ + add(data: any, opts?: JobOptions): Promise; + + /** + * Returns a promise that resolves when the queue is paused. + * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. + * A paused queue will not process new jobs until resumed, + * but current jobs being processed will continue until they are finalized. + * + * Pausing a queue that is already paused does nothing. + */ + pause(): Promise; + + /** + * Returns a promise that resolves when the queue is resumed after being paused. + * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. + * + * Resuming a queue that is not paused does nothing. + */ + resume(): Promise; + + /** + * Returns a promise that returns the number of jobs in the queue, waiting or paused. + * Since there may be other processes adding or processing jobs, this value may be true only for a very small amount of time. + */ + count(): Promise; + + /** + * Empties a queue deleting all the input lists and associated jobs. + */ + empty(): Promise; + + /** + * Closes the underlying redis client. Use this to perform a graceful shutdown. + * + * `close` can be called from anywhere, with one caveat: + * if called from within a job handler the queue won't close until after the job has been processed + */ + close(): Promise; + + /** + * Returns a promise that will return the job instance associated with the jobId parameter. + * If the specified job cannot be located, the promise callback parameter will be set to null. + */ + getJob(jobId: JobId): Promise; + + /** + * Returns a promise that resolves with the job counts for the given queue + */ + getJobCounts(): Promise; + + /** + * Tells the queue remove all jobs created outside of a grace period in milliseconds. + * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. + */ + clean(grace: number, status?: JobStatus, limit?: number): Promise; + + // tslint:disable:unified-signatures + + /** + * Listens to queue events + */ + on(event: string, callback: (...args: any[]) => void): this; + + /** + * Redis is connected and the queue is ready to accept jobs + */ + on(event: 'ready', callback: EventCallback): this; + + /** + * An error occured + */ + on(event: 'error', callback: ErrorEventCallback): this; + + /** + * A job has started. You can use `jobPromise.cancel()` to abort it + */ + on(event: 'active', callback: ActiveEventCallback): this; + + /** + * A job has been marked as stalled. + * This is useful for debugging job workers that crash or pause the event loop. + */ + on(event: 'stalled', callback: StalledEventCallback): this; + + /** + * A job's progress was updated + */ + on(event: 'progress', callback: ProgressEventCallback): this; + + /** + * A job successfully completed with a `result` + */ + on(event: 'completed', callback: CompletedEventCallback): this; + + /** + * A job failed with `err` as the reason + */ + on(event: 'failed', callback: FailedEventCallback): this; + + /** + * The queue has been paused + */ + on(event: 'paused', callback: EventCallback): this; + + /** + * The queue has been resumed + */ + on(event: 'resumed', callback: EventCallback): this; + + /** + * Old jobs have been cleaned from the queue. + * `jobs` is an array of jobs that were removed, and `type` is the type of those jobs. + * + * @see Queue#clean() for details + */ + on(event: 'cleaned', callback: CleanedEventCallback): this; + + // tslint:enable:unified-signatures + } + + type EventCallback = () => void; + + type ErrorEventCallback = (error: Error) => void; + + interface JobPromise { + /** + * Abort this job + */ + cancel(): void; + } + + type ActiveEventCallback = (job: Job, jobPromise?: JobPromise) => void; + + type StalledEventCallback = (job: Job) => void; + + type ProgressEventCallback = (job: Job, progress: any) => void; + + type CompletedEventCallback = (job: Job, result: any) => void; + + type FailedEventCallback = (job: Job, error: Error) => void; + + type CleanedEventCallback = (jobs: Job[], status: JobStatus) => void; +} + +export = Bull; From 2165e560e8e3461b103ffa3201b5f17ed2515a25 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 6 Jun 2017 14:27:27 -0400 Subject: [PATCH 088/761] Update replacer option --- types/write-json-file/index.d.ts | 5 +++- .../write-json-file/write-json-file-tests.ts | 29 ++++++++++++------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/types/write-json-file/index.d.ts b/types/write-json-file/index.d.ts index 397572305e..0f945a96e8 100644 --- a/types/write-json-file/index.d.ts +++ b/types/write-json-file/index.d.ts @@ -5,11 +5,14 @@ declare function writeJsonFile(filepath: string, data: any, options?: writeJsonFile.Options): Promise; declare namespace writeJsonFile { + interface Replacer { + (key: string, value: any): void; + } interface Options { indent?: string | number; detectIndent?: boolean; sortKeys?: boolean; - replacer?: (key: string, value: any) => any; + replacer?: Replacer | (number | string)[] | null; mode?: number; } function sync(filepath: string, data: any, options?: Options): void; diff --git a/types/write-json-file/write-json-file-tests.ts b/types/write-json-file/write-json-file-tests.ts index 62fc49d6da..b61fae2892 100644 --- a/types/write-json-file/write-json-file-tests.ts +++ b/types/write-json-file/write-json-file-tests.ts @@ -4,6 +4,16 @@ import * as write from 'write-json-file'; write('foo.json', {foo: true}).then(() => { }); write.sync('foo.json', {foo: true}); +// With options +const options: write.Options = { + indent: ' ', + detectIndent: true, + sortKeys: true, + mode: 0o666 +}; +write('foo.json', {foo: true}, options).then(() => { }); +write.sync('foo.json', {foo: true}, options); + // JSON.stringify replacer function replacer(key: any, value: any) { // Filtering out properties @@ -13,13 +23,12 @@ function replacer(key: any, value: any) { return value; } -// With options -const options: write.Options = { - indent: ' ', - detectIndent: true, - sortKeys: true, - replacer, - mode: 0o666 -}; -write('foo.json', {foo: true}, options).then(() => { }); -write.sync('foo.json', {foo: true}, options); +write.sync('foo.json', {foo: true}, {replacer}); +write.sync('foo.json', {foo: true}, {replacer: null}); +write.sync('foo.json', {foo: true}, {replacer: [1, 2, 3]}); +write.sync('foo.json', {foo: true}, {replacer: ['a', 'b', 'c']}); + +JSON.stringify({foo: true}, replacer); +JSON.stringify({foo: true}, null); +JSON.stringify({foo: true}, [1, 2, 3]); +JSON.stringify({foo: true}, ['a', 'b', 'c']); From 68455302694afea03e4ca58d508e35c4444b7d44 Mon Sep 17 00:00:00 2001 From: marshall007 Date: Tue, 6 Jun 2017 13:31:53 -0500 Subject: [PATCH 089/761] @types/bull: fix redis import --- types/bull/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 7959629044..926952f6c2 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -5,7 +5,7 @@ // Marshall Cottrell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import * as Redis from "redis"; +import * as Redis from "ioredis"; /** * This is the Queue constructor. @@ -26,7 +26,7 @@ declare namespace Bull { /** * Options passed directly to the `ioredis` constructor */ - redis?: Redis.ClientOpts; + redis?: Redis.RedisOptions; /** * Prefix to use for all redis keys From b1ecad76b7528a994b3e536b4abf9fe7cf0cd965 Mon Sep 17 00:00:00 2001 From: William Lohan Date: Tue, 6 Jun 2017 11:36:08 -0700 Subject: [PATCH 090/761] non-standard fields --- types/fullcalendar/fullcalendar-tests.ts | 5 +---- types/fullcalendar/index.d.ts | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/fullcalendar/fullcalendar-tests.ts b/types/fullcalendar/fullcalendar-tests.ts index 1e9e241ce8..c0a53a59f1 100644 --- a/types/fullcalendar/fullcalendar-tests.ts +++ b/types/fullcalendar/fullcalendar-tests.ts @@ -622,9 +622,6 @@ $('#calendar').fullCalendar({ eventColor: '#378006' }); -interface EventWithDescription extends FullCalendar.EventObject { - description: string; -} interface JQueryQTip extends JQuery { qtip(options: Object): JQuery; // dummy plugin interface } @@ -638,7 +635,7 @@ $('#calendar').fullCalendar({ } // more events here ], - eventRender(event: EventWithDescription, element: JQueryQTip, view: FullCalendar.ViewObject) { + eventRender(event: FullCalendar.EventObject, element: JQueryQTip, view: FullCalendar.ViewObject) { element.qtip({ content: event.description }); diff --git a/types/fullcalendar/index.d.ts b/types/fullcalendar/index.d.ts index 05ac6076e6..bed6396214 100644 --- a/types/fullcalendar/index.d.ts +++ b/types/fullcalendar/index.d.ts @@ -2,6 +2,7 @@ // Project: http://fullcalendar.io/ // Definitions by: Neil Stalker , Marcelo Camargo , Patrick Niemann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// @@ -229,6 +230,8 @@ export interface EventObject extends Timespan { backgroundColor?: string; borderColor?: string; textColor?: string; + // non-standard fields, see https://fullcalendar.io/docs/event_data/Event_Object/ and https://fullcalendar.io/docs/event_rendering/eventRender/ + [x: string]: any; } export interface ViewObject extends Timespan { From bafdeeaa0562e2c63b713760f14581f644e9f584 Mon Sep 17 00:00:00 2001 From: Paul Shannon Date: Thu, 1 Jun 2017 18:18:31 -0700 Subject: [PATCH 091/761] Added A-Frame typings clean-up aframe DT header using files in tsconfig.json removing name from package.json removing version from package.json removing scripts from package.json removing types from package.json Moved package.json to tests to support ease of use Telling DT to ignore tests removing unix standard blank line at end of UNUSED_FILES.txt dtslint seems to want a commonjs module module in compileroptions module in compileroptions cleaning up lint errors --- types/aframe/README.md | 28 +++ types/aframe/UNUSED_FILES.txt | 1 + types/aframe/aframe-tests.ts | 45 +++++ types/aframe/index.d.ts | 324 +++++++++++++++++++++++++++++++ types/aframe/tests/aframe.ts | 37 ++++ types/aframe/tests/component.ts | 45 +++++ types/aframe/tests/entity.ts | 66 +++++++ types/aframe/tests/intern.ts | 26 +++ types/aframe/tests/package.json | 19 ++ types/aframe/tests/tests.html | 8 + types/aframe/tests/tsconfig.json | 22 +++ types/aframe/tsconfig.json | 26 +++ types/aframe/tslint.json | 5 + 13 files changed, 652 insertions(+) create mode 100644 types/aframe/README.md create mode 100644 types/aframe/UNUSED_FILES.txt create mode 100644 types/aframe/aframe-tests.ts create mode 100644 types/aframe/index.d.ts create mode 100644 types/aframe/tests/aframe.ts create mode 100644 types/aframe/tests/component.ts create mode 100644 types/aframe/tests/entity.ts create mode 100755 types/aframe/tests/intern.ts create mode 100755 types/aframe/tests/package.json create mode 100644 types/aframe/tests/tests.html create mode 100644 types/aframe/tests/tsconfig.json create mode 100755 types/aframe/tsconfig.json create mode 100644 types/aframe/tslint.json diff --git a/types/aframe/README.md b/types/aframe/README.md new file mode 100644 index 0000000000..0bceeb7487 --- /dev/null +++ b/types/aframe/README.md @@ -0,0 +1,28 @@ +# aframe typings + +### build + +From the `tests` directory run: + +* `npm i` +* `npm run build` + +This will build the both `aframe-tests.ts` and the `tests` directory using the provided typings. + +Note: If you do not want to install node modules then a basic test can be ran by compiling `aframe-tests.ts` +by typing `tsc`. + +### test + +* build using the instructions above +* open `tests/tests.html` in a browser + +The testing framework uses [intern](https://theintern.github.io/) to run tests. The tests ensure that typings are +actually written against real aframe constructs by exercising the code and validating assertions. Intern also supports +local execution using Selenium by running `npm run test`. + + +## Contributing + +These typings cover much of the core of A-Frame. Help is welcomed to provide typings for A-Frame bundled components and +additional intern tests <3 diff --git a/types/aframe/UNUSED_FILES.txt b/types/aframe/UNUSED_FILES.txt new file mode 100644 index 0000000000..3598c3003f --- /dev/null +++ b/types/aframe/UNUSED_FILES.txt @@ -0,0 +1 @@ +tests \ No newline at end of file diff --git a/types/aframe/aframe-tests.ts b/types/aframe/aframe-tests.ts new file mode 100644 index 0000000000..190489b346 --- /dev/null +++ b/types/aframe/aframe-tests.ts @@ -0,0 +1,45 @@ +// Entity +const entity = document.createElement('a-entity'); +entity.emit('rotate'); +entity.emit('collide', { target: entity }); +entity.emit('sink', null, false); + +const position = entity.getAttribute('position'); +position.x; +position.y; +position.z; +entity.setAttribute('material', 'color', 'red'); + +entity.components['geometry'].data; + +type MyEntity = AFrame.Entity<{ + camera: THREE.Camera; + material: THREE.Material; + sound: { pause(): void }; +}>; +const camera = document.querySelector('a-entity[camera]').components.camera; +const material = document.querySelector('a-entity[material]').components.material; +document.querySelector('a-entity[sound]').components.sound.pause(); + +entity.getDOMAttribute('geometry').primitive; + +entity.setAttribute('light', { + type: 'spot', + distance: 30, + intensity: 2.0 +}); + +entity.addEventListener('child-detached', (event) => { + event.detail; +}); + +// Components +const Component = AFRAME.registerComponent('test', {}); + +// Scene + +const scene = document.querySelector('a-scene'); +scene.hasLoaded; + +// System +const system = scene.systems['systemName']; diff --git a/types/aframe/index.d.ts b/types/aframe/index.d.ts new file mode 100644 index 0000000000..b1a763e7dd --- /dev/null +++ b/types/aframe/index.d.ts @@ -0,0 +1,324 @@ +// Type definitions for AFRAME 0.5 +// Project: https://aframe.io/ +// Definitions by: Paul Shannon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +/// + +// Globals +declare var AFRAME: AFrame.AFrameGlobal; +declare var hasNativeWebVRImplementation: boolean; + +interface NodeSelector { + querySelector(selectors: 'a-scene'): AFrame.Scene; + querySelector>(selectors: string): T; + querySelectorAll(selectors: string): NodeListOf | Element>; +} + +interface Document { + createElement(tagName: string): AFrame.Entity; +} + +// Interfaces +declare namespace AFrame { + interface ObjectMap { + [ key: string ]: T; + } + + interface AFrameGlobal { + AEntity: Entity; + ANode: ANode; + AScene: Scene; + components: { [ key: string ]: ComponentDescriptor }; + geometries: { [ key: string ]: GeometryDescriptor }; + primitives: { [ key: string ]: Entity }; + registerComponent(name: string, component: ComponentDefinition): ComponentConstructor; + registerElement(name: string, element: ANode): void; + registerGeometry(name: string, geometery: THREE.Geometry): Geometry; + registerPrimitive(name: string, primitive: PrimitiveDefinition): void; + registerShader(name: string, shader: any): void; + registerSystem(name: string, definition: SystemDefinition): void; + schema: SchemaUtils; + shaders: { [ key: string ]: ShaderDescriptor }; + systems: { [key: string]: System }; + THREE: any; // TODO THREE + TWEEN: any; // TODO TWEEN + utils: Utils; + version: string; + } + + interface Animation { + attribute: string; + begin: string | number; + delay: number; + direction: 'alternate' | 'alternateReverse' | 'normal' | 'reverse'; + dur: number; + easing(): void; + end: string; + fill: 'backwards' | 'both' | 'forwards' | 'none'; + from: any; // TODO type + repeat: number | 'indefinite'; + to: number; + } + + interface ANode extends HTMLElement { + // Only public APIs added. Many methods intentionally left out. + // createdCallback + // attachedCallback + // attributeChangedCallback + closestScene(): Scene; + closest(selector: string): ANode; + // detachedCallback + hasLoaded: boolean; + load(cb?: () => void, childFilter?: (el: Element) => boolean): void; + // updateMixins + registerMixin(id: string): void; + setAttribute(type: string, newValue: any): void; + unregisterMixin(id: string): void; + removeMixinListener(id: string): void; + attachMixinListener(mixin: HTMLElement): void; + emit(name: string, detail?: any, bubbles?: boolean): void; + emitter(name: string, detail?: any, bubbles?: boolean): () => void; + } + + interface Behavior { + tick(): void; + } + + interface Component { + attrName?: string; + data?: any; + dependencies?: string[]; + el: Entity; + id: string; + multiple?: boolean; + name: string; + schema: Schema; + + init(): void; + pause(): void; + play(): void; + remove(): void; + tick?(time: number, timeDelta: number): void; + update(oldData: any): void; + updateSchema?(): void; + + extendSchema(update: Schema): void; + flushToDOM(): void; + } + + interface ComponentConstructor { + new (el: Entity, name: string, id: string): Component; + } + + interface ComponentDefinition { + dependencies?: string[]; + el?: Entity; + id?: string; + multiple?: boolean; + schema?: Schema; + + init?(): void; + pause?(): void; + play?(): void; + remove?(): void; + tick?(time: number, timeDelta: number): void; + update?(oldData: any): void; + updateSchema?(): void; + + [ key: string ]: any; + } + + interface ComponentDescriptor { + Component: Component; + dependencies: string[] | null; + multiple: boolean | null; + + // internal APIs2 + // parse + // parseAttrValueForCache + // schema + // stringify + // type + [ key: string ]: any; + } + + interface Coordinate { + x: number; + y: number; + z: number; + } + + interface Entity> extends ANode { + components: C; + isPlaying: boolean; + object3D: THREE.Object3D; + object3DMap: ObjectMap; + sceneEl?: Scene; + + addState(name: string): void; + flushToDOM(recursive?: boolean): void; + /** + * @deprecated since 0.4.0 + */ + getComputedAttribute(attr: string): T; + getDOMAttribute(attr: string): T; + getObject3D(type: string): THREE.Object3D; + getOrCreateObject3D(type: string, construct: any): THREE.Object3D; + is(stateName: string): boolean; + pause(): void; + play(): void; + setObject3D(type: string, obj: THREE.Object3D): void; + removeAttribute(attr: string, property?: string): void; + removeObject3D(type: string): void; + removeState(stateName: string): void; + + // getAttribute specific usages + getAttribute(type: string): any; + getAttribute(attr: string): T; + getAttribute(type: 'position' | 'rotation' | 'scale'): Coordinate; + + // setAttribute specific usages + setAttribute(attr: string, value: any): void; + setAttribute(attr: string, property: string, componentAttrValue?: any): void; + setAttribute(type: 'position' | 'rotation' | 'scale', value: Coordinate): void; + + // addEventListener specific usages + addEventListener(type: K, listener: (event: Event & EntityEventMap[K]) => void, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + } + + type DetailEvent = Event & { detail: D }; + + interface EntityEventMap { + 'child-attached': DetailEvent<{ el: Element | Entity }>; + 'child-detached': DetailEvent<{ el: Element | Entity }>; + 'componentchanged': DetailEvent<{ name: string }>; + 'componentremoved': DetailEvent<{ + name: string, + id: string, + newData: any, + oldData: any + }>; + 'loaded': EventListener; + 'pause': EventListener; + 'play': EventListener; + 'stateadded': DetailEvent<{ state: string }>; + 'stateremoved': DetailEvent<{ state: string }>; + 'schemachanged': DetailEvent<{ componentName: string }>; + } + + interface Geometry { + name: string; + geometry: THREE.Geometry; + schema: Schema; + update(data: object): void; + [ key: string ]: any; + } + + interface GeometryDescriptor { + Geometry: Geometry; + schema: Schema; + } + + interface MultiPropertySchema { + [ key: string ]: SinglePropertySchema; + } + + interface PrimitiveDefinition { + defaultComponents?: any; // TODO cleanup type + deprecated?: boolean; + mappings?: any; // TODO cleanup type + transforms?: any; // TODO cleanup type + } + + type PropertyTypes = 'array' | 'boolean' | 'color' | 'int' | 'number' | 'selector' | + 'selectorAll' | 'src' | 'string' | 'vec2' | 'vec3' | 'vec4'; + + type SceneEvents = 'enter-vr' | 'exit-vr' | 'loaded' | 'renderstart'; + + interface Scene extends Entity { + behaviors: Behavior[]; + camera: THREE.Camera; + canvas: HTMLCanvasElement; + effect: THREE.VREffect; + isMobile: boolean; + object3D: THREE.Scene; + renderer: THREE.WebGLRenderer; + renderStarted: boolean; + systems: ObjectMap; + time: number; + + enterVR(): Promise | void; + exitVR(): Promise | void; + reload(): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + addEventListener(type: SceneEvents, listener: EventListener, useCapture?: boolean): void; + } + + type Schema = SinglePropertySchema | MultiPropertySchema; + + interface SchemaUtils { + isSingleProperty(schema: Schema): boolean; + process(schema: Schema): boolean; + } + + interface Shader { + name: string; + schema: Schema; + } + + interface ShaderDescriptor { + Shader: Shader; + schema: Schema; + } + + interface SinglePropertySchema { + type?: PropertyTypes; + 'default'?: T; + parse?(value: string): T; + stringify?(value: T): string; + [ key: string ]: any; + } + + interface System { + data: any; + schema: Schema; + init(): void; + pause(): void; + play(): void; + tick?(): void; + } + + interface SystemDefinition { + schema?: Schema; + init?(): void; + pause?(): void; + play?(): void; + tick?(): void; + [ key: string ]: any; + } + + interface Utils { + coordinates: { + isCoordinate(value: string): boolean; + parse(value: string): Coordinate; + stringify(coord: Coordinate): string; + }; + entity: { + getComponentProperty(entity: Entity, componentName: string, delimiter?: string): any; + setComponentProperty(entity: Entity, componentName: string, value: any, delimiter?: string): void; + }; + styleParser: { + parse(value: string): object; + stringify(data: object): string; + }; + deepEqual(a: any, b: any): boolean; + diff(a: object, b: object): object; + extend(target: object, ... source: object[]): object; + extendDeep(target: object, ... source: object[]): object; + } +} diff --git a/types/aframe/tests/aframe.ts b/types/aframe/tests/aframe.ts new file mode 100644 index 0000000000..37d839e4df --- /dev/null +++ b/types/aframe/tests/aframe.ts @@ -0,0 +1,37 @@ +import 'aframe'; +import { describe, it } from 'intern!bdd'; +import * as expect from 'intern/chai!expect'; + +/** + * A-Frame exposes its public interface through the window.AFRAME browser global. + */ +describe('aframe global', () => { + describe('AFRAME', () => { + it('has the expected shape', () => { + expect(AFRAME).to.exist; + + expect(AFRAME.components).to.exist; + expect(AFRAME.geometries).to.exist; + expect(AFRAME.primitives).to.exist; + expect(AFRAME.schema).to.exist; + expect(AFRAME.shaders).to.exist; + expect(AFRAME.systems).to.exist; + expect(AFRAME.THREE).to.exist; + expect(AFRAME.TWEEN).to.exist; + expect(AFRAME.utils).to.exist; + expect(AFRAME.version).to.exist; + + expect(AFRAME.AEntity).to.be.a('function'); + expect(AFRAME.ANode).to.be.a('function'); + expect(AFRAME.AScene).to.be.a('function'); + expect(AFRAME.registerComponent).to.be.a('function'); + expect(AFRAME.registerElement).to.be.a('function'); + expect(AFRAME.registerGeometry).to.be.a('function'); + expect(AFRAME.registerPrimitive).to.be.a('function'); + }); + }); + + it('hasNativeWebVRImplementation', () => { + expect(window).to.have.property('hasNativeWebVRImplementation'); + }); +}); diff --git a/types/aframe/tests/component.ts b/types/aframe/tests/component.ts new file mode 100644 index 0000000000..0c7390e0c7 --- /dev/null +++ b/types/aframe/tests/component.ts @@ -0,0 +1,45 @@ +import 'aframe'; +import { describe, beforeEach, afterEach, it } from 'intern!bdd'; +import * as expect from 'intern/chai!expect'; + +describe('components', () => { + let Component: AFrame.ComponentConstructor; + + afterEach(() => { + if (Component) { + delete AFRAME.components[Component.prototype.name]; + } + }); + + describe('basic component', () => { + beforeEach(() => { + Component = AFRAME.registerComponent('test', {}); + }); + + it('has the expected shape', () => { + expect(Component).to.exist; + const entity: AFrame.Entity = document.createElement('a-entity'); + const component = new Component(entity, 'test', 'test'); + + expect(component.attrName).to.exist; + expect(component.el).to.exist; + expect(component.id).to.exist; + expect(component.name).to.exist; + expect(component.schema).to.exist; + + expect(component.data).to.not.exist; + expect(component.dependencies).to.not.exist; + expect(component.multiple).to.not.exist; + expect(component.tick).to.not.exist; + + expect(component.init).to.be.a('function'); + expect(component.update).to.be.a('function'); + expect(component.remove).to.be.a('function'); + expect(component.play).to.be.a('function'); + expect(component.pause).to.be.a('function'); + expect(component.remove).to.be.a('function'); + expect(component.flushToDOM).to.be.a('function'); + expect(component.extendSchema).to.be.a('function'); + }); + }); +}); diff --git a/types/aframe/tests/entity.ts b/types/aframe/tests/entity.ts new file mode 100644 index 0000000000..68cf591633 --- /dev/null +++ b/types/aframe/tests/entity.ts @@ -0,0 +1,66 @@ +import 'aframe'; +import { describe, beforeEach, afterEach, it } from 'intern!bdd'; +import * as expect from 'intern/chai!expect'; + +function assertStaticShape(entity: AFrame.Entity) { + expect(entity).to.exist; + + expect(entity.components).to.exist; + expect(entity.object3D).to.exist; + expect(entity.object3DMap).to.exist; + + expect(entity.addState).to.be.a('function'); + expect(entity.emit).to.be.a('function'); + expect(entity.flushToDOM).to.be.a('function'); + expect(entity.getAttribute).to.be.a('function'); + expect(entity.getComputedAttribute).to.be.a('function'); + expect(entity.getObject3D).to.be.a('function'); + expect(entity.getOrCreateObject3D).to.be.a('function'); + expect(entity.is).to.be.a('function'); + expect(entity.pause).to.be.a('function'); + expect(entity.play).to.be.a('function'); + expect(entity.setAttribute).to.be.a('function'); + expect(entity.setObject3D).to.be.a('function'); + expect(entity.removeAttribute).to.be.a('function'); + expect(entity.removeObject3D).to.be.a('function'); + expect(entity.removeState).to.be.a('function'); +} + +describe('entity', () => { + let entity: AFrame.Entity; + + beforeEach(() => { + entity = document.createElement('a-entity'); + }); + + describe('entity is not attached to a scene', () => { + it('has the expected shape', () => { + assertStaticShape(entity); + expect(entity.sceneEl).to.not.exist; + }); + }); + + describe('entity is part of a scene', () => { + let scene: AFrame.Scene; + + beforeEach(() => { + return new Promise(function (resolve) { + scene = document.createElement('a-scene'); + scene.addEventListener('renderstart', function () { + resolve(); + }); + document.body.appendChild(scene); + scene.appendChild(entity); + }); + }); + + afterEach(() => { + document.body.innerHTML = ''; + }); + + it('has the expected shape', () => { + assertStaticShape(entity); + expect(entity.sceneEl).to.exist; + }); + }); +}); diff --git a/types/aframe/tests/intern.ts b/types/aframe/tests/intern.ts new file mode 100755 index 0000000000..f81395f8ec --- /dev/null +++ b/types/aframe/tests/intern.ts @@ -0,0 +1,26 @@ +export const loaders = { + 'host-browser': 'node_modules/@dojo/loader/loader.js' +}; + +export const environments = [ + { browserName: 'chrome' } +]; + +// Configuration options for the module loader; any AMD configuration options supported by the specified AMD loader +// can be used here +export const loaderOptions = { + // Packages that should be registered with the loader in each testing environment + packages: [ + { name: 'tests', location: '.' }, + { name: 'aframe', location: `./node_modules/aframe/dist`, main: 'aframe-master.js' } + ] +}; + +export const suites = [ + 'tests/aframe', + 'tests/component', + 'tests/entity' +]; + +// A regular expression matching URLs to files that should not be included in code coverage analysis +export const excludeInstrumentation = /(?:node_modules|tests)[\/\\]/; diff --git a/types/aframe/tests/package.json b/types/aframe/tests/package.json new file mode 100755 index 0000000000..8d50073828 --- /dev/null +++ b/types/aframe/tests/package.json @@ -0,0 +1,19 @@ +{ + "scripts": { + "build": "tsc && tsc -p ../tsconfig.json", + "dev": "npm run build && npm run test", + "test": "intern-runner --config=./intern" + }, + "dependencies": { + "@types/three": "^0.84.8", + "@types/tweenjs": "^0.6.27" + }, + "devDependencies": { + "@dojo/loader": "^2.0.0-beta1.1", + "aframe": "^0.5.0", + "intern": "^3.3.1", + "ts-node": "^3.0.4", + "tslint": "^3.15.1", + "typescript": "^2.3.4" + } +} diff --git a/types/aframe/tests/tests.html b/types/aframe/tests/tests.html new file mode 100644 index 0000000000..113631453e --- /dev/null +++ b/types/aframe/tests/tests.html @@ -0,0 +1,8 @@ + + + + + + Unit Tests + + diff --git a/types/aframe/tests/tsconfig.json b/types/aframe/tests/tsconfig.json new file mode 100644 index 0000000000..92f9994342 --- /dev/null +++ b/types/aframe/tests/tsconfig.json @@ -0,0 +1,22 @@ +{ + "version": "2.3.2", + "extends": "../tsconfig.json", + "compilerOptions": { + "module": "umd", + "moduleResolution": "node", + "removeComments": false, + "sourceMap": true, + "types": [ "intern" ], + "noEmit": false, + "paths": { + "aframe": [ ".." ] + } + }, + "files": [ + "aframe.ts", + "component.ts", + "entity.ts", + "intern.ts", + "../index.d.ts" + ] +} diff --git a/types/aframe/tsconfig.json b/types/aframe/tsconfig.json new file mode 100755 index 0000000000..82e7e6792b --- /dev/null +++ b/types/aframe/tsconfig.json @@ -0,0 +1,26 @@ +{ + "version": "2.3.2", + "compilerOptions": { + "baseUrl": "..", + "lib": [ + "es5", + "dom", + "es2015.iterable", + "es2015.promise" + ], + "module": "commonjs", + "noImplicitAny": true, + "noImplicitThis": true, + "removeComments": false, + "sourceMap": true, + "strictNullChecks": true, + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "typeRoots": [ "../" ], + "types": [ ] + }, + "files": [ + "index.d.ts", + "aframe-tests.ts" + ] +} diff --git a/types/aframe/tslint.json b/types/aframe/tslint.json new file mode 100644 index 0000000000..724f3870ca --- /dev/null +++ b/types/aframe/tslint.json @@ -0,0 +1,5 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + } +} From 0ccd259f043e5351db216526dc6ae76205b150b4 Mon Sep 17 00:00:00 2001 From: marshall007 Date: Tue, 6 Jun 2017 14:43:09 -0500 Subject: [PATCH 092/761] @types/bull: fix `typeRoots` and `baseUrl` for v2 --- types/bull/tsconfig.json | 8 ++------ types/bull/v2/tsconfig.json | 10 +++------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/types/bull/tsconfig.json b/types/bull/tsconfig.json index 56a53750f3..0751a977c1 100644 --- a/types/bull/tsconfig.json +++ b/types/bull/tsconfig.json @@ -1,16 +1,12 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": [ "es6" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": [ "../" ], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/bull/v2/tsconfig.json b/types/bull/v2/tsconfig.json index 2948048b1e..12445fc199 100644 --- a/types/bull/v2/tsconfig.json +++ b/types/bull/v2/tsconfig.json @@ -1,16 +1,12 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": [ "es6" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], + "baseUrl": "../../", + "typeRoots": [ "../../" ], "types": [], "paths": { "bull": [ "bull/v2" ], From a683b93fa296410097b28945a033bbae1e3951e7 Mon Sep 17 00:00:00 2001 From: Adam Herrmann Date: Tue, 6 Jun 2017 16:13:57 -0400 Subject: [PATCH 093/761] feat(undertaker): add description to TaskFunctionParams --- types/undertaker/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/undertaker/index.d.ts b/types/undertaker/index.d.ts index 23b5b7b65c..b19ad4ac79 100644 --- a/types/undertaker/index.d.ts +++ b/types/undertaker/index.d.ts @@ -11,6 +11,7 @@ declare namespace Undertaker { interface TaskFunctionParams { name?: string; displayName?: string; + description?: string; } interface TaskFunction extends TaskFunctionParams { From 441c41158ed03faf0a467a72991120f8cd3b01e1 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Jun 2017 23:29:38 +0100 Subject: [PATCH 094/761] Added revparse --- types/nodegit/index.d.ts | 1 + types/nodegit/rev-parse.d.ts | 16 ++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 18 insertions(+) create mode 100644 types/nodegit/rev-parse.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 14d88297c4..c9c349fff0 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -33,6 +33,7 @@ export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; +export { Revparse } from './rev-parse'; export { Revwalk } from './rev-walk'; export { Signature } from './signature'; export { Stash } from './stash'; diff --git a/types/nodegit/rev-parse.d.ts b/types/nodegit/rev-parse.d.ts new file mode 100644 index 0000000000..9d0136cac6 --- /dev/null +++ b/types/nodegit/rev-parse.d.ts @@ -0,0 +1,16 @@ +import { Object } from './object'; +import { Repository } from './repository'; +import { Reference } from './reference'; + +export namespace Revparse { + enum MODE { + SINGLE = 1, + RANGE = 2, + MERGE_BASE = 4 + } +} + +export class Revparse { + static ext(object_out: Object, reference_out: Reference, repo: Repository, spec: string): number; + static single(repo: Repository, spec: string): Promise; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 9e3fa9285a..e2307970d6 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -47,6 +47,7 @@ "remote-callbacks.d.ts", "remote.d.ts", "repository.d.ts", + "rev-parse.d.ts", "rev-walk.d.ts", "signature.d.ts", "stash.d.ts", From 332dd084791e96b13e350af56169f556aef84d80 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Jun 2017 23:32:39 +0100 Subject: [PATCH 095/761] Added Revert --- types/nodegit/index.d.ts | 1 + types/nodegit/revert.d.ts | 17 +++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 19 insertions(+) create mode 100644 types/nodegit/revert.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index c9c349fff0..e2962e2cee 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -35,6 +35,7 @@ export { Remote } from './remote'; export { Repository } from './repository'; export { Revparse } from './rev-parse'; export { Revwalk } from './rev-walk'; +export { Revert } from './revert'; export { Signature } from './signature'; export { Stash } from './stash'; export { StatusEntry } from './status-entry'; diff --git a/types/nodegit/revert.d.ts b/types/nodegit/revert.d.ts new file mode 100644 index 0000000000..a1210182eb --- /dev/null +++ b/types/nodegit/revert.d.ts @@ -0,0 +1,17 @@ +import { MergeOptions } from './merge-options'; +import { CheckoutOptions } from './checkout-options'; +import { Repository } from './repository'; +import { Commit } from './commit'; +import { Index } from './index'; + +export interface RevertOptions { + version: number; + mainline: number; + mergeOpts: MergeOptions; + checkoutOpts: CheckoutOptions; +} + +export class Revert { + static revert(repo: Repository, commit: Commit, given_opts: RevertOptions): Promise; + static commit(repo: Repository, revert_commit: Commit, our_commit: Commit, mainline: number, merge_options: MergeOptions): Promise; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index e2307970d6..b8b465f84d 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -49,6 +49,7 @@ "repository.d.ts", "rev-parse.d.ts", "rev-walk.d.ts", + "revert.d.ts", "signature.d.ts", "stash.d.ts", "status-entry.d.ts", From d456855e53c4766a88a41215ed8ce8cf55acdcfb Mon Sep 17 00:00:00 2001 From: Kamil Szostak Date: Tue, 6 Jun 2017 15:56:43 -0700 Subject: [PATCH 096/761] Update trackTrack definition --- types/applicationinsights-js/applicationinsights-js-tests.ts | 3 ++- types/applicationinsights-js/index.d.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/applicationinsights-js/applicationinsights-js-tests.ts b/types/applicationinsights-js/applicationinsights-js-tests.ts index 1a4d585795..8967356426 100644 --- a/types/applicationinsights-js/applicationinsights-js-tests.ts +++ b/types/applicationinsights-js/applicationinsights-js-tests.ts @@ -44,7 +44,7 @@ appInsights = { trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number) { 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; }, + trackTrace(message: string, properties?: { [name: string]: string; }, severityLevel?: AI.SeverityLevel) { return null; }, flush() { return null; }, setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string) { return null; }, clearAuthenticatedUserContext() { return null; }, @@ -77,6 +77,7 @@ appInsights.trackException(new Error("sample error"), "handledAt", null, null); // trackTrace appInsights.trackTrace("message"); appInsights.trackTrace("message", null); +appInsights.trackTrace("message", { a: '1', b: '2' }, AI.SeverityLevel.Error); // trackDependency appInsights.trackDependency("id", "POST", "http://example.com/test/abc", "/test/abc", null, true, null); diff --git a/types/applicationinsights-js/index.d.ts b/types/applicationinsights-js/index.d.ts index cce53f5823..0a01d726a4 100644 --- a/types/applicationinsights-js/index.d.ts +++ b/types/applicationinsights-js/index.d.ts @@ -763,7 +763,7 @@ declare module Microsoft.ApplicationInsights { * @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; + trackTrace(message: string, properties?: { [name: string]: string }, severityLevel?: AI.SeverityLevel): any; /** * Immediately send all queued telemetry. */ From f04f22ac45ccab878a90bba1d0aed98f498ddd0a Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:13:49 +0100 Subject: [PATCH 097/761] Added Reset --- types/nodegit/index.d.ts | 1 + types/nodegit/reset.d.ts | 0 types/nodegit/tsconfig.json | 1 + 3 files changed, 2 insertions(+) create mode 100644 types/nodegit/reset.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index e2962e2cee..94aa7fe1ef 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -33,6 +33,7 @@ export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; +export { Reset } from './reset'; export { Revparse } from './rev-parse'; export { Revwalk } from './rev-walk'; export { Revert } from './revert'; diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index b8b465f84d..56641e050c 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -47,6 +47,7 @@ "remote-callbacks.d.ts", "remote.d.ts", "repository.d.ts", + "reset.d.ts", "rev-parse.d.ts", "rev-walk.d.ts", "revert.d.ts", From 95a20577f6e937a95a3c1b54e4843456cc1e0811 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:19:16 +0100 Subject: [PATCH 098/761] fixed Reset --- types/nodegit/reset.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index e69de29bb2..8af3919ff4 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -0,0 +1,19 @@ +import { AnnotatedCommit } from './annotated-commit'; +import { Repository } from './repository'; +import { Object } from './object'; +import { Strarray } from './str-array'; +import { CheckoutOptions } from './checkout-options'; + +export namespace Reset { + enum TYPE { + SOFT = 1, + MIXED = 2, + HARD = 3 + } +} + +export class Reset { + static reset(repo: Repository, target: Object, reset_type: number, checkout_opts: CheckoutOptions): Promise; + static default(repo: Repository, target: Object, pathspecs: Strarray): Promise; + static fromAnnotated(repo: Repository, commit: AnnotatedCommit, reset_type: number, checkout_opts: CheckoutOptions): number; +} From 9bbd5e983c3e9f1377d5d8cfc6156a5b209df8d4 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:26:06 +0100 Subject: [PATCH 099/761] Added Reflog --- types/nodegit/index.d.ts | 1 + types/nodegit/ref-log.d.ts | 23 +++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 25 insertions(+) create mode 100644 types/nodegit/ref-log.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 94aa7fe1ef..79c6d60c54 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -28,6 +28,7 @@ export { Oidarray } from './oid-array'; export { Oid } from './oid'; export { PushOptions } from './push-options'; export { Refdb } from './ref-db'; +export { Reflog, ReflogEntry } from './ref-log' import { Refspec } from './ref-spec'; export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; diff --git a/types/nodegit/ref-log.d.ts b/types/nodegit/ref-log.d.ts new file mode 100644 index 0000000000..749f0c03a1 --- /dev/null +++ b/types/nodegit/ref-log.d.ts @@ -0,0 +1,23 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Signature } from './signature'; + +export class Reflog { + static delete(repo: Repository, name: string): number; + static entryCommitter(entry: ReflogEntry): Signature; + static entryIdNew(entry: ReflogEntry): Oid; + static entryIdOld(entry: ReflogEntry): Oid; + static entryMessage(entry: ReflogEntry): string; + static read(repo: Repository, name: string): Promise; + static rename(repo: Repository, old_name: string, name: string): number; + + append(id: Oid, committer: Signature, msg: string): number; + drop(idx: number, rewrite_previous_entry: number): number; + entryByIndex(idx: number): ReflogEntry; + entrycount(): number; + free(): void; + write(): number; +} + +export class ReflogEntry { +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 56641e050c..7dba399bca 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -42,6 +42,7 @@ "oid.d.ts", "push-options.d.ts", "ref-db.d.ts", + "ref-log.d.ts", "ref-spec.d.ts", "reference.d.ts", "remote-callbacks.d.ts", From bf5f2294ca8ec46c463511f2b9c45d485f26d8e3 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:27:58 +0100 Subject: [PATCH 100/761] Added RebaseOpertation --- types/nodegit/index.d.ts | 3 ++- types/nodegit/rebase-operation.d.ts | 18 ++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 types/nodegit/rebase-operation.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 79c6d60c54..4305b092ac 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -27,9 +27,10 @@ export { Odb } from './odb'; export { Oidarray } from './oid-array'; export { Oid } from './oid'; export { PushOptions } from './push-options'; +export { RebaseOperation } from './rebase-operation'; export { Refdb } from './ref-db'; export { Reflog, ReflogEntry } from './ref-log' -import { Refspec } from './ref-spec'; +export { Refspec } from './ref-spec'; export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; diff --git a/types/nodegit/rebase-operation.d.ts b/types/nodegit/rebase-operation.d.ts new file mode 100644 index 0000000000..a6e6e53bfa --- /dev/null +++ b/types/nodegit/rebase-operation.d.ts @@ -0,0 +1,18 @@ +import { Oid } from './oid'; + +export namespace RebaseOperation { + enum REBASE_OPERATION { + PICK = 0, + REWORD = 1, + EDIT = 2, + SQUASH = 3, + FIXUP = 4, + EXEC = 5 + } +} + +export class RebaseOperation { + type: number; + id: Oid; + exec: string; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 7dba399bca..0d52815cb5 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -41,6 +41,7 @@ "oid-array.d.ts", "oid.d.ts", "push-options.d.ts", + "rebase-operation.d.ts", "ref-db.d.ts", "ref-log.d.ts", "ref-spec.d.ts", From cc2fd5a8d85708fa2544c912064c95bbcf7e11ea Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:32:18 +0100 Subject: [PATCH 101/761] Added meathods to ref log --- types/nodegit/ref-log.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/nodegit/ref-log.d.ts b/types/nodegit/ref-log.d.ts index 749f0c03a1..8557d02a39 100644 --- a/types/nodegit/ref-log.d.ts +++ b/types/nodegit/ref-log.d.ts @@ -20,4 +20,8 @@ export class Reflog { } export class ReflogEntry { + committer(): Signature; + idNew(): Oid; + idOld(): Oid; + message(): string; } From 09e7e4151994672779e2e92fb7de0259edcf574f Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:32:24 +0100 Subject: [PATCH 102/761] Added Rebase --- types/nodegit/index.d.ts | 1 + types/nodegit/rebase.d.ts | 27 +++++++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 29 insertions(+) create mode 100644 types/nodegit/rebase.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 4305b092ac..eca21bec1c 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -28,6 +28,7 @@ export { Oidarray } from './oid-array'; export { Oid } from './oid'; export { PushOptions } from './push-options'; export { RebaseOperation } from './rebase-operation'; +export { Rebase, RebaseOptions } from './rebase'; export { Refdb } from './ref-db'; export { Reflog, ReflogEntry } from './ref-log' export { Refspec } from './ref-spec'; diff --git a/types/nodegit/rebase.d.ts b/types/nodegit/rebase.d.ts new file mode 100644 index 0000000000..15862ff17d --- /dev/null +++ b/types/nodegit/rebase.d.ts @@ -0,0 +1,27 @@ +import { CheckoutOptions } from './checkout-options'; +import { AnnotatedCommit } from './annotated-commit'; +import { Repository } from './repository'; +import { Signature } from './signature'; +import { Oid } from './oid'; +import { RebaseOperation } from './rebase-operation'; + +export interface RebaseOptions { + version: number; + quiet: number; + rewriteNotesRef: string; + checkoutOptions: CheckoutOptions; +} + +export class Rebase { + static init(repo: Repository, branch: AnnotatedCommit, upstream: AnnotatedCommit, onto: AnnotatedCommit, opts: RebaseOptions): Promise; + static initOptions(opts: RebaseOptions, version: number): number; + static open(repo: Repository, opts: RebaseOptions): Promise; + + abort(): number; + commit(author: Signature, committer: Signature, message_encoding: string, message: string): Oid; + finish(signature: Signature): number; + next(): Promise; + operationByIndex(idx: number): RebaseOperation; + operationCurrent(): number; + operationEntrycount(): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 0d52815cb5..3753e1d693 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -42,6 +42,7 @@ "oid.d.ts", "push-options.d.ts", "rebase-operation.d.ts", + "rebase.d.ts", "ref-db.d.ts", "ref-log.d.ts", "ref-spec.d.ts", From 5c1cf0697d657f4ed0970a8caa72091bbb33728e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:43:37 +0100 Subject: [PATCH 103/761] Added Push --- types/nodegit/index.d.ts | 1 + types/nodegit/push.d.ts | 6 ++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 8 insertions(+) create mode 100644 types/nodegit/push.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index eca21bec1c..db7b3c6ed0 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -27,6 +27,7 @@ export { Odb } from './odb'; export { Oidarray } from './oid-array'; export { Oid } from './oid'; export { PushOptions } from './push-options'; +export { Push } from './push'; export { RebaseOperation } from './rebase-operation'; export { Rebase, RebaseOptions } from './rebase'; export { Refdb } from './ref-db'; diff --git a/types/nodegit/push.d.ts b/types/nodegit/push.d.ts new file mode 100644 index 0000000000..26d8f07b60 --- /dev/null +++ b/types/nodegit/push.d.ts @@ -0,0 +1,6 @@ +import { RemoteCallbacks } from './remote-callbacks'; +import { PushOptions } from './push-options'; + +export class Push { + static initOptions(opts: PushOptions, version: number): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 3753e1d693..5022d35c65 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -41,6 +41,7 @@ "oid-array.d.ts", "oid.d.ts", "push-options.d.ts", + "push.d.ts", "rebase-operation.d.ts", "rebase.d.ts", "ref-db.d.ts", From 73b4969fa08305aa8abf8db1de9391c905269d56 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:48:34 +0100 Subject: [PATCH 104/761] Added PushUpdate and Pathspec --- types/nodegit/index.d.ts | 2 ++ types/nodegit/path-spec.d.ts | 34 ++++++++++++++++++++++++++++++++++ types/nodegit/push-update.d.ts | 8 ++++++++ types/nodegit/tsconfig.json | 2 ++ 4 files changed, 46 insertions(+) create mode 100644 types/nodegit/path-spec.d.ts create mode 100644 types/nodegit/push-update.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index db7b3c6ed0..8ddc254bc6 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -26,7 +26,9 @@ export { OdbObject } from './odb-object'; export { Odb } from './odb'; export { Oidarray } from './oid-array'; export { Oid } from './oid'; +export { Pathspec } from './path-spec'; export { PushOptions } from './push-options'; +export { PushUpdate } from './push-update'; export { Push } from './push'; export { RebaseOperation } from './rebase-operation'; export { Rebase, RebaseOptions } from './rebase'; diff --git a/types/nodegit/path-spec.d.ts b/types/nodegit/path-spec.d.ts new file mode 100644 index 0000000000..d09d2812da --- /dev/null +++ b/types/nodegit/path-spec.d.ts @@ -0,0 +1,34 @@ +import { DiffDelta } from './diff-delta'; +import { Tree } from './tree'; +import { Diff } from './diff'; +import { Repository } from './repository'; +import { Index } from './index'; +import { Strarray } from './str-array'; + +export namespace Pathspec { + enum FLAG { + DEFAULT = 0, + IGNORE_CASE = 1, + USE_CASE = 2, + NO_GLOB = 4, + NO_MATCH_ERROR = 8, + FIND_FAILURES = 16, + FAILURES_ONLY = 32 + } +} + +export class Pathspec { + static matchListDiffEntry(m: any, pos: number): DiffDelta; + static matchListEntry(m: any, pos: number): string; + static matchListEntrycount(m: any): number; + static matchListFailedEntry(m: any, pos: number): string; + static matchListFailedEntrycount(m: any): number; + static create(pathspec: Strarray): Pathspec; + + free(): void; + matchDiff(diff: Diff, flags: number): Promise; + matchIndex(index: Index, flags: number): Promise; + matchTree(tree: Tree, flags: number): Promise; + matchWorkdir(repo: Repository, flags: number): Promise; + matchesPath(flags: number, path: string): number; +} diff --git a/types/nodegit/push-update.d.ts b/types/nodegit/push-update.d.ts new file mode 100644 index 0000000000..50f46726d5 --- /dev/null +++ b/types/nodegit/push-update.d.ts @@ -0,0 +1,8 @@ +import { Oid } from './oid'; + +export class PushUpdate { + srcRefname: string; + dstRefname: string; + src: Oid; + dst: Oid; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 5022d35c65..7d446ebcbd 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -40,7 +40,9 @@ "odb.d.ts", "oid-array.d.ts", "oid.d.ts", + "path-spec.d.ts", "push-options.d.ts", + "push-update.d.ts", "push.d.ts", "rebase-operation.d.ts", "rebase.d.ts", From bdd0f86ce7033bce36605ac55a451f42e41ece2b Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:52:15 +0100 Subject: [PATCH 105/761] Added Packbuilder --- types/nodegit/index.d.ts | 1 + types/nodegit/pack-builder.d.ts | 25 +++++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 27 insertions(+) create mode 100644 types/nodegit/pack-builder.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 8ddc254bc6..f343cd5dd6 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -26,6 +26,7 @@ export { OdbObject } from './odb-object'; export { Odb } from './odb'; export { Oidarray } from './oid-array'; export { Oid } from './oid'; +export { Packbuilder } from './pack-builder'; export { Pathspec } from './path-spec'; export { PushOptions } from './push-options'; export { PushUpdate } from './push-update'; diff --git a/types/nodegit/pack-builder.d.ts b/types/nodegit/pack-builder.d.ts new file mode 100644 index 0000000000..0f21f5f328 --- /dev/null +++ b/types/nodegit/pack-builder.d.ts @@ -0,0 +1,25 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Revwalk } from './rev-walk'; + +export namespace Packbuilder { + enum STAGE { + ADDING_OBJECTS = 0, + DELTAFICATION = 1 + } +} + +export class Packbuilder { + static create(repo: Repository): Packbuilder; + + free(): void; + hash(): Oid; + insert(id: Oid, name: string): number; + insertCommit(id: Oid): number; + insertRecur(id: Oid, name: string): number; + insertTree(id: Oid): number; + insertWalk(walk: Revwalk): number; + objectCount(): number; + setThreads(n: number): number; + written(): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 7d446ebcbd..6ec7d65565 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -40,6 +40,7 @@ "odb.d.ts", "oid-array.d.ts", "oid.d.ts", + "path-builder.d.ts", "path-spec.d.ts", "push-options.d.ts", "push-update.d.ts", From 4a60f79472da6b0df7f3f0b86c6154bd73a89dc2 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:54:30 +0100 Subject: [PATCH 106/761] fixed typo --- types/nodegit/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 6ec7d65565..1f0cfe70f9 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -40,7 +40,7 @@ "odb.d.ts", "oid-array.d.ts", "oid.d.ts", - "path-builder.d.ts", + "pack-builder.d.ts", "path-spec.d.ts", "push-options.d.ts", "push-update.d.ts", From 0fbae92912bcd278082c5cdfa2f510c2e5d647bb Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:55:10 +0100 Subject: [PATCH 107/761] Added Openssl --- types/nodegit/index.d.ts | 1 + types/nodegit/open-ssl.d.ts | 3 +++ types/nodegit/tsconfig.json | 1 + 3 files changed, 5 insertions(+) create mode 100644 types/nodegit/open-ssl.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index f343cd5dd6..ff8adee80e 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -26,6 +26,7 @@ export { OdbObject } from './odb-object'; export { Odb } from './odb'; export { Oidarray } from './oid-array'; export { Oid } from './oid'; +export { Openssl } from './open-ssl'; export { Packbuilder } from './pack-builder'; export { Pathspec } from './path-spec'; export { PushOptions } from './push-options'; diff --git a/types/nodegit/open-ssl.d.ts b/types/nodegit/open-ssl.d.ts new file mode 100644 index 0000000000..f8370260d5 --- /dev/null +++ b/types/nodegit/open-ssl.d.ts @@ -0,0 +1,3 @@ +export class Openssl { + static setLocking(): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 1f0cfe70f9..0e297fb291 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -40,6 +40,7 @@ "odb.d.ts", "oid-array.d.ts", "oid.d.ts", + "open-ssl.d.ts", "pack-builder.d.ts", "path-spec.d.ts", "push-options.d.ts", From 13e07d9e23849a9b84cd11a154a126790128323c Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:58:49 +0100 Subject: [PATCH 108/761] Added Note --- types/nodegit/index.d.ts | 1 + types/nodegit/note.d.ts | 18 ++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 20 insertions(+) create mode 100644 types/nodegit/note.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index ff8adee80e..4f232c4cf7 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -21,6 +21,7 @@ export { IndexEntry } from './index-entry'; export { MergeFileInput } from './merge-file-input'; export { MergeOptions } from './merge-options'; export { Merge } from './merge'; +export { Note } from './note'; export { Object } from './object'; export { OdbObject } from './odb-object'; export { Odb } from './odb'; diff --git a/types/nodegit/note.d.ts b/types/nodegit/note.d.ts new file mode 100644 index 0000000000..2ea74b9df8 --- /dev/null +++ b/types/nodegit/note.d.ts @@ -0,0 +1,18 @@ +import {Repository} from './repository'; +import {Signature} from './signature'; +import {Oid} from './oid'; + +export class Note { + static create(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid, note: string, force: number): Promise; + static foreach(repo: Repository, notes_ref: string, note_cb: Function, payload: void): Promise; + static iteratorNew(repo: Repository, notes_ref: string): Promise; + static next(note_id: Oid, annotated_id: Oid, it: any): number; + static read(repo: Repository, notes_ref: string, oid: Oid): Promise; + static remove(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid): Promise; + + author(): Signature; + committer(): Signature; + free(): void; + id(): Oid; + message(): string; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 0e297fb291..32102a2de8 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -35,6 +35,7 @@ "merge-options.d.ts", "merge.d.ts", "nodegit-tests.ts", + "note.d.ts", "object.d.ts", "odb-object.d.ts", "odb.d.ts", From bf3471c59d169f8b101a5a2f0ea9ce053fad5645 Mon Sep 17 00:00:00 2001 From: Yoni Lerner Date: Tue, 6 Jun 2017 17:00:02 -0700 Subject: [PATCH 109/761] Add onLimitReached for express-rate-limit RateLimit.Options, and add function signatures for all Options (#17009) * Update index.d.ts * Update index.d.ts * Update index.d.ts --- types/express-rate-limit/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/express-rate-limit/index.d.ts b/types/express-rate-limit/index.d.ts index 54bdacb936..86b8d497b0 100644 --- a/types/express-rate-limit/index.d.ts +++ b/types/express-rate-limit/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for express-rate-limit 2.6 +// Type definitions for express-rate-limit 2.8 // Project: https://github.com/nfriedly/express-rate-limit // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -17,14 +17,15 @@ declare namespace RateLimit { interface Options { delayAfter?: number; delayMs?: number; - handlers?(): any; + handlers?(req?: express.Request, res?: express.Response, next?: express.NextFunction): any; headers?: boolean; - keyGenerator?(): string; + keyGenerator?(req?: express.Request, res?: express.Response): string; max?: number; message?: string; - skip?(): boolean; + skip?(req?: express.Request, res?: express.Response): boolean; statusCode?: number; store?: Store; + onLimitReached?(req?: express.Request, res?: express.Response, optionsUsed?: Options): void; windowMs?: number; } } From 501ea7986b960b3fe6b511c56466073340dc16ec Mon Sep 17 00:00:00 2001 From: Simon Males Date: Wed, 7 Jun 2017 02:18:42 +0200 Subject: [PATCH 110/761] Add definition for AWS Lambda Cognito User Pool event: request.usernameParameter (#16998) * request.usernameParameter * usernameParameter test --- types/aws-lambda/aws-lambda-tests.ts | 1 + types/aws-lambda/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index e3356cae42..55a3d6b99f 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -188,6 +188,7 @@ str = cognitoUserPoolEvent.callerContext.clientId; str = cognitoUserPoolEvent.request.userAttributes["email"]; str = cognitoUserPoolEvent.request.validationData["k1"]; str = cognitoUserPoolEvent.request.codeParameter; +str = cognitoUserPoolEvent.request.usernameParameter; b = cognitoUserPoolEvent.request.newDeviceUsed; cognitoUserPoolEvent.request.session[0].challengeName === "CUSTOM_CHALLENGE"; cognitoUserPoolEvent.request.session[0].challengeName === "PASSWORD_VERIFIER"; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 2af4e09ae7..ca84cd350d 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -142,6 +142,7 @@ interface CognitoUserPoolEvent { userAttributes: {[key: string]: string}; validationData?: {[key: string]: string}; codeParameter?: string; + usernameParameter?: string; newDeviceUsed?: boolean; session?: { challengeName: "CUSTOM_CHALLENGE" | "PASSWORD_VERIFIER" | "SMS_MFA" | "DEVICE_SRP_AUTH" | "DEVICE_PASSWORD_VERIFIER" | "ADMIN_NO_SRP_AUTH"; From 9bb76af07f5a1aa109b2c676f2d4c645399bcb6d Mon Sep 17 00:00:00 2001 From: StickerFiend Date: Tue, 6 Jun 2017 17:19:01 -0700 Subject: [PATCH 111/761] [types/paper] Updated from clark-stevenson repo (#16997) * Updated index.d.ts from clark-stevenson paperjs type repo * Fixed failing test --- types/paper/index.d.ts | 391 ++++++++++++++++++++++++++----------- types/paper/paper-tests.ts | 2 +- 2 files changed, 279 insertions(+), 114 deletions(-) diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 41b958fd50..197707058b 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Clark Stevenson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +type NativeMouseEvent = MouseEvent; + declare module 'paper' { /** @@ -285,7 +287,7 @@ declare module 'paper' { * Transforms a point and returns the result. * @param point - the point to be transformed */ - transform(point: Point): Point; + transform(point: Point): Matrix; /** * Transforms an array of coordinates by this matrix and stores the results into the destination array, which is also returned. @@ -299,7 +301,7 @@ declare module 'paper' { * Inverse transforms a point and returns the result. * @param point - the point to be transformed */ - inverseTransform(point: Point): Point; + inverseTransform(point: Point): Matrix; /** * Attempts to decompose the affine transformation described by this matrix into scaling, rotation and shearing, and returns an object with these properties if it succeeded, null otherwise. @@ -550,6 +552,36 @@ declare module 'paper' { */ abs(): Point; + /* + * Returns a new point + * @param point - The point you want to add with + */ + add(point: Point): Point; + add(point: number[]): Point; + + /* + * Returns a new point + * @param point - The point you want to subtract with + */ + subtract(point: Point): Point; + subtract(point: number[]): Point; + + /* + * Returns the new multiplied point + * @param point - The point you want to multiply with + */ + multiply(point: Point): Point; + multiply(point: number[]): Point; + multiply(point: number): Point; + + /* + * Returns the new divided point + * @param point - The point you want to divide with + */ + divide(point: Point): Point; + divide(point: number[]): Point; + divide(point: number): Point; + } /** * A Rectangle specifies an area that is enclosed by it's top-left point (x, y), its width, and its height. It should not be confused with a rectangular path, it is not an item. @@ -894,6 +926,22 @@ declare module 'paper' { */ abs(): Size; + /* + * Returns the new multiplied size + * @param point - The size you want to multiply with + */ + multiply(point: Size): Size; + multiply(point: number[]): Size; + multiply(point: number): Size; + + /* + * Returns the new divided size + * @param point - The size you want to divide with + */ + divide(point: Size): Size; + divide(point: number[]): Size; + divide(point: number): Size; + } export interface IFrameEvent { @@ -1223,6 +1271,11 @@ declare module 'paper' { */ fillColor: Color | string; + /** + * The fill rule. + */ + fillRule: string; + /** * The color the item is highlighted with when selected. If the item does not specify its own color, the color defined by its layer is used instead. */ @@ -1432,6 +1485,20 @@ declare module 'paper' { */ insertBelow(item: Item): Item; + /** + * Moves this item above the specified item. Returns true if the item + * was moved. + * @param item - the item above which it should be moved + */ + moveAbove(item: Item): boolean; + + /** + * Moves this item below the specified item. Returns true if the item + * was moved. + * @param item - the item below which it should be moved + */ + moveBelow(item: Item): boolean; + /** * Sends this item to the back of all other items within the same parent. */ @@ -1551,7 +1618,7 @@ declare module 'paper' { * Translates (moves) the item by the given offset point. * @param delta - the offset to translate the item by */ - translate(delta: number): Point; + translate(delta: Point): Point; /** * Rotates the item by a given angle around the given point. @@ -1561,6 +1628,11 @@ declare module 'paper' { */ rotate(angle: number, center?: Point): void; + /** + * Gets the current rotation of the item. + */ + getRotation(): number; + /** * Scales the item by the given value from its center point, or optionally from a supplied point. * @param scale - the scale factor @@ -1883,6 +1955,7 @@ declare module 'paper' { * @param position [optional] - the center position at which the raster item is placed */ constructor(source?: HTMLImageElement | HTMLCanvasElement | string, position?: Point); + constructor(config: any); /** * The size of the raster in pixels. @@ -2105,7 +2178,7 @@ declare module 'paper' { * @param handle2 - The second control point handle for the curve * @param to - The end control point of the curve */ - cublicCurveTo(handle1: Point, handle2: Point, to: Point): void; + cubicCurveTo(handle1: Point, handle2: Point, to: Point): void; /** * Adds a quadratic bezier curve to the path, defined by a handle and a to point. @@ -2168,7 +2241,7 @@ declare module 'paper' { * @param handle2 - * @param to - */ - cublicCurveBy(handle1: Point, handle2: Point, to: Point): void; + cubicCurveBy(handle1: Point, handle2: Point, to: Point): void; /** * @@ -2227,118 +2300,11 @@ declare module 'paper' { */ export class Path extends PathItem { - /** - * Creates a linear path item from two points describing a line. - * @param from - the line's starting point - * @param to - the line's ending point - */ - static Line(from: Point, to: Point): Path; - - /** - * Creates a linear path item from the properties described by an object literal. - * @param object - an object literal containing properties describing the path's attributes - */ - static Line(object: any): Path; - - /** - * Creates a circular path item. - * @param center - the center point of the circle - * @param radius - the radius of the circle - */ - static Circle(center: Point, radius: number): Path; - - /** - * Creates a circular path item from the properties described by an object literal. - * @param object - an object literal containing properties describing the path's attributes - */ - static Circle(object: any): Path; - - /** - * Creates a rectangular path item, with optionally rounded corners. - * @param rectangle - the rectangle object describing the geometry of the rectangular path to be created. - * @param radius [optional] - the size of the rounded corners default: null - */ - static Rectangle(rectangle: Rectangle, radius?: number): Path; - - /** - * Creates a rectangular path item from a point and a size object. - * @param point - the rectangle's top-left corner. - * @param size - the rectangle's size. - */ - static Rectangle(point: Point, size: Size): Path; - - /** - * Creates a rectangular path item from the passed points. These do not necessarily need to be the top left and bottom right corners, the constructor figures out how to fit a rectangle between them. - * @param from - the first point defining the rectangle - * @param to - the second point defining the rectangle - */ - static Rectangle(from: Point, to: Point): Path; - - /** - * Creates a rectangular path item from the properties described by an object literal. - * @param object - an object literal containing properties describing the path's attributes - */ - static Rectangle(object: any): Path; - - /** - * Creates an elliptical path item. - * @param rectangle - the rectangle circumscribing the ellipse - */ - static Ellipse(rectangle: Rectangle): Path; - - /** - * Creates an elliptical path item from the properties described by an object literal. - * @param object - an object literal containing properties describing the path's attributes - */ - static Ellipse(object: any): Path; - /** - * Creates a circular arc path item - * @param from - the starting point of the circular arc - * @param through - the point the arc passes through - * @param to - the end point of the arc - */ - static Arc(from: Point, through: Point, to: Point): Path; - - /** - * Creates an circular arc path item from the properties described by an object literal. - * @param object - an object literal containing properties describing the path's attributes - */ - static Arc(object: any): Path; - - /** - * Creates a regular polygon shaped path item. - * @param center - the center point of the polygon - * @param sides - the number of sides of the polygon - * @param radius - the radius of the polygon - */ - static RegularPolygon(center: Point, sides: number, radius: number): Path; - - /** - * Creates a regular polygon shaped path item from the properties described by an object literal. - * @param object - an object literal containing properties describing the path's attributes - */ - static RegularPolygon(object: any): Path; - - /** - * Creates a star shaped path item. The largest of radius1 and radius2 will be the outer radius of the star. The smallest of radius1 and radius2 will be the inner radius. - * @param center - the center point of the star - * @param points - the number of points of the star - * @param radius1 - * @param radius2 - */ - static Star(center: Point, points: number, radius1: number, radius2: number): Path; - - /** - * Creates a star shaped path item from the properties described by an object literal. - * @param object - an object literal containing properties describing the path's attributes - */ - static Star(object: any): Path; - /** * Creates a new path item and places it at the top of the active layer. * @param segments [optional] - An array of segments (or points to be converted to segments) that will be added to the path */ - constructor(segments?: Segment[]| Point[]); + constructor(segments?: Segment[] | Point[]); /** * Creates a new path item from an object description and places it at the top of the active layer. @@ -2574,6 +2540,130 @@ declare module 'paper' { } + module Path { + export class Line extends Path { + /** + * Creates a linear path item from two points describing a line. + * @param from - the line's starting point + * @param to - the line's ending point + */ + constructor(from: Point, to: Point); + + /** + * Creates a linear path item from the properties described by an object literal. + * @param object - an object literal containing properties describing the path's attributes + */ + constructor(object: any); + } + + export class Circle extends Path { + /** + * Creates a circular path item. + * @param center - the center point of the circle + * @param radius - the radius of the circle + */ + constructor(center: Point, radius: number); + + /** + * Creates a circular path item from the properties described by an object literal. + * @param object - an object literal containing properties describing the path's attributes + */ + constructor(object: any); + } + + export class Rectangle extends Path { + /** + * Creates a rectangular path item, with optionally rounded corners. + * @param rectangle - the rectangle object describing the geometry of the rectangular path to be created. + * @param radius [optional] - the size of the rounded corners default: null + */ + constructor(rectangle: Rectangle, radius?: number); + + /** + * Creates a rectangular path item from a point and a size object. + * @param point - the rectangle's top-left corner. + * @param size - the rectangle's size. + */ + constructor(point: Point, size: Size); + + /** + * Creates a rectangular path item from the passed points. These do not necessarily need to be the top left and bottom right corners, the constructor figures out how to fit a rectangle between them. + * @param from - the first point defining the rectangle + * @param to - the second point defining the rectangle + */ + constructor(from: Point, to: Point); + + /** + * Creates a rectangular path item from the properties described by an object literal. + * @param object - an object literal containing properties describing the path's attributes + */ + constructor(object: any); + } + + export class Ellipse extends Path { + /** + * Creates an elliptical path item. + * @param rectangle - the rectangle circumscribing the ellipse + */ + constructor(rectangle: Rectangle); + + /** + * Creates an elliptical path item from the properties described by an object literal. + * @param object - an object literal containing properties describing the path's attributes + */ + constructor(object: any); + } + + export class Arc extends Path { + /** + * Creates a circular arc path item + * @param from - the starting point of the circular arc + * @param through - the point the arc passes through + * @param to - the end point of the arc + */ + constructor(from: Point, through: Point, to: Point); + + /** + * Creates an circular arc path item from the properties described by an object literal. + * @param object - an object literal containing properties describing the path's attributes + */ + constructor(object: any); + } + + export class RegularPolygon extends Path { + /** + * Creates a regular polygon shaped path item. + * @param center - the center point of the polygon + * @param sides - the number of sides of the polygon + * @param radius - the radius of the polygon + */ + constructor(center: Point, sides: number, radius: number); + + /** + * Creates a regular polygon shaped path item from the properties described by an object literal. + * @param object - an object literal containing properties describing the path's attributes + */ + constructor(object: any); + } + + export class Star extends Path { + /** + * Creates a star shaped path item. The largest of radius1 and radius2 will be the outer radius of the star. The smallest of radius1 and radius2 will be the inner radius. + * @param center - the center point of the star + * @param points - the number of points of the star + * @param radius1 + * @param radius2 + */ + constructor(center: Point, points: number, radius1: number, radius2: number); + + /** + * Creates a star shaped path item from the properties described by an object literal. + * @param object - an object literal containing properties describing the path's attributes + */ + constructor(object: any); + } + } + /** * A compound path contains two or more paths, holes are drawn where the paths overlap. All the paths in a compound path take on the style of the backmost path and can be accessed through its item.children list. */ @@ -4005,4 +4095,79 @@ declare module 'paper' { } + /** + * A Javascript MouseEvent wrapper + */ + export class MouseEvent extends Event { + constructor(type: string, event: NativeMouseEvent, point: Point, target: Item, delta: Point) + + /** + * The JavaScript mouse event + */ + event: NativeMouseEvent; + + /** + * The position of the mouse in project coordinates when the event was + * fired. + */ + point: Point; + + /** + * The last event's position of the mouse in project coordinates when + * the event was fired. + */ + lastPoint: Point; + + /** + * + */ + delta: Point; + + /** + * The item that dispatched the event. It is different from + * currentTarget when the event handler is called during the bubbling + * phase of the event. + */ + target: Item; + + /** + * The current target for the event, as the event traverses the scene + * graph. It always refers to the element the event handler has been + * attached to as opposed to target which identifies the element on + * which the event occurred. + */ + currentTarget: Item; + + /** + * Type of mouse event + */ + type: 'mousedown' | 'mouseup' | 'mousedrag' | 'click' | 'doubleclick' | 'mousemove' | 'mouseenter' | 'mouseleave'; + + /** + * The time at which the event was created, in milliseconds since the + * epoch. + */ + timeStamp(): number; + + /** + * Cancels the event if it is cancelable, without stopping further + * propagation of the event. + */ + preventDefault(): void; + + /** + * Prevents further propagation of the current event. + */ + stopPropagation(): void; + + /** + * Cancels the event if it is cancelable, and stops stopping further + * propagation of the event. This is has the same effect as calling + * both stopPropagation() and preventDefault(). + * + * Any handler can also return false to indicate that stop() should be + * called right after. + */ + stop(): void; + } } diff --git a/types/paper/paper-tests.ts b/types/paper/paper-tests.ts index 39d015db87..444ffb8725 100644 --- a/types/paper/paper-tests.ts +++ b/types/paper/paper-tests.ts @@ -5,7 +5,7 @@ var canvas = document.createElement('canvas') paper.setup(canvas); // Circle -var path = paper.Path.Circle({ +var path = new paper.Path.Circle({ center: [80, 50], radius: 35, fillColor: 'red' From 99d808a93f7f21b31a1b10a58242a4a82f04cdf3 Mon Sep 17 00:00:00 2001 From: Bernd Date: Wed, 7 Jun 2017 02:21:44 +0200 Subject: [PATCH 112/761] add type definitions for HERE data lens (#16690) * add type definitions for HERE data lens * add missing test file to tsconfig.json * fix tests and dtslint and improve typings --- types/heredatalens/heredatalens-tests.ts | 123 +++ types/heredatalens/index.d.ts | 947 +++++++++++++++++++++++ types/heredatalens/tsconfig.json | 23 + types/heredatalens/tslint.json | 3 + 4 files changed, 1096 insertions(+) create mode 100644 types/heredatalens/heredatalens-tests.ts create mode 100644 types/heredatalens/index.d.ts create mode 100644 types/heredatalens/tsconfig.json create mode 100644 types/heredatalens/tslint.json diff --git a/types/heredatalens/heredatalens-tests.ts b/types/heredatalens/heredatalens-tests.ts new file mode 100644 index 0000000000..37f20f2f84 --- /dev/null +++ b/types/heredatalens/heredatalens-tests.ts @@ -0,0 +1,123 @@ +/** + * Typescript definition tests for heredatalens + * + * Note: These tests are intended to test the definitions only + * in the sense of typing and call signature consistency. They + * are not intended as functional tests. + */ + +let serviceOptions: H.datalens.Service.Options = { + subDomain: 'sub', + version: 'version', + access_token: 'token', + refresh_token: 'token', + domainSharding: ['a', 'b'], + baseUrl: 'url' +}; + +let queryTileProviderTileParamNames: H.datalens.QueryTileProvider.TileParamNames = { + x: 'x', + y: 'y', + z: 'z' +}; + +let queryTileProviderOptions: H.datalens.QueryTileProvider.Options = { + queryId: 'id', + queryParams: 'params', + tileParamNames: queryTileProviderTileParamNames +}; + +let service: H.datalens.Service = new H.datalens.Service(serviceOptions); +service.request('method', 'endpoint', 'params', 'body', (result: any) => {}, (error: any) => {}).then((data: any) => {}); +service.fetchQueryData('id', 'params', (result: any) => {}, (error: any) => {}).then((data: any) => {}); +service.fetchQueryStats('id', 'query', (result: any) => {}, (error: any) => {}).then((data: any) => {}); +service.fetchLayer('name', 'params', (result: any) => {}, (error: any) => {}).then((data: any) => {}); +service.fetchLayerTile('name', 1, 2, 3, 'params', (result: any) => {}, (error: any) => {}).then((data: any) => {}); +service.setTokens('token', 'refresh_token'); +service.configure('app_id', 'app_code', true, true, new H.service.Url('scheme', 'host')); + +let queryTileProvider = new H.datalens.QueryTileProvider(service, queryTileProviderOptions); +queryTileProvider.setQueryId('some id'); +queryTileProvider.setQueryParams('some params'); +queryTileProvider.setTileParamNames(queryTileProviderTileParamNames); + +let provider = new H.datalens.Provider({ columns: ['1', '2'], rows: [[], []]}); +provider.getData(); +provider.setData({ columns: ['3', '4'], rows: [[], []]}); + +let queryProviderOptions: H.datalens.QueryProvider.Options = { + queryId: 'id', + queryParams: 'params' +}; +let queryProvider = new H.datalens.QueryProvider({ columns: ['1', '2'], rows: [[], []]}, queryProviderOptions); +queryProvider.setQueryId('id'); +queryProvider.setQueryParams('params'); +queryProvider.reload(); +queryProvider.getData(); +queryProvider.setData({ columns: ['3', '4'], rows: [[], []]}); + +let rasterLayerOptions: H.datalens.RasterLayer.Options = { + dataToRows: (): H.datalens.RasterLayer.Row[] => [], + rowToTilePoint: (): H.datalens.RasterLayer.TilePoint => ({ x: 1, y: 2 }), + buffer: (): number => 1, + renderTile: () => {} +}; + +let rasterLayer = new H.datalens.RasterLayer(); +rasterLayer.redraw(); + +let heatmapLayerOptions: H.datalens.HeatmapLayer.Options = { + dataToRows: (): H.datalens.HeatmapLayer.Row[] => [], + rowToTilePoint: (): H.datalens.HeatmapLayer.TilePoint => ({ x: 1, y: 2, value: 5, count: 5 }), + bandwidth: 5, + valueRange: (): number[] => [], + countRange: (): number[] => [], + colorScale: (): string => '2', + alphaScale: (): number => 1, + aggregation: H.datalens.HeatmapLayer.Aggregation.SUM, + inputScale: H.datalens.HeatmapLayer.InputScale.LINEAR +}; + +let heatmapLayer = new H.datalens.HeatmapLayer(queryTileProvider, heatmapLayerOptions); +heatmapLayer.getOptionsPerZoom(5); +heatmapLayer.dispose(); +heatmapLayer.redraw(); + +let objectLayerOptions: H.datalens.ObjectLayer.Options = { + dataToRows: (): H.datalens.ObjectLayer.Row[] => [], + rowToMapObject: (): H.map.Object => new H.map.Object(), + rowToStyle: (): H.datalens.ObjectLayer.ObjectStyleOptions => ({ icon: new H.map.Icon('x'), style: {}, arrows: {}, zIndex: 1 }), + dataDomains: 2, + clustering: { rowToDataPoint: (): H.clustering.DataPoint => ({ lat: 12.1, lng: 1.12, alt: 5, ctx: H.geo.AltitudeContext.GL, wt: 2, data: {} }), + options: (): H.clustering.Provider.ClusteringOptions => ({}) } +}; + +let objectLayer = new H.datalens.ObjectLayer(provider, objectLayerOptions); +objectLayer.redraw(); +objectLayer.updateObjectStyle(new H.map.Object(), { icon: new H.map.Icon('x'), style: {}, arrows: {}, zIndex: 1 }); + +let rawDataProviderOptions: H.datalens.RawDataProvider.Options = { + dataUrl: 'url', + dataToFeatures: (): H.datalens.RawDataProvider.Feature[] => [], + featuresToRows: (): H.datalens.ObjectLayer.Row[] => [] +}; + +let rawDataProvider = new H.datalens.RawDataProvider(rawDataProviderOptions); + +let spatialTileProviderOptions: H.datalens.SpatialTileProvider.Options = { + layerName: 'name', + queryParams: 'params' +}; + +let spatialProvider: H.datalens.SpatialTileProvider = new H.datalens.SpatialTileProvider(service, spatialTileProviderOptions); + +let spatialLayerOptions: H.datalens.SpatialLayer.Options = { + dataToRows: (): H.datalens.SpatialLayer.Row[] => [], + rowToSpatialId: (): string => 'asd', + featureToSpatialId: (): string => 'asd', + rowToStyle: (): any => { return; }, + defaultStyle: (): any => { return; }, + transformFeature: 1 +}; + +let spatialLayer = new H.datalens.SpatialLayer(provider, spatialProvider, spatialLayerOptions); diff --git a/types/heredatalens/index.d.ts b/types/heredatalens/index.d.ts new file mode 100644 index 0000000000..9b3ff44431 --- /dev/null +++ b/types/heredatalens/index.d.ts @@ -0,0 +1,947 @@ +// Type definitions for HERE Data Lens API for JavaScript 2.3 +// Project: https://developer.here.com/ +// Definitions by: Bernd Hacker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace H { + /** + * Data Lens REST API connector for HERE Maps API + * Data Lens JavaScript API is a module for HERE Maps API. + * It connects Data Lens REST API and provides data-driven styling of data on a map. + */ + namespace datalens { + /** + * HERE Maps API and Data Lens JavaScript API can be used to visualize data from different network sources. + * For each network source type, a service class is required. The service also stores API connection credentials. + * The service instance must be configured with a H.service.Platform instance. + */ + class Service implements H.service.IConfigurable { + /** + * Constructor + * @param options {H.datalens.Service.Options=} - Overrides the configuration from the H.service.Platform instance + */ + constructor(options?: H.datalens.Service.Options); + + /** + * This method makes an HTTP request to the Data Lens REST API. + * It makes any CRUD request (GET, PUT, POST, DELETE). + * This method can be used when implementing a custom provider or implementing data management. + * Otherwise existing providers are used to get data from the Data Lens REST API. + * @param method {string} - Any HTTP method (GET, PUT, POST, etc.) + * @param endpoint {string} - The REST API endpoint + * @param params {any=} - URL parameters + * @param body {any=} - The payload of the request + * @param onResult {function(any)=} - Callback called on a successful request with response data + * @param onError {function(Error)=} - Callback called on an unsuccessful request with the Error object + * @returns {Promise} - Response Promise + */ + request(method: string, endpoint: string, params?: any, body?: any, onResult?: (result: any) => void, onError?: (error: any) => void): Promise; + + /** + * This method fetches query data for a given query ID. + * This method can be used when implementing a custom provider. + * Otherwise existing providers are used to get data from the Data Lens REST API. + * @param queryId {string} - The ID of the Data Lens REST API query + * @param params {any=} - Query dynamic parameters + * @param onResult {function(any)=} - Callback called on a successful request with response data + * @param onError {function(Error)=} - Callback called on an unsuccessful request with the Error object + * @returns {Promise} - Response Promise + */ + fetchQueryData(queryId: string, params?: any, onResult?: (result: any) => void, onError?: (error: any) => void): Promise; + + /** + * This method fetches statistical data for the Data Lens query (eg minimum and maximum values for the query metric). + * It can be used to define visualization boundaries, scales and legends. + * @param queryId {string} - The ID of the Data Lens REST API query + * @param statsQuery {any} - A JSON object which defines a statistics query for the Data Lens query + * @param onResult {function(any)=} - Callback called on a successful request with response data + * @param onError {function(Error)=} - Callback called on an unsuccessful request with the Error object + * @returns {Promise} - Response Promise + */ + fetchQueryStats(queryId: string, statsQuery: any, onResult?: (result: any) => void, onError?: (error: any) => void): Promise; + + /** + * This method fetches a layer of geometries (eg buildings or administrative boundaries). + * @param layerName {string} - The name of the layer + * @param params {any=} - URL parameters (eg bounding box) + * @param onResult {function(any)=} - Callback called on a successful request with response data + * @param onError {function(Error)=} - Callback called on an unsuccessful request with the Error object + * @returns {Promise} - Response Promise + */ + fetchLayer(layerName: string, params?: any, onResult?: (result: any) => void, onError?: (error: any) => void): Promise; + + /** + * This method fetches vector tile data from the layer. + * @param layerName {string} + * @param x {H.datalens.QueryTileProvider.X} - Tile columns + * @param y {H.datalens.QueryTileProvider.Y} - Tile row + * @param z {H.datalens.QueryTileProvider.Zoom} - zoom level + * @param params {any=} - URL parameters (eg bounding box) + * @param onResult {function(any)=} - Callback called on a successful request with response data + * @param onError {function(Error)=} - Callback called on an unsuccessful request with the Error object + * @returns {Promise} - Typed array with tile data + */ + fetchLayerTile(layerName: string, x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, z: H.datalens.QueryTileProvider.Zoom, + params?: any, onResult?: (result: any) => void, onError?: (error: any) => void): Promise; + + /** + * Sets the access and refresh tokens used to authenticate all requests against the Data Lens REST API. + * Use this method to implement custom authentication to the Data Lens REST API. + * @param accessToken {string} - The token used to authenticate all requests + * @param refreshToken {string} - The token used to fetch a new access token after the previous access token has expired. + * When refreshToken is provided, Service will automatically update the expired accessToken. + */ + setTokens(accessToken: string, refreshToken: string): void; + + /** + * This method implements H.service.IConfigurable interface. It is called by the H.service.Platform instance. + * @param appId {string} - The appId + * @param appCode {string} - The appCode + * @param useHTTPS {boolean} - A flag to use HTTPS or not + * @param useCIT {boolean} - A flag to use the staging server (CIT) or not + * @param baseUrl {H.service.Url=} - The base URL for all requests to the Data Lens REST API + * @returns {H.datalens.Service} + */ + configure(appId: string, appCode: string, useHTTPS: boolean, useCIT: boolean, baseUrl?: H.service.Url): H.datalens.Service; + } + + namespace Service { + /** + * Overrides the H.datalens.Service configuration + * Normally the H.datalens.Service instance is configured with the H.service.Platform instance. + * This configuration can be overridden by specifying these options. + * It can be useful when the Data Lens environment is different from the HERE Platform environment. + * @property subDomain {string=} - Subdomain of the Data Lens REST API URL + * @property version {string=} - Pathname prefix of the Data Lens REST API endpoints + * @property access_token {string=} - The token used to authenticate all requests + * @property refresh_token {string=} - The token used to fetch a new access token after the previous access token has expired. + * When refresh_token is provided, Service will automatically update the expired access_token. + * @property domainSharding {string[]=} - To increase the number of simultaneous requests to the Data Lens REST API, domain sharding is used. + * This option can be used when the Data Lens environment does not support domain sharding. + * @property baseUrl {string=} - Defines an alternative host for the Data Lens REST API URL + */ + interface Options { + subDomain?: string; + version?: string; + access_token?: string; + refresh_token?: string; + domainSharding?: string[]; + baseUrl?: string; + } + + /** + * The format of Data Lens query data. + * The Data Lens query data has a table-like structure with named columns and rows. + * @property columns {string[]} - Column names + * @property rows {Array} - Rows of data + */ + interface Data { + columns: string[]; + rows: [any[]]; // rows : { Array. } + } + } + + /** + * Providers define interfaces for layers to access data. + * The input data can be stored locally or loaded from the network. Data can be loaded by tiles or in one chunk. + * This provider allows you to supply data stored locally or fetched using external tools. + */ + class Provider extends H.map.provider.Provider { + /** + * Constructor + * @param data {H.datalens.Service.Data=} - JSON object + * @param options {H.map.provider.Provider.Options=} - Configures data accessibility parameters + */ + constructor(data?: H.datalens.Service.Data, options?: H.map.provider.Provider.Options); + + /** + * Updates the provider data. When data is updated, the update event is triggered so that the consuming layers are redrawn. + * @param data {H.datalens.Service.Data} - JSON object + */ + setData(data: H.datalens.Service.Data): void; + + /** + * Retrieves the provider data. + * @returns {H.datalens.Service.Data} - JSON object + */ + getData(): H.datalens.Service.Data; + } + + /** + * Defines the source of the data for layers from a Data Lens query. + * Providers define interfaces for layers to access data. The input data can be stored locally or loaded from the network. + * Data can be loaded by tiles or in one chunk. This provider loads query data with the Data Lens REST API. + * Note that this provider must be used only for non-tiled queries. + */ + class QueryProvider extends H.datalens.Provider { + /** + * Constructor + * @param service {H.datalens.Service} - Data Lens REST API service + * @param options {H.datalens.QueryProvider.Options=} - Configures source query and data accessibility parameters + */ + constructor(data: H.datalens.Service.Data, options?: H.map.provider.Provider.Options); + + /** + * Updates the query ID to be used in the next call of the Data Lens REST API. + * Note that new data will be fetched only after the reload method is called. + * @param queryId {string} + */ + setQueryId(queryId: string): void; + + /** + * Updates the query's dynamic parameters to be used in the next call of the Data Lens REST API. + * Note that new data will be fetched only after the reload method is called. + * This method is normally used when updating your visualization. + * @param queryParams {any|null} - Query dynamic parameters + */ + setQueryParams(queryParams: any|null): void; + + /** + * Fetches new data from the Data Lens REST API. + * When data is fetched, the update event is triggered so that the consuming layers are redrawn. + */ + reload(): void; + + /** + * Updates the provider data. + * When data is updated, the update event is triggered so that the consuming layers are redrawn. + * @param data {H.datalens.Service.Data} - JSON object + */ + setData(data: H.datalens.Service.Data): void; + + /** + * Retrieves the provider data. + * @returns {H.datalens.Service.Data} - JSON object + */ + getData(): H.datalens.Service.Data; + } + + namespace QueryProvider { + /** + * Configures source query and data accessibility parameters for H.datalens.QueryProvider + * Specifies the query credentials and dynamic parameters required for fetching query data with the Data Lens REST API. Other options from H.datalens.Provider.Options are available. + * @property queryId {string} - The ID of the Data Lens REST API query + * @property queryParams {any=} - The query's dynamic parameters. The dynamic parameters can be used to filter data provided by the query. + */ + interface Options { + queryId: string; + queryParams?: any; + } + } + + /** + * Providers define interfaces for layers to access data. + * The input data can be stored locally or loaded from the network. Data can be loaded by tiles or in one chunk. + * This provider loads tiled query data with the Data Lens REST API. Tiled queries are used to load data only for the current viewport. + * This optimizes memory and network usage and enables progressive rendering. + */ + class QueryTileProvider extends H.map.provider.RemoteTileProvider { + /** + * Constructor + * @param service {H.datalens.Service} - Data Lens REST API service + * @param options {H.datalens.QueryTileProvider.Options} - Configures source query and data accessibility parameters + */ + constructor(service: H.datalens.Service, options: H.datalens.QueryTileProvider.Options); + + /** + * Updates the query ID to be used in the next call of the Data Lens REST API. + * Note that new data will be fetched only after the reload method is called. + * @param queryId {string} + */ + setQueryId(queryId: string): void; + + /** + * Updates the query's dynamic parameters to be used in the next call of the Data Lens REST API. + * Note that new data will be fetched only after the reload method is called. This method is normally used when updating your visualization. + * @param queryParams {any|null} + */ + setQueryParams(queryParams: any|null): void; + + /** + * Updates the names of the dynamic parameters that defines tiles. This method is only needed when the query ID is updated. + * Note that new data will be fetched only after the reload method is called. + * @param tileParamNames {H.datalens.QueryTileProvider.TileParamNames} - Names of the URI parameters that control the x/y/z of a tiled query + */ + setTileParamNames(tileParamNames: H.datalens.QueryTileProvider.TileParamNames): void; + } + + namespace QueryTileProvider { + /** + * Represents the names of the URI parameters that control the x/y/z of tiled query. + * When defining the Data Lens query, dynamic parameters that control tiling can be arbitrarily named. + * Names of these parameters must be specified to fetch tiles. + * @property x {string} - Name of the dynamic parameter that defines tile column + * @property y {string} - Name of the dynamic parameter that defines tile row + * @property z {string} - Name of the dynamic parameter that defines zoom level + */ + interface TileParamNames { + x: string; + y: string; + z: string; + } + + /** + * Configures source query and data accessibility parameters for H.datalens.QueryTileProvider + * Specifies the query credentials and dynamic parameters required for fetching tiled query data with the Data Lens REST API. + * Other options from H.datalens.Provider.Options are available. + * @property tileParamNames {H.datalens.QueryTileProvider.TileParamNames=} - Names of the URI parameters that control the x/y/z of a tiled query + * @property queryId {string} - The ID for the Data Lens REST API query + * @property queryParams {any=} - The query's dynamic parameters. The dynamic parameters can be used to filter data provided by the query. + */ + interface Options { + tileParamNames: H.datalens.QueryTileProvider.TileParamNames; + queryId: string; + queryParams?: string; + } + + /** + * Tile X coordinate (column) + * Coordinate in XYZ tile numbering scheme. + */ + type X = number; + + /** + * Tile Y coordinate (row) + * Coordinate in XYZ tile numbering scheme. + */ + type Y = number; + + /** + * Zoom level + * Coordinate in XYZ tile numbering scheme. May vary within range 1 to 20. + */ + type Zoom = number; + } + + /** + * Provides pixel-wise rendering of data. + * Layer used when you need to visualize more than 10k points. The layer requires source data to be located in pixel coordinates. + * The rendering is implemented by drawing directly on a canvas. The layer is often used together with a Data Lens query which groups rows by pixels. + * This reduces the amount of data delivered to the client. + */ + class RasterLayer extends H.map.layer.TileLayer { + /** + * Constructor + */ + constructor(); + + /** + * Default value for dataToRows callback option. + * It represents each row as an object where property names correspond to data column names. + */ + static defaultDataToRows: any; + + /** + * Force re-rendering of the layer. + * In the case where the callbacks passed to the layer options are not pure functions, you can call this method to force re-rendering. + */ + redraw(): void; + + /** + * This is a default implementation of renderTile callback. This method represents each point as a black 1x1 pixel square. + * @param points {Array} - Input data points within a tile + * @param canvas {HTMLCanvasElement} - The target canvas + */ + static defaultRenderTile(points: H.datalens.RasterLayer.TilePoint[], canvas: HTMLCanvasElement): void; + } + + namespace RasterLayer { + /** + * Defines data processing and rendering options for RasterLayer. + * The initial step of rendering is to split the tile data by rows, where each row represents a bucket. + * By default this step is processed with H.datalens.RasterLayer.defaultDataToRows. + * This behavior can be changed by defining the dataToRows callback. + * To collect the rows for a tile including buffer, the rows must be translated to H.datalens.RasterLayer.TilePoint. + * This translation must be specified with the rowToTilePoint callback. The final rendering on the tile canvas must be defined in renderTile. + * @property dataToRows {function(H.datalens.Service.Data, H.datalens.QueryTileProvider.X, H.datalens.QueryTileProvider.Y, H.datalens.QueryTileProvider.Zoom)=} - + * Defines how the input tile data is split by rows. You can specify this callback to define client-side aggregation and filtering. This callback is called for each tile. + * @property rowToTilePoint {function(H.datalens.RasterLayer.Row, H.datalens.RasterLayer.X, H.datalens.RasterLayer.Y)=} - + * Defines how the row is translated to the H.datalens.RasterLayer.TilePoint. This callback is called for each row that is returned from dataToRows. + * @property buffer {function(H.datalens.QueryTileProvider.Zoom)=} - Defines the buffer as a function of the zoom level. + * The buffer is a value (in pixels) that defines an extra area around each tile to capture data points from. + * This is done to avoid drawing edges between tiles. For example, if data points represented with circles with a maximum radius of 10 pixels, then the buffer must be 10 pixels. + * @property renderTile {function(Array, HTMLCanvasElement, H.datalens.QueryTileProvider.Zoom)=} - + * Defines how tile data is represented on a canvas. Input points for each tile are collected with respect to the buffer. + * For progressive rendering this callback may be called more than once for the tile. + */ + interface Options { + dataToRows?(data: H.datalens.Service.Data, x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, zoom: H.datalens.QueryTileProvider.Zoom): + H.datalens.RasterLayer.Row[]; + rowToTilePoint?(row: H.datalens.RasterLayer.Row, x: H.datalens.RasterLayer.X, y: H.datalens.RasterLayer.Y): H.datalens.RasterLayer.TilePoint; + buffer?(zoom: H.datalens.QueryTileProvider.Zoom): number; + renderTile?(points: H.datalens.RasterLayer.TilePoint[], canvas: HTMLCanvasElement, zoom: H.datalens.QueryTileProvider.Zoom): void; + } + + /** + * Defines the input data format for heat map rendering. + * To collect data rows for each tile with respect to the buffer, each row must be represented as a point within the map tile. + * @property x {number} - Row relative to tile + * @property y {number} - Column relative to tile + * @property data {H.datalens.RasterLayer.Row=} - Reference to source data row + */ + interface TilePoint { + x: number; + y: number; + data?: H.datalens.RasterLayer.Row; + } + + /** + * Tile X coordinate (column) + * Coordinate in XYZ tile numbering scheme. + */ + type X = number; + + /** + * Tile Y coordinate (row) + * Coordinate in XYZ tile numbering scheme. + */ + type Y = number; + + /** + * Slice of data (eg Data Lens query data row) that represents a data point. + * Each row is transformed into TilePoint and passed to renderTile callback. By default each row is an Object where property names correspond to data column names. + * This representation can be changed with the dataToRows callback. + */ + type Row = number; + } + + /** + * Provides functionality of value-based heat map with density alpha mask. + * Layer support different types of blending, including weighted average. Also it allows to apply alpha mask calculated by density. + * In most cases, the layer consumes data grouped by 1x1 pixels buckets. For proper averaging it requires aggregated value and count (number of rows in bucket) for each bucket. + * Blending of buckets is implemented via kernel density estimation (KDE) with a Gaussian kernel. + */ + class HeatmapLayer extends H.datalens.RasterLayer { + /** + * Constructor + * @param provider {H.datalens.QueryTileProvider} - Source of tiled data + * @param options {H.datalens.HeatmapLayer.Options} - Configuration for data processing and rendering + */ + constructor(provider: H.datalens.QueryTileProvider, options: H.datalens.HeatmapLayer.Options); + + /** + * Default value for dataToRows callback option. It represents each row as an object where property names correspond to data column names. + * @param data {H.datalens.Service.Data} + * @param x {H.datalens.QueryTileProvider.X} + * @param y {H.datalens.QueryTileProvider.Y} + * @param zoom {H.datalens.QueryTileProvider.Zoom} + * @returns {Array} + */ + static defaultDataToRows: (data: H.datalens.Service.Data, x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, zoom: H.datalens.QueryTileProvider.Zoom) => + H.datalens.HeatmapLayer.Row[]; + + /** + * Set of possible values for the inputScale option + * @type {H.datalens.HeatmapLayer.InputScale} + */ + static inputScale: H.datalens.HeatmapLayer.InputScale; + + /** + * Set of possible values for the aggregation option + * @type {H.datalens.HeatmapLayer.Aggregation} + */ + static aggregation: H.datalens.HeatmapLayer.Aggregation; + + /** + * @param zoom {number} - zoom level + * @return {H.datalens.HeatmapLayer.Options} + */ + getOptionsPerZoom(zoom: number): H.datalens.HeatmapLayer.Options; + + /** + * Removes listeners, and references to memory consuming objects, from this layer. Call this method when you no longer need the layer. + */ + dispose(): void; + + /** + * Force re-rendering of the layer. In the case where the callbacks passed to the layer options are not pure functions, you can call this method to force re-rendering. + */ + redraw(): void; + } + + namespace HeatmapLayer { + /** + * Defines data processing and rendering options for HeatmapLayer. + * The data processing flow of HeatmapLayer is similar to RasterLayer. The initial step of rendering is to split the tile data by rows, where each row represents a bucket. + * By default this step is processed with H.datalens.HeatmapLayer.defaultDataToRows. This behavior can be changed by defining the dataToRows callback. + * To collect the rows for a tile including buffer, the rows must be translated to H.datalens.HeatmapLayer.TilePoint. This translation must be specified with the rowToTilePoint callback. + * Other options define the blending options for the heat map. + * @property dataToRows {function(H.datalens.Service.Data, H.datalens.QueryTileProvider.X, H.datalens.QueryTileProvider.Y, H.datalens.QueryTileProvider.Zoom)=} - + * Defines how the input tile data is split by rows. You can specify this callback to define client-side aggregation and filtering. This callback is called for each tile. + * @property rowToTilePoint {function(H.datalens.HeatmapLayer.Row, H.datalens.HeatmapLayer.X, H.datalens.HeatmapLayer.Y)=} - + * Defines how the row is translated to the H.datalens.HeatmapLayer.TilePoint. This callback is called for each row that is returned from dataToRows. + * @property bandwidth {H.datalens.HeatmapLayer~Bandwidth | H.datalens.HeatmapLayer~BandwidthStop | Array. | + * H.datalens.HeatmapLayer~BandwidthCallback=} - Describes the bandwidth behavior in relation to current zoom level A numeric value sets it static across all levels + * An Object with zoom, value and optional zoomIncrementFactor (1 equals doubling on every zoom increment) defines a behavior across all zoom levels + * An Array of one or more zoom, value objects describes the behavior between the two defined levels and extrapolates the implied change outside of the defined range + * Alternatively defines the level of smoothing as a function of the zoom level. The callback must return a value in pixels. + * The cut-off of the Gaussian kernel is defined as 3 * bandwidth , a multiple (default 3) of bandwidth. + * @property valueRange {function(H.datalens.QueryTileProvider.Zoom)} - Defines the range for the color scale as a function of the zoom level. + * The returned value must be an array of 2 numbers. + * @property countRange {function(H.datalens.QueryTileProvider.Zoom)} - Defines the range for the density alpha mask as a function of the zoom level. + * When defined, the density alpha mask is applied. The returned value must be an array of 2 numbers. + * @property colorScale {function(number)} - Defines a color palette as a function of the normalized value. You can use D3.js library scale functions with the domain [0, 1]. + * @property alphaScale {function(number)} - Defines the alpha mask value as a function of the normalized count. + * You can use D3.js library scale functions with the domain [0, 1] and the range [0, 1]. + * @property aggregation {H.datalens.HeatmapLayer.Aggregation} - Specifies which type of aggregation was applied (eg. type of aggregation function for bucket in the Data Lens query). + * Possible values are SUM or AVERAGE. If the aggregation type is AVERAGE , then an averaged heat map is rendered. + * @property inputScale {H.datalens.HeatmapLayer.InputScale} - Defines the scale (eg logarithmic scale) of the TilePoint value. + * Note: if the value is not in a linear scale, then the aggregation in the source query must be defined with respect to the scale type. + * For example, before applying the average aggregation function in a query, the value must be transformed to the linear scale. This guarantees correct linear averaging of values. + */ + interface Options { + dataToRows?(data: H.datalens.Service.Data, x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, zoom: H.datalens.QueryTileProvider.Zoom): + H.datalens.HeatmapLayer.Row[]; + rowToTilePoint(row: H.datalens.HeatmapLayer.Row, x: H.datalens.HeatmapLayer.X, y: H.datalens.HeatmapLayer.Y): H.datalens.HeatmapLayer.TilePoint; + bandwidth?: H.datalens.HeatmapLayer.Bandwidth | H.datalens.HeatmapLayer.BandwidthStop | H.datalens.HeatmapLayer.BandwidthStop[] | H.datalens.HeatmapLayer.BandwidthCallback; + valueRange?(zoom: H.datalens.QueryTileProvider.Zoom): number[]; + countRange?(zoom: H.datalens.QueryTileProvider.Zoom): number[]; + colorScale?(scale: number): string; + alphaScale?(scale: number): number; + aggregation?: H.datalens.HeatmapLayer.Aggregation; + inputScale?: H.datalens.HeatmapLayer.InputScale; + } + + /** + * Tile X coordinate (column) + * Coordinate in XYZ tile numbering scheme. + */ + type X = number; + + /** + * Tile Y coordinate (row) + * Coordinate in XYZ tile numbering scheme. + */ + type Y = number; + + /** + * Slice of data (eg Data Lens query data row) that represents a data point. + * Each row is transformed into TilePoint and then rendered on a heat map. By default each row is an Object where property names correspond to data column names. + * This representation can be changed with the dataToRows callback. + */ + interface Row { + tx?: number; + ty?: number; + count?: number; + } + + /** + * Defines a constant for the bandwidth + * A number that sets a constant for the bandwidth across all zoom levels. + */ + type Bandwidth = number; + + /** + * Sets the bandwidth for a given zoom level and uses this to calculate the increment or decrement of the bandwidth at other zoom levels + * This object defines the behavior of the bandwidth value across all zoom levels, initialized by a reference zoom level and its value at that level. + * The default behavior with zoomIncrementFactor = 1 doubles the bandwidth with every increasing zoom level and halves it on every decrease in zoom level. + * For example, a bandwidth of 10@zoom1 turns to 20@zoom2 and 5@zoom0. A zoomIncrementFactor of 0 effectively equals the bandwidth number, ignoring the provided zoom level. + * A zoomIncrementFactor of 0.5 mean a bandwidth increase of 50% compared to a factor of 1. So a bandwidth of 10@zoom1 computes to 15@zoom2. + */ + interface BandwidthStop { + zoom: number; + value: number; + zoomIncrementFactor?: number; + } + + /** + * TODO: this is missing in the documentation: https://developer.here.com/visualization/documentation/datalens/h-datalens-heatmaplayer-options.html + */ + type BandwidthCallback = () => void; + + /** + * Defines the input data format for heat map rendering. + * For heat map rendering, each row of data must be represented as a point within the map tile. + * @property x {number} - Row relative to tile + * @property y {number} - Column relative to tile + * @property value {number} - Value at the point (eg aggregated bucket value) + * @property count {number} - Number of contributors to the value at the point (eg number of rows in a bucket) + * @property data {H.datalens.HeatmapLayer.Row} - Reference to source data row + */ + interface TilePoint { + x: number; + y: number; + value: number; + count: number; + data?: H.datalens.HeatmapLayer.Row; + } + + /** + * Set of possible values for the aggregation option. + * If the heat map input data is buckets, then different types of aggregation can be applied to the rows in a bucket. + * The aggregation type is required for proper blending mode of the heat map. For the AVERAGE aggregation type, an averaged heat map is rendered. + * @property SUM {string} - Specifies that the sum aggregation was applied to the bucket value + * @property AVERAGE {string} - Specifies that the average aggregation was applied to the bucket value + */ + enum Aggregation { + SUM, + AVERAGE + } + + /** + * Set of possible values for the inputScale option. + * The input scale is required for proper heat map blending. If the input scale is not linear, then the TilePoint.value is converted to linear scale before calculating the sum or average. + * @property DB {string} - Decibel (dB) scale + * @property LINEAR {string} - Linear scale + * @property LOG {string} - Logarithmic scale + */ + enum InputScale { + DB, + LINEAR, + LOG + } + } + + /** + * Presents data as points or spatial map objects with data-driven styles and client-side clustering. + * Applicable for drawing interactive map objects like markers, polygons, circles and other instances of H.map.Object. Source of data can be either tiled or not tiled. + * Styles for objects can be parametrized with data rows and zoom level. Allows to create data-driven icons for markers like donuts or bars. + * Also enables clustering and data domains for visualizing up to 100k points or more. + */ + class ObjectLayer extends H.map.layer.ObjectLayer { + /** + * Constructor + * @param provider {H.map.provider.RemoteTileProvider | H.datalens.Provider | H.datalens.QueryProvider | H.datalens.QueryTileProvider} - Data source (tiled or not) + * @param options {H.datalens.ObjectLayer.Options} - Defines data processing, clustering and data-driven styling + */ + constructor(provider: H.map.provider.RemoteTileProvider | H.datalens.Provider | H.datalens.QueryProvider | H.datalens.QueryTileProvider, options: H.datalens.ObjectLayer.Options); + + /** + * Default value for dataToRows callback option. It represents each row as an object where property names correspond to data column names. + * @property data {H.datalens.Service.Data} + * @returns {Array} + */ + static defaultDataToRows(data: H.datalens.Service.Data): H.datalens.ObjectLayer.Row[]; + + /** + * A factory method for data-driven icons. The method allows you to build an icon from SVG markup or JsonML object. Provides caching of icons with the same markup. + * @param svg {string | Array} - SVG presented as markup or JsonML Array + * @param options {H.map.Icon.Options} - Icon options (eg size and anchor). Note that the default anchor is in the middle. + * @param options.size {H.math.ISize | number} - When the icon is a square, you can define the size as a number in pixels + * @returns {H.map.Icon} - Icon which can be used for marker or cluster + */ + static createIcon(svg: string | any[], options?: H.map.Icon.Options): H.map.Icon; + + /** + * Returns cache of icons created with the createIcon method. Can be used to clean the icon cache. + * @return {H.util.Cache} - Icon cache + */ + static getIconCache(): H.util.Cache; + + /** + * Force re-rendering of the layer. In the case where the callbacks passed to the layer options are not pure functions, you can call this method to force re-rendering. + */ + redraw(): void; + + /** + * Recalculates the style and applies it to the map object based on the new StyleState + * @param object {H.map.Object} - Map object + * @param state {H.datalens.ObjectLayer.StyleState} - New state + */ + updateObjectStyle(any: H.map.Object, state: H.datalens.ObjectLayer.StyleState): void; + } + + namespace ObjectLayer { + /** + * Defines data processing and data-driven styling for ObjectLayer + * The initial step of rendering is to split the tile data by rows, where each row represents a bucket. + * By default this step is processed with H.datalens.ObjectLayer.defaultDataToRows. This behavior can be changed by defining the dataToRows callback. + * In the next step each row must be presented as a map object with the rowToMapObject callback. Data-driven styling can be provided with the rowToStyle callback. + * @property dataToRows {function(H.datalens.Service.Data)=} - Defines how the input data is split by rows. You can specify this callback to define client-side aggregation and filtering. + * @property rowToMapObject {function(H.datalens.ObjectLayer.Row, H.datalens.QueryTileProvider.Zoom)} - Defines how each row is presented on the map (eg marker, polygon) + * @property rowToStyle {function(H.datalens.ObjectLayer.Row, H.datalens.QueryTileProvider.Zoom, H.datalens.ObjectLayer.StyleState)=} - + * Defines map object style and icon according to data row and zoom level. Also it can define different styles depending on the StyleState (eg hovered, selected). + * @property dataDomains {H.datalens.ObjectLayer.DataDomains=} - Defines quantization of data for improving data-driven styling performance + * @property clustering {H.datalens.ObjectLayer.Clustering=} - When present, client-side clustering is applied + */ + interface Options { + dataToRows?(data: H.datalens.Service.Data): H.datalens.ObjectLayer.Row[]; + rowToMapObject(row: H.datalens.ObjectLayer.Row, z: H.datalens.QueryTileProvider.Zoom): H.map.Object; + rowToStyle?(row: H.datalens.ObjectLayer.Row, z: H.datalens.QueryTileProvider.Zoom, styleState: H.datalens.ObjectLayer.StyleState): H.datalens.ObjectLayer.ObjectStyleOptions; + dataDomains?: H.datalens.ObjectLayer.DataDomains; + clustering?: H.datalens.ObjectLayer.Clustering; + } + + /** + * Defines client-side clustering in the ObjectLayer. + * When the clustering option is provided, rows returned from dataToRows go to the clustering.rowToDataPoint callback to be transformed to data points. + * Then, the data points are clustered according to clustering.options. Clustering produces clusters and noise points (data points that are not clustered). + * Clusters and noise points must be presented as map objects with the rowToMapObject callback and can be styled with the rowToStyle callback. + * @property rowToDataPoint {H.datalens.ObjectLayer.Row} - Defines data points from rows + * @property options {function(H.datalens.QueryTileProvider.Zoom)} - Defines clustering options as a function of the zoom level + */ + interface Clustering { + rowToDataPoint(row: H.datalens.ObjectLayer.Row): H.clustering.DataPoint; + options(zoom: H.datalens.QueryTileProvider.Zoom): H.clustering.Provider.ClusteringOptions; + } + + /** + * Slice of data (eg Data Lens query data row) that represents a data point. + * Each row is translated to map objects with the rowToMapObject callback. By default each row is an Object where property names correspond to data column names. + * This representation can be changed with the dataToRows callback. + */ + interface Row { + getPosition(): H.geo.Point; + lat: number; + lng: number; + } + + /** + * User defined modification of a data-driven style + * StyleState appears as a parameter in the rowToStyle callback. By default it is 'DEFAULT_STATE'. To change StyleState, use the ObjectLayer.updateObjectStyle method. + */ + type StyleState = any; + + /** + * Output from the rowToStyle callback. + * Defines the styles or the icon that is applied to the map object. + * @property icon {H.map.Icon} - Marker icon + * @property style {H.map.SpatialStyle.Options} - Spatial style + * @property arrows {H.map.ArrowStyle.Options} - Style of arrows to render along a polyline + * @property zIndex {number} - The z-index value of the map object, default is 0 + */ + interface ObjectStyleOptions { + icon: H.map.Icon; + style: H.map.SpatialStyle.Options; + arrows: H.map.ArrowStyle.Options; + zIndex: number; + } + + /** + * Input data quantization domain, used to optimize styling performance. + * The option must have properties corresponding to the properties of H.datalens.ObjectLayer.Row. Values must be represented as an Array of Numbers that defines the quantization domain. + * When provided, the input data will be quantized, and rowToStyle will be called only for quantized values. + */ + type DataDomains = any; + } + + /** + * Defines how to load data from a raw data file + * This provider defines the interface for loading data, such as geometries or coordinates, from a local or remote data file in GeoJSON or CSV format + */ + class RawDataProvider extends H.map.provider.RemoteTileProvider { + /** + * Constructor + * @param options {H.datalens.RawDataProvider.Options} - Configures options + */ + constructor(options: H.datalens.RawDataProvider.Options); + + /** + * Updates the data url. Note that new data will be fetched only after the reload method is called. + * @param dataUrl {string} + */ + setDataUrl(dataUrl: string): void; + } + + namespace RawDataProvider { + /** + * Defines options for RawDataProvider + * Options for RawDataProvider + * @property dataUrl - The data url to fetch + * @property dataToFeatures {function(any)=} - Defines how the input data is mapped to an array of GeoJSON features + * @property featuresToRows {function(Array, H.datalens.QueryTileProvider.X, H.datalens.QueryTileProvider.Y, H.datalens.QueryTileProvider.Zoom, + * H.datalens.RawDataProvider.TileSize, H.datalens.RawDataProvider.Helpers)=} - + * Defines how GeoJSON features on a tile should be mapped to data rows, which are inputs to layers such as ObjectLayer and HeatmapLayer + */ + interface Options { + dataUrl?: string; + dataToFeatures?(obj: any): H.datalens.RawDataProvider.Feature[]; + featuresToRows?(features: H.datalens.RawDataProvider.Feature[], x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, z: H.datalens.QueryTileProvider.Zoom, + tileSize: H.datalens.RawDataProvider.TileSize, helpers: H.datalens.RawDataProvider.Helpers): H.datalens.ObjectLayer.Row[]; + } + + /** + * A GeoJSON feature + * A GeoJSON feature object which conforms to the standard GeoJSON spec + */ + type Feature = any; + + /** + * Tile size + * The tile size in pixels. + */ + type TileSize = any; + + /** + * A helper class used in the worker thread + * This helper class provides convenience functions you can use in the worker thread + * @property latLngToPixel {function(H.datalens.RawDataProvider.Latitude, H.datalens.RawDataProvider.Longitude, H.datalens.QueryTileProvider.Zoom, H.datalens.RawDataProvider.TileSize)=} - + * Translates geographical coordinates (latitude, longitude) to world pixel coordinates. + * @property pixelToLatLng {function(H.datalens.RawDataProvider.PX, H.datalens.RawDataProvider.PY, H.datalens.QueryTileProvider.Zoom, H.datalens.RawDataProvider.TileSize)=} - + * Translates world pixel coordinates to geographical coordinates (latitude, longitude). + * @property parseCSV {function(any)=} - Takes CSV data as input, parses it, and return the parsed result. + */ + interface Helpers { + latLngToPixel?(latitude: H.datalens.RawDataProvider.Latitude, longitude: H.datalens.RawDataProvider.Longitude, z: H.datalens.QueryTileProvider.Zoom, + tileSize: H.datalens.RawDataProvider.TileSize): H.datalens.RawDataProvider.PixelCoordinates; + pixelToLatLng?(x: H.datalens.RawDataProvider.PX, y: H.datalens.RawDataProvider.PY, z: H.datalens.QueryTileProvider.Zoom, tileSize: H.datalens.RawDataProvider.TileSize): + H.datalens.RawDataProvider.GeoCoordinates; + parseCSV?(obj: any): any[]; + } + + /** + * Geographic coordinates + * A geographic coordinates pair [lat, lng] + */ + type GeoCoordinates = [number, number]; + + /** + * Latitude coordinate + * The latitude in the geographic coordinates pair + */ + type Latitude = number; + + /** + * Longitude coordinate + * The longitude in the geographic coordinates pair + */ + type Longitude = number; + + /** + * Pixel coordinates + * Pixel coordinates [px, py] pair + */ + type PixelCoordinates = [number, number]; + + /** + * Pixel coordinate in the x direction + * The x coordinate of the pixel coordinates pair [px, py] + */ + type PX = number; + + /** + * Pixel coordinate in the y direction + * The y coordinate of the pixel coordinates pair [px, py] + */ + type PY = number; + } + + /** + * Renders vector tiles using data-driven styles + * This layer binds the spatial data and user data, all provided by the Data Lens REST API. The layer renders geometry features using data-driven styles. + */ + class SpatialLayer extends H.map.layer.TileLayer { + /** + * Constructor + * @param dataProvider {H.datalens.Provider} - Source of tiled data (pass in null if data come from feature properties) + * @param spatialProvider {H.datalens.SpatialTileProvider} - Source of geometry data + * @param options {H.datalens.SpatialLayer.Options} - Configuration for data processing and rendering + */ + constructor(dataProvider: H.datalens.Provider, spatialProvider: H.datalens.SpatialTileProvider, options: H.datalens.SpatialLayer.Options); + + static DEFAULT_STATE: any; + static Spatial: any; + + /** + * Default value for dataToRows callback option. It represents each row as an object where property names correspond to data column names. + */ + static defaultDataToRows: any; + + /** + * Forces re-rendering of the layer. When the callbacks passed to the layer options are not pure functions, you can call this method to force re-rendering. + */ + redraw(): void; + + /** + * This method changes the state of a map object; for example, style on mouse event. + * @param {H.map.Object} spatial + * @param {H.datalens.SpatialLayer.StyleState} state + */ + updateSpatialStyle(spatial: H.map.Object, state: H.datalens.SpatialLayer.StyleState): void; + } + + namespace SpatialLayer { + /** + * Defines data processing and rendering options for SpatialLayer + * The initial step of rendering is to split the tile data by rows, where each row represents a bucket. + * By default this step is processed with H.datalens.SpatialLayer.defaultDataToRows. This behavior can be changed by defining the dataToRows callback. + * @property dataToRows {function(H.datalens.Service.Data, H.datalens.QueryTileProvider.X, H.datalens.QueryTileProvider.Y, H.datalens.QueryTileProvider.Zoom)=} - + * Defines how the input tile data is split by rows. You can specify this callback to define client-side aggregation and filtering. This callback is called for each tile. + * @property rowToSpatialId {function(H.datalens.SpatialLayer.Row)} - + * Defines how to get the spatial ID from a data row. This callback is called for each row that is returned from dataToRows. + * @property featureToSpatialId {function(H.datalens.SpatialLayer.Feature)} - + * Defines how to get the spatial ID from a geometry feature. This callback is called for each geometry feature in the vector tile. + * @property rowToStyle {function(H.datalens.SpatialLayer.Row, H.datalens.QueryTileProvider.Zoom, H.datalens.SpatialLayer.StyleState)} - + * Defines how the row is translated to map object style. This callback is called for each row that is returned from dataToRows. + * @property defaultStyle {function(H.datalens.QueryTileProvider.Zoom, H.datalens.SpatialLayer.StyleState)} - Defines the default map object style. + * @property transformFeature {H.datalens.SpatialLayer.transformFeature} - Defines how to transform the features. + */ + interface Options { + dataToRows?(data: H.datalens.Service.Data, x: H.datalens.QueryTileProvider.X, y: H.datalens.QueryTileProvider.Y, z: H.datalens.QueryTileProvider.Zoom): + H.datalens.SpatialLayer.Row[]; + rowToSpatialId(row: H.datalens.SpatialLayer.Row): string; + featureToSpatialId(feature: H.datalens.SpatialLayer.Feature): string; + rowToStyle(row: H.datalens.SpatialLayer.Row, z: H.datalens.QueryTileProvider.Zoom, styleState: H.datalens.SpatialLayer.StyleState): any; + defaultStyle(z: H.datalens.QueryTileProvider.Zoom, styleState: H.datalens.SpatialLayer.StyleState): any; + transformFeature: H.datalens.SpatialLayer.transformFeature; + } + + /** + * Defines modification of a data-driven style + * StyleState appears as a parameter in the rowToStyle callback. By default it is 'DEFAULT_STATE'. To change StyleState, use the SpatialLayer.updateSpatialStyle method. + */ + type StyleState = any; + + /** + * Defines a slice of data (eg Data Lens query data row) that represents a data point + * By default each row is an object where property names correspond to data column names. This representation can be changed with the dataToRows callback. + */ + type Row = any; + + /** + * Defines a geometry in the vector tile + * Each geometry is described by various properties, including a unique identifier which must be used to map the geometry to user data. + */ + type Feature = any; + + /** + * TODO: missing in documentation: https://developer.here.com/visualization/documentation/datalens/h-datalens-spatiallayer-options.html + */ + type transformFeature = any; + } + + /** + * Specifies how to access layer data (shapes, geometries) using the Data Lens REST API. + * This provider defines the interface for accessing shape layers via the Data Lens REST API. The input data is provided as vector tiles in the MapBox format (Protobuf). + * Data is loaded by tiles. + */ + class SpatialTileProvider extends H.map.provider.RemoteTileProvider { + /** + * Constructor + * @param service {H.datalens.Service} - Data Lens REST API service + * @param options {H.datalens.SpatialTileProvider.Options} - Configures layer name + */ + constructor(service: H.datalens.Service, options: H.datalens.SpatialTileProvider.Options); + + static VectorTile: any; + + /** + * Updates the layer name to be used in the next call of the Data Lens REST API. Note that new data will be fetched only after the reload method is called. + * @param {string} layerName + */ + setLayerName(layerName: string): void; + + /** + * Updates the query's dynamic parameters to be used in the next call of the Data Lens REST API. Note that new data will be fetched only after the reload method is called. + * This method is normally used when updating your visualization. + * @param {any|null} queryParams + */ + setQueryParams(queryParams: any | null): void; + } + + namespace SpatialTileProvider { + /** + * Defines layer name and data accessibility parameters for H.datalens.SpatialTileProvider + * This defines the layer name and dynamic parameters required for fetching tiled geometry data with the Data Lens REST API. Other options from H.datalens.Provider.Options are available. + * @property layerName {string} - The name of the layer to fetch with the Data Lens REST API query + * @property queryParams {any} - The query's dynamic parameters. The dynamic parameters can be used to filter data provided by the query. + */ + interface Options { + layerName: string; + queryParams?: any; + } + } + } +} diff --git a/types/heredatalens/tsconfig.json b/types/heredatalens/tsconfig.json new file mode 100644 index 0000000000..9c60b13753 --- /dev/null +++ b/types/heredatalens/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "heredatalens-tests.ts" + ] +} \ No newline at end of file diff --git a/types/heredatalens/tslint.json b/types/heredatalens/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/heredatalens/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 879a6039ac7035742eb4636a551a7d8ebd99dbc8 Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Wed, 7 Jun 2017 03:22:10 +0300 Subject: [PATCH 113/761] Types for rrc 0.10 (#16996) * rrc types files added. rrc types definitions. * TS config updated. Types definitions updated. Tests added. * withScroll return type adjusted to `react-router` RouteProps.component type. * Test values updated. * rrc types file lint errors fixed. * rrc tests file updated. --- types/rrc/index.d.ts | 75 ++++++++++++++++++++++++ types/rrc/rrc-tests.tsx | 122 ++++++++++++++++++++++++++++++++++++++++ types/rrc/tsconfig.json | 24 ++++++++ types/rrc/tslint.json | 1 + 4 files changed, 222 insertions(+) create mode 100644 types/rrc/index.d.ts create mode 100644 types/rrc/rrc-tests.tsx create mode 100644 types/rrc/tsconfig.json create mode 100644 types/rrc/tslint.json diff --git a/types/rrc/index.d.ts b/types/rrc/index.d.ts new file mode 100644 index 0000000000..5ebf120c74 --- /dev/null +++ b/types/rrc/index.d.ts @@ -0,0 +1,75 @@ +// Type definitions for rrc 0.10 +// Project: https://github.com/pshrmn/rrc#readme +// Definitions by: Deividas Bakanas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as React from "react"; +import * as H from "history"; +import { RouteProps, RouteComponentProps, match as MatchObject } from "react-router-dom"; + +export interface ScrollIntoViewProps { + alignToTop?: boolean; + id: string; +} + +export class ScrollIntoView extends React.Component { } + +export type PropIdCallback = () => string; + +export interface WithScrollOptions { + propId?: PropIdCallback; + alignToTop?: boolean; +} + +export type ComponentConstructor = React.ComponentClass | React.SFC; + +export function withScroll(component: ComponentConstructor | undefined>, options?: WithScrollOptions) + : ComponentConstructor | undefined>; + +export type RouteConfiguration = RouteProps & { inject?: { [key: string]: any } }; + +export interface SwitchProps { + routes: RouteConfiguration[]; + location: H.LocationDescriptorObject & { pathname: H.Pathname }; +} + +export class ConfigSwitch extends React.Component { } + +export type OnUpdateCall = (location: H.Location) => void; + +export interface OnUpdateProps { + call: OnUpdateCall; + immediate?: boolean; +} + +export class OnUpdate extends React.Component { } + +export type IsActiveCallback = () => boolean; + +export interface WhenActiveOptions { + exact?: boolean; + strict?: boolean; + pathProp?: string; + className?: string; + style?: React.CSSProperties; + isActive?: IsActiveCallback; +} + +export type WhenActiveReturnType = (component: ComponentConstructor) => ComponentConstructor; + +export function whenActive(options?: WhenActiveOptions): WhenActiveReturnType; + +export interface StatusProps { + code: string; +} + +export class Status extends React.Component { } + +export type GetKeyFunction = (match: MatchObject, route: RouteConfiguration, location: H.Location) => string; + +export interface WrapSwitchProps extends SwitchProps { + getKey?: GetKeyFunction; +} + +export function wrapSwitch(Wrapper: ComponentConstructor): + ComponentConstructor & WrapperProps>; diff --git a/types/rrc/rrc-tests.tsx b/types/rrc/rrc-tests.tsx new file mode 100644 index 0000000000..084f921614 --- /dev/null +++ b/types/rrc/rrc-tests.tsx @@ -0,0 +1,122 @@ +import * as React from "react"; +import { Switch, Route, RouteComponentProps, BrowserRouter, Link } from "react-router-dom"; +import { + ScrollIntoView, + ConfigSwitch, + withScroll, + OnUpdate, + whenActive, + Status, + wrapSwitch, + RouteConfiguration, + GetKeyFunction, + OnUpdateCall +} from "rrc"; + +class RouteOne extends React.Component, {}> { + render() { + return
+ +
Main view
+
+ }, + { path: "/one/two", render: () =>
One two route
} + ]} /> +
; + } +} + +class RouteTwo extends React.Component, {}> { + private onUpdate: OnUpdateCall = (location) => { console.log("update"); }; + + render() { + return
+ Route 2 + Go to Route 1 + +
; + } +} + +interface LayoutProps { + title: string; + subtitle?: string; +} + +class Layout extends React.Component { + render() { + return
+
{`Layout ${this.props.title}`}
+
+ Content + {this.props.children} +
+
; + } +} + +const WrappedLayout = wrapSwitch(Layout); + +interface Params { + page: number; +} + +class RouteFour extends React.Component, {}> { + private routes: RouteConfiguration[] = [ + { path: "/four/something/:page", component: RouteTwo } + ]; + + private getKey: GetKeyFunction = (match, route, location) => { + return "my-key-" + match.url; + } + + render() { + return
+
+ Route four +
+
+ +
+
; + } +} + +interface MyContainerProps { + className?: string; + color: number; +} + +class MyContainer extends React.Component { + render() { + return
+ {this.props.children} +
; + } +} + +const ExtendedContainer = whenActive({ className: "active" })(MyContainer); + +const RouteTwoWithScroll = withScroll(RouteTwo); + +export const Routes = + +
+
My page
+ + + + + Route 3} /> + + +
+
; diff --git a/types/rrc/tsconfig.json b/types/rrc/tsconfig.json new file mode 100644 index 0000000000..12588363b6 --- /dev/null +++ b/types/rrc/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "rrc-tests.tsx" + ] +} diff --git a/types/rrc/tslint.json b/types/rrc/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/rrc/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From e366674da8a8265eee509e3ffe272c539d4db813 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 6 Jun 2017 20:22:36 -0400 Subject: [PATCH 114/761] [semantic-ui-site] Add type definitions. (#16995) --- types/semantic-ui-site/global.d.ts | 85 +++++++++++++++++++ types/semantic-ui-site/index.d.ts | 11 +++ .../semantic-ui-site-tests.ts | 52 ++++++++++++ types/semantic-ui-site/tsconfig.json | 24 ++++++ types/semantic-ui-site/tslint.json | 7 ++ 5 files changed, 179 insertions(+) create mode 100644 types/semantic-ui-site/global.d.ts create mode 100644 types/semantic-ui-site/index.d.ts create mode 100644 types/semantic-ui-site/semantic-ui-site-tests.ts create mode 100644 types/semantic-ui-site/tsconfig.json create mode 100644 types/semantic-ui-site/tslint.json diff --git a/types/semantic-ui-site/global.d.ts b/types/semantic-ui-site/global.d.ts new file mode 100644 index 0000000000..1cd7caa858 --- /dev/null +++ b/types/semantic-ui-site/global.d.ts @@ -0,0 +1,85 @@ +interface JQueryStatic { + site: SemanticUI.Site; +} + +interface JQuery { + site: SemanticUI.Site; +} + +declare namespace SemanticUI { + interface Site { + settings: SiteSettings; + + (behavior: 'destroy'): JQuery; + (behavior: 'setting', name: K, value?: undefined): SiteSettings[K]; + (behavior: 'setting', name: K, value: SiteSettings[K]): JQuery; + (behavior: 'setting', value: SiteSettings.Param): JQuery; + (settings?: SiteSettings.Param): JQuery; + } + + interface SiteSettings extends Pick { } + + namespace SiteSettings { + type Param = SiteSettings | object; + + interface _Impl { + modules: string[]; + siteNamespace: string; + namespaceStub: Site.NamespaceStubSettings; + + // region Component Settings + + // region DOM Settings + + /** + * Event namespace. Makes sure module teardown does not effect other events attached to an element. + */ + namespace: string; + + // endregion + + // region Debug Settings + + /** + * Name used in log statements + */ + name: string; + /** + * Silences all console output including error messages, regardless of other debug settings. + */ + silent: boolean; + /** + * Debug output to console + */ + debug: boolean; + /** + * Show console.table output with performance metrics + */ + performance: boolean; + /** + * Debug output includes all internal behaviors + */ + verbose: boolean; + + // endregion + + // endregion + } + } + + namespace Site { + interface NamespaceStubSettings extends Pick { } + + namespace NamespaceStubSettings { + type Param = NamespaceStubSettings | object; + + interface _Impl { + cache: any; + config: any; + sections: any; + section: any; + utilities: any; + } + } + } +} diff --git a/types/semantic-ui-site/index.d.ts b/types/semantic-ui-site/index.d.ts new file mode 100644 index 0000000000..6b2eeff1ef --- /dev/null +++ b/types/semantic-ui-site/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for semantic-ui-site 2.2 +// Project: http://www.semantic-ui.com +// Definitions by: Leonard Thieu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// +/// + +declare const site: SemanticUI.Site; +export = site; diff --git a/types/semantic-ui-site/semantic-ui-site-tests.ts b/types/semantic-ui-site/semantic-ui-site-tests.ts new file mode 100644 index 0000000000..0eaddfc5b2 --- /dev/null +++ b/types/semantic-ui-site/semantic-ui-site-tests.ts @@ -0,0 +1,52 @@ +function test_site_static() { + $.site.settings.namespace = 'namespace'; + $.site.settings.name = 'name'; + $.site.settings.silent = false; + $.site.settings.debug = true; + $.site.settings.performance = true; + $.site.settings.verbose = true; + + $.fn.site.settings.namespace = 'namespace'; + $.fn.site.settings.name = 'name'; + $.fn.site.settings.silent = false; + $.fn.site.settings.debug = true; + $.fn.site.settings.performance = true; + $.fn.site.settings.verbose = true; +} + +function test_site() { + const selector = '.ui.site'; + $(selector).site('destroy') === $(); + $(selector).site('setting', 'debug', undefined) === false; + $(selector).site('setting', 'debug') === false; + $(selector).site('setting', 'debug', true) === $(); + $(selector).site('setting', { + namespace: 'namespace', + name: 'name', + silent: false, + debug: true, + performance: true, + verbose: true + }) === $(); + $(selector).site({ + modules: [ + 'module1', + 'module2', + ], + siteNamespace: 'siteNamespace', + namespaceStub: { + cache: {}, + config: {}, + sections: {}, + section: {}, + utilities: {} + } + }) === $(); + $(selector).site() === $(); +} + +import site = require('semantic-ui-site'); + +function test_module() { + $.fn.site = site; +} diff --git a/types/semantic-ui-site/tsconfig.json b/types/semantic-ui-site/tsconfig.json new file mode 100644 index 0000000000..0ea895173c --- /dev/null +++ b/types/semantic-ui-site/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "global.d.ts", + "semantic-ui-site-tests.ts" + ] +} diff --git a/types/semantic-ui-site/tslint.json b/types/semantic-ui-site/tslint.json new file mode 100644 index 0000000000..758e484744 --- /dev/null +++ b/types/semantic-ui-site/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false, + "unified-signatures": false + } +} From 8109b32f883e81f36957f84dfe0fc3a6dd02e312 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 6 Jun 2017 20:22:55 -0400 Subject: [PATCH 115/761] [semantic-ui-visibility] Add type definitions. (#16994) --- types/semantic-ui-visibility/global.d.ts | 366 ++++++++++++++++++ types/semantic-ui-visibility/index.d.ts | 11 + .../semantic-ui-visibility-tests.ts | 161 ++++++++ types/semantic-ui-visibility/tsconfig.json | 24 ++ types/semantic-ui-visibility/tslint.json | 7 + 5 files changed, 569 insertions(+) create mode 100644 types/semantic-ui-visibility/global.d.ts create mode 100644 types/semantic-ui-visibility/index.d.ts create mode 100644 types/semantic-ui-visibility/semantic-ui-visibility-tests.ts create mode 100644 types/semantic-ui-visibility/tsconfig.json create mode 100644 types/semantic-ui-visibility/tslint.json diff --git a/types/semantic-ui-visibility/global.d.ts b/types/semantic-ui-visibility/global.d.ts new file mode 100644 index 0000000000..fa735676c5 --- /dev/null +++ b/types/semantic-ui-visibility/global.d.ts @@ -0,0 +1,366 @@ +interface JQuery { + visibility: SemanticUI.Visibility; +} + +declare namespace SemanticUI { + interface Visibility { + settings: VisibilitySettings; + + /** + * Disable callbacks temporarily. This is useful if you need to adjust scroll position and do not want to trigger callbacks during the position change. + */ + (behavior: 'disable callbacks'): JQuery; + /** + * Re-enable callbacks + */ + (behavior: 'enable callbacks'): JQuery; + /** + * Returns whether element is on screen + */ + (behavior: 'is on screen'): boolean; + /** + * Returns whether element is off screen + */ + (behavior: 'is off screen'): boolean; + /** + * Returns number of pixels passed in current element from top of element + */ + (behavior: 'get pixels passed'): number; + /** + * Returns element calculations as object + */ + (behavior: 'get element calculations'): Visibility.ElementCalculations; + /** + * Returns screen calculations as object + */ + (behavior: 'get screen calculations'): Visibility.ScreenCalculations; + /** + * Returns screen size as object + */ + (behavior: 'get screen size'): Visibility.ScreenSize; + (behavior: 'destroy'): JQuery; + (behavior: 'setting', name: K, value?: undefined): VisibilitySettings[K]; + (behavior: 'setting', name: K, value: VisibilitySettings[K]): JQuery; + (behavior: 'setting', value: VisibilitySettings.Param): JQuery; + (settings?: VisibilitySettings.Param): JQuery; + } + + /** + * @see {@link http://semantic-ui.com/behaviors/visibility.html#/settings} + */ + interface VisibilitySettings extends Pick { } + + namespace VisibilitySettings { + type Param = VisibilitySettings | object; + + interface _Impl { + // region Functionality + + /** + * When set to false a callback will occur each time an element passes the threshold for a condition. + * + * @default true + */ + once: boolean; + /** + * When set to true a callback will occur anytime an element passes a condition not just immediately after the threshold is met. + * + * @default false + */ + continuous: boolean; + /** + * Set to image to load images when on screen. Set to fixed to add class name fixed when passed. + * + * @default false + */ + type: false | 'image' | 'fixed'; + /** + * Whether visibility conditions should be checked immediately on init + * + * @default true + */ + initialCheck: boolean; + /** + * The scroll context visibility should use. + * + * @default 'window' + */ + context: string | JQuery; + /** + * Whether visibility conditions should be checked on window load. This ensures that after images load content positions will be updated correctly. + * + * @default true + */ + refreshOnLoad: boolean; + /** + * Whether visibility conditions should be checked on window resize. Useful when content resizes causes continuous changes in position + * + * @default true + */ + refreshOnResize: boolean; + /** + * Whether visibility conditions should be checked on calls to refresh. + * These calls can be triggered from either resize, load or manually calling $('.foo').visibility('refresh') + * + * @default true + */ + checkOnRefresh: boolean; + /** + * Specify a z-index when using type: 'fixed'. + * + * @default 1 + * @since 2.2 + */ + zIndex: number; + /** + * Value that context scrollTop should be adjusted in pixels. Useful for making content appear below content fixed to the page. + * + * @default 0 + */ + offset: number; + /** + * Whether element calculations should include its margin + * + * @default false + */ + includeMargin: boolean; + /** + * When set to an integer, scroll position will be debounced using this ms value. false will debounce with requestAnimationFrame. + * + * @default false + */ + throttle: false | number; + /** + * Whether to automatically refresh content when changes are made to the element's DOM subtree + * + * @default true + */ + observeChanges: boolean; + /** + * When using type: image allows you to specify transition when showing a loaded image + * + * @default false + */ + transition: false | string; + /** + * When using type: image allows you to specify transition duration + * + * @default 1000 + */ + duration: number; + + // endregion + + // region Visibility Callbacks + + /** + * Element's top edge has passed bottom of screen + */ + onTopVisible(this: JQuery): void; + /** + * Element's top edge has passed top of the screen + */ + onTopPassed(this: JQuery): void; + /** + * Element's bottom edge has passed bottom of screen + */ + onBottomVisible(this: JQuery): void; + /** + * Any part of an element is visible on screen + */ + onPassing(this: JQuery): void; + /** + * Element's bottom edge has passed top of screen + */ + onBottomPassed(this: JQuery): void; + /** + * Element's top edge has not passed bottom of screen + */ + onTopVisibleReverse(this: JQuery): void; + /** + * Element's top edge has not passed top of the screen + */ + onTopPassedReverse(this: JQuery): void; + /** + * Element's bottom edge has not passed bottom of screen + */ + onBottomVisibleReverse(this: JQuery): void; + /** + * Element's top has not passed top of screen but bottom has + */ + onPassingReverse(this: JQuery): void; + /** + * Element's bottom edge has not passed top of screen + */ + onBottomPassedReverse(this: JQuery): void; + onOnScreen(this: JQuery): void; + onOffScreen(this: JQuery): void; + + // endregion + + // region Image Callbacks + + /** + * Occurs after an image has completed loading + * + * @since 2.2 + */ + onLoad(this: JQuery): void; + /** + * Occurs after all img initialized at the same time have loaded. + * + * @since 2.2 + */ + onAllLoaded(this: JQuery): void; + + // endregion + + // region Fixed Callbacks + + /** + * Occurs after element has been assigned position fixed + * + * @since 2.2 + */ + onFixed(this: JQuery): void; + /** + * Occurs after element has been removed from fixed position + * + * @since 2.2 + */ + onUnfixed(this: JQuery): void; + + // endregion + + // region Utility Callbacks + + /** + * Occurs each time an elements calculations are updated + */ + onUpdate(this: JQuery, calculations: Visibility.ElementCalculations): void; + /** + * Occurs whenever element's visibility is refreshed + */ + onRefresh(this: JQuery): void; + + // endregion + + // region DOM Settings + + /** + * Class names used to attach style to state + */ + className: Visibility.ClassNameSettings; + + // endregion + + // region Debug Settings + + error: Visibility.ErrorSettings; + + // endregion + + // region Component Settings + + // region DOM Settings + + /** + * Event namespace. Makes sure module teardown does not effect other events attached to an element. + */ + namespace: string; + + // endregion + + // region Debug Settings + + /** + * Name used in log statements + */ + name: string; + /** + * Silences all console output including error messages, regardless of other debug settings. + */ + silent: boolean; + /** + * Debug output to console + */ + debug: boolean; + /** + * Show console.table output with performance metrics + */ + performance: boolean; + /** + * Debug output includes all internal behaviors + */ + verbose: boolean; + + // endregion + + // endregion + } + } + + namespace Visibility { + interface ElementPosition { + fits: boolean; + offset: JQueryCoordinates; + width: number; + height: number; + } + + interface ElementCalculations extends ElementPosition { + margin?: { + top: number; + bottom: number; + }; + top: number; + bottom: number; + + topVisible: boolean; + topPassed: boolean; + bottomVisible: boolean; + bottomPassed: boolean; + pixelsPassed: number; + percentagePassed: number; + + onScreen: boolean; + passing: boolean; + offScreen: boolean; + } + + interface ScreenCalculations { + top: number; + bottom: number; + } + + interface ScreenSize { + height: number; + } + + interface ClassNameSettings extends Pick { } + + namespace ClassNameSettings { + type Param = ClassNameSettings | object; + + interface _Impl { + /** + * @default 'fixed' + */ + fixed: string; + } + } + + interface ErrorSettings extends Pick { } + + namespace ErrorSettings { + type Param = ErrorSettings | object; + + interface _Impl { + /** + * @default 'The method you called is not defined.' + */ + method: string; + } + } + } +} diff --git a/types/semantic-ui-visibility/index.d.ts b/types/semantic-ui-visibility/index.d.ts new file mode 100644 index 0000000000..14873ba2ea --- /dev/null +++ b/types/semantic-ui-visibility/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for semantic-ui-visibility 2.2 +// Project: http://www.semantic-ui.com +// Definitions by: Leonard Thieu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// +/// + +declare const visibility: SemanticUI.Visibility; +export = visibility; diff --git a/types/semantic-ui-visibility/semantic-ui-visibility-tests.ts b/types/semantic-ui-visibility/semantic-ui-visibility-tests.ts new file mode 100644 index 0000000000..960eeb5215 --- /dev/null +++ b/types/semantic-ui-visibility/semantic-ui-visibility-tests.ts @@ -0,0 +1,161 @@ +function test_visibility_static() { + $.fn.visibility.settings.error.method = 'method'; + $.fn.visibility.settings.namespace = 'namespace'; + $.fn.visibility.settings.name = 'name'; + $.fn.visibility.settings.silent = false; + $.fn.visibility.settings.debug = true; + $.fn.visibility.settings.performance = true; + $.fn.visibility.settings.verbose = true; +} + +function test_visibility() { + const selector = '.ui.visibility'; + $(selector).visibility('disable callbacks') === $(); + $(selector).visibility('enable callbacks') === $(); + $(selector).visibility('is on screen') === false; + $(selector).visibility('is off screen') === true; + $(selector).visibility('get pixels passed') === 20; + $(selector).visibility('get element calculations') === { + fits: false, + offset: { + top: 955.96875, + left: 292 + }, + width: 466, + height: 1665.890625, + top: 955.96875, + bottom: 2621.859375, + topPassed: true, + bottomPassed: false, + topVisible: true, + bottomVisible: false, + pixelsPassed: 742.03125, + percentagePassed: 0.44542615155182, + onScreen: true, + passing: true, + offScreen: false + }; + $(selector).visibility('get screen calculations') === { + bottom: 2658, + top: 1698 + }; + $(selector).visibility('get screen size') === { + height: 960 + }; + $(selector).visibility('destroy') === $(); + $(selector).visibility('setting', 'debug', undefined) === false; + $(selector).visibility('setting', 'debug') === false; + $(selector).visibility('setting', 'debug', true) === $(); + $(selector).visibility('setting', { + namespace: 'namespace', + name: 'name', + silent: false, + debug: true, + performance: true, + verbose: true + }) === $(); + $(selector).visibility({ + once: false, + continuous: true, + type: 'image', + initialCheck: false, + context: $(), + refreshOnLoad: true, + refreshOnResize: false, + checkOnRefresh: true, + zIndex: 2, + offset: 3, + includeMargin: false, + throttle: 10, + observeChanges: true, + transition: 'fade', + duration: 5, + onTopVisible() { + this === $(); + }, + onTopPassed() { + this === $(); + }, + onBottomVisible() { + this === $(); + }, + onPassing() { + this === $(); + }, + onBottomPassed() { + this === $(); + }, + onTopVisibleReverse() { + this === $(); + }, + onTopPassedReverse() { + this === $(); + }, + onBottomVisibleReverse() { + this === $(); + }, + onPassingReverse() { + this === $(); + }, + onBottomPassedReverse() { + this === $(); + }, + onOnScreen() { + this === $(); + }, + onOffScreen() { + this === $(); + }, + onLoad() { + this === $(); + }, + onAllLoaded() { + this === $(); + }, + onFixed() { + this === $(); + }, + onUnfixed() { + this === $(); + }, + onUpdate(calculations) { + this === $(); + calculations === { + fits: false, + offset: { + top: 955.96875, + left: 292 + }, + width: 466, + height: 1665.890625, + top: 955.96875, + bottom: 2621.859375, + topPassed: true, + bottomPassed: false, + topVisible: true, + bottomVisible: false, + pixelsPassed: 742.03125, + percentagePassed: 0.44542615155182, + onScreen: true, + passing: true, + offScreen: false + }; + }, + onRefresh() { + this === $(); + }, + className: { + fixed: 'fixed', + }, + error: { + method: 'method' + } + }) === $(); + $(selector).visibility() === $(); +} + +import visibility = require('semantic-ui-visibility'); + +function test_module() { + $.fn.visibility = visibility; +} diff --git a/types/semantic-ui-visibility/tsconfig.json b/types/semantic-ui-visibility/tsconfig.json new file mode 100644 index 0000000000..dcf5313a0a --- /dev/null +++ b/types/semantic-ui-visibility/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "global.d.ts", + "semantic-ui-visibility-tests.ts" + ] +} diff --git a/types/semantic-ui-visibility/tslint.json b/types/semantic-ui-visibility/tslint.json new file mode 100644 index 0000000000..758e484744 --- /dev/null +++ b/types/semantic-ui-visibility/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false, + "unified-signatures": false + } +} From dc6ff26ec2e2affed08c3df3c170cb9cee245bcd Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 6 Jun 2017 20:23:50 -0400 Subject: [PATCH 116/761] [semantic-ui-tab] Add type definitions. (#16992) --- .../semantic-ui-api/semantic-ui-api-tests.ts | 3 +- types/semantic-ui-tab/global.d.ts | 357 ++++++++++++++++++ types/semantic-ui-tab/index.d.ts | 12 + .../semantic-ui-tab/semantic-ui-tab-tests.ts | 204 ++++++++++ types/semantic-ui-tab/tsconfig.json | 24 ++ types/semantic-ui-tab/tslint.json | 7 + 6 files changed, 605 insertions(+), 2 deletions(-) create mode 100644 types/semantic-ui-tab/global.d.ts create mode 100644 types/semantic-ui-tab/index.d.ts create mode 100644 types/semantic-ui-tab/semantic-ui-tab-tests.ts create mode 100644 types/semantic-ui-tab/tsconfig.json create mode 100644 types/semantic-ui-tab/tslint.json diff --git a/types/semantic-ui-api/semantic-ui-api-tests.ts b/types/semantic-ui-api/semantic-ui-api-tests.ts index c365765934..683c1a35c4 100644 --- a/types/semantic-ui-api/semantic-ui-api-tests.ts +++ b/types/semantic-ui-api/semantic-ui-api-tests.ts @@ -1,4 +1,4 @@ -function test_static() { +function test_api_static() { $.api.settings.className.error = 'error'; $.api.settings.namespace = 'namespace'; $.api.settings.name = 'name'; @@ -42,7 +42,6 @@ function test_api() { loadingDuration: 3, hideError: true, errorDuration: 10, - action: 'action', url: 'url', urlData: false, diff --git a/types/semantic-ui-tab/global.d.ts b/types/semantic-ui-tab/global.d.ts new file mode 100644 index 0000000000..7bd8aad4fc --- /dev/null +++ b/types/semantic-ui-tab/global.d.ts @@ -0,0 +1,357 @@ +interface JQuery { + tab: SemanticUI.Tab; +} + +declare namespace SemanticUI { + interface Tab { + settings: TabSettings; + + // Documentation says this exists but it does not. + // /** + // * Attaches tab action to given selector. Default event if none specified is toggle + // */ + // (behavior: 'attach events', selector: Selector, event?: string): JQuery; + /** + * Changes tab to path + */ + (behavior: 'change tab', path: string): JQuery; + /** + * Sets current path to state + */ + (behavior: 'set state', path: string): JQuery; + /** + * Returns current path + */ + (behavior: 'get path'): string; + /** + * Returns whether tab exists + */ + (behavior: 'is tab'): boolean; + /** + * Returns cached HTML for path + */ + (behavior: 'cache read', path: string): string | false; + /** + * Sets cached HTML for path + */ + (behavior: 'cache add', path: string, html: string): JQuery; + /** + * Removes cached HTML for path + */ + (behavior: 'cache remove', path: string): JQuery; + (behavior: 'destroy'): JQuery; + (behavior: 'setting', name: K, value?: undefined): TabSettings[K]; + (behavior: 'setting', name: K, value: TabSettings[K]): JQuery; + (behavior: 'setting', value: TabSettings.Param): JQuery; + (settings?: TabSettings.Param): JQuery; + } + + /** + * @see {@link http://semantic-ui.com/modules/tab.html#/settings} + */ + interface TabSettings extends Pick { } + + namespace TabSettings { + type Param = TabSettings | object; + + interface _Impl { + // region Tab Settings + + /** + * Whether tab should load remote content as same url as history + * + * @default false + */ + auto: boolean; + /** + * When set to siblings will only deactivate elements that are DOM siblings with the activated element. + * When set to all the component will deactivate all other elements initialized at the same time. + * + * @default 'siblings' + * @since 2.2 + */ + deactivate: 'siblings' | 'all'; + /** + * Whether to record history events for tab changes + * + * @default false + */ + history: boolean; + /** + * Do not load content remotely on first tab load. Useful when open tab is rendered on server. + * + * @default false + */ + ignoreFirstLoad: boolean; + /** + * Whether inline scripts in tab HTML should be parsed on tab load. + * Defaults to once, parsing only on first load. + * Can also be set to true or false to always parse or never parse inline scripts. + * + * @default 'once' + */ + evaluateScripts: 'once' | boolean; + /** + * Tab should reload content every time it is opened + */ + alwaysRefresh: boolean; + /** + * Can be set to either response, DOM or html. + * Using DOM will cache the a clone of the DOM tree, preserving all events as they existed on render. + * response will cache the original response on load, this way callbacks always receive the same content. + * Using html will cache the resulting html after all callbacks, making sure any changes to content are preserved. + * + * @default 'response' + */ + cacheType: 'response' | 'DOM' | 'html'; + /** + * Tab should cache content after loading locally to avoid server trip on second load + * + * @default true + */ + cache: boolean; + /** + * Settings object for $.api call + * + * @default false + * @see {@link http://semantic-ui.com/behaviors/api.html} + */ + apiSettings: ApiSettings; + /** + * Can be set to hash or state. + * Hash will use an in-page link to create history events. + * State will use DOM History and load pages from server on refresh. + * + * @default 'hash' + * @see {@link https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history} + */ + historyType: 'hash' | 'state'; + /** + * When using historyType state you must specify the base URL for all internal links. + * + * @default false + */ + path: false | string; + /** + * Tabs are limited to those found inside this context + * + * @default false + */ + context: false | string | JQuery; + /** + * If enabled limits tabs to children of passed context + * + * @default false + */ + childrenOnly: boolean; + /** + * Maximum amount of nested tabs allowed (avoids recursion) + * + * @default 25 + */ + maxDepth: number; + /** + * When enabled only calls remote endpoint for tab data on first load and leaves the DOM undisturbed afterwards. + * + * @default false + * @since 2.2.8 + */ + loadOnce: boolean; + + // endregion + + // region Callbacks + + /** + * Callback only the first time a tab is loaded + */ + onFirstLoad(this: JQuery, tabPath: string, parameterArray: any[], historyEvent: any): void; + /** + * Callback every time a tab is loaded + */ + onLoad(this: JQuery, tabPath: string, parameterArray: any[], historyEvent: any): void; + /** + * Called when a tab begins loading remote content + */ + onRequest(this: JQuery, tabPath: string): void; + /** + * Called after a tab becomes visible + */ + onVisible(this: JQuery, tabPath: string): void; + + // endregion + + // region DOM Settings + + /** + * Functions used to return content + */ + templates: Tab.TemplatesSettings; + /** + * Selectors used by module + */ + selector: Tab.SelectorSettings; + /** + * DOM metadata used by module + */ + metadata: Tab.MetadataSettings; + /** + * Class names used to attach style to state + */ + className: Tab.ClassNameSettings; + + // endregion + + // region Debug Settings + + error: Tab.ErrorSettings; + + // endregion + + // region Component Settings + + // region DOM Settings + + /** + * Event namespace. Makes sure module teardown does not effect other events attached to an element. + */ + namespace: string; + + // endregion + + // region Debug Settings + + /** + * Name used in log statements + */ + name: string; + /** + * Silences all console output including error messages, regardless of other debug settings. + */ + silent: boolean; + /** + * Debug output to console + */ + debug: boolean; + /** + * Show console.table output with performance metrics + */ + performance: boolean; + /** + * Debug output includes all internal behaviors + */ + verbose: boolean; + + // endregion + + // endregion + } + } + + namespace Tab { + interface TemplatesSettings extends Pick { } + + namespace TemplatesSettings { + type Param = TemplatesSettings | object; + + interface _Impl { + /** + * returns page title + */ + determineTitle(tabArray: any[]): string; + } + } + + interface SelectorSettings extends Pick { } + + namespace SelectorSettings { + type Param = SelectorSettings | object; + + interface _Impl { + /** + * @default '.ui.tab' + */ + tabs: string; + /** + * @default '.ui:not(.menu)' + */ + parent: string; + } + } + + interface MetadataSettings extends Pick { } + + namespace MetadataSettings { + type Param = MetadataSettings | object; + + interface _Impl { + /** + * @default 'tab' + */ + tab: string; + /** + * @default 'loaded' + */ + loaded: string; + /** + * @default 'promise' + */ + promise: string; + } + } + + interface ClassNameSettings extends Pick { } + + namespace ClassNameSettings { + type Param = ClassNameSettings | object; + + interface _Impl { + /** + * @default 'loading' + */ + loading: string; + /** + * @default 'active' + */ + active: string; + } + } + + interface ErrorSettings extends Pick { } + + namespace ErrorSettings { + type Param = ErrorSettings | object; + + interface _Impl { + /** + * @default 'You attempted to load content without API module' + */ + api: string; + /** + * @default 'The method you called is not defined' + */ + method: string; + /** + * @default 'Activated tab cannot be found for this context.' + */ + missingTab: string; + /** + * @default 'The tab you specified is missing a content url.' + */ + noContent: string; + /** + * @default 'History enabled, but no path was specified' + */ + path: string; + /** + * @default 'Max recursive depth reached' + */ + recursion: string; + /** + * @default 'The state library has not been initialized' + */ + state: string; + } + } + } +} diff --git a/types/semantic-ui-tab/index.d.ts b/types/semantic-ui-tab/index.d.ts new file mode 100644 index 0000000000..4becf66817 --- /dev/null +++ b/types/semantic-ui-tab/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for semantic-ui-tab 2.2 +// Project: http://www.semantic-ui.com +// Definitions by: Leonard Thieu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// +/// +/// + +declare const tab: SemanticUI.Tab; +export = tab; diff --git a/types/semantic-ui-tab/semantic-ui-tab-tests.ts b/types/semantic-ui-tab/semantic-ui-tab-tests.ts new file mode 100644 index 0000000000..a3bbc096c4 --- /dev/null +++ b/types/semantic-ui-tab/semantic-ui-tab-tests.ts @@ -0,0 +1,204 @@ +function test_tab_static() { + $.fn.tab.settings.error.method = 'method'; + $.fn.tab.settings.namespace = 'namespace'; + $.fn.tab.settings.name = 'name'; + $.fn.tab.settings.silent = false; + $.fn.tab.settings.debug = true; + $.fn.tab.settings.performance = true; + $.fn.tab.settings.verbose = true; +} + +function test_tab() { + const selector = '.ui.tab'; + $(selector).tab('change tab', 'path') === $(); + $(selector).tab('set state', 'path') === $(); + $(selector).tab('get path') === 'path'; + $(selector).tab('is tab') === false; + $(selector).tab('cache read', 'path') === false; + $(selector).tab('cache add', 'path', 'html') === $(); + $(selector).tab('cache remove', 'path') === $(); + $(selector).tab('destroy') === $(); + $(selector).tab('setting', 'debug', undefined) === false; + $(selector).tab('setting', 'debug') === false; + $(selector).tab('setting', 'debug', true) === $(); + $(selector).tab('setting', { + namespace: 'namespace', + name: 'name', + silent: false, + debug: true, + performance: true, + verbose: true + }) === $(); + $(selector).tab({ + auto: false, + deactivate: 'siblings', + history: true, + ignoreFirstLoad: false, + evaluateScripts: 'once', + alwaysRefresh: true, + cacheType: 'DOM', + cache: false, + apiSettings: { + on: 'on', + cache: true, + stateContext: $(), + encodeParameters: false, + defaultData: true, + serializeForm: false, + throttle: 10, + throttleFirstRequest: true, + interruptRequests: false, + loadingDuration: 3, + hideError: true, + errorDuration: 10, + action: 'action', + url: 'url', + urlData: false, + response: false, + responseAsync(settings, callback) { + settings === ({} as SemanticUI.ApiSettings); + callback === ((response: any) => { }); + }, + mockResponse: false, + mockResponseAsync(settings, callback) { + settings === ({} as SemanticUI.ApiSettings); + callback === ((response: any) => { }); + }, + method: 'post', + dataType: 'xml', + data: {}, + beforeSend(settings) { + settings === ({} as SemanticUI.ApiSettings); + }, + beforeXHR(xhrObject) { + xhrObject === ({} as JQueryXHR); + }, + onRequest(promise, xhr) { + promise === ({} as JQueryDeferred); + xhr === ({} as JQueryXHR); + }, + onResponse(response) { + response === ({} as any); + }, + successTest(response) { + return response === ({} as any); + }, + onSuccess(response, element, xhr) { + response === ({} as any); + element === $(); + xhr === ({} as JQueryXHR); + }, + onComplete(response, element, xhr) { + response === ({} as any); + element === $(); + xhr === ({} as JQueryXHR); + }, + onFailure(response, element) { + response === ({} as any); + element === $(); + }, + onError(errorMessage, element, xhr) { + errorMessage === ''; + element === $(); + xhr === ({} as JQueryXHR); + }, + onAbort(errorMessage, element, xhr) { + errorMessage === ''; + element === $(); + xhr === ({} as JQueryXHR); + }, + regExp: { + required: /{\$*[A-z0-9]+}/g, + optional: /{\/\$*[A-z0-9]+}/g + }, + selector: { + disabled: '.disabled', + form: 'form' + }, + className: { + loading: 'loading', + error: 'error' + }, + metadata: { + action: 'action', + url: 'url' + }, + error: { + beforeSend: 'beforeSend', + error: 'error', + exitConditions: 'exitConditions', + JSONParse: 'JSONParse', + legacyParameters: 'legacyParameters', + missingAction: 'missingAction', + missingSerialize: 'missingSerialize', + missingURL: 'missingURL', + noReturnedValue: 'noReturnedValue', + parseError: 'parseError', + requiredParameter: 'requiredParameter', + statusMessage: 'statusMessage', + timeout: 'timeout' + } + }, + historyType: 'state', + path: 'path', + context: $(), + childrenOnly: true, + maxDepth: 10, + loadOnce: false, + onFirstLoad(tabPath, parameterArray, historyEvent) { + this === $(); + tabPath === 'tabPath'; + parameterArray === []; + historyEvent === {}; + }, + onLoad(tabPath, parameterArray, historyEvent) { + this === $(); + tabPath === 'tabPath'; + parameterArray === []; + historyEvent === {}; + }, + onRequest(tabPath) { + this === $(); + tabPath === 'tabPath'; + }, + onVisible(tabPath) { + this === $(); + tabPath === 'tabPath'; + }, + templates: { + determineTitle(tabArray) { + tabArray === []; + return 'title'; + } + }, + selector: { + tabs: 'tabs', + parent: 'parent' + }, + metadata: { + tab: 'tab', + loaded: 'loaded', + promise: 'promise' + }, + className: { + loading: 'loading', + active: 'active' + }, + error: { + api: 'api', + method: 'method', + missingTab: 'missingTab', + noContent: 'noContent', + path: 'path', + recursion: 'recursion', + state: 'state' + } + }) === $(); + $(selector).tab() === $(); +} + +import tab = require('semantic-ui-tab'); + +function test_module() { + $.fn.tab = tab; +} diff --git a/types/semantic-ui-tab/tsconfig.json b/types/semantic-ui-tab/tsconfig.json new file mode 100644 index 0000000000..2896defde1 --- /dev/null +++ b/types/semantic-ui-tab/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "global.d.ts", + "semantic-ui-tab-tests.ts" + ] +} diff --git a/types/semantic-ui-tab/tslint.json b/types/semantic-ui-tab/tslint.json new file mode 100644 index 0000000000..758e484744 --- /dev/null +++ b/types/semantic-ui-tab/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false, + "unified-signatures": false + } +} From 2529651e84146d29881a837813aaf41013346a21 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 6 Jun 2017 20:24:16 -0400 Subject: [PATCH 117/761] [semantic-ui-sticky] Add type definitions. (#16991) --- types/semantic-ui-sticky/global.d.ts | 219 ++++++++++++++++++ types/semantic-ui-sticky/index.d.ts | 11 + .../semantic-ui-sticky-tests.ts | 74 ++++++ types/semantic-ui-sticky/tsconfig.json | 24 ++ types/semantic-ui-sticky/tslint.json | 7 + 5 files changed, 335 insertions(+) create mode 100644 types/semantic-ui-sticky/global.d.ts create mode 100644 types/semantic-ui-sticky/index.d.ts create mode 100644 types/semantic-ui-sticky/semantic-ui-sticky-tests.ts create mode 100644 types/semantic-ui-sticky/tsconfig.json create mode 100644 types/semantic-ui-sticky/tslint.json diff --git a/types/semantic-ui-sticky/global.d.ts b/types/semantic-ui-sticky/global.d.ts new file mode 100644 index 0000000000..683d1aafc7 --- /dev/null +++ b/types/semantic-ui-sticky/global.d.ts @@ -0,0 +1,219 @@ +interface JQuery { + sticky: SemanticUI.Sticky; +} + +declare namespace SemanticUI { + interface Sticky { + settings: StickySettings; + + /** + * recalculates offsets + */ + (behavior: 'refresh'): JQuery; + (behavior: 'destroy'): JQuery; + (behavior: 'setting', name: K, value?: undefined): StickySettings[K]; + (behavior: 'setting', name: K, value: StickySettings[K]): JQuery; + (behavior: 'setting', value: StickySettings.Param): JQuery; + (settings?: StickySettings.Param): JQuery; + } + + /** + * @see {@link http://semantic-ui.com/modules/sticky.html#/settings} + */ + interface StickySettings extends Pick { } + + namespace StickySettings { + type Param = StickySettings | object; + + interface _Impl { + // region Sticky Settings + + /** + * Whether element should be "pushed" by the viewport, attaching to the bottom of the screen when scrolling up + * + * @default false + */ + pushing: boolean; + /** + * Sticky container height will only be set if the difference between heights of container and context is larger than this jitter value. + * + * @default 5 + */ + jitter: number; + /** + * Whether any change in context DOM should automatically refresh cached sticky positions + * + * @default false + */ + observeChanges: boolean; + /** + * Context which sticky element should stick to + * + * @default false + */ + context: false | string | JQuery; + /** + * Context which sticky should attach onscroll events. + * + * @default 'window' + */ + scrollContext: string | JQuery; + /** + * Offset in pixels from the top of the screen when fixing element to viewport + * + * @default 0 + */ + offset: number; + /** + * Offset in pixels from the bottom of the screen when fixing element to viewport + * + * @default 0 + */ + bottomOffset: number; + + // endregion + + // region Callbacks + + /** + * Callback when element is repositioned from layout change + */ + onReposition(this: JQuery): void; + /** + * Callback when requestAnimationFrame fires from scroll handler. + */ + onScroll(this: JQuery): void; + /** + * Callback when element is fixed to page + */ + onStick(this: JQuery): void; + /** + * Callback when element is unfixed from page + */ + onUnstick(this: JQuery): void; + /** + * Callback when element is bound to top of parent container + */ + onTop(this: JQuery): void; + /** + * Callback when element is bound to bottom of parent container + */ + onBottom(this: JQuery): void; + + // endregion + + // region DOM Settings + + /** + * Class names used to attach style to state + */ + className: Sticky.ClassNameSettings; + + // endregion + + // region Debug Settings + + error: Sticky.ErrorSettings; + + // endregion + + // region Component Settings + + // region DOM Settings + + /** + * Event namespace. Makes sure module teardown does not effect other events attached to an element. + */ + namespace: string; + + // endregion + + // region Debug Settings + + /** + * Name used in log statements + */ + name: string; + /** + * Silences all console output including error messages, regardless of other debug settings. + */ + silent: boolean; + /** + * Debug output to console + */ + debug: boolean; + /** + * Show console.table output with performance metrics + */ + performance: boolean; + /** + * Debug output includes all internal behaviors + */ + verbose: boolean; + + // endregion + + // endregion + } + } + + namespace Sticky { + interface ClassNameSettings extends Pick { } + + namespace ClassNameSettings { + type Param = ClassNameSettings | object; + + interface _Impl { + /** + * @default 'bound' + */ + bound: string; + /** + * @default 'fixed' + */ + fixed: string; + /** + * @default 'native' + */ + supported: string; + /** + * @default 'top' + */ + top: string; + /** + * @default 'bottom' + */ + bottom: string; + } + } + + interface ErrorSettings extends Pick { } + + namespace ErrorSettings { + type Param = ErrorSettings | object; + + interface _Impl { + /** + * @default 'Sticky element must be inside a relative container' + */ + container: string; + /** + * @default 'Element is hidden, you must call refresh after element becomes visible' + */ + visible: string; + /** + * @default 'The method you called is not defined.' + */ + method: string; + /** + * @default 'Context specified does not exist' + */ + invalidContext: string; + /** + * @default 'Sticky element is larger than its container, cannot create sticky.' + */ + elementSize: string; + } + } + } +} diff --git a/types/semantic-ui-sticky/index.d.ts b/types/semantic-ui-sticky/index.d.ts new file mode 100644 index 0000000000..9bc36ca270 --- /dev/null +++ b/types/semantic-ui-sticky/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for semantic-ui-sticky 2.2 +// Project: http://www.semantic-ui.com +// Definitions by: Leonard Thieu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// +/// + +declare const sticky: SemanticUI.Sticky; +export = sticky; diff --git a/types/semantic-ui-sticky/semantic-ui-sticky-tests.ts b/types/semantic-ui-sticky/semantic-ui-sticky-tests.ts new file mode 100644 index 0000000000..0a3585f08d --- /dev/null +++ b/types/semantic-ui-sticky/semantic-ui-sticky-tests.ts @@ -0,0 +1,74 @@ +function test_sticky_static() { + $.fn.sticky.settings.error.method = 'method'; + $.fn.sticky.settings.namespace = 'namespace'; + $.fn.sticky.settings.name = 'name'; + $.fn.sticky.settings.silent = false; + $.fn.sticky.settings.debug = true; + $.fn.sticky.settings.performance = true; + $.fn.sticky.settings.verbose = true; +} + +function test_sticky() { + const selector = '.ui.sticky'; + $(selector).sticky('refresh') === $(); + $(selector).sticky('destroy') === $(); + $(selector).sticky('setting', 'debug', undefined) === false; + $(selector).sticky('setting', 'debug') === false; + $(selector).sticky('setting', 'debug', true) === $(); + $(selector).sticky('setting', { + namespace: 'namespace', + name: 'name', + silent: false, + debug: true, + performance: true, + verbose: true + }) === $(); + $(selector).sticky({ + pushing: false, + jitter: 4, + observeChanges: true, + context: $(), + scrollContext: $(), + offset: 1, + bottomOffset: 200, + onReposition() { + this === $(); + }, + onScroll() { + this === $(); + }, + onStick() { + this === $(); + }, + onUnstick() { + this === $(); + }, + onTop() { + this === $(); + }, + onBottom() { + this === $(); + }, + className: { + bound: 'bound', + fixed: 'fixed', + supported: 'supported', + top: 'top', + bottom: 'bottom' + }, + error: { + container: 'container', + visible: 'visible', + method: 'method', + invalidContext: 'invalidContext', + elementSize: 'elementSize' + } + }) === $(); + $(selector).sticky() === $(); +} + +import sticky = require('semantic-ui-sticky'); + +function test_module() { + $.fn.sticky = sticky; +} diff --git a/types/semantic-ui-sticky/tsconfig.json b/types/semantic-ui-sticky/tsconfig.json new file mode 100644 index 0000000000..8a60c43a02 --- /dev/null +++ b/types/semantic-ui-sticky/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "global.d.ts", + "semantic-ui-sticky-tests.ts" + ] +} diff --git a/types/semantic-ui-sticky/tslint.json b/types/semantic-ui-sticky/tslint.json new file mode 100644 index 0000000000..758e484744 --- /dev/null +++ b/types/semantic-ui-sticky/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false, + "unified-signatures": false + } +} From 4ab8603649b8ace29d5970603608288a4d3b2d84 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 6 Jun 2017 20:24:34 -0400 Subject: [PATCH 118/761] [semantic-ui-form] Add type definitions. (#16993) --- types/semantic-ui-form/global.d.ts | 465 ++++++++++++++++++ types/semantic-ui-form/index.d.ts | 11 + .../semantic-ui-form-tests.ts | 156 ++++++ types/semantic-ui-form/tsconfig.json | 24 + types/semantic-ui-form/tslint.json | 7 + 5 files changed, 663 insertions(+) create mode 100644 types/semantic-ui-form/global.d.ts create mode 100644 types/semantic-ui-form/index.d.ts create mode 100644 types/semantic-ui-form/semantic-ui-form-tests.ts create mode 100644 types/semantic-ui-form/tsconfig.json create mode 100644 types/semantic-ui-form/tslint.json diff --git a/types/semantic-ui-form/global.d.ts b/types/semantic-ui-form/global.d.ts new file mode 100644 index 0000000000..13fefb8147 --- /dev/null +++ b/types/semantic-ui-form/global.d.ts @@ -0,0 +1,465 @@ +interface JQuery { + form: SemanticUI.Form; +} + +declare namespace SemanticUI { + interface Form { + settings: FormSettings; + + /** + * Submits selected form + */ + (behavior: 'submit'): JQuery; + /** + * Returns true/false whether a form passes its validation rules + */ + (behavior: 'is valid'): boolean; + /** + * Validates form and calls onSuccess or onFailure + */ + (behavior: 'validate form'): JQuery; + /** + * gets browser property change event + */ + (behavior: 'get change event'): string; + /** + * Returns element with matching name, id, or data-validate metadata to ID + */ + (behavior: 'get field', id: string): JQuery; + /** + * Returns value of element with id + */ + (behavior: 'get value', id: string): any; + /** + * Returns object of element values that match array of ids. If no IDS are passed will return all fields + */ + (behavior: 'get values', ids?: string[]): any; + /** + * Sets value of element with id + */ + (behavior: 'set value', id: string): JQuery; + /** + * Sets key/value pairs from passed values object to matching ids + */ + (behavior: 'set values', values: any): JQuery; + /** + * Returns validation rules for a given jQuery-referenced input field + */ + (behavior: 'get validation', element: JQuery): any; + /** + * Returns whether a field exists + */ + (behavior: 'has field', identifier: string): boolean; + /** + * Adds errors to form, given an array errors + */ + (behavior: 'add errors', errors: string[]): JQuery; + (behavior: 'destroy'): JQuery; + (behavior: 'setting', name: K, value?: undefined): FormSettings[K]; + (behavior: 'setting', name: K, value: FormSettings[K]): JQuery; + (behavior: 'setting', value: FormSettings.Param): JQuery; + (settings?: FormSettings.Param): JQuery; + } + + /** + * @see {@link http://semantic-ui.com/behaviors/form.html#/settings} + */ + interface FormSettings extends Pick { } + + namespace FormSettings { + type Param = FormSettings | object; + + interface _Impl { + // region Form Settings + + /** + * Adds keyboard shortcuts for enter and escape keys to submit form and blur fields respectively + * + * @default true + */ + keyboardShortcuts: boolean; + /** + * Event used to trigger validation. Can be either submit, blur or change. + * + * @default 'submit' + */ + on: 'submit' | 'blur' | 'change'; + /** + * If set to true will revalidate fields with errors on input change + * + * @default true + */ + revalidate: boolean; + /** + * Delay from last typed letter to validate a field when using on: change or when revalidating a field. + * + * @default true + */ + delay: boolean; + /** + * Adds inline error on field validation error + * + * @default false + */ + inline: boolean; + /** + * Named transition to use when animating validation errors. Fade and slide down are available without including ui transitions + * + * @default 'scale' + * @see {@link http://semantic-ui.com/modules/transition.html} + */ + transition: string; + /** + * Animation speed for inline prompt + * + * @default 150 + */ + duration: number; + fields: { + [name: string]: string | string[] | Form.Field; + }; + + // endregion + + // region Form Prompts + + text: Form.TextSettings; + prompt: Form.PromptSettings; + + // endregion + + // region Callbacks + + /** + * Callback on each valid field + */ + onValid(this: JQuery): void; + /** + * Callback on each invalid field + */ + onInvalid(this: JQuery): void; + /** + * Callback if a form is all valid + */ + onSuccess(this: JQuery, event: JQueryEventObject, fields: any): void; + /** + * Callback if any form field is invalid + */ + onFailure(this: JQuery, formErrors: string[], fields: any): void; + + // endregion + + // region Templates + + templates: Form.TemplatesSettings; + + // endregion + + // region Rules + + rules: { + [name: string]: (this: HTMLElement, ...args: any[]) => boolean; + }; + + // endregion + + // region DOM Settings + + /** + * Selectors used to match functionality to DOM + */ + selector: Form.SelectorSettings; + /** + * HTML5 metadata attributes + */ + metadata: Form.MetadataSettings; + /** + * Class names used to attach style to state + */ + className: Form.ClassNameSettings; + + // endregion + + // region Debug Settings + + error: Form.ErrorSettings; + + // endregion + + // region Component Settings + + // region DOM Settings + + /** + * Event namespace. Makes sure module teardown does not effect other events attached to an element. + */ + namespace: string; + + // endregion + + // region Debug Settings + + /** + * Name used in log statements + */ + name: string; + /** + * Silences all console output including error messages, regardless of other debug settings. + */ + silent: boolean; + /** + * Debug output to console + */ + debug: boolean; + /** + * Show console.table output with performance metrics + */ + performance: boolean; + /** + * Debug output includes all internal behaviors + */ + verbose: boolean; + + // endregion + + // endregion + } + } + + namespace Form { + interface Field { + identifier: string; + rules: Rule[]; + } + + interface Rule { + type: string; + prompt: string; + } + + interface TextSettings extends Pick { } + + namespace TextSettings { + type Param = TextSettings | object; + + interface _Impl { + /** + * @default 'Please enter a valid value' + */ + unspecifiedRule: string; + /** + * @default 'This field' + */ + unspecifiedField: string; + } + } + + interface PromptSettings extends Pick { } + + namespace PromptSettings { + type Param = PromptSettings | object; + + interface _Impl { + /** + * @default '{name} must have a value' + */ + empty: string; + /** + * @default '{name} must be checked' + */ + checked: string; + /** + * @default '{name} must be a valid e-mail' + */ + email: string; + /** + * @default '{name} must be a valid url' + */ + url: string; + /** + * @default '{name} is not formatted correctly' + */ + regExp: string; + /** + * @default '{name} must be an integer' + */ + integer: string; + /** + * @default '{name} must be a decimal number' + */ + decimal: string; + /** + * @default '{name} must be set to a number' + */ + number: string; + /** + * @default '{name} must be \'{ruleValue}\'' + */ + is: string; + /** + * @default '{name} must be exactly \'{ruleValue}\'' + */ + isExactly: string; + /** + * @default '{name} cannot be set to \'{ruleValue}\'' + */ + not: string; + /** + * @default '{name} cannot be set to exactly \'{ruleValue}\'' + */ + notExactly: string; + /** + * @default '{name} cannot contain \'{ruleValue}\'' + */ + contain: string; + /** + * @default '{name} cannot contain exactly \'{ruleValue}\'' + */ + containExactly: string; + /** + * @default '{name} must contain \'{ruleValue}\'' + */ + doesntContain: string; + /** + * @default '{name} must contain exactly \'{ruleValue}\'' + */ + doesntContainExactly: string; + /** + * @default '{name} must be at least {ruleValue} characters' + */ + minLength: string; + /** + * @default '{name} must be at least {ruleValue} characters' + */ + length: string; + /** + * @default '{name} must be exactly {ruleValue} characters' + */ + exactLength: string; + /** + * @default '{name} cannot be longer than {ruleValue} characters' + */ + maxLength: string; + /** + * @default '{name} must match {ruleValue} field' + */ + match: string; + /** + * @default '{name} must have a different value than {ruleValue} field' + */ + different: string; + /** + * @default '{name} must be a valid credit card number' + */ + creditCard: string; + /** + * @default '{name} must have at least {ruleValue} choices' + */ + minCount: string; + /** + * @default '{name} must have exactly {ruleValue} choices' + */ + exactCount: string; + /** + * @default '{name} must have {ruleValue} or less choices' + */ + maxCount: string; + } + } + + interface TemplatesSettings extends Pick { } + + namespace TemplatesSettings { + type Param = TemplatesSettings | object; + + interface _Impl { + error(errors: string[]): JQuery; + prompt(errors: string[]): JQuery; + } + } + + interface SelectorSettings extends Pick { } + + namespace SelectorSettings { + type Param = SelectorSettings | object; + + interface _Impl { + /** + * @default '.error.message' + */ + message: string; + /** + * @default 'input, textarea, select' + */ + field: string; + /** + * @default '.field' + */ + group: string; + /** + * @default 'input' + */ + input: string; + /** + * @default '.prompt' + */ + prompt: string; + /** + * @default '.submit' + */ + submit: string; + } + } + + interface MetadataSettings extends Pick { } + + namespace MetadataSettings { + type Param = MetadataSettings | object; + + interface _Impl { + /** + * @default 'validate' + */ + validate: string; + } + } + + interface ClassNameSettings extends Pick { } + + namespace ClassNameSettings { + type Param = ClassNameSettings | object; + + interface _Impl { + /** + * @default 'active' + */ + active: string; + /** + * @default 'default' + */ + placeholder: string; + /** + * @default 'disabled' + */ + disabled: string; + /** + * @default 'visible' + */ + visible: string; + } + } + + interface ErrorSettings extends Pick { } + + namespace ErrorSettings { + type Param = ErrorSettings | object; + + interface _Impl { + /** + * @default 'The method you called is not defined.' + */ + method: string; + } + } + } +} diff --git a/types/semantic-ui-form/index.d.ts b/types/semantic-ui-form/index.d.ts new file mode 100644 index 0000000000..bf2dd88bdd --- /dev/null +++ b/types/semantic-ui-form/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for semantic-ui-form 2.2 +// Project: http://www.semantic-ui.com +// Definitions by: Leonard Thieu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// +/// + +declare const form: SemanticUI.Form; +export = form; diff --git a/types/semantic-ui-form/semantic-ui-form-tests.ts b/types/semantic-ui-form/semantic-ui-form-tests.ts new file mode 100644 index 0000000000..58e8a18f70 --- /dev/null +++ b/types/semantic-ui-form/semantic-ui-form-tests.ts @@ -0,0 +1,156 @@ +function test_form_static() { + $.fn.form.settings.error.method = 'method'; + $.fn.form.settings.namespace = 'namespace'; + $.fn.form.settings.name = 'name'; + $.fn.form.settings.silent = false; + $.fn.form.settings.debug = true; + $.fn.form.settings.performance = true; + $.fn.form.settings.verbose = true; +} + +function test_form() { + const selector = '.ui.form'; + $(selector).form('submit') === $(); + $(selector).form('is valid') === false; + $(selector).form('validate form') === $(); + $(selector).form('get change event') === 'change event'; + $(selector).form('get field', 'id') === $(); + $(selector).form('get value', 'id') === {}; + $(selector).form('get values', ['id1', 'id2']) === {}; + $(selector).form('set value', 'id') === $(); + $(selector).form('set values', ['id1', 'id2']) === $(); + $(selector).form('get validation', $()) === {}; + $(selector).form('has field', 'identifier') === true; + $(selector).form('add errors', ['error1', 'error2']) === $(); + $(selector).form('destroy') === $(); + $(selector).form('setting', 'debug', undefined) === false; + $(selector).form('setting', 'debug') === false; + $(selector).form('setting', 'debug', true) === $(); + $(selector).form('setting', { + namespace: 'namespace', + name: 'name', + silent: false, + debug: true, + performance: true, + verbose: true + }) === $(); + $(selector).form({ + keyboardShortcuts: false, + on: 'submit', + revalidate: true, + delay: 20, + inline: false, + transition: 'fade', + duration: 22, + fields: { + field1: 'field1', + field2: ['field1', 'field2'], + field3: { + identifier: 'identifier', + rules: [ + { + type: 'type', + prompt: 'prompt' + }, + { + type: 'type', + prompt: 'prompt' + } + ] + } + }, + text: { + unspecifiedRule: 'unspecifiedRule', + unspecifiedField: 'unspecifiedField' + }, + prompt: { + empty: 'empty', + checked: 'checked', + email: 'email', + url: 'url', + regExp: 'regExp', + integer: 'integer', + decimal: 'decimal', + number: 'number', + is: 'is', + isExactly: 'isExactly', + not: 'not', + notExactly: 'notExactly', + contain: 'contain', + containExactly: 'containExactly', + doesntContain: 'doesntContain', + doesntContainExactly: 'doesntContainExactly', + minLength: 'minLength', + length: 'length', + exactLength: 'exactLength', + maxLength: 'maxLength', + match: 'match', + different: 'different', + creditCard: 'creditCard', + minCount: 'minCount', + exactCount: 'exactCount', + maxCount: 'maxCount' + }, + onValid() { + this === $(); + }, + onInvalid() { + this === $(); + }, + onSuccess(event, fields) { + this === $(); + event.stopPropagation(); + fields === {}; + }, + onFailure(formErrors, fields) { + this === $(); + formErrors === []; + fields === {}; + }, + templates: { + error(errors) { + errors === []; + return $(); + }, + prompt(errors) { + errors === []; + return $(); + } + }, + rules: { + empty(value) { + return !(value === undefined || '' === value || $.isArray(value) && value.length === 0); + }, + checked() { + return ($(this).filter(':checked').length > 0); + } + }, + selector: { + message: 'message', + field: 'field', + group: 'group', + input: 'input', + prompt: 'prompt', + submit: 'submit' + }, + metadata: { + validate: 'validate' + }, + className: { + active: 'active', + placeholder: 'placeholder', + disabled: 'disabled', + visible: 'visible' + }, + error: { + method: 'method' + } + }) === $(); + $(selector).form() === $(); +} + +import form = require('semantic-ui-form'); + +function test_module() { + $.fn.form = form; +} diff --git a/types/semantic-ui-form/tsconfig.json b/types/semantic-ui-form/tsconfig.json new file mode 100644 index 0000000000..172834b107 --- /dev/null +++ b/types/semantic-ui-form/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "global.d.ts", + "semantic-ui-form-tests.ts" + ] +} diff --git a/types/semantic-ui-form/tslint.json b/types/semantic-ui-form/tslint.json new file mode 100644 index 0000000000..758e484744 --- /dev/null +++ b/types/semantic-ui-form/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false, + "unified-signatures": false + } +} From 98b385b76d86271b708d9ed0116004bfe60e2c98 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 01:31:28 +0100 Subject: [PATCH 119/761] Added MergeFileResult --- types/nodegit/index.d.ts | 1 + types/nodegit/merge-file-result.d.ts | 7 +++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 9 insertions(+) create mode 100644 types/nodegit/merge-file-result.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 4f232c4cf7..a299e9c4bf 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -19,6 +19,7 @@ export { FetchOptions } from './fetch-options'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; export { MergeFileInput } from './merge-file-input'; +export { MergeFileResult } from './merge-file-result'; export { MergeOptions } from './merge-options'; export { Merge } from './merge'; export { Note } from './note'; diff --git a/types/nodegit/merge-file-result.d.ts b/types/nodegit/merge-file-result.d.ts new file mode 100644 index 0000000000..e6f2efcc3b --- /dev/null +++ b/types/nodegit/merge-file-result.d.ts @@ -0,0 +1,7 @@ +export class MergeFileResult { + automergeable: number; + path: string; + mode: number; + ptr: string; + len: number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 32102a2de8..0e6b5c6daa 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -32,6 +32,7 @@ "index-entry.d.ts", "index.d.ts", "merge-file-input.d.ts", + "merge-file-result.d.ts", "merge-options.d.ts", "merge.d.ts", "nodegit-tests.ts", From 96568ae6e3bcf8f37d44ff2b09447fd7fc5aecec Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 01:32:50 +0100 Subject: [PATCH 120/761] Added MergeFileOptions --- types/nodegit/index.d.ts | 1 + types/nodegit/merge-file-options.d.ts | 8 ++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 10 insertions(+) create mode 100644 types/nodegit/merge-file-options.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index a299e9c4bf..a8253f700f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -19,6 +19,7 @@ export { FetchOptions } from './fetch-options'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; export { MergeFileInput } from './merge-file-input'; +export { MergeFileOptions } from './merge-file-options'; export { MergeFileResult } from './merge-file-result'; export { MergeOptions } from './merge-options'; export { Merge } from './merge'; diff --git a/types/nodegit/merge-file-options.d.ts b/types/nodegit/merge-file-options.d.ts new file mode 100644 index 0000000000..5d8233bcd6 --- /dev/null +++ b/types/nodegit/merge-file-options.d.ts @@ -0,0 +1,8 @@ +export interface MergeFileOptions { + version: number; + ancestorLabel: string; + ourLabel: string; + theirLabel: string; + favor: number; + flags: number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 0e6b5c6daa..28a3d8e30b 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -32,6 +32,7 @@ "index-entry.d.ts", "index.d.ts", "merge-file-input.d.ts", + "merge-file-options.d.ts", "merge-file-result.d.ts", "merge-options.d.ts", "merge.d.ts", From 59c7f36e1df68a33ff7dd10c20ff4e3a90ce56c1 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 01:34:38 +0100 Subject: [PATCH 121/761] Added Libgit2 --- types/nodegit/index.d.ts | 1 + types/nodegit/lib-git2.d.ts | 25 +++++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 27 insertions(+) create mode 100644 types/nodegit/lib-git2.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index a8253f700f..c9e56f125e 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -18,6 +18,7 @@ export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; +export { Libgit2 } from './lib-git2'; export { MergeFileInput } from './merge-file-input'; export { MergeFileOptions } from './merge-file-options'; export { MergeFileResult } from './merge-file-result'; diff --git a/types/nodegit/lib-git2.d.ts b/types/nodegit/lib-git2.d.ts new file mode 100644 index 0000000000..9d7f1a5281 --- /dev/null +++ b/types/nodegit/lib-git2.d.ts @@ -0,0 +1,25 @@ +export namespace Libgit2 { + enum OPT { + GET_MWINDOW_SIZE = 0, + SET_MWINDOW_SIZE = 1, + GET_MWINDOW_MAPPED_LIMIT = 2, + SET_MWINDOW_MAPPED_LIMIT = 3, + GET_SEARCH_PATH = 4, + SET_SEARCH_PATH = 5, + SET_CACHE_OBJECT_LIMIT = 6, + SET_CACHE_MAX_SIZE = 7, + ENABLE_CACHING = 8, + GET_CACHED_MEMORY = 9, + GET_TEMPLATE_PATH = 10, + SET_TEMPLATE_PATH = 11, + SET_SSL_CERT_LOCATIONS = 12 + } +} + +export class Libgit2 { + static features(): number; + static init(): number; + static opts(option: number): number; + static shutdown(): number; + static version(major: number, minor: number, rev: number): void; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 28a3d8e30b..faae7d850e 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -31,6 +31,7 @@ "fetch-options.d.ts", "index-entry.d.ts", "index.d.ts", + "lib-git2.d.ts", "merge-file-input.d.ts", "merge-file-options.d.ts", "merge-file-result.d.ts", From 498c2392a18eaf36f5b3dc0502a13fb9c2d85d71 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:14:52 +0100 Subject: [PATCH 122/761] Added Indexer --- types/nodegit/index.d.ts | 1 + types/nodegit/indexer.d.ts | 8 ++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 10 insertions(+) create mode 100644 types/nodegit/indexer.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index c9e56f125e..5539972cfb 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -18,6 +18,7 @@ export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; +export { Indexer } from './indexer'; export { Libgit2 } from './lib-git2'; export { MergeFileInput } from './merge-file-input'; export { MergeFileOptions } from './merge-file-options'; diff --git a/types/nodegit/indexer.d.ts b/types/nodegit/indexer.d.ts new file mode 100644 index 0000000000..ee3ba9bc69 --- /dev/null +++ b/types/nodegit/indexer.d.ts @@ -0,0 +1,8 @@ +import { TransferProgress } from './transfer-progress'; +import { Oid } from './oid'; + +export class Indexer { + commit(stats: TransferProgress): number; + free(): void; + hash(): Oid; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index faae7d850e..a5e147be73 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -31,6 +31,7 @@ "fetch-options.d.ts", "index-entry.d.ts", "index.d.ts", + "indexer.d.ts", "lib-git2.d.ts", "merge-file-input.d.ts", "merge-file-options.d.ts", From fa9c001d4630bfea938336a415ecb397742fab41 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:16:33 +0100 Subject: [PATCH 123/761] Changed from interface to class --- types/nodegit/index-entry.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodegit/index-entry.d.ts b/types/nodegit/index-entry.d.ts index f2ac5cad8a..b121b7a826 100644 --- a/types/nodegit/index-entry.d.ts +++ b/types/nodegit/index-entry.d.ts @@ -5,7 +5,7 @@ export interface IndexTime { nanoseconds: number; } -export interface IndexEntry { +export class IndexEntry { ctime: IndexTime; mtime: IndexTime; dev: number; From f5562c51a6103854e7977292c876fbbd1cc7c794 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:18:54 +0100 Subject: [PATCH 124/761] Added Ignore --- types/nodegit/ignore.d.ts | 7 +++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 9 insertions(+) create mode 100644 types/nodegit/ignore.d.ts diff --git a/types/nodegit/ignore.d.ts b/types/nodegit/ignore.d.ts new file mode 100644 index 0000000000..c38d84d1f3 --- /dev/null +++ b/types/nodegit/ignore.d.ts @@ -0,0 +1,7 @@ +import { Repository } from './repository'; + +export class Ignore { + static addRule(repo: Repository, rules: string): number; + static clearInternalRules(repo: Repository): number; + static pathIsIgnored(repo: Repository, path: string): Promise; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 5539972cfb..6803e441af 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -18,6 +18,7 @@ export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; +export { Ignore } from './ignore'; export { Indexer } from './indexer'; export { Libgit2 } from './lib-git2'; export { MergeFileInput } from './merge-file-input'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index a5e147be73..17fc3afa54 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "diff.d.ts", "enums.d.ts", "fetch-options.d.ts", + "ignore.d.ts", "index-entry.d.ts", "index.d.ts", "indexer.d.ts", From aa3eb7c40986b8595a33dcc04bad34f44da7b9d9 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:20:26 +0100 Subject: [PATCH 125/761] Added Hashsig --- types/nodegit/hash-sig.d.ts | 7 +++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 9 insertions(+) create mode 100644 types/nodegit/hash-sig.d.ts diff --git a/types/nodegit/hash-sig.d.ts b/types/nodegit/hash-sig.d.ts new file mode 100644 index 0000000000..7cc6a91c05 --- /dev/null +++ b/types/nodegit/hash-sig.d.ts @@ -0,0 +1,7 @@ +export class Hashsig { + static create(buf: string, buflen: number, opts: number): Promise; + static createFromFile(path: string, opts: number): Promise; + + compare(b: Hashsig): number; + free(): void; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 6803e441af..c863896f24 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -16,6 +16,7 @@ export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; +export { Hashsig } from './hash-sig'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; export { Ignore } from './ignore'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 17fc3afa54..b7d15c0739 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "diff.d.ts", "enums.d.ts", "fetch-options.d.ts", + "hash-sig.d.ts", "ignore.d.ts", "index-entry.d.ts", "index.d.ts", From 77b77136272734769a8402824c411fb2f61b0cff Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:21:08 +0100 Subject: [PATCH 126/761] Added namespace for Hashsig --- types/nodegit/hash-sig.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/nodegit/hash-sig.d.ts b/types/nodegit/hash-sig.d.ts index 7cc6a91c05..afa9bc121c 100644 --- a/types/nodegit/hash-sig.d.ts +++ b/types/nodegit/hash-sig.d.ts @@ -1,3 +1,12 @@ +export namespace Hashsig { + enum OPTION { + NORMAL = 0, + IGNORE_WHITESPACE = 1, + SMART_WHITESPACE = 2, + ALLOW_SMALL_FILES = 4 + } +} + export class Hashsig { static create(buf: string, buflen: number, opts: number): Promise; static createFromFile(path: string, opts: number): Promise; From a0ed80ee2dd0e272bd7553bde20e1607f902dd0d Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:22:30 +0100 Subject: [PATCH 127/761] Added Giterr --- types/nodegit/git-err.d.ts | 7 +++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 9 insertions(+) create mode 100644 types/nodegit/git-err.d.ts diff --git a/types/nodegit/git-err.d.ts b/types/nodegit/git-err.d.ts new file mode 100644 index 0000000000..5147e7fb3c --- /dev/null +++ b/types/nodegit/git-err.d.ts @@ -0,0 +1,7 @@ +export class Giterr { + static errClear(): void; + static errDetach(cpy: NodeGit.Error): number; + static errLast(): Error; + static errSetOom(): void; + static errSetString(error_class: number, string: string): void; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index c863896f24..b1e5219aa9 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -16,6 +16,7 @@ export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; +export { Giterr } from './git-err'; export { Hashsig } from './hash-sig'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index b7d15c0739..9ddbc87a30 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "diff.d.ts", "enums.d.ts", "fetch-options.d.ts", + "git-err.d.ts", "hash-sig.d.ts", "ignore.d.ts", "index-entry.d.ts", From 4e0dccc6e751b4126ab25489ddab155f1039ed71 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:26:29 +0100 Subject: [PATCH 128/761] Added Filter --- types/nodegit/filter.d.ts | 19 +++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 21 insertions(+) create mode 100644 types/nodegit/filter.d.ts diff --git a/types/nodegit/filter.d.ts b/types/nodegit/filter.d.ts new file mode 100644 index 0000000000..391ab00456 --- /dev/null +++ b/types/nodegit/filter.d.ts @@ -0,0 +1,19 @@ +import { Repository } from './repository'; +import { Blob } from './blob'; +import { Buf } from './buf'; + +export class Filter { + static listContains(filters: any, name: string): number; + static listLength(fl: any): number; + static listNew(repo: Repository, mode: number, options: number): Promise; + static listStreamBlob(filters: any, blob: Blob, target: Writestream): number; + static listStreamData(filters: any, data: Buf, target: Writestream): number; + static listStreamFile(filters: any, repo: Repository, path: string, target: Writestream): number; + static unregister(name: string): number; + + lookup(name: string): Filter; + register(name: string, priority: number): number; + version: number; + attributes: string; + stream: Function; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index b1e5219aa9..c1ece4a753 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -16,6 +16,7 @@ export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; +export { Filter } from './filter'; export { Giterr } from './git-err'; export { Hashsig } from './hash-sig'; export { Index } from './index_'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 9ddbc87a30..9ff8fdea93 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "diff.d.ts", "enums.d.ts", "fetch-options.d.ts", + "filter.d.ts", "git-err.d.ts", "hash-sig.d.ts", "ignore.d.ts", From bb108937c7faa215dba04fea8d65f7a6741faa4c Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:26:38 +0100 Subject: [PATCH 129/761] Added semi-colon --- types/nodegit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index c1ece4a753..3a6aef1423 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -44,7 +44,7 @@ export { Push } from './push'; export { RebaseOperation } from './rebase-operation'; export { Rebase, RebaseOptions } from './rebase'; export { Refdb } from './ref-db'; -export { Reflog, ReflogEntry } from './ref-log' +export { Reflog, ReflogEntry } from './ref-log'; export { Refspec } from './ref-spec'; export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; From a7d31d8d6b0ced066bb516ccc2109e25c1a8c208 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:27:13 +0100 Subject: [PATCH 130/761] Added namespace to Filter --- types/nodegit/filter.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/types/nodegit/filter.d.ts b/types/nodegit/filter.d.ts index 391ab00456..aedc0dbd6f 100644 --- a/types/nodegit/filter.d.ts +++ b/types/nodegit/filter.d.ts @@ -2,6 +2,20 @@ import { Repository } from './repository'; import { Blob } from './blob'; import { Buf } from './buf'; +export namespace Filter { + enum FLAG { + DEFAULT = 0, + ALLOW_UNSAFE = 1 + } + + enum MODE { + TO_WORKTREE = 0, + SMUDGE = 0, + TO_ODB = 1, + CLEAN = 1 + } +} + export class Filter { static listContains(filters: any, name: string): number; static listLength(fl: any): number; From 27d38b770f9fe26386ac4560fa9d175349cb97cd Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:28:47 +0100 Subject: [PATCH 131/761] Added Error --- types/nodegit/error.d.ts | 68 +++++++++++++++++++++++++++++++++++++ types/nodegit/git-err.d.ts | 4 ++- types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 types/nodegit/error.d.ts diff --git a/types/nodegit/error.d.ts b/types/nodegit/error.d.ts new file mode 100644 index 0000000000..e1267c082b --- /dev/null +++ b/types/nodegit/error.d.ts @@ -0,0 +1,68 @@ +export namespace Error { + enum ERROR { + GITERR_NONE = 0, + GITERR_NOMEMORY = 1, + GITERR_OS = 2, + GITERR_INVALID = 3, + GITERR_REFERENCE = 4, + GITERR_ZLIB = 5, + GITERR_REPOSITORY = 6, + GITERR_CONFIG = 7, + GITERR_REGEX = 8, + GITERR_ODB = 9, + GITERR_INDEX = 10, + GITERR_OBJECT = 11, + GITERR_NET = 12, + GITERR_TAG = 13, + GITERR_TREE = 14, + GITERR_INDEXER = 15, + GITERR_SSL = 16, + GITERR_SUBMODULE = 17, + GITERR_THREAD = 18, + GITERR_STASH = 19, + GITERR_CHECKOUT = 20, + GITERR_FETCHHEAD = 21, + GITERR_MERGE = 22, + GITERR_SSH = 23, + GITERR_FILTER = 24, + GITERR_REVERT = 25, + GITERR_CALLBACK = 26, + GITERR_CHERRYPICK = 27, + GITERR_DESCRIBE = 28, + GITERR_REBASE = 29, + GITERR_FILESYSTEM = 30 + } + + enum CODE { + OK = 0, + ERROR = -1, + ENOTFOUND = -3, + EEXISTS = -4, + EAMBIGUOUS = -5, + EBUFS = -6, + EUSER = -7, + EBAREREPO = -8, + EUNBORNBRANCH = -9, + EUNMERGED = -10, + ENONFASTFORWARD = -11, + EINVALIDSPEC = -12, + ECONFLICT = -13, + ELOCKED = -14, + EMODIFIED = -15, + EAUTH = -16, + ECERTIFICATE = -17, + EAPPLIED = -18, + EPEEL = -19, + EEOF = -20, + EINVALID = -21, + EUNCOMMITTED = -22, + EDIRECTORY = -23, + PASSTHROUGH = -30, + ITEROVER = -31 + } +} + +export class Error { + message: string; + klass: number; +} diff --git a/types/nodegit/git-err.d.ts b/types/nodegit/git-err.d.ts index 5147e7fb3c..6a9da24bb3 100644 --- a/types/nodegit/git-err.d.ts +++ b/types/nodegit/git-err.d.ts @@ -1,6 +1,8 @@ +import { Error } from './error'; + export class Giterr { static errClear(): void; - static errDetach(cpy: NodeGit.Error): number; + static errDetach(cpy: Error): number; static errLast(): Error; static errSetOom(): void; static errSetString(error_class: number, string: string): void; diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 3a6aef1423..df1b2c1f20 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -15,6 +15,7 @@ export { DiffFile } from './diff-file'; export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; +export { Error } from './error'; export { FetchOptions } from './fetch-options'; export { Filter } from './filter'; export { Giterr } from './git-err'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 9ff8fdea93..21d56ac954 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -28,6 +28,7 @@ "diff-perf-data.d.ts", "diff.d.ts", "enums.d.ts", + "error.d.ts", "fetch-options.d.ts", "filter.d.ts", "git-err.d.ts", From df90245f9953ecf2a7bf3bd48d7117b6295ef619 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:30:05 +0100 Subject: [PATCH 132/761] Added Fetch --- types/nodegit/fetch.d.ts | 13 +++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 15 insertions(+) create mode 100644 types/nodegit/fetch.d.ts diff --git a/types/nodegit/fetch.d.ts b/types/nodegit/fetch.d.ts new file mode 100644 index 0000000000..2e71097ba3 --- /dev/null +++ b/types/nodegit/fetch.d.ts @@ -0,0 +1,13 @@ +import { FetchOptions } from './fetch-options'; + +export namespace Fetch { + enum PRUNE { + GIT_FETCH_PRUNE_UNSPECIFIED = 0, + GIT_FETCH_PRUNE = 1, + GIT_FETCH_NO_PRUNE = 2 + } +} + +export class Fetch { + static initOptions(opts: FetchOptions, version: number): number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index df1b2c1f20..ab802f0246 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -17,6 +17,7 @@ export { Diff } from './diff'; export { Enums } from './enums'; export { Error } from './error'; export { FetchOptions } from './fetch-options'; +export { Fetch } from './fetch'; export { Filter } from './filter'; export { Giterr } from './git-err'; export { Hashsig } from './hash-sig'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 21d56ac954..e97659918d 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -30,6 +30,7 @@ "enums.d.ts", "error.d.ts", "fetch-options.d.ts", + "fetch.d.ts", "filter.d.ts", "git-err.d.ts", "hash-sig.d.ts", From 7d5307d0ec3d2340ac75b7a066a86ffc31986dce Mon Sep 17 00:00:00 2001 From: flushentitypacket Date: Tue, 6 Jun 2017 21:31:41 -0400 Subject: [PATCH 133/761] Export as `export = moxios` to match the moxios package export. (#16913) --- types/moxios/index.d.ts | 2 +- types/moxios/moxios-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/moxios/index.d.ts b/types/moxios/index.d.ts index d3d6dd5b51..94756158c9 100644 --- a/types/moxios/index.d.ts +++ b/types/moxios/index.d.ts @@ -189,4 +189,4 @@ declare let moxios: { wait(fn: () => void, delay?: number): void; }; -export default moxios; +export = moxios; diff --git a/types/moxios/moxios-tests.ts b/types/moxios/moxios-tests.ts index 82ceb8535b..0e6820d287 100644 --- a/types/moxios/moxios-tests.ts +++ b/types/moxios/moxios-tests.ts @@ -1,7 +1,7 @@ // from https://github.com/mzabriskie/moxios/blob/master/test.js import {equal, notEqual, deepEqual} from 'power-assert'; // compatible with 'assert'; import axios from 'axios'; -import moxios from 'moxios'; +import * as moxios from 'moxios'; declare const sinon: any; declare const describe: any; From a4d567c6bc4611f5aef76b5b7b9da3d7a75a0439 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:31:43 +0100 Subject: [PATCH 134/761] Added Graph --- types/nodegit/graph.d.ts | 7 +++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 9 insertions(+) create mode 100644 types/nodegit/graph.d.ts diff --git a/types/nodegit/graph.d.ts b/types/nodegit/graph.d.ts new file mode 100644 index 0000000000..d16d7b5dee --- /dev/null +++ b/types/nodegit/graph.d.ts @@ -0,0 +1,7 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; + +export class Graph { + static aheadBehind(repo: Repository, local: Oid, upstream: Oid): Promise; + static descendantOf(repo: Repository, commit: Oid, ancestor: Oid): Promise; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index ab802f0246..bce68c89da 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -20,6 +20,7 @@ export { FetchOptions } from './fetch-options'; export { Fetch } from './fetch'; export { Filter } from './filter'; export { Giterr } from './git-err'; +export { Graph } from './graph'; export { Hashsig } from './hash-sig'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index e97659918d..6ae8a96742 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -33,6 +33,7 @@ "fetch.d.ts", "filter.d.ts", "git-err.d.ts", + "graph.d.ts", "hash-sig.d.ts", "ignore.d.ts", "index-entry.d.ts", From dbc4d532424fa5728793fee6022638b2e10ddd74 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:33:31 +0100 Subject: [PATCH 135/761] Added DiffOptions --- types/nodegit/diff-options.d.ts | 16 ++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 18 insertions(+) create mode 100644 types/nodegit/diff-options.d.ts diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts new file mode 100644 index 0000000000..e78de28aac --- /dev/null +++ b/types/nodegit/diff-options.d.ts @@ -0,0 +1,16 @@ +import { Strarray } from './str-array'; + +export interface DiffOptions { + version: number; + flags: number; + ignoreSubmodules: number; + pathspec: Strarray; + notifyCb: Function; + notifyPayload: void; + contextLines: number; + interhunkLines: number; + idAbbrev: number; + maxSize: number; + oldPrefix: string; + newPrefix: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index bce68c89da..bcafde5c65 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -12,6 +12,7 @@ export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; +export { DiffOptions } from './diff-options'; export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 6ae8a96742..65a9de572d 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -25,6 +25,7 @@ "convenient-patch.d.ts", "diff-delta.d.ts", "diff-file.d.ts", + "diff-options.d.ts", "diff-perf-data.d.ts", "diff.d.ts", "enums.d.ts", From de7e279831066413ec9401911f0afd5f5dbc9305 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:34:30 +0100 Subject: [PATCH 136/761] Added DiffLine --- types/nodegit/diff-line.d.ts | 9 +++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 11 insertions(+) create mode 100644 types/nodegit/diff-line.d.ts diff --git a/types/nodegit/diff-line.d.ts b/types/nodegit/diff-line.d.ts new file mode 100644 index 0000000000..587653b09f --- /dev/null +++ b/types/nodegit/diff-line.d.ts @@ -0,0 +1,9 @@ +export class DiffLine { + content(): string; + origin: number; + oldLineno: number; + newLineno: number; + numLines: number; + contentLen: number; + contentOffset: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index bcafde5c65..3001fef55c 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -12,6 +12,7 @@ export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; +export { DiffLine } from './diff-line'; export { DiffOptions } from './diff-options'; export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 65a9de572d..82a4c1c2f2 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -25,6 +25,7 @@ "convenient-patch.d.ts", "diff-delta.d.ts", "diff-file.d.ts", + "diff-line.d.ts", "diff-options.d.ts", "diff-perf-data.d.ts", "diff.d.ts", From ac1db88fa889b1780d33c3f1ba2a46d6f021546c Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 6 Jun 2017 21:36:00 -0400 Subject: [PATCH 137/761] [semantic-ui] Update type definitions. Depend on modules. --- types/semantic-ui/index.d.ts | 5601 +----------------------- types/semantic-ui/semantic-ui-tests.ts | 492 +-- types/semantic-ui/tslint.json | 2 +- 3 files changed, 69 insertions(+), 6026 deletions(-) diff --git a/types/semantic-ui/index.d.ts b/types/semantic-ui/index.d.ts index b069899b69..e36ff8c748 100644 --- a/types/semantic-ui/index.d.ts +++ b/types/semantic-ui/index.d.ts @@ -2,5584 +2,29 @@ // Project: http://semantic-ui.com/ // Definitions by: Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.2 /// -interface JQueryStatic { - site: SemanticUI.Site; - - api: SemanticUI.Api; -} - -interface JQuery { - site: SemanticUI.Site; - - accordion: SemanticUI.Accordion; - checkbox: SemanticUI.Checkbox; - dimmer: SemanticUI.Dimmer; - dropdown: SemanticUI.Dropdown; - embed: SemanticUI.Embed; - modal: SemanticUI.Modal; - nag: SemanticUI.Nag; - popup: SemanticUI.Popup; - progress: SemanticUI.Progress; - rating: SemanticUI.Rating; - search: SemanticUI.Search; - shape: SemanticUI.Shape; - sidebar: SemanticUI.Sidebar; - sticky: SemanticUI.Sticky; - tab: SemanticUI.Tab; - transition: SemanticUI.Transition; - - api: SemanticUI.Api; - form: SemanticUI.Form; - visibility: SemanticUI.Visibility; -} - -declare namespace SemanticUI { - type Selector = string | JQuery; - - /** - * These settings are native to all modules, and define how the component ties content to DOM attributes, and debugging settings for the module. - */ - interface ComponentSettings { - // region DOM Settings - - /** - * Event namespace. Makes sure module teardown does not effect other events attached to an element. - */ - namespace?: string; - - // endregion - - // region Debug Settings - - /** - * Name used in log statements - */ - name?: string; - /** - * Silences all console output including error messages, regardless of other debug settings. - */ - silent?: boolean; - /** - * Debug output to console - */ - debug?: boolean; - /** - * Show console.table output with performance metrics - */ - performance?: boolean; - /** - * Debug output includes all internal behaviors - */ - verbose?: boolean; - - // endregion - } - - // region Globals - - // region Site - - interface Site { - settings: SiteSettings; - - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): SiteSettings[K]; - (behavior: 'setting', name: K, value: SiteSettings[K]): JQuery; - (behavior: 'setting', value: SiteSettings): JQuery; - (settings?: SiteSettings): JQuery; - } - - interface SiteSettings extends ComponentSettings { - modules?: string[]; - siteNamespace?: string; - namespaceStub?: { - cache?: any; - config?: any; - sections?: any; - section?: any; - utilities?: any; - }; - } - - // endregion - - // endregion - - // region Modules - - // region Accordion - - interface Accordion { - settings: AccordionSettings; - - /** - * Refreshes all cached selectors and data - */ - (behavior: 'refresh'): JQuery; - /** - * Opens accordion content at index - */ - (behavior: 'open', index: number): JQuery; - /** - * Closes accordion content that are not active - */ - (behavior: 'close others'): JQuery; - /** - * Closes accordion content at index - */ - (behavior: 'close', index: number): JQuery; - /** - * Toggles accordion content at index - */ - (behavior: 'toggle', index: number): JQuery; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): AccordionSettings[K]; - (behavior: 'setting', name: K, value: AccordionSettings[K]): JQuery; - (behavior: 'setting', value: AccordionSettings): JQuery; - (settings?: AccordionSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/accordion.html#/settings} - */ - interface AccordionSettings extends ComponentSettings { - // region Behavior - - /** - * Only allow one section open at a time - * - * @default true - */ - exclusive?: boolean; - /** - * Event on title that will cause accordion to open - * - * @default 'click' - */ - on?: string; - /** - * Whether child content opacity should be animated (may cause performance issues with many child elements) - * - * @default true - */ - animateChildren?: boolean; - /** - * Close open nested accordion content when an element closes - * - * @default true - */ - closeNested?: boolean; - /** - * Allow active sections to collapse - * - * @default true - */ - collapsible?: boolean; - /** - * Duration in ms of opening animation - * - * @default 500 - */ - duration?: number; - /** - * Easing of opening animation. EaseInOutQuint is included with accordion, for additional options you must include easing equations. - * - * @default 'easeInOutQuint' - * @see {@link http://gsgd.co.uk/sandbox/jquery/easing/} - */ - easing?: string; - /** - * whether accordion should automatically refresh on DOM insertion - * - * @default true - */ - observeChanges?: boolean; - - // endregion - - // region Callbacks - - /** - * Callback before element opens - */ - onOpening?(this: JQuery): void; - /** - * Callback after element is open - */ - onOpen?(this: JQuery): void; - /** - * Callback before element closes - */ - onClosing?(this: JQuery): void; - /** - * Callback after element is closed - */ - onClose?(this: JQuery): void; - /** - * Callback on element open or close - */ - onChange?(this: JQuery): void; - - // endregion - - // region DOM Settings - - /** - * Selectors used to find parts of a module - */ - selector?: { - /** - * @default '.accordion' - */ - accordion?: string; - /** - * @default '.title' - */ - title?: string; - /** - * @default '.title' - */ - trigger?: string; - /** - * @default '.content' - */ - content?: string; - }; - /** - * Class names used to determine element state - */ - className?: { - /** - * @default 'active' - */ - active?: string; - /** - * @default 'animating' - */ - animating?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'The method you called is not defined.' - */ - method?: string; - }; - - // endregion - } - - // endregion - - // region Checkbox - - interface Checkbox { - settings: CheckboxSettings; - - /** - * Switches a checkbox from current state - */ - (behavior: 'toggle'): JQuery; - /** - * Set a checkbox state to checked - */ - (behavior: 'check'): JQuery; - /** - * Set a checkbox state to unchecked - */ - (behavior: 'uncheck'): JQuery; - /** - * Set as indeterminate checkbox - */ - (behavior: 'indeterminate'): JQuery; - /** - * Set as determinate checkbox - */ - (behavior: 'determinate'): JQuery; - /** - * Enable interaction with a checkbox - */ - (behavior: 'enable'): JQuery; - /** - * Set a checkbox state to checked without callbacks - */ - (behavior: 'set checked'): JQuery; - /** - * Set a checkbox state to unchecked without callbacks - */ - (behavior: 'set unchecked'): JQuery; - /** - * Set as indeterminate checkbox without callbacks - */ - (behavior: 'set indeterminate'): JQuery; - /** - * Set as determinate checkbox without callbacks - */ - (behavior: 'set determinate'): JQuery; - /** - * Enable interaction with a checkbox without callbacks - */ - (behavior: 'set enabled'): JQuery; - /** - * Disable interaction with a checkbox without callbacks - */ - (behavior: 'set disabled'): JQuery; - /** - * Attach checkbox events to another element - */ - (behavior: 'attach events', selector: Selector, event?: string): JQuery; - /** - * Returns whether element is radio selection - */ - (behavior: 'is radio'): boolean; - /** - * Returns whether element is currently checked - */ - (behavior: 'is checked'): boolean; - /** - * Returns whether element is not checked - */ - (behavior: 'is unchecked'): boolean; - /** - * Returns whether element is able to be changed - */ - (behavior: 'can change'): boolean; - /** - * Returns whether element can be checked (checking if already checked or `beforeChecked` would cancel) - */ - (behavior: 'should allow check'): boolean; - /** - * Returns whether element can be unchecked (checking if already unchecked or `beforeUnchecked` would cancel) - */ - (behavior: 'should allow uncheck'): boolean; - /** - * Returns whether element can be determinate (checking if already determinate or `beforeDeterminate` would cancel) - */ - (behavior: 'should allow determinate'): boolean; - /** - * Returns whether element can be indeterminate (checking if already indeterminate or `beforeIndeterminate` would cancel) - */ - (behavior: 'should allow indeterminate'): boolean; - /** - * Returns whether element is able to be unchecked - */ - (behavior: 'can uncheck'): boolean; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): CheckboxSettings[K]; - (behavior: 'setting', name: K, value: CheckboxSettings[K]): JQuery; - (behavior: 'setting', value: CheckboxSettings): JQuery; - (settings?: CheckboxSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/checkbox.html#/settings} - */ - interface CheckboxSettings extends ComponentSettings { - // region Behavior - - /** - * Setting to true/false will determine whether an input will allow no selection. Auto will set disallow this behavior only for radio boxes - * - * @default 'auto' - */ - uncheckable?: 'auto' | boolean; - /** - * Whether callbacks for checked status should be fired on init as well as change - * - * @default false - */ - fireOnInit?: boolean; - - // endregion - - // region Callbacks - - /** - * Callback after a checkbox is either checked or unchecked. - */ - onChange?(this: HTMLElement): void; - /** - * Callback after a checkbox is checked. - */ - onChecked?(this: HTMLElement): void; - /** - * Callback after a checkbox is set to undeterminate. - */ - onIndeterminate?(this: HTMLElement): void; - /** - * Callback after a checkbox is set to determinate. - */ - onDeterminate?(this: HTMLElement): void; - /** - * Callback after a checkbox is unchecked. - */ - onUnchecked?(this: HTMLElement): void; - /** - * Callback before a checkbox is checked. Can cancel change by returning false - */ - beforeChecked?(this: HTMLElement): boolean; - /** - * Callback before a checkbox is set to undeterminate. Can cancel change by returning false - */ - beforeIndeterminate?(this: HTMLElement): boolean; - /** - * Callback before a checkbox is set to determinate. Can cancel change by returning false - */ - beforeDeterminate?(this: HTMLElement): boolean; - /** - * Callback before a checkbox is unchecked. Can cancel change by returning false - */ - beforeUnchecked?(this: HTMLElement): boolean; - /** - * Callback after a checkbox is enabled. - */ - onEnable?(this: HTMLElement): void; - /** - * Callback after a checkbox is disabled. - */ - onDisable?(this: HTMLElement): void; - /** - * Callback after a checkbox is enabled. - * - * @deprecated - */ - onEnabled?(this: HTMLElement): void; - /** - * Callback after a checkbox is disabled. - * - * @deprecated - */ - onDisabled?(this: HTMLElement): void; - - // endregion - - // region DOM Settings - - /** - * Selectors used to find parts of a module - */ - selector?: { - /** - * @default 'input[type=checkbox], input[type=radio]' - */ - input?: string; - /** - * @default 'label' - */ - label?: string; - }; - /** - * Class names used to determine element state - */ - className?: { - /** - * @default 'checked' - */ - checked?: string; - /** - * @default 'disabled' - */ - disabled?: string; - /** - * @default 'radio' - */ - radio?: string; - /** - * @default 'read-only' - */ - readOnly?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'The method you called is not defined.' - */ - method?: string; - }; - - // endregion - } - - // endregion - - // region Dimmer - - interface Dimmer { - settings: DimmerSettings; - - /** - * Detaches a given element from DOM and reattaches element inside dimmer - */ - (behavior: 'add content', element: Selector): JQuery; - /** - * Shows dimmer - */ - (behavior: 'show'): JQuery; - /** - * Hides dimmer - */ - (behavior: 'hide'): JQuery; - /** - * Toggles current dimmer visibility - */ - (behavior: 'toggle'): JQuery; - /** - * Changes dimmer opacity - */ - (behavior: 'set opacity', opacity: number): JQuery; - /** - * Creates a new dimmer in dimmable context - */ - (behavior: 'create'): JQuery; - /** - * Returns current duration for show or hide event depending on current visibility - */ - (behavior: 'get duration'): number; - /** - * Returns DOM element for dimmer - */ - (behavior: 'get dimmer'): JQuery; - /** - * Returns whether current dimmable has a dimmer - */ - (behavior: 'has dimmer'): boolean; - /** - * Whether section's dimmer is active - */ - (behavior: 'is active'): boolean; - /** - * Whether dimmer is animating - */ - (behavior: 'is animating'): boolean; - /** - * Whether current element is a dimmer - */ - (behavior: 'is dimmer'): boolean; - /** - * Whether current element is a dimmable section - */ - (behavior: 'is dimmable'): boolean; - /** - * Whether dimmer is disabled - */ - (behavior: 'is disabled'): boolean; - /** - * Whether dimmer is not disabled - */ - (behavior: 'is enabled'): boolean; - /** - * Whether dimmable section is body - */ - (behavior: 'is page'): boolean; - /** - * Whether dimmer is a page dimmer - */ - (behavior: 'is page dimmer'): boolean; - /** - * Sets page dimmer to active - */ - (behavior: 'set active'): JQuery; - /** - * Sets an element as a dimmable section - */ - (behavior: 'set dimmable'): JQuery; - /** - * Sets a dimmable section as dimmed - */ - (behavior: 'set dimmed'): JQuery; - /** - * Sets current dimmer as a page dimmer - */ - (behavior: 'set page dimmer'): JQuery; - /** - * Sets a dimmer as disabled - */ - (behavior: 'set disabled'): JQuery; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): DimmerSettings[K]; - (behavior: 'setting', name: K, value: DimmerSettings[K]): JQuery; - (behavior: 'setting', value: DimmerSettings): JQuery; - (settings?: DimmerSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/dimmer.html#/settings} - */ - interface DimmerSettings extends ComponentSettings { - // region Behavior - - /** - * Dimmers opacity from 0-1. Defaults to auto which uses the CSS specified opacity. - * - * @default 'auto' - */ - opacity?: 'auto' | number; - /** - * Specify a variation to add when generating dimmer, like inverted - * - * @default false - */ - variation?: false | string; - /** - * If initializing a dimmer on a dimmable context, you can use dimmerName to distinguish between multiple dimmers in that context. - * - * @default false - */ - dimmerName?: false | string; - /** - * Whether clicking on the dimmer should hide the dimmer (Defaults to auto, closable only when settings.on is not hover - * - * @default 'auto' - */ - closable?: 'auto' | boolean; - /** - * Can be set to hover or click to show/hide dimmer on dimmable event - * - * @default false - */ - on?: false | 'hover' | 'click'; - /** - * Whether to dim dimmers using CSS transitions. - * - * @default true - */ - useCSS?: boolean; - /** - * Animation duration of dimming. If an integer is used, that value will apply to both show and hide animations. - */ - duration?: number | { - /** - * @default 500 - */ - show?: number; - /** - * @default 500 - */ - hide?: number; - }; - /** - * Named transition to use when animating menu in and out. Fade and slide down are available without including ui transitions - * - * @default 'fade' - * @see {@link http://semantic-ui.com/modules/transition.html} - */ - transition?: string; - - // endregion - - // region Callbacks - - /** - * Callback on element show - */ - onShow?(this: JQuery): void; - /** - * Callback on element hide - */ - onHide?(this: JQuery): void; - /** - * Callback on element show or hide - */ - onChange?(this: JQuery): void; - - // endregion - - // region DOM Settings - - /** - * Object containing selectors used by module. - */ - selector?: { - /** - * @default '.dimmable' - */ - dimmable?: string; - /** - * @default '.ui.dimmer' - */ - dimmer?: string; - /** - * @default '.ui.dimmer > .content, .ui.dimmer > .content > .center' - */ - content?: string; - }; - /** - * Templates used to generate dimmer content - */ - template?: { - dimmer?(): JQuery; - }; - /** - * Class names used to attach style to state - */ - className?: { - /** - * @default 'active' - */ - active?: string; - /** - * @default 'dimmable' - */ - dimmable?: string; - /** - * @default 'dimmed' - */ - dimmed?: string; - /** - * @default 'disabled' - */ - disabled?: string; - /** - * @default 'page' - */ - pageDimmer?: string; - /** - * @default 'hide' - */ - hide?: string; - /** - * @default 'show' - */ - show?: string; - /** - * @default 'transition' - */ - transition?: string; - }; - - // endregion - - // region Debug Settings - - /** - * Error messages displayed to console - */ - error?: { - /** - * @default 'The method you called is not defined.' - */ - method?: string; - }; - - // endregion - } - - // endregion - - // region Dropdown - - // TODO: Should 'value'/'values' parameters be of type 'string' instead of 'any'? - - interface Dropdown { - settings: DropdownSettings; - - /** - * Recreates dropdown menu from select option values. - */ - (behavior: 'setup menu'): JQuery; - /** - * Refreshes all cached selectors and data - */ - (behavior: 'refresh'): JQuery; - /** - * Toggles current visibility of dropdown - */ - (behavior: 'toggle'): JQuery; - /** - * Shows dropdown - */ - (behavior: 'show'): JQuery; - /** - * Hides dropdown - */ - (behavior: 'hide'): JQuery; - /** - * Clears dropdown of selection - */ - (behavior: 'clear'): JQuery; - /** - * Hides all other dropdowns that is not current dropdown - */ - (behavior: 'hide others'): JQuery; - /** - * Restores dropdown text and value to its value on page load - */ - (behavior: 'restore defaults'): JQuery; - /** - * Restores dropdown text to its value on page load - */ - (behavior: 'restore default text'): JQuery; - /** - * Restores dropdown text to its prompt, placeholder text - */ - (behavior: 'restore placeholder text'): JQuery; - /** - * Restores dropdown value to its value on page load - */ - (behavior: 'restore default value'): JQuery; - /** - * Saves current text and value as new defaults (for use with restore) - */ - (behavior: 'save defaults'): JQuery; - /** - * Sets value as selected - */ - (behavior: 'set selected', value: any): JQuery; - /** - * Remove value from selected - */ - (behavior: 'remove selected', value: any): JQuery; - /** - * Adds a group of values as selected - */ - (behavior: 'set selected', values: any[]): JQuery; - /** - * Sets selected values to exactly specified values, removing current selection - */ - (behavior: 'set exactly', values: any[]): JQuery; - /** - * Sets dropdown text to a value - */ - (behavior: 'set text', text: string): JQuery; - /** - * Sets dropdown input to value (does not update display state) - */ - (behavior: 'set value', value: any): JQuery; - /** - * Returns current dropdown text - */ - (behavior: 'get text'): string; - /** - * Returns current dropdown input value - */ - (behavior: 'get value'): any; - /** - * Returns DOM element that matches a given input value - */ - (behavior: 'get item', value: any): JQuery; - /** - * Adds touch events to element - */ - (behavior: 'bind touch events'): JQuery; - /** - * Adds mouse events to element - */ - (behavior: 'bind mouse events'): JQuery; - /** - * Binds a click to document to determine if you click away from a dropdown - */ - (behavior: 'bind intent'): JQuery; - /** - * Unbinds document intent click - */ - (behavior: 'unbind intent'): JQuery; - /** - * Returns whether event occurred inside dropdown - */ - (behavior: 'determine intent'): boolean; - /** - * Triggers preset item selection action based on settings passing text/value - */ - (behavior: 'determine select action', text: string, value: any): JQuery; - /** - * Sets dropdown to active state - */ - (behavior: 'set active'): JQuery; - /** - * Sets dropdown to visible state - */ - (behavior: 'set visible'): JQuery; - /** - * Removes dropdown active state - */ - (behavior: 'remove active'): JQuery; - /** - * Removes dropdown visible state - */ - (behavior: 'remove visible'): JQuery; - /** - * Returns whether dropdown is a selection dropdown - */ - (behavior: 'is selection'): boolean; - /** - * Returns whether dropdown is animated - */ - (behavior: 'is animated'): boolean; - /** - * Returns whether dropdown is visible - */ - (behavior: 'is visible'): boolean; - /** - * Returns whether dropdown is hidden - */ - (behavior: 'is hidden'): boolean; - /** - * Returns dropdown value as set on page load - */ - (behavior: 'get default text'): string; - /** - * Returns placeholder text - */ - (behavior: 'get placeholder text'): string; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): DropdownSettings[K]; - (behavior: 'setting', name: K, value: DropdownSettings[K]): JQuery; - (behavior: 'setting', value: DropdownSettings): JQuery; - (settings?: DropdownSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/dropdown.html#/settings} - */ - interface DropdownSettings extends ComponentSettings { - // region Frequently Used Settings - - /** - * Event used to trigger dropdown (Hover, Click, Custom Event) - * - * @default 'click' - */ - on?: string; - /** - * When set to true will fire onChange even when the value a user select matches the currently selected value. - * - * @default false - */ - allowReselection?: boolean; - /** - * Whether search selection should allow users to add their own selections, works for single or multi-select. - * - * @default false - */ - allowAdditions?: boolean; - /** - * When disabled user additions will appear in the results menu using a specially formatted selection item formatted by templates.addition. - * - * @default true - */ - hideAdditions?: boolean; - /** - * Sets a default action to occur. (See usage guide) - * - * @default 'activate' - * @see {@link http://semantic-ui.com/modules/dropdown.html#/usage} - */ - action?: 'activate' | 'select' | 'combo' | 'nothing' | 'hide' | ((this: JQuery, text: string, value: string | false, element: JQuery) => void); - /** - * The minimum characters for a search to begin showing results - * - * @default 1 - */ - minCharacters?: number; - /** - * When using search selection specifies how to match values. - * - * @default 'both' - */ - match?: 'both' | 'value' | 'text'; - /** - * Whether dropdown should select new option when using keyboard shortcuts. Setting to false will require enter or left click to confirm a choice. - * - * @default true - */ - selectOnKeydown?: boolean; - /** - * Whether search selection will force currently selected choice when element is blurred. - * - * @default true - */ - forceSelection?: boolean; - /** - * Whether menu items with sub-menus (categories) should be selectable - * - * @default false - */ - allowCategorySelection?: boolean; - /** - * @default 'auto' - */ - placeholder?: 'auto' | 'value' | false; - - // endregion - - // region Remote Settings - - /** - * Can be set to an object to specify API settings for retrieving remote selection menu content from an API endpoint - * - * @default false - * @see {@link http://semantic-ui.com/behaviors/api.html} - */ - apiSettings?: false | ApiSettings; - /** - * List mapping dropdown content to JSON Property when using API - */ - fields?: { - /** - * grouping for api results - * - * @default 'results' - */ - remoteValues?: string; - /** - * grouping for all dropdown values - * - * @default 'values' - */ - values?: string; - /** - * displayed dropdown text - * - * @default 'name' - */ - name?: string; - /** - * actual dropdown value - * - * @default 'value' - */ - value?: string; - }; - /** - * When enabled will automatically store selected name/value pairs in sessionStorage to preserve user selection on page refresh. Disabling will clear remote dropdown values on refresh. - * - * @default true - */ - saveRemoteData?: boolean; - /** - * When set to true API will be expected to return the complete result set, which will then be filtered clientside to only display matching results. - * - * @default false - * @since 2.2.8 - */ - filterRemoteData?: boolean; - - // endregion - - // region Multiple Select Settings - - /** - * Whether multiselect should use labels. Must be set to true when allowAdditions is true - * - * @default true - */ - useLabels?: boolean; - /** - * When set to a number, sets the maximum number of selections - * - * @default false - */ - maxSelections?: boolean; - /** - * Maximum glyph width, used to calculate search size. This is usually size of a "W" in your font in em - * - * @default 1.0714 - */ - glyphWidth?: number; - /** - * Allows customization of multi-select labels - */ - label?: { - /** - * @default 'horizontal flip' - */ - transition?: string; - /** - * @default 200 - */ - duration?: number; - /** - * @default false - */ - variation?: false | string; - }; - - // endregion - - // region Additional Settings - - /** - * When set to auto determines direction based on whether dropdown can fit on screen. Set to upward or downward to always force a direction. - * - * @default 'auto' - */ - direction?: 'auto' | 'upward' | 'downward'; - /** - * Whether dropdown should try to keep itself on screen by checking whether menus display position in its context (Default context is page). - * - * @default true - */ - keepOnScreen?: boolean; - /** - * Element context to use when checking whether can show when keepOnScreen: true - * - * @default 'window' - */ - context?: Selector; - /** - * Specifying to "true" will use a fuzzy full text search, setting to "exact" will force the exact search to be matched somewhere in the string - * - * @default false - */ - fullTextSearch?: boolean | 'exact'; - /** - * Whether HTML included in dropdown values should be preserved. (Allows icons to show up in selected value) - * - * @default true - */ - preserveHTML?: boolean; - /** - * Whether to sort values when creating a dropdown automatically from a select element. - * - * @default false - */ - sortSelect?: boolean; - /** - * Whether to show dropdown menu automatically on element focus. - * - * @default true - */ - showOnFocus?: boolean; - /** - * Whether to allow the element to be navigable by keyboard, by automatically creating a tabindex - * - * @default true - */ - allowTab?: boolean; - /** - * Named transition to use when animating menu in and out. - * Defaults to slide down or slide up depending on dropdown direction. - * Fade and slide down are available without including ui transitions - * - * @default 'auto' - * @see {@link http://semantic-ui.com/modules/transition.html} - */ - transition?: 'auto' | string; - /** - * Duration of animation events - * - * @default 200 - */ - duration?: number; - /** - * The keycode used to represent keyboard shortcuts. To avoid issues with some foreign languages, you can pass false for comma delimiter's value - */ - keys?: { - /** - * @default 8 - */ - backspace?: number; - /** - * @default 188 - */ - delimiter?: number | false; - /** - * @default 46 - */ - deleteKey?: number; - /** - * @default 13 - */ - enter?: number; - /** - * @default 27 - */ - escape?: number; - /** - * @default 33 - */ - pageUp?: number; - /** - * @default 34 - */ - pageDown?: number; - /** - * @default 37 - */ - leftArrow?: number; - /** - * @default 38 - */ - upArrow?: number; - /** - * @default 39 - */ - rightArrow?: number; - /** - * @default 40 - */ - downArrow?: number; - }; - /** - * Time in milliseconds to debounce show or hide behavior when on: hover is used, or when touch is used. - */ - delay?: { - /** - * @default 300 - */ - hide?: number; - /** - * @default 200 - */ - show?: number; - /** - * @default 50 - */ - search?: number; - /** - * @default 50 - */ - touch?: number; - }; - - // endregion - - // region Callbacks - - /** - * Is called after a dropdown value changes. Receives the name and value of selection and the active menu element - */ - onChange?(this: JQuery, value: any, text: string, $choice: JQuery): void; - /** - * Is called after a dropdown selection is added using a multiple select dropdown, only receives the added value - */ - onAdd?(this: JQuery, addedValue: any, addedText: string, $addedChoice: JQuery): void; - /** - * Is called after a dropdown selection is removed using a multiple select dropdown, only receives the removed value - */ - onRemove?(this: JQuery, removedValue: any, removedText: string, $removedChoice: JQuery): void; - /** - * Allows you to modify a label before it is added. Expects the jQ DOM element for a label to be returned. - */ - onLabelCreate?(this: JQuery, value: any, text: string): JQuery; - /** - * Called when a label is remove, return false; will prevent the label from being removed. - */ - onLabelRemove?(this: JQuery, value: any): false | void; - /** - * Is called after a label is selected by a user - */ - onLabelSelect?(this: JQuery, $selectedLabels: JQuery): void; - /** - * Is called after a dropdown is searched with no matching values - */ - onNoResults?(this: JQuery, searchValue: any): void; - /** - * Is called before a dropdown is shown. If false is returned, dropdown will not be shown. - */ - onShow?(this: JQuery): false | void; - /** - * Is called before a dropdown is hidden. If false is returned, dropdown will not be hidden. - */ - onHide?(this: JQuery): false | void; - - // endregion - - // region DOM Settings - - /** - * You can specify site wide messages by modifying $.fn.dropdown.settings.message that will apply on any dropdown if it appears in the page. - */ - message?: { - /** - * @default 'Add {term}' - */ - addResult?: string; - /** - * @default '{count} selected' - */ - count?: string; - /** - * @default 'Max {maxCount} selections' - */ - maxSelections?: string; - /** - * 'No results found.' - */ - noResults?: string; - }; - selector?: { - /** - * @default '.addition' - */ - addition?: string; - /** - * @default '.ui.dropdown' - */ - dropdown?: string; - /** - * @default '> .dropdown.icon' - */ - icon?: string; - /** - * @default '> input[type="hidden"], > select' - */ - input?: string; - /** - * @default '.item' - */ - item?: string; - /** - * @default '> .label' - */ - label?: string; - /** - * @default '> .label > .delete.icon' - */ - remove?: string; - /** - * @default '.label' - */ - siblingLabel?: string; - /** - * @default '.menu' - */ - menu?: string; - /** - * @default '.message' - */ - message?: string; - /** - * @default '.dropdown.icon' - */ - menuIcon?: string; - /** - * @default 'input.search, .menu > .search > input' - */ - search?: string; - /** - * @default '> .text:not(.icon)' - */ - text?: string; - }; - regExp?: { - /** - * @default /[-[\]{}()*+?.,\\^$|#\s]/g - */ - escape?: RegExp; - }; - metadata?: { - /** - * @default 'defaultText' - */ - defaultText?: string; - /** - * @default 'defaultValue' - */ - defaultValue?: string; - /** - * @default 'placeholderText' - */ - placeholderText?: string; - /** - * @default 'text' - */ - text?: string; - /** - * @default 'value' - */ - value?: string; - }; - className?: { - /** - * @default 'active' - */ - active?: string; - /** - * @default 'addition' - */ - addition?: string; - /** - * @default 'animating' - */ - animating?: string; - /** - * @default 'disabled' - */ - disabled?: string; - /** - * @default 'ui dropdown' - */ - dropdown?: string; - /** - * @default 'filtered' - */ - filtered?: string; - /** - * @default 'hidden transition' - */ - hidden?: string; - /** - * @default 'item' - */ - item?: string; - /** - * @default 'ui label' - */ - label?: string; - /** - * @default 'loading' - */ - loading?: string; - /** - * @default 'menu' - */ - menu?: string; - /** - * @default 'message' - */ - message?: string; - /** - * @default 'multiple' - */ - multiple?: string; - /** - * @default 'default' - */ - placeholder?: string; - /** - * @default 'search' - */ - search?: string; - /** - * @default 'selected' - */ - selected?: string; - /** - * @default 'selection' - */ - selection?: string; - /** - * @default 'upward' - */ - upward?: string; - /** - * @default 'visible' - */ - visible?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'You called a dropdown action that was not defined' - */ - action?: string; - /** - * @default 'Once a select has been initialized behaviors must be called on the created ui dropdown' - */ - alreadySetup?: string; - /** - * @default 'Allowing user additions currently requires the use of labels.' - */ - labels?: string; - /** - * @default 'The method you called is not defined.' - */ - method?: string; - /** - * @default 'This module requires ui transitions ' - */ - noTransition?: string; - }; - - // endregion - } - - // endregion - - // region Embed - - interface Embed { - settings: EmbedSettings; - - /** - * Changes iframe to a new content source - */ - (behavior: 'change', source: string, id: string, url: string): JQuery; - /** - * Removes embed and shows placeholder content if available - */ - (behavior: 'reset'): JQuery; - /** - * Shows embed content - */ - (behavior: 'show'): JQuery; - /** - * Hides embed content and shows placeholder content - */ - (behavior: 'hide'): JQuery; - /** - * Returns current content id - */ - (behavior: 'get id'): string; - /** - * Returns placeholder image url - */ - (behavior: 'get placeholder'): string; - /** - * Returns source name - */ - (behavior: 'get sources'): string; - /** - * Returns source type - */ - (behavior: 'get type'): string; - /** - * Returns URL with all parameters added - */ - (behavior: 'get url'): string; - /** - * Returns whether embed content has placeholder - */ - (behavior: 'has placeholder'): boolean; - /** - * Destroys instance and removes all events - */ - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): EmbedSettings[K]; - (behavior: 'setting', name: K, value: EmbedSettings[K]): JQuery; - (behavior: 'setting', value: EmbedSettings): JQuery; - (settings?: EmbedSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/embed.html#/settings} - */ - interface EmbedSettings extends ComponentSettings { - /** - * Specifies a url to use for embed - * - * @default false - */ - url?: false | string; - - // region Embed Settings - - /** - * Specifies an icon to use with placeholder content - * - * @default false - */ - icon?: false | string; - /** - * Specifies a source to use, if no source is provided it will be determined from the domain of a specified url. - * - * @default false - */ - source?: false | string; - /** - * Specifies an id value to replace with the {id} value found in templated urls - * - * @default false - */ - id?: false | string; - /** - * Specify an object containing key/value pairs to add to the iframes GET parameters - * - * @default false - */ - parameters?: false | any; - - // endregion - - // region Video Settings - - /** - * Default setting auto will only autoplay content when a placeholder is specified. Setting to true or false will force autoplay. - * - * @default 'auto' - */ - autoplay?: 'auto' | boolean; - /** - * Specifies a default chrome color with Vimeo or YouTube. - * - * @default '#444444' - */ - color?: string; - /** - * Whether to prefer HD content - * - * @default true - */ - hd?: boolean; - /** - * Whether to show networks branded UI like title cards, or after video calls to action. - * - * @default false - */ - brandedUI?: boolean; - - // endregion - - // region Callbacks - - /** - * Callback when iframe is generated - */ - onCreate?(this: JQuery, url: string): void; - /** - * Whenever an iframe contents is shown - */ - onDisplay?(this: JQuery): void; - /** - * Callback immediately before Embed is removed from DOM - */ - onPlaceholderDisplay?(this: JQuery): void; - /** - * Callback when module parameters are determined. Allows you to adjust parameters at run time by returning a new parameters object. - */ - onEmbed?(this: JQuery, parameters: any): any; - - // endregion - - // region DOM Settings - - /** - * DOM Selectors used internally - */ - selector?: { - /** - * @default '.embed' - */ - embed?: string; - /** - * @default '.placeholder' - */ - placeholder?: string; - /** - * @default '.play' - */ - play?: string; - }; - /** - * HTML Data attributes used to store data - */ - metadata?: { - /** - * @default 'id' - */ - id?: string; - /** - * @default 'icon' - */ - icon?: string; - /** - * @default 'placeholder' - */ - placeholder?: string; - /** - * @default 'source' - */ - source?: string; - /** - * @default 'url' - */ - url?: string; - }; - /** - * Class names used to attach style to state - */ - className?: { - /** - * @default 'active' - */ - active?: string; - /** - * @default 'embed' - */ - embed?: string; - }; - templates?: { - /** - * returns html for iframe - */ - iframe?(url: string, parameters: string): string; - /** - * returns html for placeholder element - */ - placeholder?(image: string, icon: string): string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'No URL specified' - */ - noURL?: string; - /** - * @default 'The method you called is not defined' - */ - method?: string; - }; - - // endregion - } - - // endregion - - // region Modal - - interface Modal { - settings: ModalSettings; - - /** - * Shows the modal - */ - (behavior: 'show'): JQuery; - /** - * Hides the modal - */ - (behavior: 'hide'): JQuery; - /** - * Toggles the modal - */ - (behavior: 'toggle'): JQuery; - /** - * Refreshes centering of modal on page - */ - (behavior: 'refresh'): JQuery; - /** - * Shows associated page dimmer - */ - (behavior: 'show dimmer'): JQuery; - /** - * Hides associated page dimmer - */ - (behavior: 'hide dimmer'): JQuery; - /** - * Hides all modals not selected modal in a dimmer - */ - (behavior: 'hide others'): JQuery; - /** - * Hides all visible modals in the same dimmer - */ - (behavior: 'hide all'): JQuery; - /** - * Caches current modal size - */ - (behavior: 'cache sizes'): JQuery; - /** - * Returns whether the modal can fit on the page - */ - (behavior: 'can fit'): boolean; - /** - * Returns whether the modal is active - */ - (behavior: 'is active'): boolean; - /** - * Sets modal to active - */ - (behavior: 'set active'): JQuery; - (behavior: 'attach events', selector: Selector, event?: string): JQuery; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): ModalSettings[K]; - (behavior: 'setting', name: K, value: ModalSettings[K]): JQuery; - (behavior: 'setting', value: ModalSettings): JQuery; - (settings?: ModalSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/modal.html#/settings} - */ - interface ModalSettings extends ComponentSettings { - // region Modal Settings - - /** - * If set to false will prevent the modal from being moved to inside the dimmer - * - * @default true - */ - detachable?: boolean; - /** - * When true, the first form input inside the modal will receive focus when shown. Set this to false to prevent this behavior. - * - * @default true - */ - autofocus?: boolean; - /** - * Whether any change in modal DOM should automatically refresh cached positions - * - * @default false - */ - observeChanges?: boolean; - /** - * If set to true will not close other visible modals when opening a new one - * - * @default false - */ - allowMultiple?: boolean; - /** - * Whether to automatically bind keyboard shortcuts - * - * @default true - */ - keyboardShortcuts?: boolean; - /** - * A vertical offset to allow for content outside of modal, for example a close button, to be centered. - * - * @default 0 - */ - offset?: number; - /** - * Selector or jquery object specifying the area to dim - * - * @default 'body' - */ - context?: Selector; - /** - * Setting to false will not allow you to close the modal by clicking on the dimmer - * - * @default true - */ - closable?: boolean; - /** - * You can specify custom settings to extend UI dimmer - * - * @see {@link http://semantic-ui.com/modules/dimmer.html} - */ - dimmerSettings?: DimmerSettings; - /** - * Named transition to use when animating menu in and out, full list can be found in ui transitions docs. - * - * @default 'scale' - * @see {@link http://semantic-ui.com/modules/transition.html} - */ - transition?: string; - /** - * Duration of animation - * - * @default 400 - */ - duration?: number; - /** - * Whether additional animations should queue - * - * @default false - */ - queue?: boolean; - - // endregion - - // region Callbacks - - /** - * Is called when a modal starts to show. - */ - onShow?(this: JQuery): void; - /** - * Is called after a modal has finished showing animating. - */ - onVisible?(this: JQuery): void; - /** - * Is called after a modal starts to hide. If the function returns false, the modal will not hide. - */ - onHide?(this: JQuery, $element: JQuery): false | void; - /** - * Is called after a modal has finished hiding animation. - */ - onHidden?(this: JQuery): void; - /** - * Is called after a positive, approve or ok button is pressed. If the function returns false, the modal will not hide. - */ - onApprove?(this: JQuery, $element: JQuery): false | void; - /** - * Is called after a negative, deny or cancel button is pressed. If the function returns false the modal will not hide. - */ - onDeny?(this: JQuery, $element: JQuery): false | void; - - // endregion - - // region DOM Settings - - selector?: { - /** - * @default '.close, .actions .button' - */ - close?: string; - /** - * @default '.actions .positive, .actions .approve, .actions .ok' - */ - approve?: string; - /** - * @default '.actions .negative, .actions .deny, .actions .cancel' - */ - deny?: string; - }; - className?: { - /** - * @default 'active' - */ - active?: string; - /** - * @default 'scrolling' - */ - scrolling?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'The method you called is not defined.' - */ - method?: string; - }; - - // endregion - } - - // endregion - - // region Nag - - interface Nag { - settings: NagSettings; - - (behavior: 'show'): JQuery; - (behavior: 'hide'): JQuery; - /** - * Clears cookie so nag shows again - */ - (behavior: 'clear'): JQuery; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): NagSettings[K]; - (behavior: 'setting', name: K, value: NagSettings[K]): JQuery; - (behavior: 'setting', value: NagSettings): JQuery; - (settings?: NagSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/nag.html} - */ - interface NagSettings extends ComponentSettings { - // region Behavior - - /** - * allows cookie to be overridden - * - * @default false - */ - persist?: boolean; - /** - * set to zero to require manually dismissal, otherwise hides on its own - * - * @default 0 - */ - displayTime?: number; - animation?: { - /** - * @default 'slide' - */ - show?: string; - /** - * @default 'slide' - */ - hide?: string; - }; - /** - * @default false - */ - context?: false | Selector; - /** - * @default false - */ - detachable?: boolean; - - /** - * @default 30 - */ - expires?: number; - /** - * @default false - */ - domain?: false | string; - /** - * @default '/' - */ - path?: string; - - /** - * type of storage to use - * - * @default 'cookie' - */ - storageMethod?: 'cookie' | 'localstorage' | 'sessionstorage'; - - /** - * @default 'nag' - */ - key?: any; - /** - * @default 'dismiss' - */ - value?: any; - - /** - * @default 500 - */ - speed?: number; - /** - * @default 'easeOutQuad' - */ - easing?: string; - - // endregion - - // region Callbacks - - onHide?(this: JQuery): void; - - // endregion - - // region DOM Settings - - className?: { - /** - * @default 'bottom' - */ - bottom?: string; - /** - * @default 'fixed' - */ - fixed?: string; - }; - selector?: { - /** - * @default '.close.icon' - */ - close?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default '$.cookie is not included. A storage solution is required.' - */ - noCookieStorage?: string; - /** - * @default 'Neither $.cookie or store is defined. A storage solution is required for storing state' - */ - noStorage?: string; - /** - * @default 'The method you called is not defined.' - */ - method?: string; - }; - - // endregion - } - - // endregion - - // region Popup - - interface Popup { - settings: PopupSettings; - - /** - * Shows popup - */ - (behavior: 'show'): JQuery; - /** - * Hides popup - */ - (behavior: 'hide'): JQuery; - /** - * Hides all visible pop ups on the page - */ - (behavior: 'hide all'): JQuery; - /** - * Returns current popup dom element - */ - (behavior: 'get popup'): JQuery; - /** - * Changes current popup content - */ - (behavior: 'change content', html: string): JQuery; - /** - * Toggles visibility of popup - */ - (behavior: 'toggle'): JQuery; - /** - * Returns whether popup is visible - */ - (behavior: 'is visible'): boolean; - /** - * Returns whether popup is hidden - */ - (behavior: 'is hidden'): boolean; - /** - * Returns whether popup is created and inserted into the page - */ - (behavior: 'exists'): boolean; - /** - * Adjusts popup when content size changes (only necessary for centered popups) - */ - (behavior: 'reposition'): JQuery; - /** - * Repositions a popup - */ - (behavior: 'set position', position: string): JQuery; - /** - * Removes popup from the page and removes all events - */ - (behavior: 'destroy'): JQuery; - /** - * Removes popup from the page - */ - (behavior: 'remove popup'): JQuery; - (behavior: 'setting', name: K, value?: undefined): PopupSettings[K]; - (behavior: 'setting', name: K, value: PopupSettings[K]): JQuery; - (behavior: 'setting', value: PopupSettings): JQuery; - (settings?: PopupSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/popup.html#/settings} - */ - interface PopupSettings extends ComponentSettings { - // region Popup Settings - - /** - * Can specify a DOM element that should be used as the popup. This is useful for including a pre-formatted popup. - * - * @default false - */ - popup?: false | Selector; - /** - * Whether all other popups should be hidden when this popup is opened - * - * @default false - */ - exclusive?: boolean; - /** - * Whether to move popup to same offset container as target element when popup already exists on the page. - * Using a popup inside of an element without overflow:visible, like a sidebar, may require you to set this to false - * - * @default true - */ - movePopup?: boolean; - /** - * Whether popup should attach mutationObservers to automatically run destroy when the element is removed from the page's DOM. - * - * @default true - */ - observeChanges?: boolean; - /** - * When the popup surpasses the boundary of this element, it will attempt to find another display position. - */ - boundary?: Selector; - /** - * Selector or jquery object specifying where the popup should be created. - * - * @default 'body' - */ - context?: Selector; - /** - * Will automatically hide a popup on scroll event in this context - */ - scrollContext?: Selector; - /** - * Number of pixels that a popup is allowed to appear outside the boundaries of its context. - * This allows for permissible rounding errors when an element is against the edge of its context. - * - * @default 2 - */ - jitter?: number; - /** - * Position that the popup should appear - * - * @default 'top left' - */ - position?: string; - /** - * If a popup is inline it will be created next to current element, allowing for local css rules to apply. - * It will not be removed from the DOM after being hidden. - * Otherwise popups will appended to body and removed after being hidden. - * - * @default false - */ - inline?: boolean; - /** - * Whether popup contents should be preserved in the page after being hidden, allowing it to re-appear slightly faster on subsequent loads. - * - * @default false - */ - preserve?: boolean; - /** - * Can be set to adjacent or opposite to prefer adjacent or opposite position if popup cannot fit on screen - * - * @default 'adjacent' - */ - prefer?: 'adjacent' | 'opposite'; - /** - * When set to false, a popup will not appear and produce an error message if it cannot entirely fit on page. - * Setting this to a position like, right center forces the popup to use this position as a last resort even if it is partially offstage. - * Setting this to true will use the last attempted position. - * - * @default false - */ - lastResort?: boolean | string; - /** - * Event used to trigger popup. Can be either focus, click, hover, or manual. Manual popups must be triggered with $('.element').popup('show'); - * - * @default 'hover' - */ - on?: 'focus' | 'click' | 'hover' | 'manual'; - /** - * Delay in milliseconds before showing or hiding a popup on hover or focus - */ - delay?: { - show?: number; - hide?: number; - }; - /** - * Named transition to use when animating menu in and out. Fade and slide down are available without including ui transitions - * - * @default 'slide down' - * @see {@link http://semantic-ui.com/modules/transition.html} - */ - transition?: string; - /** - * Duration of animation events - * - * @default 200 - */ - duration?: number; - /** - * Whether popup should set fluid popup variation width on load to avoid width: 100% including padding - * - * @default true - */ - setFluidWidth?: boolean; - /** - * Whether popup should not close on hover (useful for popup navigation menus) - * - * @default false - */ - hoverable?: boolean; - /** - * When using on: 'click' specifies whether clicking the page should close the popup - * - * @default true - */ - closable?: boolean; - /** - * When using on: 'hover' whether touchstart events should be added to allow the popup to be triggered - */ - addTouchEvents?: boolean; - /** - * Whether popup should hide on scroll or touchmove, auto only hides for popups without on: 'click'. - * Set this to false to prevent mobile browsers from closing popups when you tap inside input fields. - * - * @default 'auto' - */ - hideOnScroll?: 'auto' | false; - /** - * If a selector or jQuery object is specified this allows the popup to be positioned relative to that element. - * - * @default false - */ - target?: false | Selector; - /** - * Offset for distance of popup from element - * - * @default 0 - */ - distanceAway?: number; - /** - * Offset in pixels from calculated position - * - * @default 0 - */ - offset?: number; - /** - * Number of iterations before giving up search for popup position when a popup cannot fit on screen - * - * @default 10 - */ - maxSearchDepth?: number; - - // endregion - - // region Callbacks - - /** - * Callback on popup element creation, with created popup - */ - onCreate?(this: JQuery, $module: JQuery): void; - /** - * Callback immediately before Popup is removed from DOM - */ - onRemove?(this: JQuery, $module: JQuery): void; - /** - * Callback before popup is shown. Returning false from this callback will cancel the popup from showing. - */ - onShow?(this: JQuery, $module: JQuery): false | void; - /** - * Callback after popup is shown - */ - onVisible?(this: JQuery, $module: JQuery): void; - /** - * Callback before popup is hidden. Returning false from this callback will cancel the popup from hiding. - */ - onHide?(this: JQuery, $module: JQuery): false | void; - /** - * Callback after popup is hidden - */ - onHidden?(this: JQuery, $module: JQuery): void; - /** - * Callback after popup cannot be placed on screen - */ - onUnplaceable?(this: JQuery, $module: JQuery): void; - - // endregion - - // region Content Settings - - /** - * Popup variation to use, can use multiple variations with a space delimiter - */ - variation?: string; - /** - * Content to display - */ - content?: string; - /** - * Title to display alongside content - */ - title?: string; - /** - * HTML content to display instead of preformatted title and content - */ - html?: string | JQuery; - - // endregion - - // region DOM Settings - - /** - * DOM Selectors used internally - */ - selector?: { - /** - * @default '.ui.popup' - */ - popup?: string; - }; - /** - * HTML Data attributes used to store data - */ - metadata?: { - /** - * @default 'content' - */ - content?: string; - /** - * @default 'html' - */ - html?: string; - /** - * @default 'offset' - */ - offset?: string; - /** - * @default 'position' - */ - position?: string; - /** - * @default 'title' - */ - title?: string; - /** - * @default 'variation' - */ - variation?: string; - }; - /** - * Class names used to attach style to state - */ - className?: { - /** - * @default 'loading' - */ - loading?: string; - /** - * @default 'ui popup' - */ - popup?: string; - /** - * @default 'top left center bottom right' - */ - position?: string; - /** - * @default 'visible' - */ - visible?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'The position you specified is not a valid position' - */ - invalidPosition?: string; - /** - * @default 'Popup does not fit within the boundaries of the viewport' - */ - cannotPlace?: string; - /** - * @default 'The method you called is not defined.' - */ - method?: string; - /** - * @default 'This module requires ui transitions ' - */ - noTransition?: string; - /** - * @default 'The target or popup you specified does not exist on the page' - */ - notFound?: string; - }; - - // endregion - } - - // endregion - - // region Progress - - interface Progress { - settings: ProgressSettings; - - /** - * Sets current percent of progress to value. If using a total will convert from percent to estimated value. - */ - (behavior: 'set percent', percent: number): JQuery; - /** - * Sets progress to specified value. Will automatically calculate percent from total. - */ - (behavior: 'set progress', value: number): JQuery; - /** - * Increments progress by increment value, if not passed a value will use random amount specified in settings - */ - (behavior: 'increment', incrementValue: number): JQuery; - /** - * Decrements progress by decrement value, if not passed a value will use random amount specified in settings - */ - (behavior: 'decrement', decrementValue: number): JQuery; - /** - * Immediately updates progress to value, ignoring progress animation interval delays - */ - (behavior: 'update progress', value: number): JQuery; - /** - * Finishes progress and sets loaded to 100% - */ - (behavior: 'complete'): JQuery; - /** - * Resets progress to zero - */ - (behavior: 'reset'): JQuery; - /** - * Set total to a new value - */ - (behavior: 'set total', total: number): JQuery; - /** - * Replaces templated string with value, total, percent left and percent. - */ - (behavior: 'get text', text: string): string; - /** - * Returns normalized value inside acceptable range specified by total. - */ - (behavior: 'get normalized value', value: number): number; - /** - * Returns percent as last specified - */ - (behavior: 'get percent'): number; - /** - * Returns current progress value - */ - (behavior: 'get value'): number; - /** - * Returns total - */ - (behavior: 'get total'): number; - /** - * Returns whether progress is completed - */ - (behavior: 'is complete'): boolean; - /** - * Returns whether progress was a success - */ - (behavior: 'is success'): boolean; - /** - * Returns whether progress is in warning state - */ - (behavior: 'is warning'): boolean; - /** - * Returns whether progress is in error state - */ - (behavior: 'is error'): boolean; - /** - * Returns whether progress is in active state - */ - (behavior: 'is active'): boolean; - /** - * Sets progress to active state - */ - (behavior: 'set active'): JQuery; - /** - * Sets progress to warning state - */ - (behavior: 'set warning'): JQuery; - /** - * Sets progress to success state - */ - (behavior: 'set success'): JQuery; - /** - * Sets progress to error state - */ - (behavior: 'set error'): JQuery; - /** - * Changes progress animation speed - */ - (behavior: 'set duration', value: number): JQuery; - /** - * Sets progress exterior label to text - */ - (behavior: 'set label', text: string): JQuery; - /** - * Sets progress bar label to text - */ - (behavior: 'set bar label', text: string): JQuery; - /** - * Removes progress to active state - */ - (behavior: 'remove active'): JQuery; - /** - * Removes progress to warning state - */ - (behavior: 'remove warning'): JQuery; - /** - * Removes progress to success state - */ - (behavior: 'remove success'): JQuery; - /** - * Removes progress to error state - */ - (behavior: 'remove error'): JQuery; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): ProgressSettings[K]; - (behavior: 'setting', name: K, value: ProgressSettings[K]): JQuery; - (behavior: 'setting', value: ProgressSettings): JQuery; - (settings?: ProgressSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/progress.html#/settings} - */ - interface ProgressSettings extends ComponentSettings { - // region Progress Settings - - /** - * Whether success state should automatically trigger when progress completes - * - * @default true - */ - autoSuccess?: boolean; - /** - * Whether progress should automatically show activity when incremented - * - * @default true - */ - showActivity?: boolean; - /** - * When set to true, values that calculate to above 100% or below 0% will be adjusted. - * When set to false, inappropriate values will produce an error. - * - * @default true - */ - limitValues?: boolean; - /** - * Can be set to either to display progress as percent or ratio. Matches up to corresponding text template with the same name. - * - * @default 'percent' - */ - label?: 'percent' | 'ratio'; - /** - * When incrementing without value, sets range for random increment value - */ - random?: { - /** - * @default 2 - */ - min?: number; - /** - * @default 5 - */ - max?: number; - }; - /** - * Decimal point precision for calculated progress - * - * @default 1 - */ - precision?: number; - /** - * Setting a total value will make each call to increment get closer to this total (i.e. 1/20, 2/20 etc) - * - * @default false - */ - total?: false | number; - /** - * Sets current value, when total is specified, this is used to calculate a ratio of the total, with percent this should be the overall percent - * - * @default false - */ - value?: false | number; - - // endregion - - // region Callbacks - - /** - * Callback on percentage change - */ - onChange?(this: JQuery, percent: number, value: number, total: number): void; - /** - * Callback on success state - */ - onSuccess?(this: JQuery, total: number): void; - /** - * Callback on active state - */ - onActive?(this: JQuery, value: number, total: number): void; - /** - * Callback on error state - */ - onError?(this: JQuery, value: number, total: number): void; - /** - * Callback on warning state - */ - onWarning?(this: JQuery, value: number, total: number): void; - - // endregion - - // region DOM Settings - - /** - * Text content for each state, uses simple templating with {percent}, {value}, {total} - */ - text?: { - /** - * @default false - */ - active?: false | string; - /** - * @default false - */ - error?: false | string; - /** - * @default false - */ - success?: false | string; - /** - * @default false - */ - warning?: false | string; - /** - * @default '{percent}%' - */ - percent?: false | string; - /** - * @default '{value} of {total}' - */ - ratio?: false | string; - }; - /** - * Regular expressions used by module - */ - regExp?: { - /** - * @default /\{\$*[A-z0-9]+\}/g - */ - variable?: RegExp; - }; - /** - * Selectors used by module - */ - selector?: { - /** - * @default '> .bar - */ - bar?: string; - /** - * @default '> .label' - */ - label?: string; - /** - * @default '.bar > .progress' - */ - progress?: string; - }; - /** - * DOM metadata used by module - */ - metadata?: { - /** - * @default 'percent' - */ - percent?: string; - /** - * @default 'total' - */ - total?: string; - /** - * @default 'value' - */ - value?: string; - }; - /** - * Class names used to attach style to state - */ - className?: { - /** - * @default 'active' - */ - active?: string; - /** - * @default 'error' - */ - error?: string; - /** - * @default 'success' - */ - success?: string; - /** - * @default 'warning' - */ - warning?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'The method you called is not defined.' - */ - method?: string; - /** - * @default 'Progress value is non numeric' - */ - nonNumeric?: string; - }; - - // endregion - } - - // endregion - - // region Rating - - interface Rating { - settings: RatingSettings; - - /** - * Sets rating programmatically - */ - (behavior: 'set rating', rating: number): JQuery; - /** - * Gets current rating - */ - (behavior: 'get rating'): number; - /** - * Disables interactive rating mode - */ - (behavior: 'disable'): JQuery; - /** - * Enables interactive rating mode - */ - (behavior: 'enable'): JQuery; - /** - * Clears current rating - */ - (behavior: 'clear rating'): JQuery; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): RatingSettings[K]; - (behavior: 'setting', name: K, value: RatingSettings[K]): JQuery; - (behavior: 'setting', value: RatingSettings): JQuery; - (settings?: RatingSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/rating.html#/settings} - */ - interface RatingSettings extends ComponentSettings { - // region Rating Settings - - /** - * A number representing the default rating to apply - * - * @default 0 - */ - initialRating?: number; - /** - * Whether callbacks like onRate should fire immediately after initializing with the current value. - * - * @default false - */ - fireOnInit?: boolean; - /** - * By default a rating will be only clearable if there is 1 icon. Setting to true/false will allow or disallow a user to clear their rating - * - * @default 'auto' - */ - clearable?: 'auto' | boolean; - /** - * Whether to enable user's ability to rate - * - * @default true - */ - interactive?: boolean; - - // endregion - - // region Callbacks - - /** - * Is called after user selects a new rating - */ - onRate?(this: JQuery, value: number): void; - - // endregion - - // region DOM Settings - - selector?: { - /** - * @default '.icon' - */ - icon?: string; - }; - className?: { - /** - * @default 'active' - */ - active?: string; - /** - * @default 'hover' - */ - hover?: string; - /** - * @default 'loading' - */ - loading?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'You called a rating action that was not defined' - */ - action?: string; - }; - - // endregion - } - - // endregion - - // region Search - - interface Search { - settings: SearchSettings; - - /** - * Search for value currently set in search input - */ - (behavior: 'query', callback?: () => void): JQuery; - /** - * Displays message in search results with text, using template matching type - */ - (behavior: 'display message', text: string, type: string): JQuery; - /** - * Cancels current remote search query - */ - (behavior: 'cancel query'): JQuery; - /** - * Search local object for specified query and display results - */ - (behavior: 'search local', query: string): JQuery; - /** - * Whether has minimum characters - */ - (behavior: 'has minimum characters'): boolean; - /** - * Search remote endpoint for specified query and display results - */ - (behavior: 'search remote', query: string, callback?: () => void): JQuery; - /** - * Search object for specified query and return results - */ - (behavior: 'search object', query: string, object: any, searchFields: string[]): any; - /** - * Cancels current remote search request - */ - (behavior: 'cancel query'): JQuery; - /** - * Whether search is currently focused - */ - (behavior: 'is focused'): boolean; - /** - * Whether search results are visible - */ - (behavior: 'is visible'): boolean; - /** - * Whether search results are empty - */ - (behavior: 'is empty'): boolean; - /** - * Returns current search value - */ - (behavior: 'get value'): any; - /** - * Returns JSON object matching searched title or id (see above) - */ - (behavior: 'get result', value: any): any; - /** - * Sets search input to value - */ - (behavior: 'set value', value: any): JQuery; - /** - * Reads cached results for query - */ - (behavior: 'read cache', query: string): JQuery; - /** - * Clears value from cache, if no parameter passed clears all cache - */ - (behavior: 'clear cache', query?: string): JQuery; - /** - * Writes cached results for query - */ - (behavior: 'write cache', query: string): JQuery; - /** - * Adds HTML to results and displays - */ - (behavior: 'add results', html: string): JQuery; - /** - * Shows results container - */ - (behavior: 'show results', callback?: () => void): JQuery; - /** - * Hides results container - */ - (behavior: 'hide results', callback?: () => void): JQuery; - /** - * Generates results using parser specified by settings.template - */ - (behavior: 'generate results', response: any): JQuery; - /** - * Removes all events - */ - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): SearchSettings[K]; - (behavior: 'setting', name: K, value: SearchSettings[K]): JQuery; - (behavior: 'setting', value: SearchSettings): JQuery; - (settings?: SearchSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/search.html#/settings} - */ - interface SearchSettings extends ComponentSettings { - // region Behavior - - /** - * Settings for API call. - * - * @see {@link http://semantic-ui.com/behaviors/api.html#/usage} - */ - apiSettings?: ApiSettings; - /** - * Minimum characters to query for results - * - * @default 1 - */ - minCharacters?: number; - /** - * Named transition to use when animating menu in and out. Fade and slide down are available without including ui transitions - * - * @default 'fade' - * @see {@link http://semantic-ui.com/modules/transition.html} - */ - transition?: string; - /** - * Duration of animation events - * - * @default 300 - */ - duration?: number; - /** - * Maximum results to display when using local and simple search, maximum category count for category search - * - * @default 7 - */ - maxResults?: number; - /** - * Caches results locally to avoid requerying server - * - * @default true - */ - cache?: boolean; - /** - * Specify a Javascript object which will be searched locally - * - * @default false - */ - source?: false | any; - /** - * Whether the search should automatically select the first search result after searching - * - * @default false - */ - selectFirstResult?: boolean; - /** - * Whether a "no results" message should be shown if no results are found. (These messages can be modified using the template object specified below) - * - * @default false - */ - showNoResults?: boolean; - /** - * Return local results that match anywhere inside your content - * - * @default true - */ - searchFullText?: boolean; - /** - * List mapping display content to JSON property, either with API or source. - */ - fields?: { - /** - * array of categories (category view) - * - * @default 'results' - */ - categories?: string; - /** - * name of category (category view) - * - * @default 'name' - */ - categoryName?: string; - /** - * array of results (category view) - * - * @default 'results' - */ - categoryResults?: string; - /** - * result description - * - * @default 'description' - */ - description?: string; - /** - * result image - * - * @default 'image' - */ - image?: string; - /** - * result price - * - * @default 'price' - */ - price?: string; - /** - * array of results (standard) - * - * @default 'results' - */ - results?: string; - /** - * result title - * - * @default 'title' - */ - title?: string; - /** - * "view more" object name - * - * @default 'action' - */ - action?: string; - /** - * "view more" text - * - * @default 'text' - */ - actionText?: string; - /** - * "view more" url - * - * @default 'url' - */ - actionURL?: string; - }; - /** - * Specify object properties inside local source object which will be searched - */ - searchFields?: string[]; - /** - * Delay before hiding results after search blur - * - * @default 0 - */ - hideDelay?: number; - /** - * Delay before querying results on inputchange - * - * @default 100 - */ - searchDelay?: number; - /** - * Easing equation when using fallback Javascript animation - * - * @default 'easeOutExpo' - */ - easing?: string; - - // endregion - - // region Callbacks - - /** - * Callback on element selection by user. - * The first parameter includes the filtered response results for that element. - * The function should return false to prevent default action (closing search results and selecting value). - */ - onSelect?(this: JQuery, result: any, response: any): false | void; - /** - * Callback after processing element template to add HTML to results. Function should return false to prevent default actions. - */ - onResultsAdd?(this: JQuery, html: string): false | void; - /** - * Callback on search query - */ - onSearchQuery?(this: JQuery, query: string): void; - /** - * Callback on server response - */ - onResults?(this: JQuery, response: any): void; - /** - * Callback when results are opened - */ - onResultsOpen?(this: JQuery): void; - /** - * Callback when results are closed - */ - onResultsClose?(this: JQuery): void; - - // endregion - - // region Templates - - templates?: { - escape?(string: string): string; - message?(message: string, type: string): string; - category?(response: any): string; - standard?(response: any): string; - }; - - // endregion - - // region DOM Settings - - /** - * Regular expressions used for matching - */ - regExp?: { - /** - * @default /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g - */ - escape?: RegExp; - /** - * @default '(?:\s|^)' - */ - beginsWith?: string; - }; - /** - * Selectors used to find parts of a module - */ - selector?: { - /** - * @default '.prompt' - */ - prompt?: string; - /** - * @default '.search.button' - */ - searchButton?: string; - /** - * @default '.results' - */ - results?: string; - /** - * @default '.category' - */ - category?: string; - /** - * @default '.result' - */ - result?: string; - }; - /** - * HTML5 metadata attributes used internally - */ - metadata?: { - /** - * @default 'cache' - */ - cache?: string; - /** - * @default 'results' - */ - results?: string; - }; - /** - * Class names used to determine element state - */ - className?: { - /** - * @default 'active' - */ - active?: string; - /** - * @default 'empty' - */ - empty?: string; - /** - * @default 'focus' - */ - focus?: string; - /** - * @default 'loading' - */ - loading?: string; - /** - * @default 'down' - */ - pressed?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'Cannot search. No source used, and Semantic API module was not included' - */ - source?: string; - /** - * @default 'Your search returned no results' - */ - noResults?: string; - /** - * @default 'Error in debug logging, exiting.' - */ - logging?: string; - /** - * @default 'A valid template name was not specified.' - */ - noTemplate?: string; - /** - * @default 'There was an issue with querying the server.' - */ - serverError?: string; - /** - * @default 'Results must be an array to use maxResults setting' - */ - maxResults?: string; - /** - * @default 'The method you called is not defined.' - */ - method?: string; - }; - - // endregion - } - - // endregion - - // region Shape - - interface Shape { - settings: ShapeSettings; - - /** - * Flips the shape upward - */ - (behavior: 'flip up'): JQuery; - /** - * Flips the shape downward - */ - (behavior: 'flip down'): JQuery; - /** - * Flips the shape right - */ - (behavior: 'flip right'): JQuery; - /** - * Flips the shape left - */ - (behavior: 'flip left'): JQuery; - /** - * Flips the shape over clock-wise - */ - (behavior: 'flip over'): JQuery; - /** - * Flips the shape over counter-clockwise - */ - (behavior: 'flip back'): JQuery; - /** - * Set the next side to a specific selector - */ - (behavior: 'set next side', selector: Selector): JQuery; - /** - * Returns whether shape is currently animating - */ - (behavior: 'is animating'): boolean; - /** - * Removes all inline styles - */ - (behavior: 'reset'): JQuery; - /** - * Queues an animation until after current animation - */ - (behavior: 'queue', animation: string): JQuery; - /** - * Forces a reflow on element - */ - (behavior: 'repaint'): JQuery; - /** - * Set the next side to next sibling to active element - */ - (behavior: 'set default side'): JQuery; - /** - * Sets shape to the content size of the next side - */ - (behavior: 'set stage size'): JQuery; - /** - * Refreshes the selector cache for element sides - */ - (behavior: 'refresh'): JQuery; - /** - * Returns translation for next side staged below - */ - (behavior: 'get transform down'): Translation; - /** - * Returns translation for next side staged left - */ - (behavior: 'get transform left'): Translation; - /** - * Returns translation for next side staged right - */ - (behavior: 'get transform right'): Translation; - /** - * Returns translation for next side staged up - */ - (behavior: 'get transform up'): Translation; - /** - * Returns translation for next side staged down - */ - (behavior: 'get transform down'): Translation; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): ShapeSettings[K]; - (behavior: 'setting', name: K, value: ShapeSettings[K]): JQuery; - (behavior: 'setting', value: ShapeSettings): JQuery; - (settings?: ShapeSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/shape.html#/settings} - */ - interface ShapeSettings extends ComponentSettings { - // region Shape Settings - - /** - * Duration of side change animation - * - * @default 700 - */ - duration?: number; - /** - * When set to next will use the width of the next side during the shape's animation. - * When set to initial it will use the width of the shape at initialization. - * When set to a specific pixel height, will force the width to that height. - * - * @default 'initial' - * @since 2.2 - */ - width?: 'next' | 'initial' | number; - /** - * When set to next will use the height of the next side during the shape's animation. - * When set to initial it will use the height of the shape at initialization. - * When set to a specific pixel height, will force the height to that height. - * - * @default 'initial' - * @since 2.2 - */ - height?: 'next' | 'initial' | number; - - // endregion - - // region Callbacks - - /** - * Is called before side change - */ - beforeChange?(this: JQuery): void; - /** - * Is called after visible side change - */ - onChange?(this: JQuery): void; - - // endregion - - // region DOM Settings - - selector?: { - /** - * @default '.sides' - */ - sides?: string; - /** - * @default '.side' - */ - side?: string; - }; - className?: { - /** - * @default 'animating' - */ - animating?: string; - /** - * @default 'hidden' - */ - hidden?: string; - /** - * @default 'loading' - */ - loading?: string; - /** - * @default 'active' - */ - active?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'You tried to switch to a side that does not exist.' - */ - side?: string; - /** - * @default 'The method you called is not defined' - */ - method?: string; - }; - - // endregion - } - - interface Translation { - transform: string; - } - - // endregion - - // region Sidebar - - interface Sidebar { - settings: SidebarSettings; - - /** - * Attaches sidebar action to given selector. Default event if none specified is toggle - */ - (behavior: 'attach events', selector: string, event?: string): JQuery; - /** - * Shows sidebar - */ - (behavior: 'show'): JQuery; - /** - * Hides sidebar - */ - (behavior: 'hide'): JQuery; - /** - * Toggles visibility of sidebar - */ - (behavior: 'toggle'): JQuery; - /** - * Returns whether sidebar is visible - */ - (behavior: 'is visible'): boolean; - /** - * Returns whether sidebar is hidden - */ - (behavior: 'is hidden'): boolean; - /** - * Pushes page content to be visible alongside sidebar - */ - (behavior: 'push page'): JQuery; - /** - * Returns direction of current sidebar - */ - (behavior: 'get direction'): string; - /** - * Returns page content to original position - */ - (behavior: 'pull page'): JQuery; - /** - * Adds stylesheet to page head to trigger sidebar animations - */ - (behavior: 'add body CSS'): JQuery; - /** - * Removes any inline stylesheets for sidebar animation - */ - (behavior: 'remove body CSS'): JQuery; - /** - * Returns vendor prefixed transition end event - */ - (behavior: 'get transition event'): string; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): SidebarSettings[K]; - (behavior: 'setting', name: K, value: SidebarSettings[K]): JQuery; - (behavior: 'setting', value: SidebarSettings): JQuery; - (settings?: SidebarSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/sidebar.html#/settings} - */ - interface SidebarSettings extends ComponentSettings { - // region Behavior - - /** - * Context which sidebar will appear inside - * - * @default 'body' - */ - context?: Selector; - /** - * Whether multiple sidebars can be open at once - * - * @default false - */ - exclusive?: boolean; - /** - * Whether sidebar can be closed by clicking on page - * - * @default true - */ - closable?: boolean; - /** - * Whether to dim page contents when sidebar is visible - * - * @default true - */ - dimPage?: boolean; - /** - * Whether to lock page scroll when sidebar is visible - * - * @default false - */ - scrollLock?: boolean; - /** - * Whether to return to original scroll position when sidebar is hidden, automatically occurs with transition: scale - * - * @default false - */ - returnScroll?: boolean; - /** - * When sidebar is initialized without the proper HTML, using this option will defer creation of DOM to use requestAnimationFrame. - * - * @default false - */ - delaySetup?: boolean; - - // endregion - - // region Animation - - /** - * Named transition to use when animating sidebar. Defaults to 'auto' which selects transition from defaultTransition based on direction. - * - * @default 'auto' - */ - transition?: string; - /** - * Named transition to use when animating when detecting mobile device. Defaults to 'auto' which selects transition from defaultTransition based on direction. - * - * @default 'auto' - */ - mobileTransition?: string; - /** - * Default transitions for each direction and screen size, used with transition: auto - */ - defaultTransition?: { - computer?: { - /** - * @default 'uncover' - */ - left?: string; - /** - * @default 'uncover' - */ - right?: string; - /** - * @default 'overlay' - */ - top?: string; - /** - * @default 'overlay' - */ - bottom?: string; - }; - mobile?: { - /** - * @default 'uncover' - */ - left?: string; - /** - * @default 'uncover' - */ - right?: string; - /** - * @default 'overlay' - */ - top?: string; - /** - * @default 'overlay' - */ - bottom?: string; - }; - }; - /** - * Whether Javascript animations should be used. Defaults to false. Setting to auto will use legacy animations only for browsers that do not support CSS transforms - * - * @default false - */ - useLegacy?: 'auto' | boolean; - /** - * Duration of sidebar animation when using legacy Javascript animation - * - * @default 500 - */ - duration?: number; - /** - * Easing to use when using legacy Javascript animation - * - * @default 'easeInOutQuint' - */ - easing?: string; - - // endregion - - // region Callbacks - - /** - * Is called when a sidebar begins animating in. - */ - onVisible?(this: JQuery): void; - /** - * Is called when a sidebar has finished animating in. - */ - onShow?(this: JQuery): void; - /** - * Is called when a sidebar begins to hide or show - */ - onChange?(this: JQuery): void; - /** - * Is called before a sidebar begins to animate out. - */ - onHide?(this: JQuery): void; - /** - * Is called after a sidebar has finished animating out. - */ - onHidden?(this: JQuery): void; - - // endregion - - // region DOM Settings - - className?: { - /** - * @default 'active' - */ - active?: string; - /** - * @default 'animating' - */ - animating?: string; - /** - * @default 'dimmed' - */ - dimmed?: string; - /** - * @default 'ios' - */ - ios?: string; - /** - * @default 'pushable' - */ - pushable?: string; - /** - * @default 'pushed' - */ - pushed?: string; - /** - * @default 'right' - */ - right?: string; - /** - * @default 'top' - */ - top?: string; - /** - * @default 'left' - */ - left?: string; - /** - * @default 'bottom' - */ - bottom?: string; - /** - * @default 'visible' - */ - visible?: string; - }; - regExp?: { - /** - * @default /(iPad|iPhone|iPod)/g - */ - ios?: RegExp; - /** - * @default /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g - */ - mobile?: RegExp; - }; - selector?: { - /** - * @default '.fixed' - */ - fixed?: string; - /** - * @default 'script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed' - */ - omitted?: string; - /** - * @default '.pusher' - */ - pusher?: string; - /** - * @default '.ui.sidebar' - */ - sidebar?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'The method you called is not defined.' - */ - method?: string; - /** - * @default 'Had to add pusher element. For optimal performance make sure body content is inside a pusher element' - */ - pusher?: string; - /** - * @default 'Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag' - */ - movedSidebar?: string; - /** - * @default 'The overlay setting is no longer supported, use animation: overlay' - */ - overlay?: string; - /** - * @default 'There were no elements that matched the specified selector' - */ - notFound?: string; - }; - - // endregion - } - - // endregion - - // region Sticky - - interface Sticky { - settings: StickySettings; - - /** - * recalculates offsets - */ - (behavior: 'refresh'): JQuery; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): StickySettings[K]; - (behavior: 'setting', name: K, value: StickySettings[K]): JQuery; - (behavior: 'setting', value: StickySettings): JQuery; - (settings?: StickySettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/sticky.html#/settings} - */ - interface StickySettings extends ComponentSettings { - // region Sticky Settings - - /** - * Whether element should be "pushed" by the viewport, attaching to the bottom of the screen when scrolling up - * - * @default false - */ - pushing?: boolean; - /** - * Sticky container height will only be set if the difference between heights of container and context is larger than this jitter value. - * - * @default 5 - */ - jitter?: number; - /** - * Whether any change in context DOM should automatically refresh cached sticky positions - * - * @default false - */ - observeChanges?: boolean; - /** - * Context which sticky element should stick to - * - * @default false - */ - context?: false | Selector; - /** - * Context which sticky should attach onscroll events. - * - * @default 'window' - */ - scrollContext?: Selector; - /** - * Offset in pixels from the top of the screen when fixing element to viewport - * - * @default 0 - */ - offset?: number; - /** - * Offset in pixels from the bottom of the screen when fixing element to viewport - * - * @default 0 - */ - bottomOffset?: number; - - // endregion - - // region Callbacks - - /** - * Callback when element is repositioned from layout change - */ - onReposition?(this: JQuery): void; - /** - * Callback when requestAnimationFrame fires from scroll handler. - */ - onScroll?(this: JQuery): void; - /** - * Callback when element is fixed to page - */ - onStick?(this: JQuery): void; - /** - * Callback when element is unfixed from page - */ - onUnstick?(this: JQuery): void; - /** - * Callback when element is bound to top of parent container - */ - onTop?(this: JQuery): void; - /** - * Callback when element is bound to bottom of parent container - */ - onBottom?(this: JQuery): void; - - // endregion - - // region DOM Settings - - /** - * Class names used to attach style to state - */ - className?: { - /** - * @default 'bound' - */ - bound?: string; - /** - * @default 'fixed' - */ - fixed?: string; - /** - * @default 'native' - */ - supported?: string; - /** - * @default 'top' - */ - top?: string; - /** - * @default 'bottom' - */ - bottom?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'Sticky element must be inside a relative container' - */ - container?: string; - /** - * @default 'Element is hidden, you must call refresh after element becomes visible' - */ - visible?: string; - /** - * @default 'The method you called is not defined.' - */ - method?: string; - /** - * @default 'Context specified does not exist' - */ - invalidContext?: string; - /** - * @default 'Sticky element is larger than its container, cannot create sticky.' - */ - elementSize?: string; - }; - - // endregion - } - - // endregion - - // region Tab - - interface Tab { - settings: TabSettings; - - // Documentation says this exists but it does not. - // /** - // * Attaches tab action to given selector. Default event if none specified is toggle - // */ - // (behavior: 'attach events', selector: Selector, event?: string): JQuery; - /** - * Changes tab to path - */ - (behavior: 'change tab', path: string): JQuery; - /** - * Sets current path to state - */ - (behavior: 'set state', path: string): JQuery; - /** - * Returns current path - */ - (behavior: 'get path'): string; - /** - * Returns whether tab exists - */ - (behavior: 'is tab'): boolean; - /** - * Returns cached HTML for path - */ - (behavior: 'cache read', path: string): string | false; - /** - * Sets cached HTML for path - */ - (behavior: 'cache add', path: string, html: string): JQuery; - /** - * Removes cached HTML for path - */ - (behavior: 'cache remove', path: string): JQuery; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): TabSettings[K]; - (behavior: 'setting', name: K, value: TabSettings[K]): JQuery; - (behavior: 'setting', value: TabSettings): JQuery; - (settings?: TabSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/tab.html#/settings} - */ - interface TabSettings extends ComponentSettings { - // region Tab Settings - - /** - * Whether tab should load remote content as same url as history - * - * @default false - */ - auto?: boolean; - /** - * When set to siblings will only deactivate elements that are DOM siblings with the activated element. - * When set to all the component will deactivate all other elements initialized at the same time. - * - * @default 'siblings' - * @since 2.2 - */ - deactivate?: 'siblings' | 'all'; - /** - * Whether to record history events for tab changes - * - * @default false - */ - history?: boolean; - /** - * Do not load content remotely on first tab load. Useful when open tab is rendered on server. - * - * @default false - */ - ignoreFirstLoad?: boolean; - /** - * Whether inline scripts in tab HTML should be parsed on tab load. - * Defaults to once, parsing only on first load. - * Can also be set to true or false to always parse or never parse inline scripts. - * - * @default 'once' - */ - evaluateScripts?: 'once' | boolean; - /** - * Tab should reload content every time it is opened - */ - alwaysRefresh?: boolean; - /** - * Can be set to either response, DOM or html. - * Using DOM will cache the a clone of the DOM tree, preserving all events as they existed on render. - * response will cache the original response on load, this way callbacks always receive the same content. - * Using html will cache the resulting html after all callbacks, making sure any changes to content are preserved. - * - * @default 'response' - */ - cacheType?: 'response' | 'DOM' | 'html'; - /** - * Tab should cache content after loading locally to avoid server trip on second load - * - * @default true - */ - cache?: boolean; - /** - * Settings object for $.api call - * - * @default false - * @see {@link http://semantic-ui.com/behaviors/api.html} - */ - apiSettings?: ApiSettings; - /** - * Can be set to hash or state. - * Hash will use an in-page link to create history events. - * State will use DOM History and load pages from server on refresh. - * - * @default 'hash' - * @see {@link https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history} - */ - historyType?: 'hash' | 'state'; - /** - * When using historyType state you must specify the base URL for all internal links. - * - * @default false - */ - path?: false | string; - /** - * Tabs are limited to those found inside this context - * - * @default false - */ - context?: false | Selector; - /** - * If enabled limits tabs to children of passed context - * - * @default false - */ - childrenOnly?: boolean; - /** - * Maximum amount of nested tabs allowed (avoids recursion) - * - * @default 25 - */ - maxDepth?: number; - /** - * When enabled only calls remote endpoint for tab data on first load and leaves the DOM undisturbed afterwards. - * - * @default false - * @since 2.2.8 - */ - loadOnce?: boolean; - - // endregion - - // region Callbacks - - /** - * Callback only the first time a tab is loaded - */ - onFirstLoad?(this: JQuery, tabPath: string, parameterArray: any[], historyEvent: any): void; - /** - * Callback every time a tab is loaded - */ - onLoad?(this: JQuery, tabPath: string, parameterArray: any[], historyEvent: any): void; - /** - * Called when a tab begins loading remote content - */ - onRequest?(this: JQuery, tabPath: string): void; - /** - * Called after a tab becomes visible - */ - onVisible?(this: JQuery, tabPath: string): void; - - // endregion - - // region DOM Settings - - /** - * Functions used to return content - */ - templates?: { - /** - * returns page title - */ - determineTitle?(tabArray: any[]): string; - }; - /** - * Selectors used by module - */ - selector?: { - /** - * @default '.ui.tab' - */ - tabs?: string; - /** - * @default '.ui:not(.menu)' - */ - parent?: string; - }; - /** - * DOM metadata used by module - */ - metadata?: { - /** - * @default 'tab' - */ - tab?: string; - /** - * @default 'loaded' - */ - loaded?: string; - /** - * @default 'promise' - */ - promise?: string; - }; - /** - * Class names used to attach style to state - */ - className?: { - /** - * @default 'loading' - */ - loading?: string; - /** - * @default 'active' - */ - active?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'You attempted to load content without API module' - */ - api?: string; - /** - * @default 'The method you called is not defined' - */ - method?: string; - /** - * @default 'Activated tab cannot be found for this context.' - */ - missingTab?: string; - /** - * @default 'The tab you specified is missing a content url.' - */ - noContent?: string; - /** - * @default 'History enabled, but no path was specified' - */ - path?: string; - /** - * @default 'Max recursive depth reached' - */ - recursion?: string; - /** - * @default 'The state library has not been initialized' - */ - state?: string; - }; - - // endregion - } - - // endregion - - // region Transition - - interface Transition { - settings: TransitionSettings; - - /** - * Stop current animation and preserve queue - */ - (behavior: 'stop'): JQuery; - /** - * Stop current animation and queued animations - */ - (behavior: 'stop all'): JQuery; - /** - * Clears all queued animations - */ - (behavior: 'clear queue'): JQuery; - /** - * Stop current animation and show element - */ - (behavior: 'show'): JQuery; - /** - * Stop current animation and hide element - */ - (behavior: 'hide'): JQuery; - /** - * Toggles between hide and show - */ - (behavior: 'toggle'): JQuery; - /** - * Forces reflow using a more expensive but stable method - */ - (behavior: 'force repaint'): JQuery; - /** - * Triggers reflow on element - */ - (behavior: 'repaint'): JQuery; - /** - * Resets all conditions changes during transition - */ - (behavior: 'reset'): JQuery; - /** - * Enables animation looping - */ - (behavior: 'looping'): JQuery; - /** - * Removes looping state from element - */ - (behavior: 'remove looping'): JQuery; - /** - * Adds disabled state (stops ability to animate) - */ - (behavior: 'disable'): JQuery; - /** - * Removes disabled state - */ - (behavior: 'enable'): JQuery; - /** - * Modifies element animation duration - */ - (behavior: 'set duration', duration: number): JQuery; - /** - * Saves all class names and styles to cache to be retrieved after animation - */ - (behavior: 'save conditions'): JQuery; - /** - * Adds back cached names and styles to element - */ - (behavior: 'restore conditions'): JQuery; - /** - * Returns vendor prefixed animation property for animationname - */ - (behavior: 'get animation name'): string; - /** - * Returns vendor prefixed animation property for animationend - */ - (behavior: 'get animation event'): string; - /** - * Returns whether element is currently visible - */ - (behavior: 'is visible'): boolean; - /** - * Returns whether transition is currently occurring - */ - (behavior: 'is animating'): boolean; - /** - * Returns whether animation looping is set - */ - (behavior: 'is looping'): boolean; - /** - * Returns whether animations are supported - */ - (behavior: 'is supported'): boolean; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): TransitionSettings[K]; - (behavior: 'setting', name: K, value: TransitionSettings[K]): JQuery; - (behavior: 'setting', value: TransitionSettings): JQuery; - (transition: string): JQuery; - (settings?: TransitionSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/modules/transition.html#/settings} - */ - interface TransitionSettings extends ComponentSettings { - // region Transition Settings - - /** - * Named animation event to used. Must be defined in CSS. - * - * @default 'fade' - */ - animation?: string; - /** - * Interval in MS between each elements transition - * - * @default 0 - */ - interval?: number; - /** - * When an interval is specified, sets order of animations. auto reverses only animations that are hiding. - * - * @default 'auto' - */ - reverse?: 'auto' | boolean; - /** - * Specify the final display type (block, inline-block etc) so that it doesn't have to be calculated. - * - * @default false - */ - displayType?: false | string; - /** - * Duration of the CSS transition animation - * - * @default 500 - */ - duration?: number; - /** - * If enabled a timeout will be added to ensure animationend callback occurs even if element is hidden - */ - useFailSafe?: boolean; - /** - * If enabled will allow same animation to be queued while it is already occurring - */ - allowRepeats?: boolean; - /** - * Whether to automatically queue animation if another is occurring - */ - queue?: boolean; - - // endregion - - // region Callbacks - - /** - * Callback on each transition that changes visibility to shown - */ - onShow?(this: JQuery): void; - /** - * Callback on each transition that changes visibility to hidden - */ - onHide?(this: JQuery): void; - /** - * Callback on animation start, useful for queued animations - */ - onStart?(this: JQuery): void; - /** - * Callback on each transition complete - */ - onComplete?(this: JQuery): void; - - // endregion - - // region DOM Settings - - /** - * Class names used to attach style to state - */ - className?: { - /** - * @default 'animating' - */ - animating?: string; - /** - * @default 'disabled' - */ - disabled?: string; - /** - * @default 'hidden' - */ - hidden?: string; - /** - * @default 'in' - */ - inward?: string; - /** - * @default 'loading' - */ - loading?: string; - /** - * @default 'looping' - */ - looping?: string; - /** - * @default 'out' - */ - outward?: string; - /** - * @default 'transition' - */ - transition?: string; - /** - * @default 'visible' - */ - visible?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'There is no CSS animation matching the one you specified.' - */ - noAnimation?: string; - /** - * @default 'The method you called is not defined' - */ - method?: string; - }; - - // endregion - } - - // endregion - - // endregion - - // region Behaviors - - // region API - - interface Api { - settings: ApiSettings; - - /** - * Execute query using existing API settings - */ - (behavior: 'query'): JQuery; - /** - * Adds data to existing templated url and returns full url string - */ - (behavior: 'add url data', url: string, data: any): string; - /** - * Gets promise for current API request - */ - (behavior: 'get request'): JQueryDeferred | false; - /** - * Aborts current API request - */ - (behavior: 'abort'): JQuery; - /** - * Removes loading and error state from element - */ - (behavior: 'reset'): JQuery; - /** - * Returns whether last request was cancelled - */ - (behavior: 'was cancelled'): boolean; - /** - * Returns whether last request was failure - */ - (behavior: 'was failure'): boolean; - /** - * Returns whether last request was successful - */ - (behavior: 'was successful'): boolean; - /** - * Returns whether last request was completed - */ - (behavior: 'was complete'): boolean; - /** - * Returns whether element is disabled - */ - (behavior: 'is disabled'): boolean; - /** - * Returns whether element response is mocked - */ - (behavior: 'is mocked'): boolean; - /** - * Returns whether element is loading - */ - (behavior: 'is loading'): boolean; - /** - * Sets loading state to element - */ - (behavior: 'set loading'): JQuery; - /** - * Sets error state to element - */ - (behavior: 'set error'): JQuery; - /** - * Removes loading state to element - */ - (behavior: 'remove loading'): JQuery; - /** - * Removes error state to element - */ - (behavior: 'remove error'): JQuery; - /** - * Gets event that API request will occur on - */ - (behavior: 'get event'): string; - /** - * Returns encodeURIComponent value only if value passed is not already encoded - */ - (behavior: 'get url encoded value', value: any): string; - /** - * Reads a locally cached response for a URL - */ - (behavior: 'read cached response', url: string): any; - /** - * Writes a cached response for a URL - */ - (behavior: 'write cached response', url: string, response: any): JQuery; - /** - * Creates new cache, removing all locally cached URLs - */ - (behavior: 'create cache'): JQuery; - /** - * Removes API settings from the page and all events - */ - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): ApiSettings[K]; - (behavior: 'setting', name: K, value: ApiSettings[K]): JQuery; - (behavior: 'setting', value: ApiSettings): JQuery; - (settings?: ApiSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/behaviors/api.html#/settings} - */ - interface ApiSettings extends ComponentSettings { - // region Behavior - - /** - * When API event should occur - * - * @default 'auto' - */ - on?: string; - /** - * Can be set to 'local' to cache successful returned AJAX responses when using a JSON API. - * This helps avoid server round trips when API endpoints will return the same results when accessed repeatedly. - * Setting to false, will add cache busting parameters to the URL. - * - * @default true - */ - cache?: 'local' | boolean; - /** - * UI state will be applied to this element, defaults to triggering element. - */ - stateContext?: Selector; - /** - * Whether to encode parameters with encodeURIComponent before adding into url string - * - * @default true - */ - encodeParameters?: boolean; - /** - * Whether to automatically include default data like {value} and {text} - * - * @default true - */ - defaultData?: boolean; - /** - * Whether to serialize closest form and include in request - * - * @default false - */ - serializeForm?: boolean; - /** - * How long to wait when a request is made before triggering request, useful for rate limiting oninput - * - * @default 0 - */ - throttle?: number; - /** - * When set to false will not delay the first request made, when no others are queued - * - * @default true - */ - throttleFirstRequest?: boolean; - /** - * Whether an API request can occur while another request is still pending - * - * @default false - */ - interruptRequests?: boolean; - /** - * Minimum duration to show loading indication - * - * @default 0 - */ - loadingDuration?: number; - /** - * The default auto will automatically remove error state after error duration, unless the element is a form - * - * @default 'auto' - */ - hideError?: 'auto' | boolean; - /** - * Setting to true, will not remove error. - * Setting to a duration in milliseconds to show error state after request error. - * - * @default 2000 - */ - errorDuration?: true | number; - - // endregion - - // region Request Settings - - /** - * Named API action for query, originally specified in $.fn.settings.api - */ - action?: string | false; - /** - * Templated URL for query, will override specified action - */ - url?: string | false; - /** - * Variables to use for replacement - */ - urlData?: any | false; - /** - * Can be set to a Javascript object which will be returned automatically instead of requesting JSON from server - */ - response?: any | false; - /** - * When specified, this function can be used to retrieve content from a server and return it asynchronously instead of a standard AJAX call. - * The callback function should return the server response. - * - * @default false - */ - responseAsync?: ((settings: ApiSettings, callback: (response: any) => void) => void) | false; - /** - * @see response - */ - mockResponse?: any | false; - /** - * @see responseAsync - */ - mockResponseAsync?: ((settings: ApiSettings, callback: (response: any) => void) => void) | false; - /** - * Method for transmitting request to server - */ - method?: 'post' | 'get'; - /** - * Expected data type of response - */ - dataType?: 'xml' | 'json' | 'jsonp' | 'script' | 'html' | 'text'; - /** - * POST/GET Data to Send with Request - */ - data?: any; - - // endregion - - // region Callbacks - - /** - * Allows modifying settings before request, or cancelling request - */ - beforeSend?(settings: ApiSettings): any; - /** - * Allows modifying XHR object for request - */ - beforeXHR?(xhrObject: JQueryXHR): any; - /** - * Callback that occurs when request is made. Receives both the API success promise and the XHR request promise. - */ - onRequest?(promise: JQueryDeferred, xhr: JQueryXHR): void; - /** - * Allows modifying the server's response before parsed by other callbacks to determine API event success - */ - onResponse?(response: any): void; - /** - * Determines whether completed JSON response should be treated as successful - * - * @see {@link http://semantic-ui.com/behaviors/api.html#determining-json-success} - */ - successTest?(response: any): boolean; - /** - * Callback after successful response, JSON response must pass successTest - */ - onSuccess?(response: any, element: JQuery, xhr: JQueryXHR): void; - /** - * Callback on request complete regardless of conditions - */ - onComplete?(response: any, element: JQuery, xhr: JQueryXHR): void; - /** - * Callback on failed response, or JSON response that fails successTest - */ - onFailure?(response: any, element: JQuery): void; - /** - * Callback on server error from returned status code, or XHR failure. - */ - onError?(errorMessage: string, element: JQuery, xhr: JQueryXHR): void; - /** - * Callback on abort caused by user clicking a link or manually cancelling request. - */ - onAbort?(errorMessage: string, element: JQuery, xhr: JQueryXHR): void; - - // endregion - - // region DOM Settings - - /** - * Regular expressions used for template matching - */ - regExp?: { - /** - * @default /\{\$*[A-z0-9]+\}/g - */ - required?: RegExp; - /** - * @default /\{\/\$*[A-z0-9]+\}/g - */ - optional?: RegExp; - }; - /** - * Selectors used to find parts of a module - */ - selector?: { - /** - * @default '.disabled' - */ - disabled?: string; - /** - * @default 'form' - */ - form?: string; - }; - /** - * Class names used to determine element state - */ - className?: { - /** - * @default 'loading' - */ - loading?: string; - /** - * @default 'error' - */ - error?: string; - }; - /** - * Metadata used to store XHR and response promise - */ - metadata?: { - /** - * @default 'action' - */ - action?: string; - /** - * @default 'url' - */ - url?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'The before send function has aborted the request' - */ - beforeSend?: string; - /** - * @default 'There was an error with your request' - */ - error?: string; - /** - * @default 'API Request Aborted. Exit conditions met' - */ - exitConditions?: string; - /** - * @default 'JSON could not be parsed during error handling' - */ - JSONParse?: string; - /** - * @default 'You are using legacy API success callback names' - */ - legacyParameters?: string; - /** - * @default 'API action used but no url was defined' - */ - missingAction?: string; - /** - * @default 'Required dependency jquery-serialize-object missing, using basic serialize' - */ - missingSerialize?: string; - /** - * @default 'No URL specified for API event' - */ - missingURL?: string; - /** - * @default 'The beforeSend callback must return a settings object, beforeSend ignored.' - */ - noReturnedValue?: string; - /** - * @default 'There was an error parsing your request' - */ - parseError?: string; - /** - * @default 'Missing a required URL parameter: ' - */ - requiredParameter?: string; - /** - * @default 'Server gave an error: ' - */ - statusMessage?: string; - /** - * @default 'Your request timed out' - */ - timeout?: string; - }; - - // endregion - } - - // endregion - - // region Form Validation - - interface Form { - settings: FormSettings; - - /** - * Submits selected form - */ - (behavior: 'submit'): JQuery; - /** - * Returns true/false whether a form passes its validation rules - */ - (behavior: 'is valid'): boolean; - /** - * Validates form and calls onSuccess or onFailure - */ - (behavior: 'validate form'): JQuery; - /** - * gets browser property change event - */ - (behavior: 'get change event'): string; - /** - * Returns element with matching name, id, or data-validate metadata to ID - */ - (behavior: 'get field', id: string): JQuery; - /** - * Returns value of element with id - */ - (behavior: 'get value', id: string): any; - /** - * Returns object of element values that match array of ids. If no IDS are passed will return all fields - */ - (behavior: 'get values', ids?: string[]): any; - /** - * Sets value of element with id - */ - (behavior: 'set value', id: string): JQuery; - /** - * Sets key/value pairs from passed values object to matching ids - */ - (behavior: 'set values', values: any): JQuery; - /** - * Returns validation rules for a given jQuery-referenced input field - */ - (behavior: 'get validation', element: JQuery): any; - /** - * Returns whether a field exists - */ - (behavior: 'has field', identifier: string): boolean; - /** - * Adds errors to form, given an array errors - */ - (behavior: 'add errors', errors: string[]): JQuery; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): FormSettings[K]; - (behavior: 'setting', name: K, value: FormSettings[K]): JQuery; - (behavior: 'setting', value: FormSettings): JQuery; - (settings?: FormSettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/behaviors/form.html#/settings} - */ - interface FormSettings extends ComponentSettings { - // region Form Settings - - /** - * Adds keyboard shortcuts for enter and escape keys to submit form and blur fields respectively - * - * @default true - */ - keyboardShortcuts?: boolean; - /** - * Event used to trigger validation. Can be either submit, blur or change. - * - * @default 'submit' - */ - on?: 'submit' | 'blur' | 'change'; - /** - * If set to true will revalidate fields with errors on input change - * - * @default true - */ - revalidate?: boolean; - /** - * Delay from last typed letter to validate a field when using on: change or when revalidating a field. - * - * @default true - */ - delay?: boolean; - /** - * Adds inline error on field validation error - * - * @default false - */ - inline?: boolean; - /** - * Named transition to use when animating validation errors. Fade and slide down are available without including ui transitions - * - * @default 'scale' - * @see {@link http://semantic-ui.com/modules/transition.html} - */ - transition?: string; - /** - * Animation speed for inline prompt - * - * @default 150 - */ - duration?: number; - fields?: { - [name: string]: string | string[] | Field; - }; - - // endregion - - // region Form Prompts - - text?: { - /** - * @default 'Please enter a valid value' - */ - unspecifiedRule?: string; - /** - * @default 'This field' - */ - unspecifiedField?: string; - }; - prompt?: { - /** - * @default '{name} must have a value' - */ - empty?: string; - /** - * @default '{name} must be checked' - */ - checked?: string; - /** - * @default '{name} must be a valid e-mail' - */ - email?: string; - /** - * @default '{name} must be a valid url' - */ - url?: string; - /** - * @default '{name} is not formatted correctly' - */ - regExp?: string; - /** - * @default '{name} must be an integer' - */ - integer?: string; - /** - * @default '{name} must be a decimal number' - */ - decimal?: string; - /** - * @default '{name} must be set to a number' - */ - number?: string; - /** - * @default '{name} must be \'{ruleValue}\'' - */ - is?: string; - /** - * @default '{name} must be exactly \'{ruleValue}\'' - */ - isExactly?: string; - /** - * @default '{name} cannot be set to \'{ruleValue}\'' - */ - not?: string; - /** - * @default '{name} cannot be set to exactly \'{ruleValue}\'' - */ - notExactly?: string; - /** - * @default '{name} cannot contain \'{ruleValue}\'' - */ - contain?: string; - /** - * @default '{name} cannot contain exactly \'{ruleValue}\'' - */ - containExactly?: string; - /** - * @default '{name} must contain \'{ruleValue}\'' - */ - doesntContain?: string; - /** - * @default '{name} must contain exactly \'{ruleValue}\'' - */ - doesntContainExactly?: string; - /** - * @default '{name} must be at least {ruleValue} characters' - */ - minLength?: string; - /** - * @default '{name} must be at least {ruleValue} characters' - */ - length?: string; - /** - * @default '{name} must be exactly {ruleValue} characters' - */ - exactLength?: string; - /** - * @default '{name} cannot be longer than {ruleValue} characters' - */ - maxLength?: string; - /** - * @default '{name} must match {ruleValue} field' - */ - match?: string; - /** - * @default '{name} must have a different value than {ruleValue} field' - */ - different?: string; - /** - * @default '{name} must be a valid credit card number' - */ - creditCard?: string; - /** - * @default '{name} must have at least {ruleValue} choices' - */ - minCount?: string; - /** - * @default '{name} must have exactly {ruleValue} choices' - */ - exactCount?: string; - /** - * @default '{name} must have {ruleValue} or less choices' - */ - maxCount?: string; - }; - - // endregion - - // region Callbacks - - /** - * Callback on each valid field - */ - onValid?(this: JQuery): void; - /** - * Callback on each invalid field - */ - onInvalid?(this: JQuery): void; - /** - * Callback if a form is all valid - */ - onSuccess?(this: JQuery, event: JQueryEventObject, fields: any): void; - /** - * Callback if any form field is invalid - */ - onFailure?(this: JQuery, formErrors: string[], fields: any): void; - - // endregion - - // region Templates - - templates?: { - error?(errors: string[]): JQuery; - prompt?(errors: string[]): JQuery; - }; - - // endregion - - // region Rules - - rules?: { - [name: string]: (...args: any[]) => boolean; - }; - - // endregion - - // region DOM Settings - - /** - * Selectors used to match functionality to DOM - */ - selector?: { - /** - * @default '.error.message' - */ - message?: string; - /** - * @default 'input, textarea, select' - */ - field?: string; - /** - * @default '.field' - */ - group?: string; - /** - * @default 'input' - */ - input?: string; - /** - * @default '.prompt' - */ - prompt?: string; - /** - * @default '.submit' - */ - submit?: string; - }; - /** - * HTML5 metadata attributes - */ - metadata?: { - /** - * @default 'validate' - */ - validate?: string; - }; - /** - * Class names used to attach style to state - */ - className?: { - /** - * @default 'active' - */ - active?: string; - /** - * @default 'default' - */ - placeholder?: string; - /** - * @default 'disabled' - */ - disabled?: string; - /** - * @default 'visible' - */ - visible?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'The method you called is not defined.' - */ - method?: string; - }; - - // endregion - } - - interface Field { - identifier: string; - rules: Rule[]; - } - - interface Rule { - type: string; - prompt: string; - } - - // endregion - - // region Visibility - - interface Visibility { - settings: VisibilitySettings; - - /** - * Disable callbacks temporarily. This is useful if you need to adjust scroll position and do not want to trigger callbacks during the position change. - */ - (behavior: 'disable callbacks'): JQuery; - /** - * Re-enable callbacks - */ - (behavior: 'enable callbacks'): JQuery; - /** - * Returns whether element is on screen - */ - (behavior: 'is on screen'): boolean; - /** - * Returns whether element is off screen - */ - (behavior: 'is off screen'): boolean; - /** - * Returns number of pixels passed in current element from top of element - */ - (behavior: 'get pixels passed'): number; - /** - * Returns element calculations as object - */ - (behavior: 'get element calculations'): ElementCalculations; - /** - * Returns screen calculations as object - */ - (behavior: 'get screen calculations'): ScreenCalculations; - /** - * Returns screen size as object - */ - (behavior: 'get screen size'): ScreenSize; - (behavior: 'destroy'): JQuery; - (behavior: 'setting', name: K, value?: undefined): VisibilitySettings[K]; - (behavior: 'setting', name: K, value: VisibilitySettings[K]): JQuery; - (behavior: 'setting', value: VisibilitySettings): JQuery; - (settings?: VisibilitySettings): JQuery; - } - - /** - * @see {@link http://semantic-ui.com/behaviors/visibility.html#/settings} - */ - interface VisibilitySettings extends ComponentSettings { - // region Functionality - - /** - * When set to false a callback will occur each time an element passes the threshold for a condition. - * - * @default true - */ - once?: boolean; - /** - * When set to true a callback will occur anytime an element passes a condition not just immediately after the threshold is met. - * - * @default false - */ - continuous?: boolean; - /** - * Set to image to load images when on screen. Set to fixed to add class name fixed when passed. - * - * @default false - */ - type?: false | 'image' | 'fixed'; - /** - * Whether visibility conditions should be checked immediately on init - * - * @default true - */ - initialCheck?: boolean; - /** - * The scroll context visibility should use. - * - * @default 'window' - */ - context?: Selector; - /** - * Whether visibility conditions should be checked on window load. This ensures that after images load content positions will be updated correctly. - * - * @default true - */ - refreshOnLoad?: boolean; - /** - * Whether visibility conditions should be checked on window resize. Useful when content resizes causes continuous changes in position - * - * @default true - */ - refreshOnResize?: boolean; - /** - * Whether visibility conditions should be checked on calls to refresh. - * These calls can be triggered from either resize, load or manually calling $('.foo').visibility('refresh') - * - * @default true - */ - checkOnRefresh?: boolean; - /** - * Specify a z-index when using type: 'fixed'. - * - * @default 1 - * @since 2.2 - */ - zIndex?: number; - /** - * Value that context scrollTop should be adjusted in pixels. Useful for making content appear below content fixed to the page. - * - * @default 0 - */ - offset?: number; - /** - * Whether element calculations should include its margin - * - * @default false - */ - includeMargin?: boolean; - /** - * When set to an integer, scroll position will be debounced using this ms value. false will debounce with requestAnimationFrame. - * - * @default false - */ - throttle?: false | number; - /** - * Whether to automatically refresh content when changes are made to the element's DOM subtree - * - * @default true - */ - observeChanges?: boolean; - /** - * When using type: image allows you to specify transition when showing a loaded image - * - * @default false - */ - transition?: false | string; - /** - * When using type: image allows you to specify transition duration - * - * @default 1000 - */ - duration?: number; - - // endregion - - // region Visibility Callbacks - - /** - * Element's top edge has passed bottom of screen - */ - onTopVisible?(this: JQuery): void; - /** - * Element's top edge has passed top of the screen - */ - onTopPassed?(this: JQuery): void; - /** - * Element's bottom edge has passed bottom of screen - */ - onBottomVisible?(this: JQuery): void; - /** - * Any part of an element is visible on screen - */ - onPassing?(this: JQuery): void; - /** - * Element's bottom edge has passed top of screen - */ - onBottomPassed?(this: JQuery): void; - /** - * Element's top edge has not passed bottom of screen - */ - onTopVisibleReverse?(this: JQuery): void; - /** - * Element's top edge has not passed top of the screen - */ - onTopPassedReverse?(this: JQuery): void; - /** - * Element's bottom edge has not passed bottom of screen - */ - onBottomVisibleReverse?(this: JQuery): void; - /** - * Element's top has not passed top of screen but bottom has - */ - onPassingReverse?(this: JQuery): void; - /** - * Element's bottom edge has not passed top of screen - */ - onBottomPassedReverse?(this: JQuery): void; - onOnScreen?(this: JQuery): void; - onOffScreen?(this: JQuery): void; - - // endregion - - // region Image Callbacks - - /** - * Occurs after an image has completed loading - * - * @since 2.2 - */ - onLoad?(this: JQuery): void; - /** - * Occurs after all img initialized at the same time have loaded. - * - * @since 2.2 - */ - onAllLoaded?(this: JQuery): void; - - // endregion - - // region Fixed Callbacks - - /** - * Occurs after element has been assigned position fixed - * - * @since 2.2 - */ - onFixed?(this: JQuery): void; - /** - * Occurs after element has been removed from fixed position - * - * @since 2.2 - */ - onUnfixed?(this: JQuery): void; - - // endregion - - // region Utility Callbacks - - /** - * Occurs each time an elements calculations are updated - */ - onUpdate?(this: JQuery, calculations: ElementCalculations): void; - /** - * Occurs whenever element's visibility is refreshed - */ - onRefresh?(this: JQuery): void; - - // endregion - - // region DOM Settings - - /** - * Class names used to attach style to state - */ - className?: { - /** - * @default 'fixed' - */ - fixed?: string; - }; - - // endregion - - // region Debug Settings - - error?: { - /** - * @default 'The method you called is not defined.' - */ - method?: string; - }; - - // endregion - } - - interface ElementPosition { - fits: boolean; - offset: JQueryCoordinates; - width: number; - height: number; - } - - interface ElementCalculations extends ElementPosition { - margin?: { - top: number; - bottom: number; - }; - top: number; - bottom: number; - - topVisible: boolean; - topPassed: boolean; - bottomVisible: boolean; - bottomPassed: boolean; - pixelsPassed: number; - percentagePassed: number; - - onScreen: boolean; - passing: boolean; - offScreen: boolean; - } - - interface ScreenCalculations { - top: number; - bottom: number; - } - - interface ScreenSize { - height: number; - } - - // endregion - - // endregion -} +/// + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +/// +/// +/// diff --git a/types/semantic-ui/semantic-ui-tests.ts b/types/semantic-ui/semantic-ui-tests.ts index ca5951d516..843604940d 100644 --- a/types/semantic-ui/semantic-ui-tests.ts +++ b/types/semantic-ui/semantic-ui-tests.ts @@ -1,453 +1,51 @@ -function test_site() { - const selector = '.ui.site'; - $(selector).site('destroy') === $(); - $(selector).site('setting', 'debug', undefined) === false; - $(selector).site('setting', 'debug') === false; - $(selector).site('setting', 'debug', true) === $(); - $(selector).site('setting', { - namespace: 'namespace', - name: 'name', - silent: false, - debug: true, - performance: true, - verbose: true - }) === $(); - $(selector).site({ - modules: [ - 'accordion', - 'api', - 'checkbox', - 'dimmer', - 'dropdown', - 'embed', - 'form', - 'modal', - 'nag', - 'popup', - 'rating', - 'shape', - 'sidebar', - 'state', - 'sticky', - 'tab', - 'transition', - 'visit', - 'visibility' - ], - siteNamespace: 'site', - namespaceStub: { - cache: {}, - config: {}, - sections: {}, - section: {}, - utilities: {} - } - }) === $(); - $(selector).site() === $(); -} +function test_static() { + $.site.settings.debug = true; + $.fn.site.settings.debug = true; -function test_accordion() { - const selector = '.ui.accordion'; - $(selector).accordion('refresh'); - $(selector).accordion('open', 0); - $(selector).accordion('close others'); - $(selector).accordion('close', 0); - $(selector).accordion('toggle', 0); - $(selector).accordion('destroy'); - $(selector).accordion('setting', 'exclusive', undefined) === true; - $(selector).accordion('setting', 'exclusive', true) === $(); - $(selector).accordion('setting', 'exclusive') === true; - $(selector).accordion({ - selector: { - trigger: '.title .icon' - } - }); - $(selector).accordion(); -} - -function test_checkbox() { - const selector = '.ui.checkbox'; - $(selector).checkbox({}); - $(selector).checkbox(); -} - -function test_dimmer_settings() { - $.fn.dimmer.settings.namespace = 'namespace'; - $.fn.dimmer.settings.name = 'name'; - $.fn.dimmer.settings.silent = false; + $.fn.accordion.settings.debug = true; + $.fn.checkbox.settings.debug = true; $.fn.dimmer.settings.debug = true; - $.fn.dimmer.settings.performance = true; - $.fn.dimmer.settings.verbose = true; -} - -function test_dimmer() { - const selector = '.ui.dimmer'; - $(selector).dimmer('add content', $()) === $(); - $(selector).dimmer('show') === $(); - $(selector).dimmer('hide') === $(); - $(selector).dimmer('toggle') === $(); - $(selector).dimmer('set opacity', 1) === $(); - $(selector).dimmer('create') === $(); - $(selector).dimmer('get duration') === 10; - $(selector).dimmer('get dimmer') === $(); - $(selector).dimmer('has dimmer') === true; - $(selector).dimmer('is active') === true; - $(selector).dimmer('is animating') === true; - $(selector).dimmer('is dimmer') === true; - $(selector).dimmer('is dimmable') === true; - $(selector).dimmer('is disabled') === true; - $(selector).dimmer('is enabled') === true; - $(selector).dimmer('is page') === true; - $(selector).dimmer('is page dimmer') === true; - $(selector).dimmer('set active') === $(); - $(selector).dimmer('set dimmable') === $(); - $(selector).dimmer('set dimmed') === $(); - $(selector).dimmer('set page dimmer') === $(); - $(selector).dimmer('set disabled') === $(); - $(selector).dimmer('destroy') === $(); - $(selector).dimmer('setting', 'debug', undefined) === false; - $(selector).dimmer('setting', 'debug') === false; - $(selector).dimmer('setting', 'debug', true) === $(); - $(selector).dimmer('setting', { - namespace: 'namespace', - name: 'name', - silent: false, - debug: true, - performance: true, - verbose: true - }) === $(); - $(selector).dimmer({ - opacity: 1, - variation: 'variation', - dimmerName: 'dimmerName', - closable: true, - on: 'click', - useCSS: true, - duration: { - show: 200, - hide: 300 - }, - transition: 'fade', - onShow() { - this === $(); - }, - onHide() { - this === $(); - }, - onChange() { - this === $(); - }, - selector: { - dimmable: '.dimmable', - dimmer: '.dimmer', - content: '.content' - }, - template: { - dimmer() { - return $(); - } - }, - className: { - active: 'active', - dimmable: 'dimmable', - dimmed: 'dimmed', - disabled: 'disabled', - pageDimmer: 'pageDimmer', - hide: 'hide', - show: 'show', - transition: 'transition' - }, - error: { - method: 'method' - } - }) === $(); - $(selector).dimmer() === $(); -} - -function test_dropdown() { - const selector = '.ui.dropdown'; - $(selector).dropdown({}); - $(selector).dropdown(); -} - -function test_embed() { - const selector = '.ui.embed'; - $(selector).embed({}); - $(selector).embed(); -} - -function test_modal() { - const selector = '.ui.modal'; - $(selector).modal({}); - $(selector).modal(); -} - -function test_nag() { - const selector = '.ui.nag'; - $(selector).nag({}); -} - -function test_popup() { - const selector = '.ui.popup'; - $(selector).popup({ - html: '
Content
' - }); - $(selector).popup({ - html: $('
Content
') - }); - $(selector).popup(); -} - -function test_progress() { - const selector = '.ui.progress'; - $(selector).progress({}); - $(selector).progress(); -} - -function test_rating() { - const selector = '.ui.rating'; - $(selector).rating({}); - $(selector).rating(); -} - -function test_search() { - const selector = '.ui.search'; - $(selector).search({}); - $(selector).search(); -} - -function test_shape() { - const selector = '.ui.shape'; - $(selector).shape({}); - $(selector).shape(); -} - -function test_sidebar() { - const selector = '.ui.sidebar'; - $(selector).sidebar({}); - $(selector).sidebar(); -} - -function test_sticky() { - const selector = '.ui.sticky'; - $(selector).sticky({}); - $(selector).sticky(); -} - -function test_tab() { - const selector = '.ui.tab'; - $(selector).tab({}); - $(selector).tab(); -} - -function test_transition_settings() { - $.fn.transition.settings.namespace = 'namespace'; - $.fn.transition.settings.name = 'name'; - $.fn.transition.settings.silent = false; + $.fn.dropdown.settings.debug = true; + $.fn.embed.settings.debug = true; + $.fn.modal.settings.debug = true; + $.fn.nag.settings.debug = true; + $.fn.popup.settings.debug = true; + $.fn.progress.settings.debug = true; + $.fn.rating.settings.debug = true; + $.fn.search.settings.debug = true; + $.fn.shape.settings.debug = true; + $.fn.sidebar.settings.debug = true; + $.fn.sticky.settings.debug = true; + $.fn.tab.settings.debug = true; $.fn.transition.settings.debug = true; - $.fn.transition.settings.performance = true; - $.fn.transition.settings.verbose = true; + + $.api.settings.debug = true; + $.fn.api.settings.debug = true; + $.fn.form.settings.debug = true; + $.fn.visibility.settings.debug = true; } -function test_transition() { - const selector = '.ui.transition'; - $(selector).transition('stop') === $(); - $(selector).transition('stop all') === $(); - $(selector).transition('clear queue') === $(); - $(selector).transition('show') === $(); - $(selector).transition('hide') === $(); - $(selector).transition('toggle') === $(); - $(selector).transition('force repaint') === $(); - $(selector).transition('repaint') === $(); - $(selector).transition('reset') === $(); - $(selector).transition('looping') === $(); - $(selector).transition('remove looping') === $(); - $(selector).transition('disable') === $(); - $(selector).transition('enable') === $(); - $(selector).transition('set duration', 10) === $(); - $(selector).transition('save conditions') === $(); - $(selector).transition('restore conditions') === $(); - $(selector).transition('get animation name') === 'animation name'; - $(selector).transition('get animation event') === 'animation event'; - $(selector).transition('is visible') === false; - $(selector).transition('is animating') === false; - $(selector).transition('is looping') === false; - $(selector).transition('is supported') === false; - $(selector).transition('destroy') === $(); - $(selector).transition('setting', 'debug', undefined) === false; - $(selector).transition('setting', 'debug') === false; - $(selector).transition('setting', 'debug', true) === $(); - $(selector).transition('setting', { - namespace: 'namespace', - name: 'name', - silent: false, - debug: true, - performance: true, - verbose: true - }) === $(); - $(selector).transition('fade') === $(); - $(selector).transition({ - animation: 'fade', - interval: 200, - reverse: true, - displayType: 'inline-block', - duration: 300, - useFailSafe: false, - allowRepeats: true, - queue: false, - onShow() { - this === $(); - }, - onHide() { - this === $(); - }, - onStart() { - this === $(); - }, - onComplete() { - this === $(); - }, - className: { - animating: 'animating', - disabled: 'disabled', - hidden: 'hidden', - inward: 'inward', - loading: 'loading', - looping: 'looping', - outward: 'outward', - transition: 'transition', - visible: 'visible' - }, - error: { - noAnimation: 'noAnimation', - method: 'method' - } - }); - $(selector).transition() === $(); -} - -function test_api() { - const selector = '.ui.api'; - $(selector).api({}); - $(selector).api(); -} - -function test_form() { - const selector = '.ui.form'; - $(selector).form({}); - $(selector).form(); -} - -function test_form_specifyingValidationRules() { - $('.ui.form').form({ - fields: { - name: 'empty', - gender: 'empty', - username: 'empty', - password: ['minLength[6]', 'empty'], - skills: ['minCount[2]', 'empty'], - terms: 'checked' - } - }); - - $('.ui.form').form({ - fields: { - name: { - identifier: 'name', - rules: [{ - type: 'empty', - prompt: 'Please enter your name' - }] - }, - skills: { - identifier: 'skills', - rules: [{ - type: 'minCount[2]', - prompt: 'Please select at least two skills' - }] - }, - gender: { - identifier: 'gender', - rules: [{ - type: 'empty', - prompt: 'Please select a gender' - }] - }, - username: { - identifier: 'username', - rules: [{ - type: 'empty', - prompt: 'Please enter a username' - }] - }, - password: { - identifier: 'password', - rules: [{ - type: 'empty', - prompt: 'Please enter a password' - }, { - type: 'minLength[6]', - prompt: 'Your password must be at least {ruleValue} characters' - }] - }, - terms: { - identifier: 'terms', - rules: [{ - type: 'checked', - prompt: 'You must agree to the terms and conditions' - }] - } - } - }); -} - -function test_form_addCustomRule() { - const user = { adminLevel: 1 }; - $.fn.form.settings.rules!['adminLevel'] = (value: any, adminLevel: number) => { - return (user.adminLevel >= adminLevel); - }; - $('.ui.form').form({ - fields: { - dog: { - identifier: 'dog', - rules: [{ - type: 'adminLevel[2]', - prompt: 'You must be at least a level-2 admin to add a dog' - }] - } - } - }); -} - -function test_visibility() { - const selector = '.ui.visibility'; - $(selector).visibility({}); - $(selector).visibility(); -} - -function test_settings() { - $.site.settings.verbose = true; - - $.api.settings.verbose = true; - - $.fn.site.settings.verbose = true; - - $.fn.accordion.settings.verbose = true; - $.fn.checkbox.settings.verbose = true; - $.fn.dropdown.settings.verbose = true; - $.fn.embed.settings.verbose = true; - $.fn.modal.settings.verbose = true; - $.fn.nag.settings.verbose = true; - $.fn.popup.settings.verbose = true; - $.fn.progress.settings.verbose = true; - $.fn.rating.settings.verbose = true; - $.fn.search.settings.verbose = true; - $.fn.shape.settings.verbose = true; - $.fn.sidebar.settings.verbose = true; - $.fn.sticky.settings.verbose = true; - $.fn.tab.settings.verbose = true; - - $.fn.api.settings.verbose = true; - $.fn.form.settings.verbose = true; - $.fn.visibility.settings.verbose = true; +function test() { + $('.ui.site').site() === $(); + + $('.ui.accordion').accordion() === $(); + $('.ui.checkbox').checkbox() === $(); + $('.ui.dimmer').dimmer() === $(); + $('.ui.dropdown').dropdown() === $(); + $('.ui.embed').embed() === $(); + $('.ui.modal').modal() === $(); + $('.ui.nag').nag() === $(); + $('.ui.popup').popup() === $(); + $('.ui.progress').progress() === $(); + $('.ui.rating').rating() === $(); + $('.ui.search').search() === $(); + $('.ui.shape').shape() === $(); + $('.ui.sidebar').sidebar() === $(); + $('.ui.sticky').sticky() === $(); + $('.ui.tab').tab() === $(); + $('.ui.transition').transition() === $(); + + $('.ui.api').api() === $(); + $('.ui.form').form() === $(); + $('.ui.visibility').visibility() === $(); } diff --git a/types/semantic-ui/tslint.json b/types/semantic-ui/tslint.json index 08b1465cd6..946997cb87 100644 --- a/types/semantic-ui/tslint.json +++ b/types/semantic-ui/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "unified-signatures": false + "no-useless-files": false } } From ad664c4773657633a70422ae27d36565c2c7d438 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:37:26 +0100 Subject: [PATCH 138/761] Exported DiffFindOptions --- types/nodegit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 3001fef55c..f1997a1ecd 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -15,7 +15,7 @@ export { DiffFile } from './diff-file'; export { DiffLine } from './diff-line'; export { DiffOptions } from './diff-options'; export { DiffPerfdata } from './diff-perf-data'; -export { Diff } from './diff'; +export { Diff, DiffFindOptions } from './diff'; export { Enums } from './enums'; export { Error } from './error'; export { FetchOptions } from './fetch-options'; From 037f9f982c00383374233fe4e35a3cc0f05edfbf Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:39:04 +0100 Subject: [PATCH 139/761] Moved out DiffOptions --- types/nodegit/diff.d.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index d8b60e1c6a..3612e402a4 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -5,6 +5,7 @@ import { Strarray } from './str-array'; import { Index } from './index_'; import { DiffDelta } from './diff-delta'; import { DiffPerfdata } from './diff-perf-data'; +import { DiffOptions } from './diff-options'; export interface DiffFindOptions { version: number; @@ -16,21 +17,6 @@ export interface DiffFindOptions { renameLimit: number; } -export interface DiffOptions { - version: number; - flags: number; - ignoreSubmodules: number; - pathspec: Strarray; - notifyCb: Function; - notifyPayload: undefined; - contextLines: number; - interhunkLines: number; - idAbbrev: number; - maxSize: number; - oldPrefix: string; - newPrefix: string; -} - export namespace Diff { enum DELTA { UNMODIFIED = 0, @@ -140,7 +126,7 @@ export namespace Diff { export class Diff { static blobToBuffer(old_blob: Blob, oldAsPath: string, - buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; + buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; static indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise; static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; From b93979373bfce7a7b3daf9638871f9a5124c419a Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:39:37 +0100 Subject: [PATCH 140/761] Added DiffHunk --- types/nodegit/diff-hunk.d.ts | 8 ++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 10 insertions(+) create mode 100644 types/nodegit/diff-hunk.d.ts diff --git a/types/nodegit/diff-hunk.d.ts b/types/nodegit/diff-hunk.d.ts new file mode 100644 index 0000000000..14a1a9a304 --- /dev/null +++ b/types/nodegit/diff-hunk.d.ts @@ -0,0 +1,8 @@ +export class DiffHunk { + oldStart: number; + oldLines: number; + newStart: number; + newLines: number; + headerLen: number; + header: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index f1997a1ecd..2ae963d13e 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -12,6 +12,7 @@ export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; +export { DiffHunk } from './diff-hunk'; export { DiffLine } from './diff-line'; export { DiffOptions } from './diff-options'; export { DiffPerfdata } from './diff-perf-data'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 82a4c1c2f2..645c75ffea 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -25,6 +25,7 @@ "convenient-patch.d.ts", "diff-delta.d.ts", "diff-file.d.ts", + "diff-hunk.d.ts", "diff-line.d.ts", "diff-options.d.ts", "diff-perf-data.d.ts", From 68153fbcfac8fc2c23c150299ac9fdc50318bb19 Mon Sep 17 00:00:00 2001 From: beary Date: Wed, 7 Jun 2017 09:40:02 +0800 Subject: [PATCH 141/761] Add "// TypeScript Version: 2.3"' --- types/mongodb/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 02208e721b..b1f85ed22c 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/mongodb/node-mongodb-native/tree/2.2 // Definitions by: Federico Caselli // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Documentation : http://mongodb.github.io/node-mongodb-native/2.2/api/ From 41cdc45056d0a4dd9c2f20bb9bcd13780adbb406 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:41:07 +0100 Subject: [PATCH 142/761] Added DiffBinaryFile --- types/nodegit/diff-binary-file.d.ts | 6 ++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 8 insertions(+) create mode 100644 types/nodegit/diff-binary-file.d.ts diff --git a/types/nodegit/diff-binary-file.d.ts b/types/nodegit/diff-binary-file.d.ts new file mode 100644 index 0000000000..46b67f406e --- /dev/null +++ b/types/nodegit/diff-binary-file.d.ts @@ -0,0 +1,6 @@ +export class DiffBinaryFile { + type: number; + data: string; + datalen: number; + inflatedlen: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 2ae963d13e..b30891f96f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -10,6 +10,7 @@ export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { DiffBinaryFile } from './diff-binary-file'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; export { DiffHunk } from './diff-hunk'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 645c75ffea..c9a324a8dc 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -23,6 +23,7 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "diff-binary-file.d.ts", "diff-delta.d.ts", "diff-file.d.ts", "diff-hunk.d.ts", From 9004069b4ea6b7b08808ac2f794b293c95b7805e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:42:24 +0100 Subject: [PATCH 143/761] Added DiffBinary --- types/nodegit/diff-binary.d.ts | 14 ++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 16 insertions(+) create mode 100644 types/nodegit/diff-binary.d.ts diff --git a/types/nodegit/diff-binary.d.ts b/types/nodegit/diff-binary.d.ts new file mode 100644 index 0000000000..fa6643038d --- /dev/null +++ b/types/nodegit/diff-binary.d.ts @@ -0,0 +1,14 @@ +import { DiffBinaryFile } from './diff-binary-file'; + +export namespace DiffBinary { + enum DIFF_BINARY { + NONE = 0, + LITERAL = 1, + DELTA = 2 + } +} + +export class DiffBinary { + oldFile: DiffBinaryFile; + newFile: DiffBinaryFile; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index b30891f96f..aaf1aa1d3c 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -11,6 +11,7 @@ export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; export { DiffBinaryFile } from './diff-binary-file'; +export { DiffBinary } from './diff-binary'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; export { DiffHunk } from './diff-hunk'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index c9a324a8dc..4f42f3bdd5 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -24,6 +24,7 @@ "config.d.ts", "convenient-patch.d.ts", "diff-binary-file.d.ts", + "diff-binary.d.ts", "diff-delta.d.ts", "diff-file.d.ts", "diff-hunk.d.ts", From 76aad31da39117bcd737bd2235cc504a3fa255af Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:43:48 +0100 Subject: [PATCH 144/761] Added DescribeOptions --- types/nodegit/describe-options.d.ts | 8 ++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 10 insertions(+) create mode 100644 types/nodegit/describe-options.d.ts diff --git a/types/nodegit/describe-options.d.ts b/types/nodegit/describe-options.d.ts new file mode 100644 index 0000000000..939750eb11 --- /dev/null +++ b/types/nodegit/describe-options.d.ts @@ -0,0 +1,8 @@ +export class DescribeOptions { + version: number; + maxCandidatesTags: number; + describeStrategy: number; + pattern: string; + onlyFollowFirstParent: number; + showCommitOidAsFallback: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index aaf1aa1d3c..05c4c74a18 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -10,6 +10,7 @@ export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { DescribeOptions } from './describe-options'; export { DiffBinaryFile } from './diff-binary-file'; export { DiffBinary } from './diff-binary'; export { DiffDelta } from './diff-delta'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 4f42f3bdd5..94f92b7fad 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -23,6 +23,7 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "describe-options.d.ts", "diff-binary-file.d.ts", "diff-binary.d.ts", "diff-delta.d.ts", From 30efc5e44ba9690f595b2c359f942178271684b7 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:44:46 +0100 Subject: [PATCH 145/761] Added DescribeFormatOptions --- types/nodegit/describe-format-options.d.ts | 6 ++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 8 insertions(+) create mode 100644 types/nodegit/describe-format-options.d.ts diff --git a/types/nodegit/describe-format-options.d.ts b/types/nodegit/describe-format-options.d.ts new file mode 100644 index 0000000000..ecb7f4d762 --- /dev/null +++ b/types/nodegit/describe-format-options.d.ts @@ -0,0 +1,6 @@ +export class DescribeFormatOptions { + version: number; + abbreviatedSize: number; + alwaysUseLongFormat: number; + dirtySuffix: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 05c4c74a18..5813129fd5 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -10,6 +10,7 @@ export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { DescribeFormatOptions } from './describe-format-options'; export { DescribeOptions } from './describe-options'; export { DiffBinaryFile } from './diff-binary-file'; export { DiffBinary } from './diff-binary'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 94f92b7fad..5d114d2534 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -23,6 +23,7 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "describe-format-options.d.ts", "describe-options.d.ts", "diff-binary-file.d.ts", "diff-binary.d.ts", From e7dc8f352e8301cff84a0527c66867a9821c8915 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:47:37 +0100 Subject: [PATCH 146/761] Added CvarMap --- types/nodegit/cvar-map.d.ts | 5 +++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 7 insertions(+) create mode 100644 types/nodegit/cvar-map.d.ts diff --git a/types/nodegit/cvar-map.d.ts b/types/nodegit/cvar-map.d.ts new file mode 100644 index 0000000000..f7c4b227d0 --- /dev/null +++ b/types/nodegit/cvar-map.d.ts @@ -0,0 +1,5 @@ +export class CvarMap { + cvarType: number; + strMatch: string; + mapValue: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 5813129fd5..d69425fc75 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -10,6 +10,7 @@ export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { CvarMap } from './cvar-map'; export { DescribeFormatOptions } from './describe-format-options'; export { DescribeOptions } from './describe-options'; export { DiffBinaryFile } from './diff-binary-file'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 5d114d2534..b35a0c0e7a 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -23,6 +23,7 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "cvar-map.d.ts", "describe-format-options.d.ts", "describe-options.d.ts", "diff-binary-file.d.ts", From f421bc7be56beabe69f5cace6e43f22fdad56cfd Mon Sep 17 00:00:00 2001 From: beary Date: Wed, 7 Jun 2017 09:51:29 +0800 Subject: [PATCH 147/761] Move ts version comment to end of the header --- types/mongodb/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index b1f85ed22c..916b04cc66 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -2,10 +2,11 @@ // Project: https://github.com/mongodb/node-mongodb-native/tree/2.2 // Definitions by: Federico Caselli // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 // Documentation : http://mongodb.github.io/node-mongodb-native/2.2/api/ +// TypeScript Version: 2.3 + /// /// From 32581a7937486685fb2fbe30650168db8fd17576 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:53:17 +0100 Subject: [PATCH 148/761] Added Checkout --- types/nodegit/checkout.d.ts | 51 +++++++++++++++++++++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 53 insertions(+) create mode 100644 types/nodegit/checkout.d.ts diff --git a/types/nodegit/checkout.d.ts b/types/nodegit/checkout.d.ts new file mode 100644 index 0000000000..a7bc6d63fc --- /dev/null +++ b/types/nodegit/checkout.d.ts @@ -0,0 +1,51 @@ +import { Repository } from './repository'; +import { CheckoutOptions } from './checkout-options'; +import { Reference } from './reference'; +import { Oid } from './oid'; +import { Tree } from './tree'; +import { Commit } from './commit'; +import { Index } from './index'; + +export namespace Checkout { + enum NOTIFY { + NONE = 0, + CONFLICT = 1, + DIRTY = 2, + UPDATED = 4, + UNTRACKED = 8, + IGNORED = 16, + ALL = 65535 + } + + enum STRATEGY { + NONE = 0, + SAFE = 1, + FORCE = 2, + RECREATE_MISSING = 4, + ALLOW_CONFLICTS = 16, + REMOVE_UNTRACKED = 32, + REMOVE_IGNORED = 64, + UPDATE_ONLY = 128, + DONT_UPDATE_INDEX = 256, + NO_REFRESH = 512, + SKIP_UNMERGED = 1024, + USE_OURS = 2048, + USE_THEIRS = 4096, + DISABLE_PATHSPEC_MATCH = 8192, + SKIP_LOCKED_DIRECTORIES = 262144, + DONT_OVERWRITE_IGNORED = 524288, + CONFLICT_STYLE_MERGE = 1048576, + CONFLICT_STYLE_DIFF3 = 2097152, + DONT_REMOVE_EXISTING = 4194304, + DONT_WRITE_INDEX = 8388608, + UPDATE_SUBMODULES = 65536, + UPDATE_SUBMODULES_IF_CHANGED = 131072 + } +} + +export class Checkout { + static head(repo: Repository, options?: CheckoutOptions): Promise; + static index(repo: Repository, The: Index, options?: CheckoutOptions): Promise; + static initOptions(opts: CheckoutOptions, version: number): number; + static tree(repo: Repository, treeish: Oid | Tree | Commit | Reference, options?: CheckoutOptions): Promise; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index d69425fc75..36e823ec19 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -7,6 +7,7 @@ export { AnnotatedCommit } from './annotated-commit'; export { Blob } from './blob'; export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; +export { Checkout } from './checkout'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index b35a0c0e7a..607f154837 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -20,6 +20,7 @@ "blob.d.ts", "buf.d.ts", "checkout-options.d.ts", + "checkout.d.ts", "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", From 36faaf10771183c4aeec6c6faa4de5fe5d96c5e6 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:00:04 +0100 Subject: [PATCH 149/761] Added Branch --- types/nodegit/branch.d.ts | 25 +++++++++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 27 insertions(+) create mode 100644 types/nodegit/branch.d.ts diff --git a/types/nodegit/branch.d.ts b/types/nodegit/branch.d.ts new file mode 100644 index 0000000000..d121650864 --- /dev/null +++ b/types/nodegit/branch.d.ts @@ -0,0 +1,25 @@ +import { Repository } from './repository'; +import { Reference } from './reference'; +import { Commit } from './commit'; +import { AnnotatedCommit } from './annotated-commit'; + +export namespace Branch { + enum BRANCH { + LOCAL = 1, + REMOTE = 2, + ALL = 3 + } +} + +export class Branch { + static create(repo: Repository, branch_name: string, target: Commit, force: number): Promise; + static createFromAnnotated(repository: Repository, branch_name: string, commit: AnnotatedCommit, force: number): Reference; + static delete(branch: Reference): number; + static isHead(branch: Reference): number; + static iteratorNew(repo: Repository, list_flags: number): Promise; + static lookup(repo: Repository, branch_name: string, branch_type: number): Promise; + static move(branch: Reference, new_branch_name: string, force: number): Promise; + static name(ref: Reference): Promise; + static setUpstream(branch: Reference, upstream_name: string): Promise; + static upstream(branch: Reference): Promise; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 36e823ec19..feeec58469 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -5,6 +5,7 @@ export { AnnotatedCommit } from './annotated-commit'; export { Blob } from './blob'; +export { Branch } from './branch'; export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 607f154837..e57dc2776b 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -18,6 +18,7 @@ "files": [ "annotated-commit.d.ts", "blob.d.ts", + "branch.d.ts", "buf.d.ts", "checkout-options.d.ts", "checkout.d.ts", From 48c8fa3df5a209ad9e78a7967abe9b6a9d0f582e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:00:12 +0100 Subject: [PATCH 150/761] Added Attr --- types/nodegit/attr.d.ts | 18 ++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 20 insertions(+) create mode 100644 types/nodegit/attr.d.ts diff --git a/types/nodegit/attr.d.ts b/types/nodegit/attr.d.ts new file mode 100644 index 0000000000..84a701f2b1 --- /dev/null +++ b/types/nodegit/attr.d.ts @@ -0,0 +1,18 @@ +import { Repository } from './repository'; + +export namespace Attr { + enum STATES { + UNSPECIFIED_T = 0, + TRUE_T = 1, + FALSE_T = 2, + VALUE_T = 3 + } +} + +export class Attr { + static addMacro(repo: Repository, name: string, values: string): number; + static cacheFlush(repo: Repository): void; + static get(repo: Repository, flags: number, path: string, name: string): Promise; + static getMany(repo: Repository, flags: number, path: string, num_attr: number, names: string): any[]; + static value(attr: string): number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index feeec58469..1f672ba3b4 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export { AnnotatedCommit } from './annotated-commit'; +export { Attr } from './attr'; export { Blob } from './blob'; export { Branch } from './branch'; export { Buf } from './buf'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index e57dc2776b..4192e1fc08 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -17,6 +17,7 @@ }, "files": [ "annotated-commit.d.ts", + "attr.d.ts", "blob.d.ts", "branch.d.ts", "buf.d.ts", From 7e79f7358a27bd27e42a6e88d6d6e9255c6c2a30 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:03:47 +0100 Subject: [PATCH 151/761] Added Blame and co --- types/nodegit/blame-hunk.d.ts | 13 +++++++++++++ types/nodegit/blame-options.d.ts | 11 +++++++++++ types/nodegit/blame.d.ts | 0 types/nodegit/index.d.ts | 3 +++ types/nodegit/tsconfig.json | 3 +++ 5 files changed, 30 insertions(+) create mode 100644 types/nodegit/blame-hunk.d.ts create mode 100644 types/nodegit/blame-options.d.ts create mode 100644 types/nodegit/blame.d.ts diff --git a/types/nodegit/blame-hunk.d.ts b/types/nodegit/blame-hunk.d.ts new file mode 100644 index 0000000000..601a7dbdfd --- /dev/null +++ b/types/nodegit/blame-hunk.d.ts @@ -0,0 +1,13 @@ +import { Oid } from './oid'; +import { Signature } from './Signature'; + +export class BlameHunk { + linesInHunk: number; + finalCommitId: Oid; + finalStartLineNumber: number; + finalSignature: Signature; + origCommitId: Oid; + origPath: string; + origStartLineNumber: number; + origSignature: Signature; +} diff --git a/types/nodegit/blame-options.d.ts b/types/nodegit/blame-options.d.ts new file mode 100644 index 0000000000..ca5f1f50df --- /dev/null +++ b/types/nodegit/blame-options.d.ts @@ -0,0 +1,11 @@ +import {Oid} from './oid'; + +export interface BlameOptions { + version: number; + flags: number; + minMatchCharacters: number; + newestCommit: Oid; + oldestCommit: Oid; + minLine: number; + maxLine: number; +} diff --git a/types/nodegit/blame.d.ts b/types/nodegit/blame.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 1f672ba3b4..e086fe5d4c 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -5,6 +5,9 @@ export { AnnotatedCommit } from './annotated-commit'; export { Attr } from './attr'; +export { BlameHunk } from './blame-hunk'; +export { BlameOptions } from './blame-options'; +export { Blame } from './blame'; export { Blob } from './blob'; export { Branch } from './branch'; export { Buf } from './buf'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 4192e1fc08..c8d5c68fc2 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -18,6 +18,9 @@ "files": [ "annotated-commit.d.ts", "attr.d.ts", + "blame-hunk.d.ts", + "blame-options.d.ts", + "blame.d.ts", "blob.d.ts", "branch.d.ts", "buf.d.ts", From f7b5a33770a261812bae8a442830daed4cd3cf09 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:06:21 +0100 Subject: [PATCH 152/761] Changed interface to class --- types/nodegit/checkout-options.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index c799ce2047..4122dfbe28 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -2,7 +2,7 @@ import { Strarray } from './str-array'; import { Tree } from './tree'; import { Index } from './index'; -export interface CheckoutOptions { +export class CheckoutOptions { version?: number; checkoutStrategy?: number; disableFilters?: number; From 0c0761a2f4b457788e74260f6a730de4ed785f8e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:09:58 +0100 Subject: [PATCH 153/761] Added Clone and co --- types/nodegit/clone-options.d.ts | 13 +++++++++++++ types/nodegit/clone.d.ts | 16 ++++++++++++++++ types/nodegit/index.d.ts | 2 ++ types/nodegit/tsconfig.json | 2 ++ 4 files changed, 33 insertions(+) create mode 100644 types/nodegit/clone-options.d.ts create mode 100644 types/nodegit/clone.d.ts diff --git a/types/nodegit/clone-options.d.ts b/types/nodegit/clone-options.d.ts new file mode 100644 index 0000000000..b8acc9aad0 --- /dev/null +++ b/types/nodegit/clone-options.d.ts @@ -0,0 +1,13 @@ +import { CheckoutOptions } from './checkout-options'; +import { FetchOptions } from './fetch-options'; + +export class CloneOptions { + version?: number; + checkoutOpts?: CheckoutOptions; + fetchOpts?: FetchOptions; + bare?: number; + local?: number; + checkoutBranch?: string; + repositoryCbPayload?: void; + remoteCbPayload?: void; +} diff --git a/types/nodegit/clone.d.ts b/types/nodegit/clone.d.ts new file mode 100644 index 0000000000..e0b92bb9ea --- /dev/null +++ b/types/nodegit/clone.d.ts @@ -0,0 +1,16 @@ +import { Repository } from './repository'; +import { CloneOptions } from './clone-options'; + +export namespace Clone { + enum LOCAL { + AUTO = 0, + LOCAL = 1, + NO_LOCAL = 2, + NO_LINKS = 3 + } +} + +export class Clone { + static clone(url: string, local_path: string, options?: CloneOptions): Promise; + static initOptions(opts: CloneOptions, version: number): number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index e086fe5d4c..860d1e9c2f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -13,6 +13,8 @@ export { Branch } from './branch'; export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; +export { CloneOptions } from './clone-options'; +export { Clone } from './clone'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index c8d5c68fc2..39bb95c2fc 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -26,6 +26,8 @@ "buf.d.ts", "checkout-options.d.ts", "checkout.d.ts", + "clone-options.d.ts", + "clone.d.ts", "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", From 74e32b9a5c1c04d086c7547d48ea77ce65a5f33b Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:11:15 +0100 Subject: [PATCH 154/761] Added Cert --- types/nodegit/cert.d.ts | 17 +++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 19 insertions(+) create mode 100644 types/nodegit/cert.d.ts diff --git a/types/nodegit/cert.d.ts b/types/nodegit/cert.d.ts new file mode 100644 index 0000000000..f910453700 --- /dev/null +++ b/types/nodegit/cert.d.ts @@ -0,0 +1,17 @@ +export namespace Cert { + enum TYPE { + NONE = 0, + X509 = 1, + HOSTKEY_LIBSSH2 = 2, + STRARRAY = 3 + } + + enum SSH { + MD5 = 1, + SHA1 = 2 + } +} + +export class Cert { + certType: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 860d1e9c2f..7b485e2980 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -11,6 +11,7 @@ export { Blame } from './blame'; export { Blob } from './blob'; export { Branch } from './branch'; export { Buf } from './buf'; +export { Cert } from './cert'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; export { CloneOptions } from './clone-options'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 39bb95c2fc..366b54206a 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -24,6 +24,7 @@ "blob.d.ts", "branch.d.ts", "buf.d.ts", + "cert.d.ts", "checkout-options.d.ts", "checkout.d.ts", "clone-options.d.ts", From 3063a2730a089acb520893b258821186fa2c6e60 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:11:44 +0100 Subject: [PATCH 155/761] Added body of Blame --- types/nodegit/blame.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/types/nodegit/blame.d.ts b/types/nodegit/blame.d.ts index e69de29bb2..e5b5d90ec8 100644 --- a/types/nodegit/blame.d.ts +++ b/types/nodegit/blame.d.ts @@ -0,0 +1,25 @@ +import { Repository } from './repository'; +import { BlameOptions } from './blame-options'; +import {BlameHunk} from './blame-hunk'; + +export namespace Blame { + enum FLAG { + NORMAL = 0, + TRACK_COPIES_SAME_FILE = 1, + TRACK_COPIES_SAME_COMMIT_MOVES = 2, + TRACK_COPIES_SAME_COMMIT_COPIES = 4, + TRACK_COPIES_ANY_COMMIT_COPIES = 8, + FIRST_PARENT = 16 + } +} + +export class Blame { + static file(repo: Repository, path: string, options?: BlameOptions): Blame; + static initOptions(opts: BlameOptions, version: number): number; + + buffer(buffer: string, buffer_len: number): Promise; + free(): void; + getHunkByIndex(index: number): BlameHunk; + getHunkByLine(lineno: number): BlameHunk; + getHunkCount(): number; +} From e33c2ab476567a17fc262a0b237f207650e0eab5 Mon Sep 17 00:00:00 2001 From: beary Date: Wed, 7 Jun 2017 10:19:50 +0800 Subject: [PATCH 156/761] Move ts version comment to correct location --- types/mongodb/index.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 916b04cc66..42060ba190 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -2,10 +2,9 @@ // Project: https://github.com/mongodb/node-mongodb-native/tree/2.2 // Definitions by: Federico Caselli // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Documentation : http://mongodb.github.io/node-mongodb-native/2.2/api/ - // TypeScript Version: 2.3 + +// Documentation : http://mongodb.github.io/node-mongodb-native/2.2/api/ /// /// From 0ee8e83ae3340d466f0ab03163fdee63a513de3f Mon Sep 17 00:00:00 2001 From: Yui T Date: Tue, 6 Jun 2017 21:32:28 -0700 Subject: [PATCH 157/761] Address PR --- types/react-leaflet/index.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index d86a25d066..76a1be1125 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -196,13 +196,13 @@ export interface TileLayerProps extends TileLayerEvents, Leaflet.TileLayerOption children?: Children; url: string; } -export class TileLayer

extends GridLayer { } +export class TileLayer

extends GridLayer { } export interface WMSTileLayerProps extends TileLayerEvents, Leaflet.WMSOptions { children?: Children; url: string; } -export class WMSTileLayer

extends GridLayer { } +export class WMSTileLayer

extends GridLayer { } export interface ImageOverlayProps extends Leaflet.ImageOverlayOptions { bounds: Leaflet.LatLngBoundsExpression; @@ -224,7 +224,7 @@ export interface MarkerProps extends MarkerEvents, Leaflet.MarkerOptions { children?: Children; position: Leaflet.LatLngExpression; } -export class Marker

extends MapLayer { +export class Marker

extends MapLayer { getChildContext(): { popupContainer: E }; } @@ -241,14 +241,14 @@ export interface CircleProps extends PathEvents, Leaflet.CircleMarkerOptions { children?: Children; radius: number; } -export class Circle

extends Path { } +export class Circle

extends Path { } export interface CircleMarkerProps extends PathEvents, Leaflet.CircleMarkerOptions { center: Leaflet.LatLngExpression; children?: Children; radius: number; } -export class CircleMarker

extends Path { } +export class CircleMarker

extends Path { } export interface FeatureGroupProps extends FeatureGroupEvents, Leaflet.PathOptions { children?: Children; @@ -268,21 +268,21 @@ export interface PolylineProps extends PathEvents, Leaflet.PolylineOptions { children?: Children; positions: Leaflet.LatLngExpression[] | Leaflet.LatLngExpression[][]; } -export class Polyline

extends Path { } +export class Polyline

extends Path { } export interface PolygonProps extends PathEvents, Leaflet.PolylineOptions { children?: Children; popupContainer?: Leaflet.FeatureGroup; positions: Leaflet.LatLngExpression[] | Leaflet.LatLngExpression[][] | Leaflet.LatLngExpression[][][]; } -export class Polygon

extends Path { } +export class Polygon

extends Path { } export interface RectangleProps extends PathEvents, Leaflet.PolylineOptions { children?: Children; bounds: Leaflet.LatLngBoundsExpression; popupContainer?: Leaflet.FeatureGroup; } -export class Rectangle

extends Path { } +export class Rectangle

extends Path { } export interface PopupProps extends Leaflet.PopupOptions { children?: Children; @@ -320,7 +320,7 @@ export interface LayersControlProps extends LayersControlEvents, Leaflet.Control children?: Children; overlays?: Leaflet.Control.LayersObject; } -export class LayersControl

extends MapControl { } +export class LayersControl

extends MapControl { } export namespace LayersControl { interface BaseControlledLayerProps { @@ -341,11 +341,11 @@ export namespace LayersControl { removeLayer(layer: Leaflet.Layer): void; } class BaseLayer

extends ControlledLayer

{ } - class Overlay

extends ControlledLayer

{ } + class Overlay

extends ControlledLayer

{ } } export type ScaleControlProps = Leaflet.Control.ScaleOptions; export class ScaleControl

extends MapControl { } export type ZoomControlProps = Leaflet.Control.ZoomOptions; -export class ZoomControl

extends MapControl { } +export class ZoomControl

extends MapControl { } From 7f9adbee7341408274e0aab325d459d41be4d61a Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Wed, 7 Jun 2017 16:00:41 +1000 Subject: [PATCH 158/761] express header methods can return undefined --- types/express-serve-static-core/index.d.ts | 6 +++--- types/express-serve-static-core/tsconfig.json | 2 +- types/express/express-tests.ts | 9 +++++++++ types/express/tsconfig.json | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/types/express-serve-static-core/index.d.ts b/types/express-serve-static-core/index.d.ts index 8e1f075f03..3050f080a9 100644 --- a/types/express-serve-static-core/index.d.ts +++ b/types/express-serve-static-core/index.d.ts @@ -197,11 +197,11 @@ interface Request extends http.IncomingMessage, Express.Request { * * @param name */ - get(name: string): string; + get(name: string): string | undefined; - header(name: string): string; + header(name: string): string | undefined; - headers: { [key: string]: string; }; + headers: { [key: string]: string | undefined; }; /** * Check if the given `type(s)` is acceptable, returning diff --git a/types/express-serve-static-core/tsconfig.json b/types/express-serve-static-core/tsconfig.json index 40ee779963..cdb77c3573 100644 --- a/types/express-serve-static-core/tsconfig.json +++ b/types/express-serve-static-core/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express/express-tests.ts b/types/express/express-tests.ts index 04165d5e09..cc8c63ef81 100644 --- a/types/express/express-tests.ts +++ b/types/express/express-tests.ts @@ -71,6 +71,15 @@ namespace express_tests { language = req.acceptsLanguages(['en', 'ja']); language = req.acceptsLanguages('en', 'ja'); + let existingHeader1 = req.get('existingHeader') as string; + let nonExistingHeader1 = req.get('nonExistingHeader') as undefined; + + let existingHeader2 = req.header('existingHeader') as string; + let nonExistingHeader2 = req.header('nonExistingHeader') as undefined; + + let existingHeader3 = req.headers.existingHeader as string; + let nonExistingHeader3 = req.headers.nonExistingHeader as undefined; + res.send(req.query['token']); }); diff --git a/types/express/tsconfig.json b/types/express/tsconfig.json index 0fc87c2800..009cb9ec00 100644 --- a/types/express/tsconfig.json +++ b/types/express/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From 72af5467eee6dc36dc47b01e229ce3db607adda8 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Wed, 7 Jun 2017 16:18:28 +1000 Subject: [PATCH 159/761] set TS version to 2.2 --- types/express/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/express/index.d.ts b/types/express/index.d.ts index 9b913db473..d48d58c0c9 100644 --- a/types/express/index.d.ts +++ b/types/express/index.d.ts @@ -2,6 +2,7 @@ // Project: http://expressjs.com // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /* =================== USAGE =================== From 18949a7319931be15c639aea1c0a6f76a50c403c Mon Sep 17 00:00:00 2001 From: Julien Roncaglia Date: Wed, 7 Jun 2017 11:19:58 +0200 Subject: [PATCH 160/761] Allow false as a result of React render() `false` is treated the same as `null` when returned from `render()` in react but it wasn't allowed in the typings --- types/react/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 7d71c2d183..a8f827ee0a 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -185,7 +185,7 @@ declare namespace React { setState(f: (prevState: S, props: P) => Pick, callback?: () => any): void; setState(state: Pick, callback?: () => any): void; forceUpdate(callBack?: () => any): void; - render(): JSX.Element | null; + render(): JSX.Element | null | false; // React.Props is now deprecated, which means that the `children` // property is not available on `P` by default, even though you can @@ -2728,7 +2728,7 @@ declare global { namespace JSX { interface Element extends React.ReactElement { } interface ElementClass extends React.Component { - render(): JSX.Element | null; + render(): JSX.Element | null | false; } interface ElementAttributesProperty { props: {}; } interface ElementChildrenAttribute { children: {}; } From 62c91567aa209d446bfe9f0d79f346c0cc984afe Mon Sep 17 00:00:00 2001 From: E020873 Date: Wed, 7 Jun 2017 01:31:12 +0200 Subject: [PATCH 161/761] [mongoose] set strictNullChecks to true --- types/mongoose/index.d.ts | 58 +++++++++--------- types/mongoose/mongoose-tests.ts | 100 ++++++++++++++++++++++--------- types/mongoose/tsconfig.json | 2 +- 3 files changed, 102 insertions(+), 58 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 8f5d6bdad6..c918c3950e 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1476,33 +1476,33 @@ declare module "mongoose" { * @param criteria mongodb selector * @param projection optional fields to return */ - findOne(callback?: (err: any, res: DocType) => void): DocumentQuery; + findOne(callback?: (err: any, res: DocType | null) => void): DocumentQuery; findOne(criteria: Object, - callback?: (err: any, res: DocType) => void): DocumentQuery; + callback?: (err: any, res: DocType | null) => void): DocumentQuery; /** * Issues a mongodb findAndModify remove command. * Finds a matching document, removes it, passing the found document (if any) to the * callback. Executes immediately if callback is passed. */ - findOneAndRemove(callback?: (error: any, doc: DocType, result: any) => void): DocumentQuery; + findOneAndRemove(callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; findOneAndRemove(conditions: Object, - callback?: (error: any, doc: DocType, result: any) => void): DocumentQuery; + callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; findOneAndRemove(conditions: Object, options: QueryFindOneAndRemoveOptions, - callback?: (error: any, doc: DocType, result: any) => void): DocumentQuery; + callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; /** * Issues a mongodb findAndModify update command. * Finds a matching document, updates it according to the update arg, passing any options, and returns * the found document (if any) to the callback. The query executes immediately if callback is passed. */ - findOneAndUpdate(callback?: (err: any, doc: DocType) => void): DocumentQuery; + findOneAndUpdate(callback?: (err: any, doc: DocType | null) => void): DocumentQuery; findOneAndUpdate(update: Object, - callback?: (err: any, doc: DocType) => void): DocumentQuery; + callback?: (err: any, doc: DocType | null) => void): DocumentQuery; findOneAndUpdate(query: Object | Query, update: Object, - callback?: (err: any, doc: DocType) => void): DocumentQuery; + callback?: (err: any, doc: DocType | null) => void): DocumentQuery; findOneAndUpdate(query: Object | Query, update: Object, options: QueryFindOneAndUpdateOptions, - callback?: (err: any, doc: DocType) => void): DocumentQuery; + callback?: (err: any, doc: DocType | null) => void): DocumentQuery; /** * Specifies a $geometry condition. geometry() must come after either intersects() or within(). @@ -2334,11 +2334,11 @@ declare module "mongoose" { * @param projection optional fields to return */ findById(id: Object | string | number, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; findById(id: Object | string | number, projection: Object, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; findById(id: Object | string | number, projection: Object, options: Object, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; model(name: string): Model; @@ -2395,9 +2395,9 @@ declare module "mongoose" { */ find(callback?: (err: any, res: T[]) => void): DocumentQuery; find(conditions: Object, callback?: (err: any, res: T[]) => void): DocumentQuery; - find(conditions: Object, projection: Object, + find(conditions: Object, projection?: Object | null, callback?: (err: any, res: T[]) => void): DocumentQuery; - find(conditions: Object, projection: Object, options: Object, + find(conditions: Object, projection?: Object | null, options?: Object | null, callback?: (err: any, res: T[]) => void): DocumentQuery; @@ -2409,27 +2409,27 @@ declare module "mongoose" { * Executes immediately if callback is passed, else a Query object is returned. * @param id value of _id to query by */ - findByIdAndRemove(): DocumentQuery; + findByIdAndRemove(): DocumentQuery; findByIdAndRemove(id: Object | number | string, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; findByIdAndRemove(id: Object | number | string, options: { /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ sort?: Object; /** sets the document fields to return */ select?: Object; - }, callback?: (err: any, res: T) => void): DocumentQuery; + }, callback?: (err: any, res: T | null) => void): DocumentQuery; /** * Issues a mongodb findAndModify update command by a document's _id field. findByIdAndUpdate(id, ...) * is equivalent to findOneAndUpdate({ _id: id }, ...). * @param id value of _id to query by */ - findByIdAndUpdate(): DocumentQuery; + findByIdAndUpdate(): DocumentQuery; findByIdAndUpdate(id: Object | number | string, update: Object, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; findByIdAndUpdate(id: Object | number | string, update: Object, options: ModelFindByIdAndUpdateOptions, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; /** * Finds one document. @@ -2437,20 +2437,20 @@ declare module "mongoose" { * @param projection optional fields to return */ findOne(conditions?: Object, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; findOne(conditions: Object, projection: Object, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; findOne(conditions: Object, projection: Object, options: Object, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; /** * Issue a mongodb findAndModify remove command. * Finds a matching document, removes it, passing the found document (if any) to the callback. * Executes immediately if callback is passed else a Query object is returned. */ - findOneAndRemove(): DocumentQuery; + findOneAndRemove(): DocumentQuery; findOneAndRemove(conditions: Object, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; findOneAndRemove(conditions: Object, options: { /** * if multiple docs are found by the conditions, sets the sort order to choose @@ -2461,7 +2461,7 @@ declare module "mongoose" { maxTimeMS?: number; /** sets the document fields to return */ select?: Object; - }, callback?: (err: any, res: T) => void): DocumentQuery; + }, callback?: (err: any, res: T | null) => void): DocumentQuery; /** * Issues a mongodb findAndModify update command. @@ -2469,12 +2469,12 @@ declare module "mongoose" { * and returns the found document (if any) to the callback. The query executes immediately * if callback is passed else a Query object is returned. */ - findOneAndUpdate(): DocumentQuery; + findOneAndUpdate(): DocumentQuery; findOneAndUpdate(conditions: Object, update: Object, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; findOneAndUpdate(conditions: Object, update: Object, options: ModelFindOneAndUpdateOptions, - callback?: (err: any, res: T) => void): DocumentQuery; + callback?: (err: any, res: T | null) => void): DocumentQuery; /** * geoNear support for Mongoose diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index c6de968430..3763d5975e 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -71,7 +71,7 @@ mongoose.version.toLowerCase(); * section querystream.js * http://mongoosejs.com/docs/api.html#querystream-js */ -var querystream: mongoose.QueryStream; +var querystream = {}; querystream.destroy(new Error()); querystream.pause(); querystream.pipe(process.stdout, {end: true}).end(); @@ -81,7 +81,7 @@ querystream.readable; /* inherited properties */ querystream.getMaxListeners(); /* practical examples */ -var QSModel: typeof mongoose.Model; +var QSModel = {}; var QSStream: mongoose.QueryStream = QSModel.find().stream(); QSStream.on('data', function (doc: any) { doc.save(); @@ -97,7 +97,7 @@ QSModel.where('created').gte(20000).stream().pipe(process.stdout); * section drivers/node-mongodb-native/collection.js * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-collection-js */ -var coll1: mongoose.Collection; +var coll1 = {}; coll1.$format(999).toLowerCase(); coll1.$print('name', 'i', [1, 2, 3]); coll1.getIndexes(); @@ -109,7 +109,7 @@ coll1.ensureIndex(); coll1.find({}); coll1.insert({}, {}); -var coll2 = new mongoose.Collection('', new mongoose.Connection(null)); +var coll2 = new mongoose.Collection('', new mongoose.Connection(mongoose)); coll2.$format(999).toLowerCase(); /* inherited properties */ coll2.initializeOrderedBulkOp; @@ -155,7 +155,7 @@ conn1.addListener('close', cb); * section error/validation.js * http://mongoosejs.com/docs/api.html#error-validation-js */ -var validationError: mongoose.ValidationError; +var validationError = {}; validationError.toString().toLowerCase(); /* inherited properties */ validationError.stack; @@ -178,7 +178,7 @@ mongoose.Error.Messages.hasOwnProperty(''); * section querycursor.js * http://mongoosejs.com/docs/api.html#querycursor-js */ -var querycursor: mongoose.QueryCursor; +var querycursor = > {}; querycursor.close(function (error, result) { result.execPopulate(); }).catch(cb); @@ -267,8 +267,10 @@ schema.method('name', cb).method({ schema.path('a', mongoose.Schema.Types.Buffer).path('a'); schema.pathType('m1').toLowerCase(); schema.plugin(function (schema, opts) { -schema.get('path'); - opts.hasOwnProperty(''); + schema.get('path'); + if (opts) { + opts.hasOwnProperty(''); + } }).plugin(cb, {opts: true}); schema @@ -426,7 +428,7 @@ new mongoose.Schema({ * section document.js * http://mongoosejs.com/docs/api.html#document-js */ -var doc: mongoose.MongooseDocument; +var doc = {}; doc.$isDefault('path').valueOf(); doc.depopulate('path'); doc.equals(doc).valueOf(); @@ -483,7 +485,9 @@ var MyModel = mongoose.model('test', new mongoose.Schema({ doc = new MyModel(); doc.$isDefault('name'); MyModel.findOne().populate('author').exec(function (err, doc) { - doc.depopulate('author'); + if (doc) { + doc.depopulate('author'); + } }); doc.populate('path'); doc.populate({path: 'hello'}); @@ -540,7 +544,7 @@ interface MySubEntity extends mongoose.Types.Subdocument { interface MyEntity extends mongoose.Document { sub: mongoose.Types.Array } -var myEntity: MyEntity; +var myEntity = {}; var subDocArray = _.filter(myEntity.sub, function (sd) { sd.property1; sd.property2.toLowerCase(); @@ -570,7 +574,7 @@ interface MySubEntity1 extends mongoose.Types.Subdocument { interface MyEntity1 extends mongoose.Document { sub: mongoose.Types.DocumentArray } -var newEnt: MyEntity1; +var newEnt = {}; var newSub: MySubEntity1 = newEnt.sub.create({ property1: "example", property2: "example" }); /* @@ -645,7 +649,7 @@ embeddedDocument.execPopulate(); * section query.js * http://mongoosejs.com/docs/api.html#query-js */ -var query: mongoose.Query; +var query = > {}; query.$where('').$where(cb); query.all(99).all('path', 99); query.and([{ color: 'green' }, { status: 'ok' }]).and([]); @@ -877,7 +881,7 @@ schemaArray.sparse(true); * section schema/string.js * http://mongoosejs.com/docs/api.html#schema-string-js */ -var MongoDocument: mongoose.Document; +var MongoDocument = {}; var schemastring: mongoose.Schema.Types.String = new mongoose.Schema.Types.String('hello'); schemastring.checkRequired(234, MongoDocument).valueOf(); schemastring.enum(['hi', 'a', 'b']).enum('hi').enum({}); @@ -1161,7 +1165,9 @@ mongoose.model('') .findOne({}) .exec() .then(function (arg) { - arg.save; + if (arg) { + arg.save; + } return 1; }).then(function (num) { num.toFixed; @@ -1172,7 +1178,9 @@ mongoose.model('') str.toLowerCase return (mongoose.model('')).findOne({}).exec(); }).then(function (arg) { - arg.save; + if (arg) { + arg.save; + } return 1; }).catch(function (err) { return 1; @@ -1188,7 +1196,9 @@ mongoose.model('') mongoose.model('').findOne({}) .then(function (arg) { - arg.save; + if (arg) { + arg.save; + } return 2; }).then(function (num) { num.toFixed; @@ -1237,6 +1247,9 @@ MongoModel.find({}).$where('indexOf("val") !== -1').exec(function (err, docs) { }); MongoModel.findById(999, function (err, doc) { var handleSave = function(err: Error, product: mongoose.Document, numAffected: number) {}; + if (!doc) { + return; + } doc.increment(); doc.save(handleSave).then(cb).catch(cb); doc.save({ validateBeforeSave: false }, handleSave).then(cb).catch(cb); @@ -1256,7 +1269,9 @@ var mongoModel = new MongoModel(); mongoModel.remove(function (err, product) { if (err) throw(err); MongoModel.findById(product._id, function (err, product) { - product.remove(); + if (product) { + product.remove(); + } }); }); mongoModel.save().then(function (product) { @@ -1304,11 +1319,15 @@ MongoModel.find({ name: /john/i }, null, { skip: 10 }).exec(function (err, docs) MongoModel.findById(999, function (err, adventure) {}); MongoModel.findById(999).exec(cb); MongoModel.findById(999, 'name length', function (err, adventure) { - adventure.save(); + if (adventure) { + adventure.save(); + } }); MongoModel.findById(999, 'name length').exec(cb); MongoModel.findById(999, '-length').exec(function (err, adventure) { - adventure.addListener('click', cb); + if (adventure) { + adventure.addListener('click', cb); + } }); MongoModel.findById(999, 'name', { lean: true }, function (err, doc) {}); MongoModel.findById(999, 'name').lean().exec(function (err, doc) {}); @@ -1372,6 +1391,9 @@ MongoModel.mapReduce({ console.log(docs); }).then(null, cb); MongoModel.findById(999, function (err, user) { + if (!user) { + return; + } var opts = [ { path: 'company', match: { x: 1 }, select: 'name' } , { path: 'notes', options: { limit: 10 }, model: 'override' } @@ -1425,7 +1447,9 @@ mongoModel.addListener('event', cb); MongoModel.findOne({ title: /timex/i }) .populate('_creator', 'name') .exec(function (err, story) { - story.execPopulate(); + if (story) { + story.execPopulate(); + } }); MongoModel.find({ id: 999 @@ -1460,6 +1484,9 @@ var LocModel = mongoose.model("Location", locationSchema); LocModel.findById(999) .select("-reviews -rating") .exec(function (err, location) { + if (!location) { + return; + } location.name = 'blah'; location.address = 'blah'; location.reviews.forEach(review => {}); @@ -1496,18 +1523,35 @@ LocModel.distinct('') .then(cb).catch(cb); LocModel.findByIdAndRemove() .exec(function (err, doc) { + if (!doc) { + return; + } doc.addListener; doc.openingTimes; }); LocModel.findByIdAndUpdate() .select({}) .exec(function (err, location) { - location.reviews; + if (location) { + location.reviews; + } }); -LocModel.findOne({}, function (err, doc) { doc.openingTimes; }); +LocModel.findOne({}, function (err, doc) { + if (doc) { + doc.openingTimes; + } +}); LocModel.findOneAndRemove() - .exec(function (err, location) { location.name; }); -LocModel.findOneAndUpdate().exec().then(function (arg) { arg.openingTimes; }); + .exec(function (err, location) { + if (location) { + location.name; + } + }); +LocModel.findOneAndUpdate().exec().then(function (arg) { + if (arg) { + arg.openingTimes; + } +}); LocModel.geoSearch({}, { near: [1, 2], maxDistance: 22 @@ -1528,7 +1572,7 @@ interface ModelStruct { model: MyModel; method1: (callback: (model: MyModel, doc: MyDocument) => void) => MyModel; } -var modelStruct1: ModelStruct; +var modelStruct1 = {}; var myModel1: MyModel; var myDocument1: MyDocument; modelStruct1.method1(function (myModel1, myDocument1) { @@ -1555,8 +1599,8 @@ final2.method;interface ibase extends mongoose.Document { interface extended extends ibase { email: string; } -const base: mongoose.Model = mongoose.model('testfour', null) -const extended: mongoose.Model = base.discriminator('extendedS', null); +const base: mongoose.Model = mongoose.model('testfour') +const extended: mongoose.Model = base.discriminator('extendedS', schema); const x = new extended({ username: 'hi', // required in baseSchema email: 'beddiw', // required in extededSchema diff --git a/types/mongoose/tsconfig.json b/types/mongoose/tsconfig.json index 0c7d49295c..de340232f7 100644 --- a/types/mongoose/tsconfig.json +++ b/types/mongoose/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": false, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From 552da47d0cb73f19ec70a703169ff55431337096 Mon Sep 17 00:00:00 2001 From: Konstantin Ikonnikov Date: Wed, 7 Jun 2017 15:43:27 +0300 Subject: [PATCH 162/761] [node] Add definition for Node.js v8 --- types/node/index.d.ts | 4 +- types/node/tsconfig.json | 2 +- types/node/v7/index.d.ts | 4351 +++++++++++++++++++++++++++++++++++ types/node/v7/node-tests.ts | 2467 ++++++++++++++++++++ types/node/v7/tsconfig.json | 28 + types/node/v7/tslint.json | 33 + 6 files changed, 6882 insertions(+), 3 deletions(-) create mode 100644 types/node/v7/index.d.ts create mode 100644 types/node/v7/node-tests.ts create mode 100644 types/node/v7/tsconfig.json create mode 100644 types/node/v7/tslint.json diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 1b121efb2d..77fb97dba1 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node.js v7.x +// Type definitions for Node.js v8.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped @@ -10,7 +10,7 @@ /************************************************ * * -* Node.js v7.x API * +* Node.js v8.x API * * * ************************************************/ diff --git a/types/node/tsconfig.json b/types/node/tsconfig.json index 8cb1452030..ca401a560d 100644 --- a/types/node/tsconfig.json +++ b/types/node/tsconfig.json @@ -6,7 +6,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts new file mode 100644 index 0000000000..31e068cec8 --- /dev/null +++ b/types/node/v7/index.d.ts @@ -0,0 +1,4351 @@ +// Type definitions for Node.js v7.x +// Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript +// DefinitelyTyped +// Parambir Singh +// Roberto Desideri +// Christian Vaagland Tellnes +// Wilco Bakker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/************************************************ +* * +* Node.js v7.x API * +* * +************************************************/ + +// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build +interface Console { + Console: NodeJS.ConsoleConstructor; + assert(value: any, message?: string, ...optionalParams: any[]): void; + dir(obj: any, options?: NodeJS.InspectOptions): void; + error(message?: any, ...optionalParams: any[]): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + time(label: string): void; + timeEnd(label: string): void; + trace(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +interface Error { + stack?: string; +} + +interface ErrorConstructor { + captureStackTrace(targetObject: Object, constructorOpt?: Function): void; + stackTraceLimit: number; +} + +// compat for TypeScript 1.8 +// if you use with --target es3 or --target es5 and use below definitions, +// use the lib.es6.d.ts that is bundled with TypeScript 1.8. +interface MapConstructor { } +interface WeakMapConstructor { } +interface SetConstructor { } +interface WeakSetConstructor { } + +// Forward-declare needed types from lib.es2015.d.ts (in case users are using `--lib es5`) +interface Iterable {} +interface Iterator { + next(value?: any): IteratorResult; +} +interface IteratorResult {} +interface SymbolConstructor { + readonly iterator: symbol; +} +declare var Symbol: SymbolConstructor; + +/************************************************ +* * +* GLOBAL * +* * +************************************************/ +declare var process: NodeJS.Process; +declare var global: NodeJS.Global; +declare var console: Console; + +declare var __filename: string; +declare var __dirname: string; + +declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearTimeout(timeoutId: NodeJS.Timer): void; +declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearInterval(intervalId: NodeJS.Timer): void; +declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; +declare function clearImmediate(immediateId: any): void; + +interface NodeRequireFunction { + (id: string): any; +} + +interface NodeRequire extends NodeRequireFunction { + resolve(id: string): string; + cache: any; + extensions: any; + main: NodeModule | undefined; +} + +declare var require: NodeRequire; + +interface NodeModule { + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: NodeModule | null; + children: NodeModule[]; +} + +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; +declare var SlowBuffer: { + new (str: string, encoding?: string): Buffer; + new (size: number): Buffer; + new (size: Uint8Array): Buffer; + new (array: any[]): Buffer; + prototype: Buffer; + isBuffer(obj: any): boolean; + byteLength(string: string, encoding?: string): number; + concat(list: Buffer[], totalLength?: number): Buffer; +}; + + +// Buffer class +type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex"; +interface Buffer extends NodeBuffer { } + +/** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + */ +declare var Buffer: { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + new (str: string, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + new (size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + new (array: Uint8Array): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + new (arrayBuffer: ArrayBuffer): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + new (array: any[]): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + new (buffer: Buffer): Buffer; + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + allocUnsafeSlow(size: number): Buffer; +}; + +/************************************************ +* * +* GLOBAL INTERFACES * +* * +************************************************/ +declare namespace NodeJS { + export interface InspectOptions { + showHidden?: boolean; + depth?: number | null; + colors?: boolean; + customInspect?: boolean; + showProxy?: boolean; + maxArrayLength?: number | null; + breakLength?: number; + } + + export interface ConsoleConstructor { + prototype: Console; + new(stdout: WritableStream, stderr?: WritableStream): Console; + } + + export interface ErrnoException extends Error { + errno?: number; + code?: string; + path?: string; + syscall?: string; + stack?: string; + } + + export class EventEmitter { + addListener(event: string | symbol, listener: Function): this; + on(event: string | symbol, listener: Function): this; + once(event: string | symbol, listener: Function): this; + removeListener(event: string | symbol, listener: Function): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + listenerCount(type: string | symbol): number; + // Added in Node 6... + prependListener(event: string | symbol, listener: Function): this; + prependOnceListener(event: string | symbol, listener: Function): this; + eventNames(): (string | symbol)[]; + } + + export interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: string | null): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): this; + unshift(chunk: string): void; + unshift(chunk: Buffer): void; + wrap(oldStream: ReadableStream): ReadableStream; + } + + export interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Buffer | string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + } + + export interface ReadWriteStream extends ReadableStream, WritableStream { } + + export interface Events extends EventEmitter { } + + export interface Domain extends Events { + run(fn: Function): void; + add(emitter: Events): void; + remove(emitter: Events): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + dispose(): void; + + addListener(event: string, listener: Function): this; + on(event: string, listener: Function): this; + once(event: string, listener: Function): this; + removeListener(event: string, listener: Function): this; + removeAllListeners(event?: string): this; + } + + export interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + } + + export interface CpuUsage { + user: number; + system: number; + } + + export interface ProcessVersions { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + + type Platform = 'aix' + | 'android' + | 'darwin' + | 'freebsd' + | 'linux' + | 'openbsd' + | 'sunos' + | 'win32'; + + export interface Socket extends ReadWriteStream { + isTTY?: true; + } + + export interface Process extends EventEmitter { + stdout: Socket; + stderr: Socket; + stdin: Socket; + openStdin(): Socket; + argv: string[]; + argv0: string; + execArgv: string[]; + execPath: string; + abort(): void; + chdir(directory: string): void; + cwd(): string; + emitWarning(warning: string | Error, name?: string, ctor?: Function): void; + env: any; + exit(code?: number): never; + exitCode: number; + getgid(): number; + setgid(id: number): void; + setgid(id: string): void; + getuid(): number; + setuid(id: number): void; + setuid(id: string): void; + version: string; + versions: ProcessVersions; + config: { + target_defaults: { + cflags: any[]; + default_configuration: string; + defines: string[]; + include_dirs: string[]; + libraries: string[]; + }; + variables: { + clang: number; + host_arch: string; + node_install_npm: boolean; + node_install_waf: boolean; + node_prefix: string; + node_shared_openssl: boolean; + node_shared_v8: boolean; + node_shared_zlib: boolean; + node_use_dtrace: boolean; + node_use_etw: boolean; + node_use_openssl: boolean; + target_arch: string; + v8_no_strict_aliasing: number; + v8_use_snapshot: boolean; + visibility: string; + }; + }; + kill(pid: number, signal?: string | number): void; + pid: number; + title: string; + arch: string; + platform: Platform; + mainModule?: NodeModule; + memoryUsage(): MemoryUsage; + cpuUsage(previousValue?: CpuUsage): CpuUsage; + nextTick(callback: Function, ...args: any[]): void; + umask(mask?: number): number; + uptime(): number; + hrtime(time?: [number, number]): [number, number]; + domain: Domain; + + // Worker + send?(message: any, sendHandle?: any): void; + disconnect(): void; + connected: boolean; + } + + export interface Global { + Array: typeof Array; + ArrayBuffer: typeof ArrayBuffer; + Boolean: typeof Boolean; + Buffer: typeof Buffer; + DataView: typeof DataView; + Date: typeof Date; + Error: typeof Error; + EvalError: typeof EvalError; + Float32Array: typeof Float32Array; + Float64Array: typeof Float64Array; + Function: typeof Function; + GLOBAL: Global; + Infinity: typeof Infinity; + Int16Array: typeof Int16Array; + Int32Array: typeof Int32Array; + Int8Array: typeof Int8Array; + Intl: typeof Intl; + JSON: typeof JSON; + Map: MapConstructor; + Math: typeof Math; + NaN: typeof NaN; + Number: typeof Number; + Object: typeof Object; + Promise: Function; + RangeError: typeof RangeError; + ReferenceError: typeof ReferenceError; + RegExp: typeof RegExp; + Set: SetConstructor; + String: typeof String; + Symbol: Function; + SyntaxError: typeof SyntaxError; + TypeError: typeof TypeError; + URIError: typeof URIError; + Uint16Array: typeof Uint16Array; + Uint32Array: typeof Uint32Array; + Uint8Array: typeof Uint8Array; + Uint8ClampedArray: Function; + WeakMap: WeakMapConstructor; + WeakSet: WeakSetConstructor; + clearImmediate: (immediateId: any) => void; + clearInterval: (intervalId: NodeJS.Timer) => void; + clearTimeout: (timeoutId: NodeJS.Timer) => void; + console: typeof console; + decodeURI: typeof decodeURI; + decodeURIComponent: typeof decodeURIComponent; + encodeURI: typeof encodeURI; + encodeURIComponent: typeof encodeURIComponent; + escape: (str: string) => string; + eval: typeof eval; + global: Global; + isFinite: typeof isFinite; + isNaN: typeof isNaN; + parseFloat: typeof parseFloat; + parseInt: typeof parseInt; + process: Process; + root: Global; + setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any; + setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + undefined: typeof undefined; + unescape: (str: string) => string; + gc: () => void; + v8debug?: any; + } + + export interface Timer { + ref(): void; + unref(): void; + } +} + +interface IterableIterator { } + +/** + * @deprecated + */ +interface NodeBuffer extends Uint8Array { + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + entries(): IterableIterator<[number, number]>; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + keys(): IterableIterator; + values(): IterableIterator; +} + +/************************************************ +* * +* MODULES * +* * +************************************************/ +declare module "buffer" { + export var INSPECT_MAX_BYTES: number; + var BuffType: typeof Buffer; + var SlowBuffType: typeof SlowBuffer; + export { BuffType as Buffer, SlowBuffType as SlowBuffer }; +} + +declare module "querystring" { + export interface StringifyOptions { + encodeURIComponent?: Function; + } + + export interface ParseOptions { + maxKeys?: number; + decodeURIComponent?: Function; + } + + export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): any; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): T; + export function escape(str: string): string; + export function unescape(str: string): string; +} + +declare module "events" { + class internal extends NodeJS.EventEmitter { } + + namespace internal { + export class EventEmitter extends internal { + static listenerCount(emitter: EventEmitter, event: string | symbol): number; // deprecated + static defaultMaxListeners: number; + + addListener(event: string | symbol, listener: Function): this; + on(event: string | symbol, listener: Function): this; + once(event: string | symbol, listener: Function): this; + prependListener(event: string | symbol, listener: Function): this; + prependOnceListener(event: string | symbol, listener: Function): this; + removeListener(event: string | symbol, listener: Function): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + eventNames(): (string | symbol)[]; + listenerCount(type: string | symbol): number; + } + } + + export = internal; +} + +declare module "http" { + import * as events from "events"; + import * as net from "net"; + import * as stream from "stream"; + + export interface RequestOptions { + protocol?: string; + host?: string; + hostname?: string; + family?: number; + port?: number; + localAddress?: string; + socketPath?: string; + method?: string; + path?: string; + headers?: { [key: string]: any }; + auth?: string; + agent?: Agent | boolean; + timeout?: number; + } + + export interface Server extends net.Server { + setTimeout(msecs: number, callback: Function): void; + maxHeadersCount: number; + timeout: number; + listening: boolean; + } + /** + * @deprecated Use IncomingMessage + */ + export interface ServerRequest extends IncomingMessage { + connection: net.Socket; + } + export interface ServerResponse extends stream.Writable { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + writeContinue(): void; + writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void; + writeHead(statusCode: number, headers?: any): void; + statusCode: number; + statusMessage: string; + headersSent: boolean; + setHeader(name: string, value: string | string[]): void; + setTimeout(msecs: number, callback: Function): ServerResponse; + sendDate: boolean; + getHeader(name: string): string; + removeHeader(name: string): void; + write(chunk: any, encoding?: string): any; + addTrailers(headers: any): void; + finished: boolean; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + export interface ClientRequest extends stream.Writable { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + write(chunk: any, encoding?: string): void; + abort(): void; + setTimeout(timeout: number, callback?: Function): void; + setNoDelay(noDelay?: boolean): void; + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + + setHeader(name: string, value: string | string[]): void; + getHeader(name: string): string; + removeHeader(name: string): void; + addTrailers(headers: any): void; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + export interface IncomingMessage extends stream.Readable { + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + connection: net.Socket; + headers: any; + rawHeaders: string[]; + trailers: any; + rawTrailers: any; + setTimeout(msecs: number, callback: Function): NodeJS.Timer; + /** + * Only valid for request obtained from http.Server. + */ + method?: string; + /** + * Only valid for request obtained from http.Server. + */ + url?: string; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusCode?: number; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusMessage?: string; + socket: net.Socket; + destroy(error?: Error): void; + } + /** + * @deprecated Use IncomingMessage + */ + export interface ClientResponse extends IncomingMessage { } + + export interface AgentOptions { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number; + } + + export class Agent { + maxSockets: number; + sockets: any; + requests: any; + + constructor(opts?: AgentOptions); + + /** + * Destroy any sockets that are currently in use by the agent. + * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, + * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, + * sockets may hang open for quite a long time before the server terminates them. + */ + destroy(): void; + } + + export var METHODS: string[]; + + export var STATUS_CODES: { + [errorCode: number]: string; + [errorCode: string]: string; + }; + export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server; + export function createClient(port?: number, host?: string): any; + export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; + export var globalAgent: Agent; +} + +declare module "cluster" { + import * as child from "child_process"; + import * as events from "events"; + import * as net from "net"; + + // interfaces + export interface ClusterSettings { + execArgv?: string[]; // default: process.execArgv + exec?: string; + args?: string[]; + silent?: boolean; + stdio?: any[]; + uid?: number; + gid?: number; + } + + export interface ClusterSetupMasterSettings { + exec?: string; // default: process.argv[1] + args?: string[]; // default: process.argv.slice(2) + silent?: boolean; // default: false + stdio?: any[]; + } + + export interface Address { + address: string; + port: number; + addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" + } + + export class Worker extends events.EventEmitter { + id: string; + process: child.ChildProcess; + suicide: boolean; + send(message: any, sendHandle?: any): boolean; + kill(signal?: string): void; + destroy(signal?: string): void; + disconnect(): void; + isConnected(): boolean; + isDead(): boolean; + exitedAfterDisconnect: boolean; + + /** + * events.EventEmitter + * 1. disconnect + * 2. error + * 3. exit + * 4. listening + * 5. message + * 6. online + */ + addListener(event: string, listener: Function): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (code: number, signal: string) => void): this; + addListener(event: "exit", listener: (code: number, signal: string) => void): this; + addListener(event: "listening", listener: (address: Address) => void): this; + addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: () => void): this; + + emit(event: string, listener: Function): boolean + emit(event: "disconnect", listener: () => void): boolean + emit(event: "error", listener: (code: number, signal: string) => void): boolean + emit(event: "exit", listener: (code: number, signal: string) => void): boolean + emit(event: "listening", listener: (address: Address) => void): boolean + emit(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): boolean + emit(event: "online", listener: () => void): boolean + + on(event: string, listener: Function): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (code: number, signal: string) => void): this; + on(event: "exit", listener: (code: number, signal: string) => void): this; + on(event: "listening", listener: (address: Address) => void): this; + on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: () => void): this; + + once(event: string, listener: Function): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (code: number, signal: string) => void): this; + once(event: "exit", listener: (code: number, signal: string) => void): this; + once(event: "listening", listener: (address: Address) => void): this; + once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: () => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (code: number, signal: string) => void): this; + prependListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependListener(event: "listening", listener: (address: Address) => void): this; + prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: () => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "listening", listener: (address: Address) => void): this; + prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "online", listener: () => void): this; + } + + export interface Cluster extends events.EventEmitter { + Worker: Worker; + disconnect(callback?: Function): void; + fork(env?: any): Worker; + isMaster: boolean; + isWorker: boolean; + // TODO: cluster.schedulingPolicy + settings: ClusterSettings; + setupMaster(settings?: ClusterSetupMasterSettings): void; + worker: Worker; + workers: { + [index: string]: Worker + }; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + addListener(event: string, listener: Function): this; + addListener(event: "disconnect", listener: (worker: Worker) => void): this; + addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + addListener(event: "fork", listener: (worker: Worker) => void): this; + addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: (worker: Worker) => void): this; + addListener(event: "setup", listener: (settings: any) => void): this; + + emit(event: string, listener: Function): boolean; + emit(event: "disconnect", listener: (worker: Worker) => void): boolean; + emit(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): boolean; + emit(event: "fork", listener: (worker: Worker) => void): boolean; + emit(event: "listening", listener: (worker: Worker, address: Address) => void): boolean; + emit(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): boolean; + emit(event: "online", listener: (worker: Worker) => void): boolean; + emit(event: "setup", listener: (settings: any) => void): boolean; + + on(event: string, listener: Function): this; + on(event: "disconnect", listener: (worker: Worker) => void): this; + on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + on(event: "fork", listener: (worker: Worker) => void): this; + on(event: "listening", listener: (worker: Worker, address: Address) => void): this; + on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: (worker: Worker) => void): this; + on(event: "setup", listener: (settings: any) => void): this; + + once(event: string, listener: Function): this; + once(event: "disconnect", listener: (worker: Worker) => void): this; + once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + once(event: "fork", listener: (worker: Worker) => void): this; + once(event: "listening", listener: (worker: Worker, address: Address) => void): this; + once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: (worker: Worker) => void): this; + once(event: "setup", listener: (settings: any) => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependListener(event: "fork", listener: (worker: Worker) => void): this; + prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: (worker: Worker) => void): this; + prependListener(event: "setup", listener: (settings: any) => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; + prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "online", listener: (worker: Worker) => void): this; + prependOnceListener(event: "setup", listener: (settings: any) => void): this; + + } + + export function disconnect(callback?: Function): void; + export function fork(env?: any): Worker; + export var isMaster: boolean; + export var isWorker: boolean; + // TODO: cluster.schedulingPolicy + export var settings: ClusterSettings; + export function setupMaster(settings?: ClusterSetupMasterSettings): void; + export var worker: Worker; + export var workers: { + [index: string]: Worker + }; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + export function addListener(event: string, listener: Function): Cluster; + export function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function addListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function addListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function emit(event: string, listener: Function): boolean; + export function emit(event: "disconnect", listener: (worker: Worker) => void): boolean; + export function emit(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): boolean; + export function emit(event: "fork", listener: (worker: Worker) => void): boolean; + export function emit(event: "listening", listener: (worker: Worker, address: Address) => void): boolean; + export function emit(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): boolean; + export function emit(event: "online", listener: (worker: Worker) => void): boolean; + export function emit(event: "setup", listener: (settings: any) => void): boolean; + + export function on(event: string, listener: Function): Cluster; + export function on(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function on(event: "fork", listener: (worker: Worker) => void): Cluster; + export function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function on(event: "online", listener: (worker: Worker) => void): Cluster; + export function on(event: "setup", listener: (settings: any) => void): Cluster; + + export function once(event: string, listener: Function): Cluster; + export function once(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function once(event: "fork", listener: (worker: Worker) => void): Cluster; + export function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function once(event: "online", listener: (worker: Worker) => void): Cluster; + export function once(event: "setup", listener: (settings: any) => void): Cluster; + + export function removeListener(event: string, listener: Function): Cluster; + export function removeAllListeners(event?: string): Cluster; + export function setMaxListeners(n: number): Cluster; + export function getMaxListeners(): number; + export function listeners(event: string): Function[]; + export function listenerCount(type: string): number; + + export function prependListener(event: string, listener: Function): Cluster; + export function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function prependListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function prependOnceListener(event: string, listener: Function): Cluster; + export function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function eventNames(): string[]; +} + +declare module "zlib" { + import * as stream from "stream"; + + export interface ZlibOptions { + flush?: number; // default: zlib.constants.Z_NO_FLUSH + finishFlush?: number; // default: zlib.constants.Z_FINISH + chunkSize?: number; // default: 16*1024 + windowBits?: number; + level?: number; // compression only + memLevel?: number; // compression only + strategy?: number; // compression only + dictionary?: any; // deflate/inflate only, empty dictionary by default + } + + export interface Gzip extends stream.Transform { } + export interface Gunzip extends stream.Transform { } + export interface Deflate extends stream.Transform { } + export interface Inflate extends stream.Transform { } + export interface DeflateRaw extends stream.Transform { } + export interface InflateRaw extends stream.Transform { } + export interface Unzip extends stream.Transform { } + + export function createGzip(options?: ZlibOptions): Gzip; + export function createGunzip(options?: ZlibOptions): Gunzip; + export function createDeflate(options?: ZlibOptions): Deflate; + export function createInflate(options?: ZlibOptions): Inflate; + export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; + export function createInflateRaw(options?: ZlibOptions): InflateRaw; + export function createUnzip(options?: ZlibOptions): Unzip; + + export function deflate(buf: Buffer | string, callback: (error: Error, result: Buffer) => void): void; + export function deflate(buf: Buffer | string, options: ZlibOptions, callback: (error: Error, result: Buffer) => void): void; + export function deflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer; + export function deflateRaw(buf: Buffer | string, callback: (error: Error, result: Buffer) => void): void; + export function deflateRaw(buf: Buffer | string, options: ZlibOptions, callback: (error: Error, result: Buffer) => void): void; + export function deflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer; + export function gzip(buf: Buffer, callback: (error: Error, result: Buffer) => void): void; + export function gzip(buf: Buffer, options: ZlibOptions, callback: (error: Error, result: Buffer) => void): void; + export function gzipSync(buf: Buffer, options?: ZlibOptions): Buffer; + export function gunzip(buf: Buffer, callback: (error: Error, result: Buffer) => void): void; + export function gunzip(buf: Buffer, options: ZlibOptions, callback: (error: Error, result: Buffer) => void): void; + export function gunzipSync(buf: Buffer, options?: ZlibOptions): Buffer; + export function inflate(buf: Buffer, callback: (error: Error, result: Buffer) => void): void; + export function inflate(buf: Buffer, options: ZlibOptions, callback: (error: Error, result: Buffer) => void): void; + export function inflateSync(buf: Buffer, options?: ZlibOptions): Buffer; + export function inflateRaw(buf: Buffer, callback: (error: Error, result: Buffer) => void): void; + export function inflateRaw(buf: Buffer, options: ZlibOptions, callback: (error: Error, result: Buffer) => void): void; + export function inflateRawSync(buf: Buffer, options?: ZlibOptions): Buffer; + export function unzip(buf: Buffer, callback: (error: Error, result: Buffer) => void): void; + export function unzip(buf: Buffer, options: ZlibOptions, callback: (error: Error, result: Buffer) => void): void; + export function unzipSync(buf: Buffer, options?: ZlibOptions): Buffer; + + export namespace constants { + // Allowed flush values. + + export const Z_NO_FLUSH: number; + export const Z_PARTIAL_FLUSH: number; + export const Z_SYNC_FLUSH: number; + export const Z_FULL_FLUSH: number; + export const Z_FINISH: number; + export const Z_BLOCK: number; + export const Z_TREES: number; + + // Return codes for the compression/decompression functions. Negative values are errors, positive values are used for special but normal events. + + export const Z_OK: number; + export const Z_STREAM_END: number; + export const Z_NEED_DICT: number; + export const Z_ERRNO: number; + export const Z_STREAM_ERROR: number; + export const Z_DATA_ERROR: number; + export const Z_MEM_ERROR: number; + export const Z_BUF_ERROR: number; + export const Z_VERSION_ERROR: number; + + // Compression levels. + + export const Z_NO_COMPRESSION: number; + export const Z_BEST_SPEED: number; + export const Z_BEST_COMPRESSION: number; + export const Z_DEFAULT_COMPRESSION: number; + + // Compression strategy. + + export const Z_FILTERED: number; + export const Z_HUFFMAN_ONLY: number; + export const Z_RLE: number; + export const Z_FIXED: number; + export const Z_DEFAULT_STRATEGY: number; + } + + // Constants + export var Z_NO_FLUSH: number; + export var Z_PARTIAL_FLUSH: number; + export var Z_SYNC_FLUSH: number; + export var Z_FULL_FLUSH: number; + export var Z_FINISH: number; + export var Z_BLOCK: number; + export var Z_TREES: number; + export var Z_OK: number; + export var Z_STREAM_END: number; + export var Z_NEED_DICT: number; + export var Z_ERRNO: number; + export var Z_STREAM_ERROR: number; + export var Z_DATA_ERROR: number; + export var Z_MEM_ERROR: number; + export var Z_BUF_ERROR: number; + export var Z_VERSION_ERROR: number; + export var Z_NO_COMPRESSION: number; + export var Z_BEST_SPEED: number; + export var Z_BEST_COMPRESSION: number; + export var Z_DEFAULT_COMPRESSION: number; + export var Z_FILTERED: number; + export var Z_HUFFMAN_ONLY: number; + export var Z_RLE: number; + export var Z_FIXED: number; + export var Z_DEFAULT_STRATEGY: number; + export var Z_BINARY: number; + export var Z_TEXT: number; + export var Z_ASCII: number; + export var Z_UNKNOWN: number; + export var Z_DEFLATED: number; +} + +declare module "os" { + export interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + + export interface NetworkInterfaceInfo { + address: string; + netmask: string; + family: string; + mac: string; + internal: boolean; + } + + export function hostname(): string; + export function loadavg(): number[]; + export function uptime(): number; + export function freemem(): number; + export function totalmem(): number; + export function cpus(): CpuInfo[]; + export function type(): string; + export function release(): string; + export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] }; + export function homedir(): string; + export function userInfo(options?: { encoding: string }): { username: string, uid: number, gid: number, shell: any, homedir: string } + export var constants: { + UV_UDP_REUSEADDR: number, + signals: { + SIGHUP: number; + SIGINT: number; + SIGQUIT: number; + SIGILL: number; + SIGTRAP: number; + SIGABRT: number; + SIGIOT: number; + SIGBUS: number; + SIGFPE: number; + SIGKILL: number; + SIGUSR1: number; + SIGSEGV: number; + SIGUSR2: number; + SIGPIPE: number; + SIGALRM: number; + SIGTERM: number; + SIGCHLD: number; + SIGSTKFLT: number; + SIGCONT: number; + SIGSTOP: number; + SIGTSTP: number; + SIGTTIN: number; + SIGTTOU: number; + SIGURG: number; + SIGXCPU: number; + SIGXFSZ: number; + SIGVTALRM: number; + SIGPROF: number; + SIGWINCH: number; + SIGIO: number; + SIGPOLL: number; + SIGPWR: number; + SIGSYS: number; + SIGUNUSED: number; + }, + errno: { + E2BIG: number; + EACCES: number; + EADDRINUSE: number; + EADDRNOTAVAIL: number; + EAFNOSUPPORT: number; + EAGAIN: number; + EALREADY: number; + EBADF: number; + EBADMSG: number; + EBUSY: number; + ECANCELED: number; + ECHILD: number; + ECONNABORTED: number; + ECONNREFUSED: number; + ECONNRESET: number; + EDEADLK: number; + EDESTADDRREQ: number; + EDOM: number; + EDQUOT: number; + EEXIST: number; + EFAULT: number; + EFBIG: number; + EHOSTUNREACH: number; + EIDRM: number; + EILSEQ: number; + EINPROGRESS: number; + EINTR: number; + EINVAL: number; + EIO: number; + EISCONN: number; + EISDIR: number; + ELOOP: number; + EMFILE: number; + EMLINK: number; + EMSGSIZE: number; + EMULTIHOP: number; + ENAMETOOLONG: number; + ENETDOWN: number; + ENETRESET: number; + ENETUNREACH: number; + ENFILE: number; + ENOBUFS: number; + ENODATA: number; + ENODEV: number; + ENOENT: number; + ENOEXEC: number; + ENOLCK: number; + ENOLINK: number; + ENOMEM: number; + ENOMSG: number; + ENOPROTOOPT: number; + ENOSPC: number; + ENOSR: number; + ENOSTR: number; + ENOSYS: number; + ENOTCONN: number; + ENOTDIR: number; + ENOTEMPTY: number; + ENOTSOCK: number; + ENOTSUP: number; + ENOTTY: number; + ENXIO: number; + EOPNOTSUPP: number; + EOVERFLOW: number; + EPERM: number; + EPIPE: number; + EPROTO: number; + EPROTONOSUPPORT: number; + EPROTOTYPE: number; + ERANGE: number; + EROFS: number; + ESPIPE: number; + ESRCH: number; + ESTALE: number; + ETIME: number; + ETIMEDOUT: number; + ETXTBSY: number; + EWOULDBLOCK: number; + EXDEV: number; + }, + }; + export function arch(): string; + export function platform(): NodeJS.Platform; + export function tmpdir(): string; + export var EOL: string; + export function endianness(): "BE" | "LE"; +} + +declare module "https" { + import * as tls from "tls"; + import * as events from "events"; + import * as http from "http"; + + export interface ServerOptions { + pfx?: any; + key?: any; + passphrase?: string; + cert?: any; + ca?: any; + crl?: any; + ciphers?: string; + honorCipherOrder?: boolean; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: any; + SNICallback?: (servername: string, cb: (err: Error, ctx: tls.SecureContext) => any) => any; + } + + export interface RequestOptions extends http.RequestOptions { + pfx?: any; + key?: any; + passphrase?: string; + cert?: any; + ca?: any; + ciphers?: string; + rejectUnauthorized?: boolean; + secureProtocol?: string; + } + + export interface Agent extends http.Agent { } + + export interface AgentOptions extends http.AgentOptions { + pfx?: any; + key?: any; + passphrase?: string; + cert?: any; + ca?: any; + ciphers?: string; + rejectUnauthorized?: boolean; + secureProtocol?: string; + maxCachedSessions?: number; + } + + export var Agent: { + new (options?: AgentOptions): Agent; + }; + export interface Server extends tls.Server { } + export function createServer(options: ServerOptions, requestListener?: Function): Server; + export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export var globalAgent: Agent; +} + +declare module "punycode" { + export function decode(string: string): string; + export function encode(string: string): string; + export function toUnicode(domain: string): string; + export function toASCII(domain: string): string; + export var ucs2: ucs2; + interface ucs2 { + decode(string: string): number[]; + encode(codePoints: number[]): string; + } + export var version: any; +} + +declare module "repl" { + import * as stream from "stream"; + import * as readline from "readline"; + + export interface ReplOptions { + prompt?: string; + input?: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + terminal?: boolean; + eval?: Function; + useColors?: boolean; + useGlobal?: boolean; + ignoreUndefined?: boolean; + writer?: Function; + completer?: Function; + replMode?: any; + breakEvalOnSigint?: any; + } + + export interface REPLServer extends readline.ReadLine { + defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void; + displayPrompt(preserveCursor?: boolean): void; + + /** + * events.EventEmitter + * 1. exit + * 2. reset + **/ + + addListener(event: string, listener: Function): this; + addListener(event: "exit", listener: () => void): this; + addListener(event: "reset", listener: Function): this; + + emit(event: string, ...args: any[]): boolean; + emit(event: "exit"): boolean; + emit(event: "reset", context: any): boolean; + + on(event: string, listener: Function): this; + on(event: "exit", listener: () => void): this; + on(event: "reset", listener: Function): this; + + once(event: string, listener: Function): this; + once(event: "exit", listener: () => void): this; + once(event: "reset", listener: Function): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "exit", listener: () => void): this; + prependListener(event: "reset", listener: Function): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "exit", listener: () => void): this; + prependOnceListener(event: "reset", listener: Function): this; + } + + export function start(options: ReplOptions): REPLServer; +} + +declare module "readline" { + import * as events from "events"; + import * as stream from "stream"; + + export interface Key { + sequence?: string; + name?: string; + ctrl?: boolean; + meta?: boolean; + shift?: boolean; + } + + export interface ReadLine extends events.EventEmitter { + setPrompt(prompt: string): void; + prompt(preserveCursor?: boolean): void; + question(query: string, callback: (answer: string) => void): void; + pause(): ReadLine; + resume(): ReadLine; + close(): void; + write(data: string | Buffer, key?: Key): void; + + /** + * events.EventEmitter + * 1. close + * 2. line + * 3. pause + * 4. resume + * 5. SIGCONT + * 6. SIGINT + * 7. SIGTSTP + **/ + + addListener(event: string, listener: Function): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "line", listener: (input: any) => void): this; + addListener(event: "pause", listener: () => void): this; + addListener(event: "resume", listener: () => void): this; + addListener(event: "SIGCONT", listener: () => void): this; + addListener(event: "SIGINT", listener: () => void): this; + addListener(event: "SIGTSTP", listener: () => void): this; + + emit(event: string, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "line", input: any): boolean; + emit(event: "pause"): boolean; + emit(event: "resume"): boolean; + emit(event: "SIGCONT"): boolean; + emit(event: "SIGINT"): boolean; + emit(event: "SIGTSTP"): boolean; + + on(event: string, listener: Function): this; + on(event: "close", listener: () => void): this; + on(event: "line", listener: (input: any) => void): this; + on(event: "pause", listener: () => void): this; + on(event: "resume", listener: () => void): this; + on(event: "SIGCONT", listener: () => void): this; + on(event: "SIGINT", listener: () => void): this; + on(event: "SIGTSTP", listener: () => void): this; + + once(event: string, listener: Function): this; + once(event: "close", listener: () => void): this; + once(event: "line", listener: (input: any) => void): this; + once(event: "pause", listener: () => void): this; + once(event: "resume", listener: () => void): this; + once(event: "SIGCONT", listener: () => void): this; + once(event: "SIGINT", listener: () => void): this; + once(event: "SIGTSTP", listener: () => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "line", listener: (input: any) => void): this; + prependListener(event: "pause", listener: () => void): this; + prependListener(event: "resume", listener: () => void): this; + prependListener(event: "SIGCONT", listener: () => void): this; + prependListener(event: "SIGINT", listener: () => void): this; + prependListener(event: "SIGTSTP", listener: () => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "line", listener: (input: any) => void): this; + prependOnceListener(event: "pause", listener: () => void): this; + prependOnceListener(event: "resume", listener: () => void): this; + prependOnceListener(event: "SIGCONT", listener: () => void): this; + prependOnceListener(event: "SIGINT", listener: () => void): this; + prependOnceListener(event: "SIGTSTP", listener: () => void): this; + } + + type Completer = (line: string) => CompleterResult; + type AsyncCompleter = (line: string, callback: (err: any, result: CompleterResult) => void) => any; + + export type CompleterResult = [string[], string]; + + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + completer?: Completer | AsyncCompleter; + terminal?: boolean; + historySize?: number; + } + + export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): ReadLine; + export function createInterface(options: ReadLineOptions): ReadLine; + + export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void; + export function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void; + export function clearLine(stream: NodeJS.WritableStream, dir: number): void; + export function clearScreenDown(stream: NodeJS.WritableStream): void; +} + +declare module "vm" { + export interface Context { } + export interface ScriptOptions { + filename?: string; + lineOffset?: number; + columnOffset?: number; + displayErrors?: boolean; + timeout?: number; + cachedData?: Buffer; + produceCachedData?: boolean; + } + export interface RunningScriptOptions { + filename?: string; + lineOffset?: number; + columnOffset?: number; + displayErrors?: boolean; + timeout?: number; + } + export class Script { + constructor(code: string, options?: ScriptOptions); + runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any; + runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any; + runInThisContext(options?: RunningScriptOptions): any; + } + export function createContext(sandbox?: Context): Context; + export function isContext(sandbox: Context): boolean; + export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any; + export function runInDebugContext(code: string): any; + export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any; + export function runInThisContext(code: string, options?: RunningScriptOptions): any; +} + +declare module "child_process" { + import * as events from "events"; + import * as stream from "stream"; + import * as net from "net"; + + export interface ChildProcess extends events.EventEmitter { + stdin: stream.Writable; + stdout: stream.Readable; + stderr: stream.Readable; + stdio: [stream.Writable, stream.Readable, stream.Readable]; + pid: number; + kill(signal?: string): void; + send(message: any, sendHandle?: any): boolean; + connected: boolean; + disconnect(): void; + unref(): void; + ref(): void; + + /** + * events.EventEmitter + * 1. close + * 2. disconnect + * 3. error + * 4. exit + * 5. message + **/ + + addListener(event: string, listener: Function): this; + addListener(event: "close", listener: (code: number, signal: string) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "exit", listener: (code: number, signal: string) => void): this; + addListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + emit(event: string, ...args: any[]): boolean; + emit(event: "close", code: number, signal: string): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "exit", code: number, signal: string): boolean; + emit(event: "message", message: any, sendHandle: net.Socket | net.Server): boolean; + + on(event: string, listener: Function): this; + on(event: "close", listener: (code: number, signal: string) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "exit", listener: (code: number, signal: string) => void): this; + on(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + once(event: string, listener: Function): this; + once(event: "close", listener: (code: number, signal: string) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "exit", listener: (code: number, signal: string) => void): this; + once(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "close", listener: (code: number, signal: string) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "close", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + } + + export interface SpawnOptions { + cwd?: string; + env?: any; + stdio?: any; + detached?: boolean; + uid?: number; + gid?: number; + shell?: boolean | string; + } + export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess; + + export interface ExecOptions { + cwd?: string; + env?: any; + shell?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + uid?: number; + gid?: number; + } + export interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + export interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: string; // specify `null`. + } + export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + // usage. child_process.exec("tsc", {encoding: null as string}, (err, stdout, stderr) => {}); + export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + + export interface ExecFileOptions { + cwd?: string; + env?: any; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + uid?: number; + gid?: number; + } + export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: string; // specify `null`. + } + export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + // usage. child_process.execFile("file.sh", {encoding: null as string}, (err, stdout, stderr) => {}); + export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + // usage. child_process.execFile("file.sh", ["foo"], {encoding: null as string}, (err, stdout, stderr) => {}); + export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + + export interface ForkOptions { + cwd?: string; + env?: any; + execPath?: string; + execArgv?: string[]; + silent?: boolean; + stdio?: any[]; + uid?: number; + gid?: number; + } + export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess; + + export interface SpawnSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + shell?: boolean | string; + } + export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding: string; // specify `null`. + } + export interface SpawnSyncReturns { + pid: number; + output: string[]; + stdout: T; + stderr: T; + status: number; + signal: string; + error: Error; + } + export function spawnSync(command: string): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns; + + export interface ExecSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + shell?: string; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + } + export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding: string; // specify `null`. + } + export function execSync(command: string): Buffer; + export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string; + export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer; + export function execSync(command: string, options?: ExecSyncOptions): Buffer; + + export interface ExecFileSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + } + export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding: string; // specify `null`. + } + export function execFileSync(command: string): Buffer; + export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string; + export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer; +} + +declare module "url" { + export interface Url { + href?: string; + protocol?: string; + auth?: string; + hostname?: string; + port?: string; + host?: string; + pathname?: string; + search?: string; + query?: string | any; + slashes?: boolean; + hash?: string; + path?: string; + } + + export interface UrlObject { + protocol?: string; + slashes?: boolean; + auth?: string; + host?: string; + hostname?: string; + port?: string | number; + pathname?: string; + search?: string; + query?: { [key: string]: any; }; + hash?: string; + } + + export function parse(urlStr: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): Url; + export function format(URL: URL, options?: URLFormatOptions): string; + export function format(urlObject: UrlObject): string; + export function resolve(from: string, to: string): string; + + export interface URLFormatOptions { + auth?: boolean; + fragment?: boolean; + search?: boolean; + unicode?: boolean; + } + + export class URLSearchParams implements Iterable { + constructor(init?: URLSearchParams | string | { [key: string]: string | string[] } | Iterable ); + append(name: string, value: string): void; + delete(name: string): void; + entries(): Iterator; + forEach(callback: (value: string, name: string) => void): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string): boolean; + keys(): Iterator; + set(name: string, value: string): void; + sort(): void; + toString(): string; + values(): Iterator; + [Symbol.iterator](): Iterator; + } + + export class URL { + constructor(input: string, base?: string | URL); + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toString(): string; + toJSON(): string; + } +} + +declare module "dns" { + // Supported getaddrinfo flags. + export const ADDRCONFIG: number; + export const V4MAPPED: number; + + export interface LookupOptions { + family?: number; + hints?: number; + all?: boolean; + } + + export interface LookupOneOptions extends LookupOptions { + all?: false; + } + + export interface LookupAllOptions extends LookupOptions { + all: true; + } + + export interface LookupAddress { + address: string; + family: number; + } + + export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException, addresses: LookupAddress[]) => void): void; + export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void; + export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + + export interface ResolveOptions { + ttl: boolean; + } + + export interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + + export interface RecordWithTtl { + address: string; + ttl: number; + } + + export interface MxRecord { + priority: number; + exchange: string; + } + + export interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + + export interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + + export interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException, addresses: SoaRecord) => void): void; + export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]) => void): void; + + export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void; + export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void; + + export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void; + export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void; + + export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException, address: SoaRecord) => void): void; + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + + export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void; + export function setServers(servers: string[]): void; + + //Error codes + export var NODATA: string; + export var FORMERR: string; + export var SERVFAIL: string; + export var NOTFOUND: string; + export var NOTIMP: string; + export var REFUSED: string; + export var BADQUERY: string; + export var BADNAME: string; + export var BADFAMILY: string; + export var BADRESP: string; + export var CONNREFUSED: string; + export var TIMEOUT: string; + export var EOF: string; + export var FILE: string; + export var NOMEM: string; + export var DESTRUCTION: string; + export var BADSTR: string; + export var BADFLAGS: string; + export var NONAME: string; + export var BADHINTS: string; + export var NOTINITIALIZED: string; + export var LOADIPHLPAPI: string; + export var ADDRGETNETWORKPARAMS: string; + export var CANCELLED: string; +} + +declare module "net" { + import * as stream from "stream"; + import * as events from "events"; + + export interface Socket extends stream.Duplex { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + connect(port: number, host?: string, connectionListener?: Function): void; + connect(path: string, connectionListener?: Function): void; + bufferSize: number; + setEncoding(encoding?: string): this; + write(data: any, encoding?: string, callback?: Function): void; + destroy(err?: any): void; + pause(): this; + resume(): this; + setTimeout(timeout: number, callback?: Function): void; + setNoDelay(noDelay?: boolean): void; + setKeepAlive(enable?: boolean, initialDelay?: number): void; + address(): { port: number; family: string; address: string; }; + unref(): void; + ref(): void; + + remoteAddress: string; + remoteFamily: string; + remotePort: number; + localAddress: string; + localPort: number; + bytesRead: number; + bytesWritten: number; + connecting: boolean; + destroyed: boolean; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. timeout + */ + addListener(event: string, listener: Function): this; + addListener(event: "close", listener: (had_error: boolean) => void): this; + addListener(event: "connect", listener: () => void): this; + addListener(event: "data", listener: (data: Buffer) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string, ...args: any[]): boolean; + emit(event: "close", had_error: boolean): boolean; + emit(event: "connect"): boolean; + emit(event: "data", data: Buffer): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: Function): this; + on(event: "close", listener: (had_error: boolean) => void): this; + on(event: "connect", listener: () => void): this; + on(event: "data", listener: (data: Buffer) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: Function): this; + once(event: "close", listener: (had_error: boolean) => void): this; + once(event: "connect", listener: () => void): this; + once(event: "data", listener: (data: Buffer) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "close", listener: (had_error: boolean) => void): this; + prependListener(event: "connect", listener: () => void): this; + prependListener(event: "data", listener: (data: Buffer) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "close", listener: (had_error: boolean) => void): this; + prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener(event: "data", listener: (data: Buffer) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + export var Socket: { + new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; + }; + + export interface ListenOptions { + port?: number; + host?: string; + backlog?: number; + path?: string; + exclusive?: boolean; + } + + export interface Server extends events.EventEmitter { + listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server; + listen(port: number, hostname?: string, listeningListener?: Function): Server; + listen(port: number, backlog?: number, listeningListener?: Function): Server; + listen(port: number, listeningListener?: Function): Server; + listen(path: string, backlog?: number, listeningListener?: Function): Server; + listen(path: string, listeningListener?: Function): Server; + listen(options: ListenOptions, listeningListener?: Function): Server; + listen(handle: any, backlog?: number, listeningListener?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + close(callback?: Function): Server; + address(): { port: number; family: string; address: string; }; + getConnections(cb: (error: Error, count: number) => void): void; + ref(): Server; + unref(): Server; + maxConnections: number; + connections: number; + listening: boolean; + + /** + * events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + */ + addListener(event: string, listener: Function): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "connection", listener: (socket: Socket) => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + + emit(event: string, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "connection", socket: Socket): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + + on(event: string, listener: Function): this; + on(event: "close", listener: () => void): this; + on(event: "connection", listener: (socket: Socket) => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + + once(event: string, listener: Function): this; + once(event: "close", listener: () => void): this; + once(event: "connection", listener: (socket: Socket) => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "connection", listener: (socket: Socket) => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + } + export function createServer(connectionListener?: (socket: Socket) => void): Server; + export function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server; + export function connect(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function connect(port: number, host?: string, connectionListener?: Function): Socket; + export function connect(path: string, connectionListener?: Function): Socket; + export function createConnection(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; + export function createConnection(path: string, connectionListener?: Function): Socket; + export function isIP(input: string): number; + export function isIPv4(input: string): boolean; + export function isIPv6(input: string): boolean; +} + +declare module "dgram" { + import * as events from "events"; + + interface RemoteInfo { + address: string; + family: string; + port: number; + } + + interface AddressInfo { + address: string; + family: string; + port: number; + } + + interface BindOptions { + port: number; + address?: string; + exclusive?: boolean; + } + + type SocketType = "udp4" | "udp6"; + + interface SocketOptions { + type: SocketType; + reuseAddr?: boolean; + } + + export function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + export function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + + export interface Socket extends events.EventEmitter { + send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error, bytes: number) => void): void; + send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; + bind(port?: number, address?: string, callback?: () => void): void; + bind(options: BindOptions, callback?: Function): void; + close(callback?: () => void): void; + address(): AddressInfo; + setBroadcast(flag: boolean): void; + setTTL(ttl: number): void; + setMulticastTTL(ttl: number): void; + setMulticastLoopback(flag: boolean): void; + addMembership(multicastAddress: string, multicastInterface?: string): void; + dropMembership(multicastAddress: string, multicastInterface?: string): void; + ref(): this; + unref(): this; + + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + **/ + addListener(event: string, listener: Function): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + addListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + emit(event: string, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + emit(event: "message", msg: Buffer, rinfo: AddressInfo): boolean; + + on(event: string, listener: Function): this; + on(event: "close", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + on(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + once(event: string, listener: Function): this; + once(event: "close", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + once(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + prependListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + } +} + +declare module "fs" { + import * as stream from "stream"; + import * as events from "events"; + + 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; + birthtime: Date; + } + + interface FSWatcher extends events.EventEmitter { + close(): void; + + /** + * events.EventEmitter + * 1. change + * 2. error + */ + addListener(event: string, listener: Function): this; + addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + addListener(event: "error", listener: (code: number, signal: string) => void): this; + + on(event: string, listener: Function): this; + on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + on(event: "error", listener: (code: number, signal: string) => void): this; + + once(event: string, listener: Function): this; + once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + once(event: "error", listener: (code: number, signal: string) => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependListener(event: "error", listener: (code: number, signal: string) => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependOnceListener(event: "error", listener: (code: number, signal: string) => void): this; + } + + export interface ReadStream extends stream.Readable { + close(): void; + destroy(): void; + bytesRead: number; + path: string | Buffer; + + /** + * events.EventEmitter + * 1. open + * 2. close + */ + addListener(event: string, listener: Function): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: Function): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: Function): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + export interface WriteStream extends stream.Writable { + close(): void; + bytesWritten: number; + path: string | Buffer; + + /** + * events.EventEmitter + * 1. open + * 2. close + */ + addListener(event: string, listener: Function): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: Function): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: Function): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + /** + * Asynchronous rename. + * @param oldPath + * @param newPath + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /** + * Synchronous rename + * @param oldPath + * @param newPath + */ + export function renameSync(oldPath: string, newPath: string): void; + export function truncate(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function truncate(path: string | Buffer, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function truncateSync(path: string | Buffer, len?: number): void; + export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function ftruncateSync(fd: number, len?: number): void; + export function chown(path: string | Buffer, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chownSync(path: string | Buffer, uid: number, gid: number): void; + export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchownSync(fd: number, uid: number, gid: number): void; + export function lchown(path: string | Buffer, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchownSync(path: string | Buffer, uid: number, gid: number): void; + export function chmod(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chmod(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chmodSync(path: string | Buffer, mode: number): void; + export function chmodSync(path: string | Buffer, mode: string): void; + export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchmodSync(fd: number, mode: number): void; + export function fchmodSync(fd: number, mode: string): void; + export function lchmod(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchmod(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchmodSync(path: string | Buffer, mode: number): void; + export function lchmodSync(path: string | Buffer, mode: string): void; + export function stat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function lstat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function statSync(path: string | Buffer): Stats; + export function lstatSync(path: string | Buffer): Stats; + export function fstatSync(fd: number): Stats; + export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function linkSync(srcpath: string | Buffer, dstpath: string | Buffer): void; + export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function symlinkSync(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): void; + export function readlink(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; + export function readlinkSync(path: string | Buffer): string; + export function realpath(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; + export function realpath(path: string | Buffer, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; + export function realpathSync(path: string | Buffer, cache?: { [path: string]: string }): string; + /** + * Asynchronous unlink - deletes the file specified in {path} + * + * @param path + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function unlink(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void; + /** + * Synchronous unlink - deletes the file specified in {path} + * + * @param path + */ + export function unlinkSync(path: string | Buffer): void; + /** + * Asynchronous rmdir - removes the directory specified in {path} + * + * @param path + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function rmdir(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void; + /** + * Synchronous rmdir - removes the directory specified in {path} + * + * @param path + */ + export function rmdirSync(path: string | Buffer): void; + /** + * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdir(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void; + /** + * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdir(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + /** + * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdir(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /** + * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdirSync(path: string | Buffer, mode?: number): void; + /** + * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdirSync(path: string | Buffer, mode?: string): void; + /** + * Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * + * @param prefix + * @param callback The created folder path is passed as a string to the callback's second parameter. + */ + export function mkdtemp(prefix: string, callback?: (err: NodeJS.ErrnoException, folder: string) => void): void; + /** + * Synchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * + * @param prefix + * @returns Returns the created folder path. + */ + export function mkdtempSync(prefix: string): string; + export function readdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + export function readdir(path: string | Buffer, options: string | {}, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + export function readdirSync(path: string | Buffer, options?: string | {}): string[]; + export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function closeSync(fd: number): void; + export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; + export function open(path: string | Buffer, flags: string | number, mode: number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; + export function openSync(path: string | Buffer, flags: string | number, mode?: number): number; + export function utimes(path: string | Buffer, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimesSync(path: string | Buffer, atime: number, mtime: number): void; + export function utimesSync(path: string | Buffer, atime: Date, mtime: Date): void; + export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function futimesSync(fd: number, atime: number, mtime: number): void; + export function futimesSync(fd: number, atime: Date, mtime: Date): void; + export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fsyncSync(fd: number): void; + export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; + export function write(fd: number, buffer: Buffer, offset: number, length: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; + export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position?: number | null): number; + export function writeSync(fd: number, data: any, position?: number | null, enconding?: string): number; + export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void; + export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number | null): number; + /** + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param encoding + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + /** + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer. + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + /** + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer. + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + /** + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + /** + * Synchronous readFile - Synchronously reads the entire contents of a file. + * + * @param fileName + * @param encoding + */ + export function readFileSync(filename: string, encoding: string): string; + /** + * Synchronous readFile - Synchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer. + */ + export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string; + /** + * Synchronous readFile - Synchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer. + */ + export function readFileSync(filename: string, options?: { flag?: string; }): Buffer; + export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; + export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; + export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; + export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; + export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void; + export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void; + export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; + export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; + export function watch(filename: string, encoding: string, listener?: (event: string, filename: string | Buffer) => any): FSWatcher; + export function watch(filename: string, options: { persistent?: boolean; recursive?: boolean; encoding?: string }, listener?: (event: string, filename: string | Buffer) => any): FSWatcher; + export function exists(path: string | Buffer, callback?: (exists: boolean) => void): void; + export function existsSync(path: string | Buffer): boolean; + + export namespace constants { + // File Access Constants + + /** Constant for fs.access(). File is visible to the calling process. */ + export const F_OK: number; + + /** Constant for fs.access(). File can be read by the calling process. */ + export const R_OK: number; + + /** Constant for fs.access(). File can be written by the calling process. */ + export const W_OK: number; + + /** Constant for fs.access(). File can be executed by the calling process. */ + export const X_OK: number; + + // File Open Constants + + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + export const O_RDONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + export const O_WRONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + export const O_RDWR: number; + + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + export const O_CREAT: number; + + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + export const O_EXCL: number; + + /** Constant for fs.open(). Flag indicating that if path identifies a terminal device, opening the path shall not cause that terminal to become the controlling terminal for the process (if the process does not already have one). */ + export const O_NOCTTY: number; + + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + export const O_TRUNC: number; + + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + export const O_APPEND: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + export const O_DIRECTORY: number; + + /** Constant for fs.open(). Flag indicating reading accesses to the file system will no longer result in an update to the atime information associated with the file. This flag is available on Linux operating systems only. */ + export const O_NOATIME: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + export const O_NOFOLLOW: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + export const O_SYNC: number; + + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + export const O_SYMLINK: number; + + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + export const O_DIRECT: number; + + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + export const O_NONBLOCK: number; + + // File Type Constants + + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + export const S_IFMT: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + export const S_IFREG: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + export const S_IFDIR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + export const S_IFCHR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + export const S_IFBLK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + export const S_IFIFO: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + export const S_IFLNK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + export const S_IFSOCK: number; + + // File Mode Constants + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + export const S_IRWXU: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + export const S_IRUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + export const S_IWUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + export const S_IXUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + export const S_IRWXG: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + export const S_IRGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + export const S_IWGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + export const S_IXGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + export const S_IRWXO: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + export const S_IROTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + export const S_IWOTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + export const S_IXOTH: number; + } + + /** Tests a user's permissions for the file specified by path. */ + export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; + export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; + /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */ + export function accessSync(path: string | Buffer, mode?: number): void; + export function createReadStream(path: string | Buffer, options?: { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + end?: number; + }): ReadStream; + export function createWriteStream(path: string | Buffer, options?: { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + }): WriteStream; + export function fdatasync(fd: number, callback: Function): void; + export function fdatasyncSync(fd: number): void; +} + +declare module "path" { + + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + export interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param p string path to normalize. + */ + export function normalize(p: string): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths paths to join. + */ + export function join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} paramter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param pathSegments string paths to join. Non-string arguments are ignored. + */ + export function resolve(...pathSegments: any[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * @param path path to test. + */ + export function isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to}. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + * + * @param from + * @param to + */ + export function relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param p the path to evaluate. + */ + export function dirname(p: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param p the path to evaluate. + * @param ext optionally, an extension to remove from the result. + */ + export function basename(p: string, ext?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string + * + * @param p the path to evaluate. + */ + export function extname(p: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + export var sep: string; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + export var delimiter: string; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param pathString path to evaluate. + */ + export function parse(pathString: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathString path to evaluate. + */ + export function format(pathObject: ParsedPath): string; + + export module posix { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; + } + + export module win32 { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; + } +} + +declare module "string_decoder" { + export interface NodeStringDecoder { + write(buffer: Buffer): string; + end(buffer?: Buffer): string; + } + export var StringDecoder: { + new (encoding?: string): NodeStringDecoder; + }; +} + +declare module "tls" { + import * as crypto from "crypto"; + import * as net from "net"; + import * as stream from "stream"; + + var CLIENT_RENEG_LIMIT: number; + var CLIENT_RENEG_WINDOW: number; + + export interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + + export interface PeerCertificate { + subject: Certificate; + issuer: Certificate; + subjectaltname: string; + infoAccess: { [index: string]: string[] }; + modulus: string; + exponent: string; + valid_from: string; + valid_to: string; + fingerprint: string; + ext_key_usage: string[]; + serialNumber: string; + raw: Buffer; + } + + export interface DetailedPeerCertificate extends PeerCertificate { + issuerCertificate: DetailedPeerCertificate; + } + + export interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + } + + export class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket:net.Socket, options?: { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext, + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean, + /** + * An optional net.Server instance. + */ + server?: net.Server, + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean, + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. Defaults to false. + */ + rejectUnauthorized?: boolean, + /** + * An array of strings or a Buffer naming possible NPN protocols. + * (Protocols should be ordered by their priority.) + */ + NPNProtocols?: string[] | Buffer, + /** + * An array of strings or a Buffer naming possible ALPN protocols. + * (Protocols should be ordered by their priority.) When the server + * receives both NPN and ALPN extensions from the client, ALPN takes + * precedence over NPN and the server does not send an NPN extension + * to the client. + */ + ALPNProtocols?: string[] | Buffer, + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: Function, + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer, + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean + }); + /** + * Returns the bound address, the address family name and port of the underlying socket as reported by + * the operating system. + * @returns {any} - An object with three properties, e.g. { port: 12346, family: 'IPv4', address: '127.0.0.1' }. + */ + address(): { port: number; family: string; address: string }; + /** + * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false. + */ + authorized: boolean; + /** + * The reason why the peer's certificate has not been verified. + * This property becomes available only when tlsSocket.authorized === false. + */ + authorizationError: Error; + /** + * Static boolean value, always true. + * May be used to distinguish TLS sockets from regular ones. + */ + encrypted: boolean; + /** + * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection. + * @returns {CipherNameAndProtocol} - Returns an object representing the cipher name + * and the SSL/TLS protocol version of the current connection. + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the peer's certificate. + * The returned object has some properties corresponding to the field of the certificate. + * If detailed argument is true the full chain with issuer property will be returned, + * if false only the top certificate without issuer property. + * If the peer does not provide a certificate, it returns null or an empty object. + * @param {boolean} detailed - If true; the full chain with issuer property will be returned. + * @returns {PeerCertificate | DetailedPeerCertificate} - An object representing the peer's certificate. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * Could be used to speed up handshake establishment when reconnecting to the server. + * @returns {any} - ASN.1 encoded TLS session or undefined if none was negotiated. + */ + getSession(): any; + /** + * NOTE: Works only with client TLS sockets. + * Useful only for debugging, for session reuse provide session option to tls.connect(). + * @returns {any} - TLS session ticket or undefined if none was negotiated. + */ + getTLSTicket(): any; + /** + * The string representation of the local IP address. + */ + localAddress: string; + /** + * The numeric representation of the local port. + */ + localPort: number; + /** + * The string representation of the remote IP address. + * For example, '74.125.127.100' or '2001:4860:a005::68'. + */ + remoteAddress: string; + /** + * The string representation of the remote IP family. 'IPv4' or 'IPv6'. + */ + remoteFamily: string; + /** + * The numeric representation of the remote port. For example, 443. + */ + remotePort: number; + /** + * Initiate TLS renegotiation process. + * + * NOTE: Can be used to request peer's certificate after the secure connection has been established. + * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout. + * @param {TlsOptions} options - The options may contain the following fields: rejectUnauthorized, + * requestCert (See tls.createServer() for details). + * @param {Function} callback - callback(err) will be executed with null as err, once the renegotiation + * is successfully completed. + */ + renegotiate(options: TlsOptions, callback: (err: Error) => any): any; + /** + * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by + * the TLS layer until the entire fragment is received and its integrity is verified; + * large fragments can span multiple roundtrips, and their processing can be delayed due to packet + * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, + * which may decrease overall server throughput. + * @param {number} size - TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * @returns {boolean} - Returns true on success, false otherwise. + */ + setMaxSendFragment(size: number): boolean; + + /** + * events.EventEmitter + * 1. OCSPResponse + * 2. secureConnect + **/ + addListener(event: string, listener: Function): this; + addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + addListener(event: "secureConnect", listener: () => void): this; + + emit(event: string, ...args: any[]): boolean; + emit(event: "OCSPResponse", response: Buffer): boolean; + emit(event: "secureConnect"): boolean; + + on(event: string, listener: Function): this; + on(event: "OCSPResponse", listener: (response: Buffer) => void): this; + on(event: "secureConnect", listener: () => void): this; + + once(event: string, listener: Function): this; + once(event: "OCSPResponse", listener: (response: Buffer) => void): this; + once(event: "secureConnect", listener: () => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependListener(event: "secureConnect", listener: () => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependOnceListener(event: "secureConnect", listener: () => void): this; + } + + export interface TlsOptions { + host?: string; + port?: number; + pfx?: string | Buffer[]; + key?: string | string[] | Buffer | any[]; + passphrase?: string; + cert?: string | string[] | Buffer | Buffer[]; + ca?: string | string[] | Buffer | Buffer[]; + crl?: string | string[]; + ciphers?: string; + honorCipherOrder?: boolean; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: string[] | Buffer; + SNICallback?: (servername: string, cb: (err: Error, ctx: SecureContext) => any) => any; + ecdhCurve?: string; + dhparam?: string | Buffer; + handshakeTimeout?: number; + ALPNProtocols?: string[] | Buffer; + sessionTimeout?: number; + ticketKeys?: any; + sessionIdContext?: string; + secureProtocol?: string; + } + + export interface ConnectionOptions { + host?: string; + port?: number; + socket?: net.Socket; + pfx?: string | Buffer + key?: string | string[] | Buffer | Buffer[]; + passphrase?: string; + cert?: string | string[] | Buffer | Buffer[]; + ca?: string | Buffer | (string | Buffer)[]; + rejectUnauthorized?: boolean; + NPNProtocols?: (string | Buffer)[]; + servername?: string; + path?: string; + ALPNProtocols?: (string | Buffer)[]; + checkServerIdentity?: (servername: string, cert: string | Buffer | (string | Buffer)[]) => any; + secureProtocol?: string; + secureContext?: Object; + session?: Buffer; + minDHSize?: number; + } + + export interface Server extends net.Server { + close(callback?: Function): Server; + address(): { port: number; family: string; address: string; }; + addContext(hostName: string, credentials: { + key: string; + cert: string; + ca: string; + }): void; + maxConnections: number; + connections: number; + + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + **/ + addListener(event: string, listener: Function): this; + addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + addListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + addListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + emit(event: string, ...args: any[]): boolean; + emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; + emit(event: "newSession", sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void): boolean; + emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: Function): boolean; + emit(event: "resumeSession", sessionId: any, callback: (err: Error, sessionData: any) => void): boolean; + emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; + + on(event: string, listener: Function): this; + on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + on(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + on(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + once(event: string, listener: Function): this; + once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + once(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + once(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + prependListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + prependOnceListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + } + + export interface ClearTextStream extends stream.Duplex { + authorized: boolean; + authorizationError: Error; + getPeerCertificate(): any; + getCipher: { + name: string; + version: string; + }; + address: { + port: number; + family: string; + address: string; + }; + remoteAddress: string; + remotePort: number; + } + + export interface SecurePair { + encrypted: any; + cleartext: any; + } + + export interface SecureContextOptions { + pfx?: string | Buffer; + key?: string | Buffer; + passphrase?: string; + cert?: string | Buffer; + ca?: string | Buffer; + crl?: string | string[] + ciphers?: string; + honorCipherOrder?: boolean; + } + + export interface SecureContext { + context: any; + } + + export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + export function createSecureContext(details: SecureContextOptions): SecureContext; +} + +declare module "crypto" { + export interface Certificate { + exportChallenge(spkac: string | Buffer): Buffer; + exportPublicKey(spkac: string | Buffer): Buffer; + verifySpkac(spkac: Buffer): boolean; + } + export var Certificate: { + new (): Certificate; + (): Certificate; + } + + export var fips: boolean; + + export interface CredentialDetails { + pfx: string; + key: string; + passphrase: string; + cert: string; + ca: string | string[]; + crl: string | string[]; + ciphers: string; + } + export interface Credentials { context?: any; } + export function createCredentials(details: CredentialDetails): Credentials; + export function createHash(algorithm: string): Hash; + export function createHmac(algorithm: string, key: string | Buffer): Hmac; + + type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1"; + type HexBase64Latin1Encoding = "latin1" | "hex" | "base64"; + type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary"; + type HexBase64BinaryEncoding = "binary" | "base64" | "hex"; + type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; + + export interface Hash extends NodeJS.ReadWriteStream { + update(data: string | Buffer): Hash; + update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Hash; + digest(): Buffer; + digest(encoding: HexBase64Latin1Encoding): string; + } + export interface Hmac extends NodeJS.ReadWriteStream { + update(data: string | Buffer): Hmac; + update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Hmac; + digest(): Buffer; + digest(encoding: HexBase64Latin1Encoding): string; + } + export function createCipher(algorithm: string, password: any): Cipher; + export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; + export interface Cipher extends NodeJS.ReadWriteStream { + update(data: Buffer): Buffer; + update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer; + update(data: Buffer, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string; + update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding?: boolean): void; + getAuthTag(): Buffer; + setAAD(buffer: Buffer): void; + } + export function createDecipher(algorithm: string, password: any): Decipher; + export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; + export interface Decipher extends NodeJS.ReadWriteStream { + update(data: Buffer): Buffer; + update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer; + update(data: Buffer, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string; + update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding?: boolean): void; + setAuthTag(tag: Buffer): void; + setAAD(buffer: Buffer): void; + } + export function createSign(algorithm: string): Signer; + export interface Signer extends NodeJS.WritableStream { + update(data: string | Buffer): Signer; + update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Signer; + sign(private_key: string | { key: string; passphrase: string }): Buffer; + sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string; + } + export function createVerify(algorith: string): Verify; + export interface Verify extends NodeJS.WritableStream { + update(data: string | Buffer): Verify; + update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Verify; + verify(object: string, signature: Buffer): boolean; + verify(object: string, signature: string, signature_format: HexBase64Latin1Encoding): boolean; + } + export function createDiffieHellman(prime_length: number, generator?: number): DiffieHellman; + export function createDiffieHellman(prime: Buffer): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman; + export interface DiffieHellman { + generateKeys(): Buffer; + generateKeys(encoding: HexBase64Latin1Encoding): string; + computeSecret(other_public_key: Buffer): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; + getPrime(): Buffer; + getPrime(encoding: HexBase64Latin1Encoding): string; + getGenerator(): Buffer; + getGenerator(encoding: HexBase64Latin1Encoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: HexBase64Latin1Encoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: HexBase64Latin1Encoding): string; + setPublicKey(public_key: Buffer): void; + setPublicKey(public_key: string, encoding: string): void; + setPrivateKey(private_key: Buffer): void; + setPrivateKey(private_key: string, encoding: string): void; + verifyError: number; + } + export function getDiffieHellman(group_name: string): DiffieHellman; + export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer; + export function randomBytes(size: number): Buffer; + export function randomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void; + export function pseudoRandomBytes(size: number): Buffer; + export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void; + export function randomFillSync(buffer: Buffer | Uint8Array, offset?: number, size?: number): Buffer; + export function randomFill(buffer: Buffer, callback: (err: Error, buf: Buffer) => void): void; + export function randomFill(buffer: Uint8Array, callback: (err: Error, buf: Uint8Array) => void): void; + export function randomFill(buffer: Buffer, offset: number, callback: (err: Error, buf: Buffer) => void): void; + export function randomFill(buffer: Uint8Array, offset: number, callback: (err: Error, buf: Uint8Array) => void): void; + export function randomFill(buffer: Buffer, offset: number, size: number, callback: (err: Error, buf: Buffer) => void): void; + export function randomFill(buffer: Uint8Array, offset: number, size: number, callback: (err: Error, buf: Uint8Array) => void): void; + export interface RsaPublicKey { + key: string; + padding?: number; + } + export interface RsaPrivateKey { + key: string; + passphrase?: string, + padding?: number; + } + export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer + export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer + export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer + export function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer + export function getCiphers(): string[]; + export function getCurves(): string[]; + export function getHashes(): string[]; + export interface ECDH { + generateKeys(): Buffer; + generateKeys(encoding: HexBase64Latin1Encoding): string; + generateKeys(encoding: HexBase64Latin1Encoding, format: ECDHKeyFormat): string; + computeSecret(other_public_key: Buffer): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: HexBase64Latin1Encoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: HexBase64Latin1Encoding): string; + getPublicKey(encoding: HexBase64Latin1Encoding, format: ECDHKeyFormat): string; + setPrivateKey(private_key: Buffer): void; + setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void; + } + export function createECDH(curve_name: string): ECDH; + export function timingSafeEqual(a: Buffer, b: Buffer): boolean; + export var DEFAULT_ENCODING: string; +} + +declare module "stream" { + import * as events from "events"; + + class internal extends events.EventEmitter { + pipe(destination: T, options?: { end?: boolean; }): T; + } + + namespace internal { + + export class Stream extends internal { } + + export interface ReadableOptions { + highWaterMark?: number; + encoding?: string; + objectMode?: boolean; + read?: (this: Readable, size?: number) => any; + } + + export class Readable extends Stream implements NodeJS.ReadableStream { + readable: boolean; + constructor(opts?: ReadableOptions); + _read(size: number): void; + read(size?: number): any; + setEncoding(encoding: string): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): this; + unshift(chunk: any): void; + wrap(oldStream: NodeJS.ReadableStream): Readable; + push(chunk: any, encoding?: string): boolean; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. end + * 4. readable + * 5. error + **/ + addListener(event: string, listener: Function): this; + addListener(event: string, listener: Function): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "readable", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + + emit(event: string, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "data", chunk: Buffer | string): boolean; + emit(event: "end"): boolean; + emit(event: "readable"): boolean; + emit(event: "error", err: Error): boolean; + + on(event: string, listener: Function): this; + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "end", listener: () => void): this; + on(event: "readable", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + + once(event: string, listener: Function): this; + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "end", listener: () => void): this; + once(event: "readable", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "readable", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "readable", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + + removeListener(event: string, listener: Function): this; + removeListener(event: "close", listener: () => void): this; + removeListener(event: "data", listener: (chunk: Buffer | string) => void): this; + removeListener(event: "end", listener: () => void): this; + removeListener(event: "readable", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + } + + export interface WritableOptions { + highWaterMark?: number; + decodeStrings?: boolean; + objectMode?: boolean; + write?: (chunk: string | Buffer, encoding: string, callback: Function) => any; + writev?: (chunks: { chunk: string | Buffer, encoding: string }[], callback: Function) => any; + } + + export class Writable extends Stream implements NodeJS.WritableStream { + writable: boolean; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: string, callback: Function): void; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + setDefaultEncoding(encoding: string): this; + end(): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. drain + * 3. error + * 4. finish + * 5. pipe + * 6. unpipe + **/ + addListener(event: string, listener: Function): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "pipe", listener: (src: Readable) => void): this; + addListener(event: "unpipe", listener: (src: Readable) => void): this; + + emit(event: string, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "drain", chunk: Buffer | string): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "pipe", src: Readable): boolean; + emit(event: "unpipe", src: Readable): boolean; + + on(event: string, listener: Function): this; + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "pipe", listener: (src: Readable) => void): this; + on(event: "unpipe", listener: (src: Readable) => void): this; + + once(event: string, listener: Function): this; + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "pipe", listener: (src: Readable) => void): this; + once(event: "unpipe", listener: (src: Readable) => void): this; + + prependListener(event: string, listener: Function): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "pipe", listener: (src: Readable) => void): this; + prependListener(event: "unpipe", listener: (src: Readable) => void): this; + + prependOnceListener(event: string, listener: Function): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; + + removeListener(event: string, listener: Function): this; + removeListener(event: "close", listener: () => void): this; + removeListener(event: "drain", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: "finish", listener: () => void): this; + removeListener(event: "pipe", listener: (src: Readable) => void): this; + removeListener(event: "unpipe", listener: (src: Readable) => void): this; + } + + export interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean; + readableObjectMode?: boolean; + writableObjectMode?: boolean; + } + + // Note: Duplex extends both Readable and Writable. + export class Duplex extends Readable implements Writable { + writable: boolean; + constructor(opts?: DuplexOptions); + _write(chunk: any, encoding: string, callback: Function): void; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + setDefaultEncoding(encoding: string): this; + end(): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + } + + export interface TransformOptions extends DuplexOptions { + transform?: (chunk: string | Buffer, encoding: string, callback: Function) => any; + flush?: (callback: Function) => any; + } + + export class Transform extends Duplex { + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: string, callback: Function): void; + } + + export class PassThrough extends Transform { } + } + + export = internal; +} + +declare module "util" { + export interface InspectOptions extends NodeJS.InspectOptions {} + export function format(format: any, ...param: any[]): string; + export function debug(string: string): void; + export function error(...param: any[]): void; + export function puts(...param: any[]): void; + export function print(...param: any[]): void; + export function log(string: string): void; + export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; + export function inspect(object: any, options: InspectOptions): string; + export function isArray(object: any): object is any[]; + export function isRegExp(object: any): object is RegExp; + export function isDate(object: any): object is Date; + export function isError(object: any): object is Error; + export function inherits(constructor: any, superConstructor: any): void; + export function debuglog(key: string): (msg: string, ...param: any[]) => void; + export function isBoolean(object: any): object is boolean; + export function isBuffer(object: any): object is Buffer; + export function isFunction(object: any): boolean; + export function isNull(object: any): object is null; + export function isNullOrUndefined(object: any): object is null | undefined; + export function isNumber(object: any): object is number; + export function isObject(object: any): boolean; + export function isPrimitive(object: any): boolean; + export function isString(object: any): object is string; + export function isSymbol(object: any): object is symbol; + export function isUndefined(object: any): object is undefined; + export function deprecate(fn: Function, message: string): Function; +} + +declare module "assert" { + function internal(value: any, message?: string): void; + namespace internal { + export class AssertionError implements Error { + name: string; + message: string; + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + + constructor(options?: { + message?: string; actual?: any; expected?: any; + operator?: string; stackStartFunction?: Function + }); + } + + export function fail(actual: any, expected: any, message: string, operator: string): void; + export function ok(value: any, message?: string): void; + export function equal(actual: any, expected: any, message?: string): void; + export function notEqual(actual: any, expected: any, message?: string): void; + export function deepEqual(actual: any, expected: any, message?: string): void; + export function notDeepEqual(acutal: any, expected: any, message?: string): void; + export function strictEqual(actual: any, expected: any, message?: string): void; + export function notStrictEqual(actual: any, expected: any, message?: string): void; + export function deepStrictEqual(actual: any, expected: any, message?: string): void; + export function notDeepStrictEqual(actual: any, expected: any, message?: string): void; + export var throws: { + (block: Function, message?: string): void; + (block: Function, error: Function, message?: string): void; + (block: Function, error: RegExp, message?: string): void; + (block: Function, error: (err: any) => boolean, message?: string): void; + }; + + export var doesNotThrow: { + (block: Function, message?: string): void; + (block: Function, error: Function, message?: string): void; + (block: Function, error: RegExp, message?: string): void; + (block: Function, error: (err: any) => boolean, message?: string): void; + }; + + export function ifError(value: any): void; + } + + export = internal; +} + +declare module "tty" { + import * as net from "net"; + + export function isatty(fd: number): boolean; + export interface ReadStream extends net.Socket { + isRaw: boolean; + setRawMode(mode: boolean): void; + isTTY: boolean; + } + export interface WriteStream extends net.Socket { + columns: number; + rows: number; + isTTY: boolean; + } +} + +declare module "domain" { + import * as events from "events"; + + export class Domain extends events.EventEmitter implements NodeJS.Domain { + run(fn: Function): void; + add(emitter: events.EventEmitter): void; + remove(emitter: events.EventEmitter): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + dispose(): void; + members: any[]; + enter(): void; + exit(): void; + } + + export function create(): Domain; +} + +declare module "constants" { + export var E2BIG: number; + export var EACCES: number; + export var EADDRINUSE: number; + export var EADDRNOTAVAIL: number; + export var EAFNOSUPPORT: number; + export var EAGAIN: number; + export var EALREADY: number; + export var EBADF: number; + export var EBADMSG: number; + export var EBUSY: number; + export var ECANCELED: number; + export var ECHILD: number; + export var ECONNABORTED: number; + export var ECONNREFUSED: number; + export var ECONNRESET: number; + export var EDEADLK: number; + export var EDESTADDRREQ: number; + export var EDOM: number; + export var EEXIST: number; + export var EFAULT: number; + export var EFBIG: number; + export var EHOSTUNREACH: number; + export var EIDRM: number; + export var EILSEQ: number; + export var EINPROGRESS: number; + export var EINTR: number; + export var EINVAL: number; + export var EIO: number; + export var EISCONN: number; + export var EISDIR: number; + export var ELOOP: number; + export var EMFILE: number; + export var EMLINK: number; + export var EMSGSIZE: number; + export var ENAMETOOLONG: number; + export var ENETDOWN: number; + export var ENETRESET: number; + export var ENETUNREACH: number; + export var ENFILE: number; + export var ENOBUFS: number; + export var ENODATA: number; + export var ENODEV: number; + export var ENOENT: number; + export var ENOEXEC: number; + export var ENOLCK: number; + export var ENOLINK: number; + export var ENOMEM: number; + export var ENOMSG: number; + export var ENOPROTOOPT: number; + export var ENOSPC: number; + export var ENOSR: number; + export var ENOSTR: number; + export var ENOSYS: number; + export var ENOTCONN: number; + export var ENOTDIR: number; + export var ENOTEMPTY: number; + export var ENOTSOCK: number; + export var ENOTSUP: number; + export var ENOTTY: number; + export var ENXIO: number; + export var EOPNOTSUPP: number; + export var EOVERFLOW: number; + export var EPERM: number; + export var EPIPE: number; + export var EPROTO: number; + export var EPROTONOSUPPORT: number; + export var EPROTOTYPE: number; + export var ERANGE: number; + export var EROFS: number; + export var ESPIPE: number; + export var ESRCH: number; + export var ETIME: number; + export var ETIMEDOUT: number; + export var ETXTBSY: number; + export var EWOULDBLOCK: number; + export var EXDEV: number; + export var WSAEINTR: number; + export var WSAEBADF: number; + export var WSAEACCES: number; + export var WSAEFAULT: number; + export var WSAEINVAL: number; + export var WSAEMFILE: number; + export var WSAEWOULDBLOCK: number; + export var WSAEINPROGRESS: number; + export var WSAEALREADY: number; + export var WSAENOTSOCK: number; + export var WSAEDESTADDRREQ: number; + export var WSAEMSGSIZE: number; + export var WSAEPROTOTYPE: number; + export var WSAENOPROTOOPT: number; + export var WSAEPROTONOSUPPORT: number; + export var WSAESOCKTNOSUPPORT: number; + export var WSAEOPNOTSUPP: number; + export var WSAEPFNOSUPPORT: number; + export var WSAEAFNOSUPPORT: number; + export var WSAEADDRINUSE: number; + export var WSAEADDRNOTAVAIL: number; + export var WSAENETDOWN: number; + export var WSAENETUNREACH: number; + export var WSAENETRESET: number; + export var WSAECONNABORTED: number; + export var WSAECONNRESET: number; + export var WSAENOBUFS: number; + export var WSAEISCONN: number; + export var WSAENOTCONN: number; + export var WSAESHUTDOWN: number; + export var WSAETOOMANYREFS: number; + export var WSAETIMEDOUT: number; + export var WSAECONNREFUSED: number; + export var WSAELOOP: number; + export var WSAENAMETOOLONG: number; + export var WSAEHOSTDOWN: number; + export var WSAEHOSTUNREACH: number; + export var WSAENOTEMPTY: number; + export var WSAEPROCLIM: number; + export var WSAEUSERS: number; + export var WSAEDQUOT: number; + export var WSAESTALE: number; + export var WSAEREMOTE: number; + export var WSASYSNOTREADY: number; + export var WSAVERNOTSUPPORTED: number; + export var WSANOTINITIALISED: number; + export var WSAEDISCON: number; + export var WSAENOMORE: number; + export var WSAECANCELLED: number; + export var WSAEINVALIDPROCTABLE: number; + export var WSAEINVALIDPROVIDER: number; + export var WSAEPROVIDERFAILEDINIT: number; + export var WSASYSCALLFAILURE: number; + export var WSASERVICE_NOT_FOUND: number; + export var WSATYPE_NOT_FOUND: number; + export var WSA_E_NO_MORE: number; + export var WSA_E_CANCELLED: number; + export var WSAEREFUSED: number; + export var SIGHUP: number; + export var SIGINT: number; + export var SIGILL: number; + export var SIGABRT: number; + export var SIGFPE: number; + export var SIGKILL: number; + export var SIGSEGV: number; + export var SIGTERM: number; + export var SIGBREAK: number; + export var SIGWINCH: number; + export var SSL_OP_ALL: number; + export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + export var SSL_OP_CIPHER_SERVER_PREFERENCE: number; + export var SSL_OP_CISCO_ANYCONNECT: number; + export var SSL_OP_COOKIE_EXCHANGE: number; + export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + export var SSL_OP_EPHEMERAL_RSA: number; + export var SSL_OP_LEGACY_SERVER_CONNECT: number; + export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + export var SSL_OP_MICROSOFT_SESS_ID_BUG: number; + export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + export var SSL_OP_NETSCAPE_CA_DN_BUG: number; + export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NO_COMPRESSION: number; + export var SSL_OP_NO_QUERY_MTU: number; + export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + export var SSL_OP_NO_SSLv2: number; + export var SSL_OP_NO_SSLv3: number; + export var SSL_OP_NO_TICKET: number; + export var SSL_OP_NO_TLSv1: number; + export var SSL_OP_NO_TLSv1_1: number; + export var SSL_OP_NO_TLSv1_2: number; + export var SSL_OP_PKCS1_CHECK_1: number; + export var SSL_OP_PKCS1_CHECK_2: number; + export var SSL_OP_SINGLE_DH_USE: number; + export var SSL_OP_SINGLE_ECDH_USE: number; + export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + export var SSL_OP_TLS_BLOCK_PADDING_BUG: number; + export var SSL_OP_TLS_D5_BUG: number; + export var SSL_OP_TLS_ROLLBACK_BUG: number; + export var ENGINE_METHOD_DSA: number; + export var ENGINE_METHOD_DH: number; + export var ENGINE_METHOD_RAND: number; + export var ENGINE_METHOD_ECDH: number; + export var ENGINE_METHOD_ECDSA: number; + export var ENGINE_METHOD_CIPHERS: number; + export var ENGINE_METHOD_DIGESTS: number; + export var ENGINE_METHOD_STORE: number; + export var ENGINE_METHOD_PKEY_METHS: number; + export var ENGINE_METHOD_PKEY_ASN1_METHS: number; + export var ENGINE_METHOD_ALL: number; + export var ENGINE_METHOD_NONE: number; + export var DH_CHECK_P_NOT_SAFE_PRIME: number; + export var DH_CHECK_P_NOT_PRIME: number; + export var DH_UNABLE_TO_CHECK_GENERATOR: number; + export var DH_NOT_SUITABLE_GENERATOR: number; + export var NPN_ENABLED: number; + export var RSA_PKCS1_PADDING: number; + export var RSA_SSLV23_PADDING: number; + export var RSA_NO_PADDING: number; + export var RSA_PKCS1_OAEP_PADDING: number; + export var RSA_X931_PADDING: number; + export var RSA_PKCS1_PSS_PADDING: number; + export var POINT_CONVERSION_COMPRESSED: number; + export var POINT_CONVERSION_UNCOMPRESSED: number; + export var POINT_CONVERSION_HYBRID: number; + export var O_RDONLY: number; + export var O_WRONLY: number; + export var O_RDWR: number; + export var S_IFMT: number; + export var S_IFREG: number; + export var S_IFDIR: number; + export var S_IFCHR: number; + export var S_IFBLK: number; + export var S_IFIFO: number; + export var S_IFSOCK: number; + export var S_IRWXU: number; + export var S_IRUSR: number; + export var S_IWUSR: number; + export var S_IXUSR: number; + export var S_IRWXG: number; + export var S_IRGRP: number; + export var S_IWGRP: number; + export var S_IXGRP: number; + export var S_IRWXO: number; + export var S_IROTH: number; + export var S_IWOTH: number; + export var S_IXOTH: number; + export var S_IFLNK: number; + export var O_CREAT: number; + export var O_EXCL: number; + export var O_NOCTTY: number; + export var O_DIRECTORY: number; + export var O_NOATIME: number; + export var O_NOFOLLOW: number; + export var O_SYNC: number; + export var O_SYMLINK: number; + export var O_DIRECT: number; + export var O_NONBLOCK: number; + export var O_TRUNC: number; + export var O_APPEND: number; + export var F_OK: number; + export var R_OK: number; + export var W_OK: number; + export var X_OK: number; + export var UV_UDP_REUSEADDR: number; + export var SIGQUIT: number; + export var SIGTRAP: number; + export var SIGIOT: number; + export var SIGBUS: number; + export var SIGUSR1: number; + export var SIGUSR2: number; + export var SIGPIPE: number; + export var SIGALRM: number; + export var SIGCHLD: number; + export var SIGSTKFLT: number; + export var SIGCONT: number; + export var SIGSTOP: number; + export var SIGTSTP: number; + export var SIGTTIN: number; + export var SIGTTOU: number; + export var SIGURG: number; + export var SIGXCPU: number; + export var SIGXFSZ: number; + export var SIGVTALRM: number; + export var SIGPROF: number; + export var SIGIO: number; + export var SIGPOLL: number; + export var SIGPWR: number; + export var SIGSYS: number; + export var SIGUNUSED: number; + export var defaultCoreCipherList: string; + export var defaultCipherList: string; + export var ENGINE_METHOD_RSA: number; + export var ALPN_ENABLED: number; +} + +declare module "process" { + export = process; +} + +declare module "v8" { + interface HeapSpaceInfo { + space_name: string; + space_size: number; + space_used_size: number; + space_available_size: number; + physical_space_size: number; + } + + //** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ + type DoesZapCodeSpaceFlag = 0 | 1; + + interface HeapInfo { + total_heap_size: number; + total_heap_size_executable: number; + total_physical_size: number; + total_available_size: number; + used_heap_size: number; + heap_size_limit: number; + malloced_memory: number; + peak_malloced_memory: number; + does_zap_garbage: DoesZapCodeSpaceFlag; + } + + export function getHeapStatistics(): HeapInfo; + export function getHeapSpaceStatistics(): HeapSpaceInfo[]; + export function setFlagsFromString(flags: string): void; +} + +declare module "timers" { + export function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; + export function clearTimeout(timeoutId: NodeJS.Timer): void; + export function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; + export function clearInterval(intervalId: NodeJS.Timer): void; + export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; + export function clearImmediate(immediateId: any): void; +} + +declare module "console" { + export = console; +} + +/** + * _debugger module is not documented. + * Source code is at https://github.com/nodejs/node/blob/master/lib/_debugger.js + */ +declare module "_debugger" { + export interface Packet { + raw: string; + headers: string[]; + body: Message; + } + + export interface Message { + seq: number; + type: string; + } + + export interface RequestInfo { + command: string; + arguments: any; + } + + export interface Request extends Message, RequestInfo { + } + + export interface Event extends Message { + event: string; + body?: any; + } + + export interface Response extends Message { + request_seq: number; + success: boolean; + /** Contains error message if success === false. */ + message?: string; + /** Contains message body if success === true. */ + body?: any; + } + + export interface BreakpointMessageBody { + type: string; + target: number; + line: number; + } + + export class Protocol { + res: Packet; + state: string; + execute(data: string): void; + serialize(rq: Request): string; + onResponse: (pkt: Packet) => void; + } + + export var NO_FRAME: number; + export var port: number; + + export interface ScriptDesc { + name: string; + id: number; + isNative?: boolean; + handle?: number; + type: string; + lineOffset?: number; + columnOffset?: number; + lineCount?: number; + } + + export interface Breakpoint { + id: number; + scriptId: number; + script: ScriptDesc; + line: number; + condition?: string; + scriptReq?: string; + } + + export interface RequestHandler { + (err: boolean, body: Message, res: Packet): void; + request_seq?: number; + } + + export interface ResponseBodyHandler { + (err: boolean, body?: any): void; + request_seq?: number; + } + + export interface ExceptionInfo { + text: string; + } + + export interface BreakResponse { + script?: ScriptDesc; + exception?: ExceptionInfo; + sourceLine: number; + sourceLineText: string; + sourceColumn: number; + } + + export function SourceInfo(body: BreakResponse): string; + + export interface ClientInstance extends NodeJS.EventEmitter { + protocol: Protocol; + scripts: ScriptDesc[]; + handles: ScriptDesc[]; + breakpoints: Breakpoint[]; + currentSourceLine: number; + currentSourceColumn: number; + currentSourceLineText: string; + currentFrame: number; + currentScript: string; + + connect(port: number, host: string): void; + req(req: any, cb: RequestHandler): void; + reqFrameEval(code: string, frame: number, cb: RequestHandler): void; + mirrorObject(obj: any, depth: number, cb: ResponseBodyHandler): void; + setBreakpoint(rq: BreakpointMessageBody, cb: RequestHandler): void; + clearBreakpoint(rq: Request, cb: RequestHandler): void; + listbreakpoints(cb: RequestHandler): void; + reqSource(from: number, to: number, cb: RequestHandler): void; + reqScripts(cb: any): void; + reqContinue(cb: RequestHandler): void; + } + + export var Client : { + new (): ClientInstance + } +} diff --git a/types/node/v7/node-tests.ts b/types/node/v7/node-tests.ts new file mode 100644 index 0000000000..de401eb0fc --- /dev/null +++ b/types/node/v7/node-tests.ts @@ -0,0 +1,2467 @@ +import * as assert from "assert"; +import * as fs from "fs"; +import * as events from "events"; +import events2 = require("events"); +import * as zlib from "zlib"; +import * as url from "url"; +import * as util from "util"; +import * as crypto from "crypto"; +import * as tls from "tls"; +import * as http from "http"; +import * as https from "https"; +import * as net from "net"; +import * as tty from "tty"; +import * as dgram from "dgram"; +import * as querystring from "querystring"; +import * as path from "path"; +import * as readline from "readline"; +import * as childProcess from "child_process"; +import * as cluster from "cluster"; +import * as os from "os"; +import * as vm from "vm"; +import * as console2 from "console"; +import * as string_decoder from "string_decoder"; +import * as stream from "stream"; +import * as timers from "timers"; +import * as repl from "repl"; +import * as v8 from "v8"; +import * as dns from "dns"; + +// Specifically test buffer module regression. +import {Buffer as ImportedBuffer, SlowBuffer as ImportedSlowBuffer} from "buffer"; + +////////////////////////////////////////////////////////// +/// Global Tests : https://nodejs.org/api/global.html /// +////////////////////////////////////////////////////////// +namespace global_tests { + { + let x: NodeModule; + let y: NodeModule; + x.children.push(y); + x.parent = require.main; + require.main = y; + } +} + +////////////////////////////////////////////////////////// +/// Assert Tests : https://nodejs.org/api/assert.html /// +////////////////////////////////////////////////////////// + +namespace assert_tests { + { + assert(1 + 1 - 2 === 0, "The universe isn't how it should."); + + assert.deepEqual({ x: { y: 3 } }, { x: { y: 3 } }, "DEEP WENT DERP"); + + assert.deepStrictEqual({ a: 1 }, { a: 1 }, "uses === comparator"); + + assert.doesNotThrow(() => { + const b = false; + if (b) { throw "a hammer at your face"; } + }, undefined, "What the...*crunch*"); + + assert.equal(3, "3", "uses == comparator"); + + assert.fail(1, 2, undefined, '>'); + + assert.ifError(0); + + assert.notDeepStrictEqual({ x: { y: "3" } }, { x: { y: 3 } }, "uses !== comparator"); + + assert.notEqual(1, 2, "uses != comparator"); + + assert.notStrictEqual(2, "2", "uses === comparator"); + + assert.ok(true); + assert.ok(1); + + assert.strictEqual(1, 1, "uses === comparator"); + + assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); + } +} + +//////////////////////////////////////////////////// +/// Events tests : http://nodejs.org/api/events.html +//////////////////////////////////////////////////// + +namespace events_tests { + let emitter: events.EventEmitter; + let event: string | symbol; + let listener: Function; + let any: any; + + { + let result: events.EventEmitter; + + result = emitter.addListener(event, listener); + result = emitter.on(event, listener); + result = emitter.once(event, listener); + result = emitter.prependListener(event, listener); + result = emitter.prependOnceListener(event, listener); + result = emitter.removeListener(event, listener); + result = emitter.removeAllListeners(); + result = emitter.removeAllListeners(event); + result = emitter.setMaxListeners(42); + } + + { + let result: number; + + result = events.EventEmitter.defaultMaxListeners; + result = events.EventEmitter.listenerCount(emitter, event); // deprecated + + result = emitter.getMaxListeners(); + result = emitter.listenerCount(event); + } + + { + let result: Function[]; + + result = emitter.listeners(event); + } + + { + let result: boolean; + + result = emitter.emit(event); + result = emitter.emit(event, any); + result = emitter.emit(event, any, any); + result = emitter.emit(event, any, any, any); + } + + { + let result: (string | symbol)[]; + + result = emitter.eventNames(); + } + + { + class Networker extends events.EventEmitter { + constructor() { + super(); + + this.emit("mingling"); + } + } + } + + { + new events2(); + } +} + +//////////////////////////////////////////////////// +/// File system tests : http://nodejs.org/api/fs.html +//////////////////////////////////////////////////// + +namespace fs_tests { + { + fs.writeFile("thebible.txt", + "Do unto others as you would have them do unto you.", + assert.ifError); + + fs.write(1234, "test"); + + fs.writeFile("Harry Potter", + "\"You be wizzing, Harry,\" jived Dumbledore.", + { + encoding: "ascii" + }, + assert.ifError); + } + + { + var content: string; + var buffer: Buffer; + + content = fs.readFileSync('testfile', 'utf8'); + content = fs.readFileSync('testfile', { encoding: 'utf8' }); + buffer = fs.readFileSync('testfile'); + buffer = fs.readFileSync('testfile', { flag: 'r' }); + fs.readFile('testfile', 'utf8', (err, data) => content = data); + fs.readFile('testfile', { encoding: 'utf8' }, (err, data) => content = data); + fs.readFile('testfile', (err, data) => buffer = data); + fs.readFile('testfile', { flag: 'r' }, (err, data) => buffer = data); + } + + { + var errno: number; + fs.readFile('testfile', (err, data) => { + if (err && err.errno) { + errno = err.errno; + } + }); + } + + { + fs.mkdtemp('/tmp/foo-', (err, folder) => { + console.log(folder); + // Prints: /tmp/foo-itXde2 + }); + } + + { + var tempDir: string; + tempDir = fs.mkdtempSync('/tmp/foo-'); + } + + { + fs.watch('/tmp/foo-', (event, filename) => { + console.log(event, filename); + }); + + fs.watch('/tmp/foo-', 'utf8', (event, filename) => { + console.log(event, filename); + }); + + fs.watch('/tmp/foo-', { + recursive: true, + persistent: true, + encoding: 'utf8' + }, (event, filename) => { + console.log(event, filename); + }); + } + + { + fs.access('/path/to/folder', (err) => { }); + + fs.access(Buffer.from(''), (err) => { }); + + fs.access('/path/to/folder', fs.constants.F_OK | fs.constants.R_OK, (err) => { }); + + fs.access(Buffer.from(''), fs.constants.F_OK | fs.constants.R_OK, (err) => { }); + + fs.accessSync('/path/to/folder'); + + fs.accessSync(Buffer.from('')); + + fs.accessSync('path/to/folder', fs.constants.W_OK | fs.constants.X_OK); + + fs.accessSync(Buffer.from(''), fs.constants.W_OK | fs.constants.X_OK); + } +} + +/////////////////////////////////////////////////////// +/// Buffer tests : https://nodejs.org/api/buffer.html +/////////////////////////////////////////////////////// + +function bufferTests() { + var utf8Buffer = new Buffer('test'); + var base64Buffer = new Buffer('', 'base64'); + var octets: Uint8Array = null; + var octetBuffer = new Buffer(octets); + var sharedBuffer = new Buffer(octets.buffer); + var copiedBuffer = new Buffer(utf8Buffer); + console.log(Buffer.isBuffer(octetBuffer)); + console.log(Buffer.isEncoding('utf8')); + console.log(Buffer.byteLength('xyz123')); + console.log(Buffer.byteLength('xyz123', 'ascii')); + var result1 = Buffer.concat([utf8Buffer, base64Buffer]); + var result2 = Buffer.concat([utf8Buffer, base64Buffer], 9999999); + + // Class Methods: Buffer.swap16(), Buffer.swa32(), Buffer.swap64() + { + const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + buf.swap16(); + buf.swap32(); + buf.swap64(); + } + + // Class Method: Buffer.from(array) + { + const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + } + + // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + { + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + + let buf: Buffer; + buf = Buffer.from(arr.buffer); + buf = Buffer.from(arr.buffer, 1); + buf = Buffer.from(arr.buffer, 0, 1); + } + + // Class Method: Buffer.from(buffer) + { + const buf1: Buffer = Buffer.from('buffer'); + const buf2: Buffer = Buffer.from(buf1); + } + + // Class Method: Buffer.from(str[, encoding]) + { + const buf1: Buffer = Buffer.from('this is a tést'); + const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); + } + + // Test that TS 1.6 works with the 'as Buffer' annotation + // on isBuffer. + var a: Buffer | number; + a = new Buffer(10); + if (Buffer.isBuffer(a)) { + a.writeUInt8(3, 4); + } + + // write* methods return offsets. + var b = new Buffer(16); + var result: number = b.writeUInt32LE(0, 0); + result = b.writeUInt16LE(0, 4); + result = b.writeUInt8(0, 6); + result = b.writeInt8(0, 7); + result = b.writeDoubleLE(0, 8); + + // fill returns the input buffer. + b.fill('a').fill('b'); + + { + let buffer = new Buffer('123'); + let index: number; + index = buffer.indexOf("23"); + index = buffer.indexOf("23", 1); + index = buffer.indexOf("23", 1, "utf8"); + index = buffer.indexOf(23); + index = buffer.indexOf(buffer); + } + + { + let buffer = new Buffer('123'); + let index: number; + index = buffer.lastIndexOf("23"); + index = buffer.lastIndexOf("23", 1); + index = buffer.lastIndexOf("23", 1, "utf8"); + index = buffer.lastIndexOf(23); + index = buffer.lastIndexOf(buffer); + } + + { + let buffer = new Buffer('123'); + let val: [number, number]; + + /* comment out for --target es5 + for (let entry of buffer.entries()) { + val = entry; + } + */ + } + + { + let buffer = new Buffer('123'); + let includes: boolean; + includes = buffer.includes("23"); + includes = buffer.includes("23", 1); + includes = buffer.includes("23", 1, "utf8"); + includes = buffer.includes(23); + includes = buffer.includes(23, 1); + includes = buffer.includes(23, 1, "utf8"); + includes = buffer.includes(buffer); + includes = buffer.includes(buffer, 1); + includes = buffer.includes(buffer, 1, "utf8"); + } + + { + let buffer = new Buffer('123'); + let val: number; + + /* comment out for --target es5 + for (let key of buffer.keys()) { + val = key; + } + */ + } + + { + let buffer = new Buffer('123'); + let val: number; + + /* comment out for --target es5 + for (let value of buffer.values()) { + val = value; + } + */ + } + + // Imported Buffer from buffer module works properly + { + let b = new ImportedBuffer('123'); + b.writeUInt8(0, 6); + let sb = new ImportedSlowBuffer(43); + b.writeUInt8(0, 6); + } + + // Buffer has Uint8Array's buffer field (an ArrayBuffer). + { + let buffer = new Buffer('123'); + let octets = new Uint8Array(buffer.buffer); + } +} + + +//////////////////////////////////////////////////// +/// Url tests : http://nodejs.org/api/url.html +//////////////////////////////////////////////////// + +namespace url_tests { + { + url.format(url.parse('http://www.example.com/xyz')); + + // https://google.com/search?q=you're%20a%20lizard%2C%20gary + url.format({ + protocol: 'https', + host: "google.com", + pathname: 'search', + query: { q: "you're a lizard, gary" } + }); + + const myURL = new url.URL('https://a:b@你好你好?abc#foo'); + url.format(myURL, { fragment: false, unicode: true, auth: false }); + } + + { + var helloUrl = url.parse('http://example.com/?hello=world', true) + assert.equal(helloUrl.query.hello, 'world'); + } + + { + let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert.equal(myURL.hash, '#bar'); + assert.equal(myURL.host, 'example.org:81'); + assert.equal(myURL.hostname, 'example.org'); + assert.equal(myURL.href, 'https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert.equal(myURL.origin, 'https://example.org:81'); + assert.equal(myURL.password, 'thepwd'); + assert.equal(myURL.username, 'theuser'); + assert.equal(myURL.pathname, '/foo/path'); + assert.equal(myURL.port, "81"); + assert.equal(myURL.protocol, "https:"); + assert.equal(myURL.search, "?query=string"); + assert.equal(myURL.toString(), 'https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert(myURL.searchParams instanceof url.URLSearchParams); + + myURL.host = 'example.org:82'; + myURL.hostname = 'example.com'; + myURL.href = 'http://other.com'; + myURL.hash = 'baz'; + myURL.password = "otherpwd"; + myURL.username = "otheruser"; + myURL.pathname = "/otherPath"; + myURL.port = "82"; + myURL.protocol = "http"; + myURL.search = "a=b"; + assert.equal(myURL.href, 'http://otheruser:otherpwd@other.com:82/otherPath?a=b#baz'); + + myURL = new url.URL('/foo', 'https://example.org/'); + assert.equal(myURL.href, 'https://example.org/foo'); + assert.equal(myURL.toJSON(), myURL.href); + } + + { + const searchParams = new url.URLSearchParams('abc=123'); + + assert.equal(searchParams.toString(), 'abc=123'); + searchParams.forEach((value: string, name: string): void => { + assert.equal(name, 'abc'); + assert.equal(value, '123'); + }); + + assert.equal(searchParams.get('abc'), '123'); + + searchParams.append('abc', 'xyz'); + + assert.deepEqual(searchParams.getAll('abc'), ['123', 'xyz']); + + const entries = searchParams.entries(); + assert.deepEqual(entries.next(), { value: ["abc", "123"], done: false}); + assert.deepEqual(entries.next(), { value: ["abc", "xyz"], done: false}); + assert.deepEqual(entries.next(), { value: undefined, done: true}); + + const keys = searchParams.keys(); + assert.deepEqual(keys.next(), { value: "abc", done: false}); + assert.deepEqual(keys.next(), { value: "abc", done: false}); + assert.deepEqual(keys.next(), { value: undefined, done: true}); + + const values = searchParams.values(); + assert.deepEqual(values.next(), { value: "123", done: false}); + assert.deepEqual(values.next(), { value: "xyz", done: false}); + assert.deepEqual(values.next(), { value: undefined, done: true}); + + searchParams.set('abc', 'b'); + assert.deepEqual(searchParams.getAll('abc'), ['b']); + + searchParams.delete('a'); + assert(!searchParams.has('a')); + assert.equal(searchParams.get('a'), null); + + searchParams.sort(); + } + + { + const searchParams = new url.URLSearchParams({ + user: 'abc', + query: ['first', 'second'] + }); + + assert.equal(searchParams.toString(), 'user=abc&query=first%2Csecond'); + assert.deepEqual(searchParams.getAll('query'), ['first,second']); + } + + { + // Using an array + let params = new url.URLSearchParams([ + ['user', 'abc'], + ['query', 'first'], + ['query', 'second'] + ]); + assert.equal(params.toString(), 'user=abc&query=first&query=second'); + } +} + +///////////////////////////////////////////////////// +/// util tests : https://nodejs.org/api/util.html /// +///////////////////////////////////////////////////// + +namespace util_tests { + { + // Old and new util.inspect APIs + util.inspect(["This is nice"], false, 5); + util.inspect(["This is nice"], false, null); + util.inspect(["This is nice"], { + colors: true, + depth: 5, + customInspect: false, + showProxy: true, + maxArrayLength: 10, + breakLength: 20 + }); + util.inspect(["This is nice"], { + colors: true, + depth: null, + customInspect: false, + showProxy: true, + maxArrayLength: null, + breakLength: Infinity + }) + } +} + +//////////////////////////////////////////////////// +/// Stream tests : http://nodejs.org/api/stream.html +//////////////////////////////////////////////////// + +// http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options +function stream_readable_pipe_test() { + var rs = fs.createReadStream(Buffer.from('file.txt')); + var r = fs.createReadStream('file.txt'); + var z = zlib.createGzip({ finishFlush: zlib.constants.Z_FINISH }); + var w = fs.createWriteStream('file.txt.gz'); + + assert(typeof r.bytesRead === 'number'); + assert(typeof r.path === 'string'); + assert(rs.path instanceof Buffer); + + r.pipe(z).pipe(w); + + r.close(); + rs.close(); +} + +// helpers +const compressMe = new Buffer("some data"); +const compressMeString = "compress me!"; + +zlib.deflate(compressMe, (err: Error, result: Buffer) => zlib.inflate(result, (err: Error, result: Buffer) => result)); +zlib.deflate(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflate(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +zlib.deflate(compressMeString, (err: Error, result: Buffer) => zlib.inflate(result, (err: Error, result: Buffer) => result)); +zlib.deflate(compressMeString, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflate(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +const inflated = zlib.inflateSync(zlib.deflateSync(compressMe)); +const inflatedString = zlib.inflateSync(zlib.deflateSync(compressMeString)); + +zlib.deflateRaw(compressMe, (err: Error, result: Buffer) => zlib.inflateRaw(result, (err: Error, result: Buffer) => result)); +zlib.deflateRaw(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflateRaw(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +zlib.deflateRaw(compressMeString, (err: Error, result: Buffer) => zlib.inflateRaw(result, (err: Error, result: Buffer) => result)); +zlib.deflateRaw(compressMeString, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflateRaw(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +const inflatedRaw: Buffer = zlib.inflateRawSync(zlib.deflateRawSync(compressMe)); +const inflatedRawString: Buffer = zlib.inflateRawSync(zlib.deflateRawSync(compressMeString)); + +zlib.gzip(compressMe, (err: Error, result: Buffer) => zlib.gunzip(result, (err: Error, result: Buffer) => result)); +zlib.gzip(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.gunzip(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +const gunzipped: Buffer = zlib.gunzipSync(zlib.gzipSync(compressMe)); + +zlib.unzip(compressMe, (err: Error, result: Buffer) => result); +zlib.unzip(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result); +const unzipped: Buffer = zlib.unzipSync(compressMe); + +// Simplified constructors +function simplified_stream_ctor_test() { + new stream.Readable({ + read: function(size) { + size.toFixed(); + } + }); + + new stream.Writable({ + write: function(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb() + }, + writev: function(chunks, cb) { + chunks[0].chunk.slice(0); + chunks[0].encoding.charAt(0); + cb(); + } + }); + + new stream.Duplex({ + read: function(size) { + size.toFixed(); + }, + write: function(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb() + }, + writev: function(chunks, cb) { + chunks[0].chunk.slice(0); + chunks[0].encoding.charAt(0); + cb(); + }, + readableObjectMode: true, + writableObjectMode: true + }); + + new stream.Transform({ + transform: function(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb(); + }, + flush: function(cb) { + cb() + }, + read: function(size) { + size.toFixed(); + }, + write: function(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb() + }, + writev: function(chunks, cb) { + chunks[0].chunk.slice(0); + chunks[0].encoding.charAt(0); + cb(); + }, + allowHalfOpen: true, + readableObjectMode: true, + writableObjectMode: true + }) +} + +//////////////////////////////////////////////////////// +/// Crypto tests : http://nodejs.org/api/crypto.html /// +//////////////////////////////////////////////////////// + +namespace crypto_tests { + { + var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').digest('hex'); + } + + { + let hmac: crypto.Hmac; + (hmac = crypto.createHmac('md5', 'hello')).end('world', 'utf8', () => { + let hash: Buffer | string = hmac.read(); + }); + } + + { + //crypto_cipher_decipher_string_test + let key: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); + let clearText: string = "This is the clear text."; + let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key); + let cipherText: string = cipher.update(clearText, "utf8", "hex"); + cipherText += cipher.final("hex"); + + let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key); + let clearText2: string = decipher.update(cipherText, "hex", "utf8"); + clearText2 += decipher.final("utf8"); + + assert.equal(clearText2, clearText); + } + + { + //crypto_cipher_decipher_buffer_test + let key: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); + let clearText: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]); + let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key); + let cipherBuffers: Buffer[] = []; + cipherBuffers.push(cipher.update(clearText)); + cipherBuffers.push(cipher.final()); + + let cipherText: Buffer = Buffer.concat(cipherBuffers); + + let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key); + let decipherBuffers: Buffer[] = []; + decipherBuffers.push(decipher.update(cipherText)); + decipherBuffers.push(decipher.final()); + + let clearText2: Buffer = Buffer.concat(decipherBuffers); + + assert.deepEqual(clearText2, clearText); + } + + { + let buffer1: Buffer = new Buffer([1, 2, 3, 4, 5]); + let buffer2: Buffer = new Buffer([1, 2, 3, 4, 5]); + let buffer3: Buffer = new Buffer([5, 4, 3, 2, 1]); + + assert(crypto.timingSafeEqual(buffer1, buffer2)) + assert(!crypto.timingSafeEqual(buffer1, buffer3)) + } + + { + let buffer: Buffer = new Buffer(10); + crypto.randomFillSync(buffer); + crypto.randomFillSync(buffer, 2); + crypto.randomFillSync(buffer, 2, 3); + + crypto.randomFill(buffer, (err: Error, buf: Buffer) => void {}); + crypto.randomFill(buffer, 2, (err: Error, buf: Buffer) => void {}); + crypto.randomFill(buffer, 2, 3, (err: Error, buf: Buffer) => void {}); + + let arr: Uint8Array = new Uint8Array(10); + crypto.randomFillSync(arr); + crypto.randomFillSync(arr, 2); + crypto.randomFillSync(arr, 2, 3); + + crypto.randomFill(arr, (err: Error, buf: Uint8Array) => void {}); + crypto.randomFill(arr, 2, (err: Error, buf: Uint8Array) => void {}); + crypto.randomFill(arr, 2, 3, (err: Error, buf: Uint8Array) => void {}); + } +} + +////////////////////////////////////////////////// +/// TLS tests : http://nodejs.org/api/tls.html /// +////////////////////////////////////////////////// + +namespace tls_tests { + { + var ctx: tls.SecureContext = tls.createSecureContext({ + key: "NOT REALLY A KEY", + cert: "SOME CERTIFICATE", + }); + var blah = ctx.context; + + var connOpts: tls.ConnectionOptions = { + host: "127.0.0.1", + port: 55 + }; + var tlsSocket = tls.connect(connOpts); + } + + { + let _server: tls.Server; + let _boolean: boolean; + let _func1 = function(err: Error, resp: Buffer){}; + let _func2 = function(err: Error, sessionData: any){}; + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + **/ + + _server = _server.addListener("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }) + _server = _server.addListener("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }) + _server = _server.addListener("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }) + _server = _server.addListener("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }) + _server = _server.addListener("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }) + + let _err: Error; + let _tlsSocket: tls.TLSSocket; + let _any: any; + let _func: Function; + let _buffer: Buffer; + _boolean = _server.emit("tlsClientError", _err, _tlsSocket); + _boolean = _server.emit("newSession", _any, _any, _func1); + _boolean = _server.emit("OCSPRequest", _buffer, _buffer, _func); + _boolean = _server.emit("resumeSession", _any, _func2); + _boolean = _server.emit("secureConnection", _tlsSocket); + + _server = _server.on("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }) + _server = _server.on("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }) + _server = _server.on("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }) + _server = _server.on("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }) + _server = _server.on("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }) + + _server = _server.once("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }) + _server = _server.once("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }) + _server = _server.once("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }) + _server = _server.once("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }) + _server = _server.once("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }) + + _server = _server.prependListener("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }) + _server = _server.prependListener("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }) + _server = _server.prependListener("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }) + _server = _server.prependListener("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }) + _server = _server.prependListener("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }) + + _server = _server.prependOnceListener("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }) + _server = _server.prependOnceListener("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }) + _server = _server.prependOnceListener("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }) + _server = _server.prependOnceListener("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }) + _server = _server.prependOnceListener("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }) + + // close callback parameter is optional + _server = _server.close(); + + // close callback parameter doesn't specify any arguments, so any + // function is acceptable + _server = _server.close(() => {}); + _server = _server.close((...args:any[]) => {}); + } + + { + let _TLSSocket: tls.TLSSocket; + let _boolean: boolean; + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + **/ + + _TLSSocket = _TLSSocket.addListener("OCSPResponse", (response) => { + let _response: Buffer = response; + }) + _TLSSocket = _TLSSocket.addListener("secureConnect", () => { }); + + let _buffer: Buffer; + _boolean = _TLSSocket.emit("OCSPResponse", _buffer); + _boolean = _TLSSocket.emit("secureConnect"); + + _TLSSocket = _TLSSocket.on("OCSPResponse", (response) => { + let _response: Buffer = response; + }) + _TLSSocket = _TLSSocket.on("secureConnect", () => { }); + + _TLSSocket = _TLSSocket.once("OCSPResponse", (response) => { + let _response: Buffer = response; + }) + _TLSSocket = _TLSSocket.once("secureConnect", () => { }); + + _TLSSocket = _TLSSocket.prependListener("OCSPResponse", (response) => { + let _response: Buffer = response; + }) + _TLSSocket = _TLSSocket.prependListener("secureConnect", () => { }); + + _TLSSocket = _TLSSocket.prependOnceListener("OCSPResponse", (response) => { + let _response: Buffer = response; + }) + _TLSSocket = _TLSSocket.prependOnceListener("secureConnect", () => { }); + } +} + +//////////////////////////////////////////////////// +/// Http tests : http://nodejs.org/api/http.html /// +//////////////////////////////////////////////////// + +namespace http_tests { + { + // Status codes + var codeMessage = http.STATUS_CODES['400']; + var codeMessage = http.STATUS_CODES[400]; + } + + { + var agent: http.Agent = new http.Agent({ + keepAlive: true, + keepAliveMsecs: 10000, + maxSockets: Infinity, + maxFreeSockets: 256 + }); + + var agent: http.Agent = http.globalAgent; + + http.request({ agent: false }); + http.request({ agent: agent }); + http.request({ agent: undefined }); + } + + { + // Make sure .listen() and .close() retuern a Server instance + http.createServer().listen(0).close().address(); + net.createServer().listen(0).close().address(); + } + + { + var request = http.request('http://0.0.0.0'); + request.once('error', function() { }); + request.setNoDelay(true); + request.abort(); + } + + const options: http.RequestOptions = { + timeout: 30000 + }; +} + +////////////////////////////////////////////////////// +/// Https tests : http://nodejs.org/api/https.html /// +////////////////////////////////////////////////////// + +namespace https_tests { + var agent: https.Agent = new https.Agent({ + keepAlive: true, + keepAliveMsecs: 10000, + maxSockets: Infinity, + maxFreeSockets: 256, + maxCachedSessions: 100 + }); + + var agent: https.Agent = https.globalAgent; + + https.request({ + agent: false + }); + https.request({ + agent: agent + }); + https.request({ + agent: undefined + }); +} + +//////////////////////////////////////////////////// +/// TTY tests : http://nodejs.org/api/tty.html +//////////////////////////////////////////////////// + +namespace tty_tests { + let rs: tty.ReadStream; + let ws: tty.WriteStream; + + let rsIsRaw: boolean = rs.isRaw; + rs.setRawMode(true); + + let wsColumns: number = ws.columns; + let wsRows: number = ws.rows; + + let isTTY: boolean = tty.isatty(1); +} + +//////////////////////////////////////////////////// +/// Dgram tests : http://nodejs.org/api/dgram.html +//////////////////////////////////////////////////// + +namespace dgram_tests { + { + var ds: dgram.Socket = dgram.createSocket("udp4", (msg: Buffer, rinfo: dgram.RemoteInfo): void => { + }); + ds.bind(); + ds.bind(41234); + var ai: dgram.AddressInfo = ds.address(); + ds.send(new Buffer("hello"), 0, 5, 5000, "127.0.0.1", (error: Error, bytes: number): void => { + }); + ds.send(new Buffer("hello"), 5000, "127.0.0.1"); + } + + { + let _socket: dgram.Socket; + let _boolean: boolean; + let _err: Error; + let _str: string; + let _rinfo: dgram.AddressInfo; + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + **/ + + _socket = _socket.addListener("close", () => {}); + _socket = _socket.addListener("error", (err) => { + let _err: Error = err; + }) + _socket = _socket.addListener("listening", () => {}); + _socket = _socket.addListener("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }) + + _boolean = _socket.emit("close") + _boolean = _socket.emit("error", _err); + _boolean = _socket.emit("listening"); + _boolean = _socket.emit("message", _str, _rinfo); + + _socket = _socket.on("close", () => {}); + _socket = _socket.on("error", (err) => { + let _err: Error = err; + }) + _socket = _socket.on("listening", () => {}); + _socket = _socket.on("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }) + + _socket = _socket.once("close", () => {}); + _socket = _socket.once("error", (err) => { + let _err: Error = err; + }) + _socket = _socket.once("listening", () => {}); + _socket = _socket.once("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }) + + _socket = _socket.prependListener("close", () => {}); + _socket = _socket.prependListener("error", (err) => { + let _err: Error = err; + }) + _socket = _socket.prependListener("listening", () => {}); + _socket = _socket.prependListener("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }) + + _socket = _socket.prependOnceListener("close", () => {}); + _socket = _socket.prependOnceListener("error", (err) => { + let _err: Error = err; + }) + _socket = _socket.prependOnceListener("listening", () => {}); + _socket = _socket.prependOnceListener("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }) + } +} + +//////////////////////////////////////////////////// +///Querystring tests : https://nodejs.org/api/querystring.html +//////////////////////////////////////////////////// + +namespace querystring_tests { + type SampleObject = { a: string; b: number; } + + { + let obj: SampleObject; + let sep: string; + let eq: string; + let options: querystring.StringifyOptions; + let result: string; + + result = querystring.stringify(obj); + result = querystring.stringify(obj, sep); + result = querystring.stringify(obj, sep, eq); + result = querystring.stringify(obj, sep, eq); + result = querystring.stringify(obj, sep, eq, options); + } + + { + let str: string; + let sep: string; + let eq: string; + let options: querystring.ParseOptions; + let result: SampleObject; + + result = querystring.parse(str); + result = querystring.parse(str, sep); + result = querystring.parse(str, sep, eq); + result = querystring.parse(str, sep, eq, options); + } + + { + let str: string; + let result: string; + + result = querystring.escape(str); + result = querystring.unescape(str); + } +} + +//////////////////////////////////////////////////// +/// path tests : http://nodejs.org/api/path.html +//////////////////////////////////////////////////// + +namespace path_tests { + + path.normalize('/foo/bar//baz/asdf/quux/..'); + + path.join('/foo', 'bar', 'baz/asdf', 'quux', '..'); + // returns + //'/foo/bar/baz/asdf' + + try { + path.join('foo', 'bar'); + } + catch (error) { + + } + + path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile'); + //Is similar to: + // + //cd foo/bar + //cd /tmp/file/ + //cd .. + // cd a/../subfile + //pwd + + path.resolve('/foo/bar', './baz') + // returns + // '/foo/bar/baz' + + path.resolve('/foo/bar', '/tmp/file/') + // returns + // '/tmp/file' + + path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif') + // if currently in /home/myself/node, it returns + // '/home/myself/node/wwwroot/static_files/gif/image.gif' + + path.isAbsolute('/foo/bar') // true + path.isAbsolute('/baz/..') // true + path.isAbsolute('qux/') // false + path.isAbsolute('.') // false + + path.isAbsolute('//server') // true + path.isAbsolute('C:/foo/..') // true + path.isAbsolute('bar\\baz') // false + path.isAbsolute('.') // false + + path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb') + // returns + // '..\\..\\impl\\bbb' + + path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb') + // returns + // '../../impl/bbb' + + path.dirname('/foo/bar/baz/asdf/quux') + // returns + // '/foo/bar/baz/asdf' + + path.basename('/foo/bar/baz/asdf/quux.html') + // returns + // 'quux.html' + + path.basename('/foo/bar/baz/asdf/quux.html', '.html') + // returns + // 'quux' + + path.extname('index.html') + // returns + // '.html' + + path.extname('index.coffee.md') + // returns + // '.md' + + path.extname('index.') + // returns + // '.' + + path.extname('index') + // returns + // '' + + 'foo/bar/baz'.split(path.sep) + // returns + // ['foo', 'bar', 'baz'] + + 'foo\\bar\\baz'.split(path.sep) + // returns + // ['foo', 'bar', 'baz'] + + console.log(process.env.PATH) + // '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin' + + process.env.PATH.split(path.delimiter) + // returns + // ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin'] + + console.log(process.env.PATH) + // 'C:\Windows\system32;C:\Windows;C:\Program Files\nodejs\' + + process.env.PATH.split(path.delimiter) + // returns + // ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\'] + + path.parse('/home/user/dir/file.txt') + // returns + // { + // root : "/", + // dir : "/home/user/dir", + // base : "file.txt", + // ext : ".txt", + // name : "file" + // } + + path.parse('C:\\path\\dir\\index.html') + // returns + // { + // root : "C:\", + // dir : "C:\path\dir", + // base : "index.html", + // ext : ".html", + // name : "index" + // } + + path.format({ + root: "/", + dir: "/home/user/dir", + base: "file.txt", + ext: ".txt", + name: "file" + }); + // returns + // '/home/user/dir/file.txt' +} + +//////////////////////////////////////////////////// +/// readline tests : https://nodejs.org/api/readline.html +//////////////////////////////////////////////////// + +namespace readline_tests { + let rl: readline.ReadLine; + + { + let options: readline.ReadLineOptions; + let input: NodeJS.ReadableStream; + let output: NodeJS.WritableStream; + let completer: readline.Completer; + let terminal: boolean; + + let result: readline.ReadLine; + + result = readline.createInterface(options); + result = readline.createInterface(input); + result = readline.createInterface(input, output); + result = readline.createInterface(input, output, completer); + result = readline.createInterface(input, output, completer, terminal); + result = readline.createInterface({ + input: input, + completer: function(str: string): readline.CompleterResult { + return [['test'], 'test']; + } + }); + result = readline.createInterface({ + input: input, + completer: function(str: string, callback: (err: any, result: readline.CompleterResult) => void): any { + callback(null, [['test'], 'test']); + } + }); + } + + { + let prompt: string; + + rl.setPrompt(prompt); + } + + { + let preserveCursor: boolean; + + rl.prompt(); + rl.prompt(preserveCursor); + } + + { + let query: string; + let callback: (answer: string) => void; + + rl.question(query, callback); + } + + { + let result: readline.ReadLine; + + result = rl.pause(); + } + + { + let result: readline.ReadLine; + + result = rl.resume(); + } + + { + rl.close(); + } + + { + let data: string | Buffer; + let key: readline.Key; + + rl.write(data); + rl.write(null, key); + } + + { + let stream: NodeJS.WritableStream; + let x: number; + let y: number; + + readline.cursorTo(stream, x, y); + } + + { + let stream: NodeJS.WritableStream; + let dx: number | string; + let dy: number | string; + + readline.moveCursor(stream, dx, dy); + } + + { + let stream: NodeJS.WritableStream; + let dir: number; + + readline.clearLine(stream, dir); + } + + { + let stream: NodeJS.WritableStream; + + readline.clearScreenDown(stream); + } + + { + let _rl: readline.ReadLine; + let _boolean: boolean; + + _rl = _rl.addListener("close", () => { }); + _rl = _rl.addListener("line", (input) => { + let _input: any = input; + }) + _rl = _rl.addListener("pause", () => { }); + _rl = _rl.addListener("resume", () => { }); + _rl = _rl.addListener("SIGCONT", () => { }); + _rl = _rl.addListener("SIGINT", () => { }); + _rl = _rl.addListener("SIGTSTP", () => { }); + + _boolean = _rl.emit("close", () => { }); + _boolean = _rl.emit("line", () => { }); + _boolean = _rl.emit("pause", () => { }); + _boolean = _rl.emit("resume", () => { }); + _boolean = _rl.emit("SIGCONT", () => { }); + _boolean = _rl.emit("SIGINT", () => { }); + _boolean = _rl.emit("SIGTSTP", () => { }); + + _rl = _rl.on("close", () => { }); + _rl = _rl.on("line", (input) => { + let _input: any = input; + }) + _rl = _rl.on("pause", () => { }); + _rl = _rl.on("resume", () => { }); + _rl = _rl.on("SIGCONT", () => { }); + _rl = _rl.on("SIGINT", () => { }); + _rl = _rl.on("SIGTSTP", () => { }); + + _rl = _rl.once("close", () => { }); + _rl = _rl.once("line", (input) => { + let _input: any = input; + }) + _rl = _rl.once("pause", () => { }); + _rl = _rl.once("resume", () => { }); + _rl = _rl.once("SIGCONT", () => { }); + _rl = _rl.once("SIGINT", () => { }); + _rl = _rl.once("SIGTSTP", () => { }); + + _rl = _rl.prependListener("close", () => { }); + _rl = _rl.prependListener("line", (input) => { + let _input: any = input; + }) + _rl = _rl.prependListener("pause", () => { }); + _rl = _rl.prependListener("resume", () => { }); + _rl = _rl.prependListener("SIGCONT", () => { }); + _rl = _rl.prependListener("SIGINT", () => { }); + _rl = _rl.prependListener("SIGTSTP", () => { }); + + _rl = _rl.prependOnceListener("close", () => { }); + _rl = _rl.prependOnceListener("line", (input) => { + let _input: any = input; + }) + _rl = _rl.prependOnceListener("pause", () => { }); + _rl = _rl.prependOnceListener("resume", () => { }); + _rl = _rl.prependOnceListener("SIGCONT", () => { }); + _rl = _rl.prependOnceListener("SIGINT", () => { }); + _rl = _rl.prependOnceListener("SIGTSTP", () => { }); + } +} + +//////////////////////////////////////////////////// +/// string_decoder tests : https://nodejs.org/api/string_decoder.html +//////////////////////////////////////////////////// + +namespace string_decoder_tests { + const StringDecoder = string_decoder.StringDecoder; + const buffer = new Buffer('test'); + const decoder1 = new StringDecoder(); + const decoder2 = new StringDecoder('utf8'); + const part1: string = decoder1.write(new Buffer('test')); + const end1: string = decoder1.end(); + const part2: string = decoder2.write(new Buffer('test')); + const end2: string = decoder1.end(new Buffer('test')); +} + +////////////////////////////////////////////////////////////////////// +/// Child Process tests: https://nodejs.org/api/child_process.html /// +////////////////////////////////////////////////////////////////////// + +namespace child_process_tests { + { + childProcess.exec("echo test"); + childProcess.spawnSync("echo test"); + } + + { + let _cp: childProcess.ChildProcess; + let _boolean: boolean; + + _cp = _cp.addListener("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }) + _cp = _cp.addListener("disconnect", () => { }); + _cp = _cp.addListener("error", (err) => { + let _err: Error = err; + }) + _cp = _cp.addListener("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }) + _cp = _cp.addListener("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }) + + _boolean = _cp.emit("close", () => { }); + _boolean = _cp.emit("disconnect", () => { }); + _boolean = _cp.emit("error", () => { }); + _boolean = _cp.emit("exit", () => { }); + _boolean = _cp.emit("message", () => { }); + + _cp = _cp.on("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }) + _cp = _cp.on("disconnect", () => { }); + _cp = _cp.on("error", (err) => { + let _err: Error = err; + }) + _cp = _cp.on("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }) + _cp = _cp.on("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }) + + _cp = _cp.once("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }) + _cp = _cp.once("disconnect", () => { }); + _cp = _cp.once("error", (err) => { + let _err: Error = err; + }) + _cp = _cp.once("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }) + _cp = _cp.once("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }) + + _cp = _cp.prependListener("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }) + _cp = _cp.prependListener("disconnect", () => { }); + _cp = _cp.prependListener("error", (err) => { + let _err: Error = err; + }) + _cp = _cp.prependListener("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }) + _cp = _cp.prependListener("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }) + + _cp = _cp.prependOnceListener("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }) + _cp = _cp.prependOnceListener("disconnect", () => { }); + _cp = _cp.prependOnceListener("error", (err) => { + let _err: Error = err; + }) + _cp = _cp.prependOnceListener("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }) + _cp = _cp.prependOnceListener("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }) + } +} + +////////////////////////////////////////////////////////////////////// +/// cluster tests: https://nodejs.org/api/cluster.html /// +////////////////////////////////////////////////////////////////////// + +namespace cluster_tests { + { + cluster.fork(); + Object.keys(cluster.workers).forEach(key => { + const worker = cluster.workers[key]; + if (worker.isDead()) { + console.log('worker %d is dead', worker.process.pid); + } + }); + } +} + +//////////////////////////////////////////////////// +/// os tests : https://nodejs.org/api/os.html +//////////////////////////////////////////////////// + +namespace os_tests { + { + let result: string; + + result = os.tmpdir(); + result = os.homedir(); + result = os.endianness(); + result = os.hostname(); + result = os.type(); + result = os.arch(); + result = os.release(); + result = os.EOL; + } + + { + let result: number; + + result = os.uptime(); + result = os.totalmem(); + result = os.freemem(); + } + + { + let result: number[]; + + result = os.loadavg(); + } + + { + let result: os.CpuInfo[]; + + result = os.cpus(); + } + + { + let result: { [index: string]: os.NetworkInterfaceInfo[] }; + + result = os.networkInterfaces(); + } + + { + let result: number; + + result = os.constants.signals.SIGHUP; + result = os.constants.signals.SIGINT; + result = os.constants.signals.SIGQUIT; + result = os.constants.signals.SIGILL; + result = os.constants.signals.SIGTRAP; + result = os.constants.signals.SIGABRT; + result = os.constants.signals.SIGIOT; + result = os.constants.signals.SIGBUS; + result = os.constants.signals.SIGFPE; + result = os.constants.signals.SIGKILL; + result = os.constants.signals.SIGUSR1; + result = os.constants.signals.SIGSEGV; + result = os.constants.signals.SIGUSR2; + result = os.constants.signals.SIGPIPE; + result = os.constants.signals.SIGALRM; + result = os.constants.signals.SIGTERM; + result = os.constants.signals.SIGCHLD; + result = os.constants.signals.SIGSTKFLT; + result = os.constants.signals.SIGCONT; + result = os.constants.signals.SIGSTOP; + result = os.constants.signals.SIGTSTP; + result = os.constants.signals.SIGTTIN; + result = os.constants.signals.SIGTTOU; + result = os.constants.signals.SIGURG; + result = os.constants.signals.SIGXCPU; + result = os.constants.signals.SIGXFSZ; + result = os.constants.signals.SIGVTALRM; + result = os.constants.signals.SIGPROF; + result = os.constants.signals.SIGWINCH; + result = os.constants.signals.SIGIO; + result = os.constants.signals.SIGPOLL; + result = os.constants.signals.SIGPWR; + result = os.constants.signals.SIGSYS; + result = os.constants.signals.SIGUNUSED; + } + + { + let result: number; + + result = os.constants.errno.E2BIG; + result = os.constants.errno.EACCES; + result = os.constants.errno.EADDRINUSE; + result = os.constants.errno.EADDRNOTAVAIL; + result = os.constants.errno.EAFNOSUPPORT; + result = os.constants.errno.EAGAIN; + result = os.constants.errno.EALREADY; + result = os.constants.errno.EBADF; + result = os.constants.errno.EBADMSG; + result = os.constants.errno.EBUSY; + result = os.constants.errno.ECANCELED; + result = os.constants.errno.ECHILD; + result = os.constants.errno.ECONNABORTED; + result = os.constants.errno.ECONNREFUSED; + result = os.constants.errno.ECONNRESET; + result = os.constants.errno.EDEADLK; + result = os.constants.errno.EDESTADDRREQ; + result = os.constants.errno.EDOM; + result = os.constants.errno.EDQUOT; + result = os.constants.errno.EEXIST; + result = os.constants.errno.EFAULT; + result = os.constants.errno.EFBIG; + result = os.constants.errno.EHOSTUNREACH; + result = os.constants.errno.EIDRM; + result = os.constants.errno.EILSEQ; + result = os.constants.errno.EINPROGRESS; + result = os.constants.errno.EINTR; + result = os.constants.errno.EINVAL; + result = os.constants.errno.EIO; + result = os.constants.errno.EISCONN; + result = os.constants.errno.EISDIR; + result = os.constants.errno.ELOOP; + result = os.constants.errno.EMFILE; + result = os.constants.errno.EMLINK; + result = os.constants.errno.EMSGSIZE; + result = os.constants.errno.EMULTIHOP; + result = os.constants.errno.ENAMETOOLONG; + result = os.constants.errno.ENETDOWN; + result = os.constants.errno.ENETRESET; + result = os.constants.errno.ENETUNREACH; + result = os.constants.errno.ENFILE; + result = os.constants.errno.ENOBUFS; + result = os.constants.errno.ENODATA; + result = os.constants.errno.ENODEV; + result = os.constants.errno.ENOENT; + result = os.constants.errno.ENOEXEC; + result = os.constants.errno.ENOLCK; + result = os.constants.errno.ENOLINK; + result = os.constants.errno.ENOMEM; + result = os.constants.errno.ENOMSG; + result = os.constants.errno.ENOPROTOOPT; + result = os.constants.errno.ENOSPC; + result = os.constants.errno.ENOSR; + result = os.constants.errno.ENOSTR; + result = os.constants.errno.ENOSYS; + result = os.constants.errno.ENOTCONN; + result = os.constants.errno.ENOTDIR; + result = os.constants.errno.ENOTEMPTY; + result = os.constants.errno.ENOTSOCK; + result = os.constants.errno.ENOTSUP; + result = os.constants.errno.ENOTTY; + result = os.constants.errno.ENXIO; + result = os.constants.errno.EOPNOTSUPP; + result = os.constants.errno.EOVERFLOW; + result = os.constants.errno.EPERM; + result = os.constants.errno.EPIPE; + result = os.constants.errno.EPROTO; + result = os.constants.errno.EPROTONOSUPPORT; + result = os.constants.errno.EPROTOTYPE; + result = os.constants.errno.ERANGE; + result = os.constants.errno.EROFS; + result = os.constants.errno.ESPIPE; + result = os.constants.errno.ESRCH; + result = os.constants.errno.ESTALE; + result = os.constants.errno.ETIME; + result = os.constants.errno.ETIMEDOUT; + result = os.constants.errno.ETXTBSY; + result = os.constants.errno.EWOULDBLOCK; + result = os.constants.errno.EXDEV; + } +} + +//////////////////////////////////////////////////// +/// vm tests : https://nodejs.org/api/vm.html +//////////////////////////////////////////////////// + +namespace vm_tests { + { + const sandbox = { + animal: 'cat', + count: 2 + }; + + const context = vm.createContext(sandbox); + console.log(vm.isContext(context)); + const script = new vm.Script('count += 1; name = "kitty"'); + + for (let i = 0; i < 10; ++i) { + script.runInContext(context); + } + + console.log(util.inspect(sandbox)); + + vm.runInNewContext('count += 1; name = "kitty"', sandbox); + console.log(util.inspect(sandbox)); + } + + { + const sandboxes = [{}, {}, {}]; + + const script = new vm.Script('globalVar = "set"'); + + sandboxes.forEach((sandbox) => { + script.runInNewContext(sandbox); + script.runInThisContext(); + }); + + console.log(util.inspect(sandboxes)); + + var localVar = 'initial value'; + vm.runInThisContext('localVar = "vm";'); + + console.log(localVar); + } + + { + const Debug = vm.runInDebugContext('Debug'); + Debug.scripts().forEach(function(script: any) { console.log(script.name); }); + } +} + +///////////////////////////////////////////////////// +/// Timers tests : https://nodejs.org/api/timers.html +///////////////////////////////////////////////////// + +namespace timers_tests { + { + let immediateId = timers.setImmediate(function() { console.log("immediate"); }); + timers.clearImmediate(immediateId); + } + { + let counter = 0; + let timeout = timers.setInterval(function() { console.log("interval"); }, 20); + timeout.unref(); + timeout.ref(); + timers.clearInterval(timeout); + } + { + let counter = 0; + let timeout = timers.setTimeout(function() { console.log("timeout"); }, 20); + timeout.unref(); + timeout.ref(); + timers.clearTimeout(timeout); + } +} + +///////////////////////////////////////////////////////// +/// Errors Tests : https://nodejs.org/api/errors.html /// +///////////////////////////////////////////////////////// + +namespace errors_tests { + { + Error.stackTraceLimit = Infinity; + } + { + const myObject = {}; + Error.captureStackTrace(myObject); + } +} + +/////////////////////////////////////////////////////////// +/// Process Tests : https://nodejs.org/api/process.html /// +/////////////////////////////////////////////////////////// + +import * as p from "process"; +namespace process_tests { + { + var eventEmitter: events.EventEmitter; + eventEmitter = process; // Test that process implements EventEmitter... + + var _p: NodeJS.Process = process; + _p = p; + } + { + assert(process.argv[0] === process.argv0); + } + { + var module: NodeModule | undefined; + module = process.mainModule; + } +} + +/////////////////////////////////////////////////////////// +/// Console Tests : https://nodejs.org/api/console.html /// +/////////////////////////////////////////////////////////// + +import * as c from "console"; +namespace console_tests { + { + var _c: Console = console; + _c = c; + } + { + var writeStream = fs.createWriteStream('./index.d.ts'); + var consoleInstance = new console.Console(writeStream) + + } +} + +/////////////////////////////////////////////////// +/// Net Tests : https://nodejs.org/api/net.html /// +/////////////////////////////////////////////////// + +namespace net_tests { + { + let server = net.createServer(); + // Check methods which return server instances by chaining calls + server = server.listen(0) + .close() + .ref() + .unref(); + + // close has an optional callback function. No callback parameters are + // specified, so any callback function is permissible. + server = server.close((...args: any[]) => {}); + + // test the types of the address object fields + let address = server.address(); + address.port = 1234; + address.family = "ipv4"; + address.address = "127.0.0.1"; + } + + { + /** + * net.Socket - events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. timeout + */ + let _socket: net.Socket; + + let bool: boolean; + let buffer: Buffer; + let error: Error; + let str: string; + let num: number; + + /// addListener + + _socket = _socket.addListener("close", had_error => { + bool = had_error; + }) + _socket = _socket.addListener("connect", () => { }) + _socket = _socket.addListener("data", data => { + buffer = data; + }) + _socket = _socket.addListener("drain", () => { }) + _socket = _socket.addListener("end", () => { }) + _socket = _socket.addListener("error", err => { + error = err; + }) + _socket = _socket.addListener("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }) + _socket = _socket.addListener("timeout", () => { }) + + /// emit + bool = _socket.emit("close", bool); + bool = _socket.emit("connect"); + bool = _socket.emit("data", buffer); + bool = _socket.emit("drain"); + bool = _socket.emit("end"); + bool = _socket.emit("error", error); + bool = _socket.emit("lookup", error, str, str, str); + bool = _socket.emit("lookup", error, str, num, str); + bool = _socket.emit("timeout"); + + /// on + _socket = _socket.on("close", had_error => { + bool = had_error; + }) + _socket = _socket.on("connect", () => { }) + _socket = _socket.on("data", data => { + buffer = data; + }) + _socket = _socket.on("drain", () => { }) + _socket = _socket.on("end", () => { }) + _socket = _socket.on("error", err => { + error = err; + }) + _socket = _socket.on("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }) + _socket = _socket.on("timeout", () => { }) + + /// once + _socket = _socket.once("close", had_error => { + bool = had_error; + }) + _socket = _socket.once("connect", () => { }) + _socket = _socket.once("data", data => { + buffer = data; + }) + _socket = _socket.once("drain", () => { }) + _socket = _socket.once("end", () => { }) + _socket = _socket.once("error", err => { + error = err; + }) + _socket = _socket.once("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }) + _socket = _socket.once("timeout", () => { }) + + /// prependListener + _socket = _socket.prependListener("close", had_error => { + bool = had_error; + }) + _socket = _socket.prependListener("connect", () => { }) + _socket = _socket.prependListener("data", data => { + buffer = data; + }) + _socket = _socket.prependListener("drain", () => { }) + _socket = _socket.prependListener("end", () => { }) + _socket = _socket.prependListener("error", err => { + error = err; + }) + _socket = _socket.prependListener("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }) + _socket = _socket.prependListener("timeout", () => { }) + + /// prependOnceListener + _socket = _socket.prependOnceListener("close", had_error => { + bool = had_error; + }) + _socket = _socket.prependOnceListener("connect", () => { }) + _socket = _socket.prependOnceListener("data", data => { + buffer = data; + }) + _socket = _socket.prependOnceListener("drain", () => { }) + _socket = _socket.prependOnceListener("end", () => { }) + _socket = _socket.prependOnceListener("error", err => { + error = err; + }) + _socket = _socket.prependOnceListener("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }) + _socket = _socket.prependOnceListener("timeout", () => { }) + + bool = _socket.connecting; + bool = _socket.destroyed; + _socket.destroy(); + } + + { + /** + * net.Server - events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + */ + let _server: net.Server; + + let _socket: net.Socket; + let bool: boolean; + let error: Error; + + /// addListener + _server = _server.addListener("close", () => { }) + _server = _server.addListener("connection", socket => { + _socket = socket + }) + _server = _server.addListener("error", err => { + error = err; + }) + _server = _server.addListener("listening", () => { }) + + /// emit + bool = _server.emit("close") + bool = _server.emit("connection", _socket) + bool = _server.emit("error", error) + bool = _server.emit("listening") + + /// once + _server = _server.once("close", () => { }) + _server = _server.once("connection", socket => { + _socket = socket + }) + _server = _server.once("error", err => { + error = err; + }) + _server = _server.once("listening", () => { }) + + /// prependListener + _server = _server.prependListener("close", () => { }) + _server = _server.prependListener("connection", socket => { + _socket = socket + }) + _server = _server.prependListener("error", err => { + error = err; + }) + _server = _server.prependListener("listening", () => { }) + + /// prependOnceListener + _server = _server.prependOnceListener("close", () => { }) + _server = _server.prependOnceListener("connection", socket => { + _socket = socket + }) + _server = _server.prependOnceListener("error", err => { + error = err; + }) + _server = _server.prependOnceListener("listening", () => { }) + + } + +} + +///////////////////////////////////////////////////// +/// repl Tests : https://nodejs.org/api/repl.html /// +///////////////////////////////////////////////////// + +namespace repl_tests { + { + let _server: repl.REPLServer; + let _boolean: boolean; + let _ctx: any; + + _server = _server.addListener("exit", () => { }); + _server = _server.addListener("reset", () => { }); + + _boolean = _server.emit("exit", () => { }); + _boolean = _server.emit("reset", _ctx); + + _server = _server.on("exit", () => { }); + _server = _server.on("reset", () => { }); + + _server = _server.once("exit", () => { }); + _server = _server.once("reset", () => { }); + + _server = _server.prependListener("exit", () => { }); + _server = _server.prependListener("reset", () => { }); + + _server = _server.prependOnceListener("exit", () => { }); + _server = _server.prependOnceListener("reset", () => { }); + } +} + +/////////////////////////////////////////////////// +/// DNS Tests : https://nodejs.org/api/dns.html /// +/////////////////////////////////////////////////// + +namespace dns_tests { + dns.lookup("nodejs.org", (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup("nodejs.org", 4, (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup("nodejs.org", 6, (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup("nodejs.org", {}, (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup( + "nodejs.org", + { + family: 4, + hints: dns.ADDRCONFIG | dns.V4MAPPED, + all: false + }, + (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + } + ); + dns.lookup("nodejs.org", {all: true}, (err, addresses) => { + const _err: NodeJS.ErrnoException = err; + const _address: dns.LookupAddress[] = addresses; + }); + + function trueOrFalse(): boolean { + return Math.random() > 0.5 ? true : false; + } + dns.lookup("nodejs.org", {all: trueOrFalse()}, (err, addresses, family) => { + const _err: NodeJS.ErrnoException = err; + const _addresses: string | dns.LookupAddress[] = addresses; + const _family: number | undefined = family; + }); + + dns.resolve("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve("nodejs.org", "A", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve("nodejs.org", "AAAA", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve("nodejs.org", "MX", (err, addresses) => { + const _addresses: dns.MxRecord[] = addresses; + }); + + dns.resolve4("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve4("nodejs.org", {ttl: true}, (err, addresses) => { + const _addresses: dns.RecordWithTtl[] = addresses; + }); + { + const ttl = false; + dns.resolve4("nodejs.org", {ttl: ttl}, (err, addresses) => { + const _addresses: string[] | dns.RecordWithTtl[] = addresses; + }); + } + + dns.resolve6("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve6("nodejs.org", {ttl: true}, (err, addresses) => { + const _addresses: dns.RecordWithTtl[] = addresses; + }); + { + const ttl = false; + dns.resolve6("nodejs.org", {ttl: ttl}, (err, addresses) => { + const _addresses: string[] | dns.RecordWithTtl[] = addresses; + }); + } +} + +/***************************************************************************** + * * + * The following tests are the modules not mentioned in document but existed * + * * + *****************************************************************************/ + +/////////////////////////////////////////////////////////// +/// Constants Tests /// +/////////////////////////////////////////////////////////// + +import * as constants from 'constants'; +namespace constants_tests { + var str: string; + var num: number; + num = constants.SIGHUP + num = constants.SIGINT + num = constants.SIGQUIT + num = constants.SIGILL + num = constants.SIGTRAP + num = constants.SIGABRT + num = constants.SIGIOT + num = constants.SIGBUS + num = constants.SIGFPE + num = constants.SIGKILL + num = constants.SIGUSR1 + num = constants.SIGSEGV + num = constants.SIGUSR2 + num = constants.SIGPIPE + num = constants.SIGALRM + num = constants.SIGTERM + num = constants.SIGCHLD + num = constants.SIGSTKFLT + num = constants.SIGCONT + num = constants.SIGSTOP + num = constants.SIGTSTP + num = constants.SIGTTIN + num = constants.SIGTTOU + num = constants.SIGURG + num = constants.SIGXCPU + num = constants.SIGXFSZ + num = constants.SIGVTALRM + num = constants.SIGPROF + num = constants.SIGWINCH + num = constants.SIGIO + num = constants.SIGPOLL + num = constants.SIGPWR + num = constants.SIGSYS + num = constants.SIGUNUSED + num = constants.O_RDONLY + num = constants.O_WRONLY + num = constants.O_RDWR + num = constants.S_IFMT + num = constants.S_IFREG + num = constants.S_IFDIR + num = constants.S_IFCHR + num = constants.S_IFBLK + num = constants.S_IFIFO + num = constants.S_IFLNK + num = constants.S_IFSOCK + num = constants.O_CREAT + num = constants.O_EXCL + num = constants.O_NOCTTY + num = constants.O_TRUNC + num = constants.O_APPEND + num = constants.O_DIRECTORY + num = constants.O_NOATIME + num = constants.O_NOFOLLOW + num = constants.O_SYNC + num = constants.O_DIRECT + num = constants.O_NONBLOCK + num = constants.S_IRWXU + num = constants.S_IRUSR + num = constants.S_IWUSR + num = constants.S_IXUSR + num = constants.S_IRWXG + num = constants.S_IRGRP + num = constants.S_IWGRP + num = constants.S_IXGRP + num = constants.S_IRWXO + num = constants.S_IROTH + num = constants.S_IWOTH + num = constants.S_IXOTH + num = constants.F_OK + num = constants.R_OK + num = constants.W_OK + num = constants.X_OK + num = constants.SSL_OP_ALL + num = constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION + num = constants.SSL_OP_CIPHER_SERVER_PREFERENCE + num = constants.SSL_OP_CISCO_ANYCONNECT + num = constants.SSL_OP_COOKIE_EXCHANGE + num = constants.SSL_OP_CRYPTOPRO_TLSEXT_BUG + num = constants.SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS + num = constants.SSL_OP_EPHEMERAL_RSA + num = constants.SSL_OP_LEGACY_SERVER_CONNECT + num = constants.SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER + num = constants.SSL_OP_MICROSOFT_SESS_ID_BUG + num = constants.SSL_OP_MSIE_SSLV2_RSA_PADDING + num = constants.SSL_OP_NETSCAPE_CA_DN_BUG + num = constants.SSL_OP_NETSCAPE_CHALLENGE_BUG + num = constants.SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG + num = constants.SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG + num = constants.SSL_OP_NO_COMPRESSION + num = constants.SSL_OP_NO_QUERY_MTU + num = constants.SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION + num = constants.SSL_OP_NO_SSLv2 + num = constants.SSL_OP_NO_SSLv3 + num = constants.SSL_OP_NO_TICKET + num = constants.SSL_OP_NO_TLSv1 + num = constants.SSL_OP_NO_TLSv1_1 + num = constants.SSL_OP_NO_TLSv1_2 + num = constants.SSL_OP_PKCS1_CHECK_1 + num = constants.SSL_OP_PKCS1_CHECK_2 + num = constants.SSL_OP_SINGLE_DH_USE + num = constants.SSL_OP_SINGLE_ECDH_USE + num = constants.SSL_OP_SSLEAY_080_CLIENT_DH_BUG + num = constants.SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG + num = constants.SSL_OP_TLS_BLOCK_PADDING_BUG + num = constants.SSL_OP_TLS_D5_BUG + num = constants.SSL_OP_TLS_ROLLBACK_BUG + num = constants.ENGINE_METHOD_RSA + num = constants.ENGINE_METHOD_DSA + num = constants.ENGINE_METHOD_DH + num = constants.ENGINE_METHOD_RAND + num = constants.ENGINE_METHOD_ECDH + num = constants.ENGINE_METHOD_ECDSA + num = constants.ENGINE_METHOD_CIPHERS + num = constants.ENGINE_METHOD_DIGESTS + num = constants.ENGINE_METHOD_STORE + num = constants.ENGINE_METHOD_PKEY_METHS + num = constants.ENGINE_METHOD_PKEY_ASN1_METHS + num = constants.ENGINE_METHOD_ALL + num = constants.ENGINE_METHOD_NONE + num = constants.DH_CHECK_P_NOT_SAFE_PRIME + num = constants.DH_CHECK_P_NOT_PRIME + num = constants.DH_UNABLE_TO_CHECK_GENERATOR + num = constants.DH_NOT_SUITABLE_GENERATOR + num = constants.NPN_ENABLED + num = constants.ALPN_ENABLED + num = constants.RSA_PKCS1_PADDING + num = constants.RSA_SSLV23_PADDING + num = constants.RSA_NO_PADDING + num = constants.RSA_PKCS1_OAEP_PADDING + num = constants.RSA_X931_PADDING + num = constants.RSA_PKCS1_PSS_PADDING + num = constants.POINT_CONVERSION_COMPRESSED + num = constants.POINT_CONVERSION_UNCOMPRESSED + num = constants.POINT_CONVERSION_HYBRID + str = constants.defaultCoreCipherList + str = constants.defaultCipherList +} + + +//////////////////////////////////////////////////// +/// v8 tests : https://nodejs.org/api/v8.html +//////////////////////////////////////////////////// + +namespace v8_tests { + + const heapStats = v8.getHeapStatistics(); + const heapSpaceStats = v8.getHeapSpaceStatistics(); + + const zapsGarbage: number = heapStats.does_zap_garbage; + + v8.setFlagsFromString('--collect_maps'); +} + +/////////////////////////////////////////////////////////// +/// Debugger Tests /// +/////////////////////////////////////////////////////////// + +import { Client } from "_debugger"; + +var client = new Client(); + +client.connect(8888, 'localhost'); +client.listbreakpoints((err, body, packet) => { + +}); diff --git a/types/node/v7/tsconfig.json b/types/node/v7/tsconfig.json new file mode 100644 index 0000000000..eb074775b7 --- /dev/null +++ b/types/node/v7/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "index.d.ts", + "node-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "node": [ + "node/v7" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true + } +} diff --git a/types/node/v7/tslint.json b/types/node/v7/tslint.json new file mode 100644 index 0000000000..7ca0a1dd7c --- /dev/null +++ b/types/node/v7/tslint.json @@ -0,0 +1,33 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // All are TODOs + "adjacent-overload-signatures": false, + "align": false, + "array-type": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "import-spacing": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "no-consecutive-blank-lines": false, + "no-empty-interface": false, + "no-internal-module": false, + "no-namespace": false, + "no-padding": false, + "no-string-throw": false, + "no-var": false, + "object-literal-shorthand": false, + "one-line": false, + "only-arrow-functions": false, + "prefer-method-signature": false, + "semicolon": false, + "strict-export-declare-modifiers": false, + "typedef-whitespace": false, + "unified-signatures": false, + "whitespace": false + } +} From e054978b9cbc30623b8e8b2621319f21dafcc734 Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Wed, 7 Jun 2017 15:17:43 +0200 Subject: [PATCH 163/761] fix type of H.map.Icon.Options.size according the documentation of HERE datalens, size can be a number: https://developer.here.com/visualization/documentation/datalens/h-datalens-objectlayer.html --- types/heremaps/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/heremaps/index.d.ts b/types/heremaps/index.d.ts index bfdd353dd3..1a801d0414 100644 --- a/types/heremaps/index.d.ts +++ b/types/heremaps/index.d.ts @@ -1743,7 +1743,7 @@ declare namespace H { * @property crossOrigin {boolean} - Specifies whether to use anonynous Cross-Origin Resource Sharing (CORS) when fetching an image to prevent resulting canvas from tainting, default is false. The option is ignored by IE9-10. */ export interface Options { - size?: H.math.ISize; + size?: H.math.ISize | number; anchor?: H.math.IPoint; hitArea?: H.map.HitArea; asCanvas?: H.map.HitArea; From 1e85e1d7fb862dda0814c6df869bb957f5be4ac3 Mon Sep 17 00:00:00 2001 From: Brendan McKeown Date: Wed, 7 Jun 2017 09:25:29 -0400 Subject: [PATCH 164/761] Numeral.js - add missing second optional argument to `format` method for rounding function --- types/numeral/index.d.ts | 4 +++- types/numeral/numeral-tests.ts | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/numeral/index.d.ts b/types/numeral/index.d.ts index f08f46b8c2..83ed71bdec 100644 --- a/types/numeral/index.d.ts +++ b/types/numeral/index.d.ts @@ -35,6 +35,8 @@ interface NumeralJsFormat { type RegisterType = 'format' | 'locale'; +type RoundingFunction = (value: number) => number; + // http://numeraljs.com/#use-it interface Numeral { (value?: any): Numeral; @@ -60,7 +62,7 @@ interface Numeral { nullFormat(format: string): void; defaultFormat(format: string): void; clone(): Numeral; - format(inputString?: string): string; + format(inputString?: string, roundingFunction?: RoundingFunction): string; formatCurrency(inputString?: string): string; unformat(inputString: string): number; value(): number; diff --git a/types/numeral/numeral-tests.ts b/types/numeral/numeral-tests.ts index 7be34cc8f9..b58d6e7411 100644 --- a/types/numeral/numeral-tests.ts +++ b/types/numeral/numeral-tests.ts @@ -6,6 +6,9 @@ var valueFormat: string = numeral(1000).format('0,0'); var valueUnformat: number = numeral().unformat('($10,000.00)'); // '-10000' +var valueFormatFloor: string = numeral(1.357).format('0.00', Math.floor); +// '1.35' + var value3: Numeral = numeral(1000); var added: Numeral = value3.add(10); // 1010 From d45137018d2a289d7bc898a311e11002e5a3a409 Mon Sep 17 00:00:00 2001 From: Niklas Wulf Date: Wed, 7 Jun 2017 15:37:05 +0200 Subject: [PATCH 165/761] [Hapi] Fix input and response validation function signatures (#16802) * [Hapi] Fix input and response validation function signatures Fixes #16750 * [Hapi] Allow custom validation options in route input and response * [Hapi] Adjust validation contexts to match Hapi version 16.1.1 * [Hapi] Adjust test/route/validate.ts to match newest changes * [Hapi] Add custom options to response validation test * [Hapi] Update TypeScript version to 2.3 in packages that import Hapi * [Hapi] Clarify documentation on validation function value, allow null --- types/h2o2/index.d.ts | 2 +- types/hapi-auth-basic/index.d.ts | 2 +- types/hapi-decorators/index.d.ts | 1 + types/hapi/index.d.ts | 149 +++++++++++++++++++++--------- types/hapi/test/route/validate.ts | 46 ++++++++- types/inert/index.d.ts | 1 + types/nes/index.d.ts | 1 + types/vision/index.d.ts | 2 +- 8 files changed, 154 insertions(+), 50 deletions(-) diff --git a/types/h2o2/index.d.ts b/types/h2o2/index.d.ts index a1a3680e5c..7ca3ccb85f 100644 --- a/types/h2o2/index.d.ts +++ b/types/h2o2/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hapijs/catbox // Definitions by: Jason Swearingen , AJP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 /// diff --git a/types/hapi-auth-basic/index.d.ts b/types/hapi-auth-basic/index.d.ts index 23b06de111..07c3c8cc20 100644 --- a/types/hapi-auth-basic/index.d.ts +++ b/types/hapi-auth-basic/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hapijs/hapi-auth-basic // Definitions by: AJP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import * as Hapi from 'hapi'; diff --git a/types/hapi-decorators/index.d.ts b/types/hapi-decorators/index.d.ts index 2933945e64..e4d7c40991 100644 --- a/types/hapi-decorators/index.d.ts +++ b/types/hapi-decorators/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/knownasilya/hapi-decorators // Definitions by: Ken Howard // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as hapi from 'hapi'; import * as Joi from 'joi'; diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 8dca27d66e..9b03944e9a 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hapijs/hapi // Definitions by: Jason Swearingen , AJP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1310,7 +1310,7 @@ export interface RoutePrerequisiteObjects { /** * For context see RouteAdditionalConfigurationOptions > response */ -export interface RouteResponseConfigurationObject { +export interface RouteResponseConfigurationObject { /** the default HTTP status code when the payload is empty. Value can be 200 or 204. Note that a 200 status code is converted to a 204 only at the time or response transmission (the response status code will remain 200 throughout the request lifecycle unless manually set). Defaults to 200. */ emptyStatusCode?: number; /** @@ -1326,16 +1326,20 @@ export interface RouteResponseConfigurationObject { failAction?: 'error' | 'log' | ((request: Request, reply: ReplyWithContinue, source: string, error: Boom.BoomError) => void); /** if true, applies the validation rule changes to the response payload. Defaults to false. */ modify?: boolean; - /** options to pass to Joi. Useful to set global options such as stripUnknown or abortEarly (the complete list is available [here](https://github.com/hapijs/joi/blob/master/API.md#validatevalue-schema-options-callback) ). Defaults to no options. */ - options?: JoiValidationOptions; + /** + * options to pass to Joi. Useful to set global options such as stripUnknown or abortEarly (the complete list is available [here](https://github.com/hapijs/joi/blob/master/API.md#validatevalue-schema-options-callback) ). + * If a custom validation function (see `schema` or `status` below) is defined then `options` can an arbitrary object that will be passed to this function as the second parameter. + * Defaults to no options. + */ + options?: ValidationOptions; /** if false, payload range support is disabled. Defaults to true. */ ranges?: boolean; /** the percent of response payloads validated (0 - 100). Set to 0 to disable all validation. Defaults to 100 (all response payloads). */ sample?: number; /** the default response payload validation rules (for all non-error responses) */ - schema?: RouteResponseConfigurationScheme; + schema?: RouteResponseConfigurationScheme; /** HTTP status-code-specific payload validation rules. The status key is set to an object where each key is a 3 digit HTTP status code and the value has the same definition as schema. If a response status code is not present in the status object, the schema definition is used, except for errors which are not validated by default. */ - status?: Dictionary; + status?: Dictionary>; } /** @@ -1343,27 +1347,54 @@ export interface RouteResponseConfigurationObject { * * true - any payload allowed (no validation performed). This is the default. * * false - no payload allowed. * * a Joi validation object. This will receive the request's headers, params, query, payload, and auth credentials and isAuthenticated flags as context. - * * a validation function using the signature function(value, options, next) where: - * * value - the object containing the response object. - * * options - the server validation options, merged with an object containing the request's headers, params, payload, and auth credentials object and isAuthenticated flag. - * * next(err) - the callback function called when validation is completed. + * * a validation function + * * TODO check JoiValidationObject is correct for "a Joi validation object" * * For context see RouteAdditionalConfigurationOptions > response > schema * and * For context see RouteAdditionalConfigurationOptions > response > status */ -export type RouteResponseConfigurationScheme = boolean | JoiValidationObject | ValidationFunctionForRouteResponse; +export type RouteResponseConfigurationScheme = boolean | JoiValidationObject | ValidationFunctionForRouteResponse; /** * see RouteResponseConfigurationScheme * - * TODO check `value: Response` is correct as it says "**the object containing** the response object." not just "the response object". - * TODO check `options: JoiValidationOptions` is correct - * Also see ValidationFunctionForRouteValidate + * a validation function using the signature function(value, options, next) where: + * * value - the value of the response passed to `reply(value)` in the handler. + * * options - the server validation options, merged with an object containing the request's headers, params, payload, and auth credentials object and `isAuthenticated` flag. + * * next([err, [value]]) - the callback function called when validation is completed. `value` will be used as the response value when `err` is falsy, when `value` is not `undefined`, and when `route.settings.response.modify` is `true`. If the response is already a `Boom` error it will be set as its `message` value. */ -export interface ValidationFunctionForRouteResponse { - (value: Response, options: JoiValidationOptions, next: ContinuationFunction): void; +export interface ValidationFunctionForRouteResponse { + (value: any, options: RouteResponseValidationContext & ValidationOptions, next: ContinuationValueFunction): void; +} + +/** + * A context for route input validation via a Joi schema or validation function. + * + * This object is merged with the route response options and passed into the validation function. + * + * See https://github.com/hapijs/hapi/blob/v16.1.1/lib/validation.js#L217 + */ +export interface RouteResponseValidationContext { + context: { + /** The request headers */ + headers: Dictionary; + /** The request path parameters */ + params: any; + /** The request query parameters */ + query: any; + /** The request payload parameters */ + payload: any; + + /** Partial request authentication information */ + auth: { + /** true if the request has been successfully authenticated, otherwise false. */ + isAuthenticated: boolean; + /** the credential object received during the authentication process. The presence of an object does not mean successful authentication. */ + credentials: AuthenticatedCredentials; + }; + } } /** @@ -1399,7 +1430,7 @@ export interface RouteSecurityConfigurationObject { * For context see RouteAdditionalConfigurationOptions > validate * TODO check JoiValidationObject is correct for "a Joi validation object" */ -export interface RouteValidationConfigurationObject { +export interface RouteValidationConfigurationObject { /** * validation rules for incoming request headers (note that all header field names must be in lowercase to match the headers normalized by node). Values allowed: * * true - any headers allowed (no validation performed). This is the default. @@ -1408,25 +1439,25 @@ export interface RouteValidationConfigurationObject { * * a validation function using the signature function(value, options, next) where: * * value - the object containing the request headers. * * options - the server validation options. - * * next(err, value) - the callback function called when validation is completed. + * * next(err, value) - the callback function called when validation is completed. `value` will be used as the `headers` value when `err` is falsy. If `next` is called with `undefined` or no arguments then the original value of `value` will be used. */ - headers?: boolean | JoiValidationObject | ValidationFunctionForRouteValidate; + headers?: boolean | JoiValidationObject | ValidationFunctionForRouteInput; /** * validation rules for incoming request path parameters, after matching the path against the route and extracting any parameters then stored in request.params. Values allowed: * Same as `headers`, see above. */ - params?: boolean | JoiValidationObject | ValidationFunctionForRouteValidate; + params?: boolean | JoiValidationObject | ValidationFunctionForRouteInput; /** * validation rules for an incoming request URI query component (the key-value part of the URI between '?' and '#'). The query is parsed into its individual key-value pairs and stored in request.query prior to validation. Values allowed: * Same as `headers`, see above. */ - query?: boolean | JoiValidationObject | ValidationFunctionForRouteValidate; + query?: boolean | JoiValidationObject | ValidationFunctionForRouteInput; /** * validation rules for an incoming request payload (request body). Values allowed: * Same as `headers`, see above, with the addition that: * * a Joi validation object. Note that empty payloads are represented by a null value. If a validation schema is provided and empty payload are supported, it must be explicitly defined by setting the payload value to a joi schema with null allowed (e.g. Joi.object({ /* keys here * / }).allow(null)). */ - payload?: boolean | JoiValidationObject | ValidationFunctionForRouteValidate; + payload?: boolean | JoiValidationObject | ValidationFunctionForRouteInput; /** an optional object with error fields copied into every validation error response. */ errorFields?: any; /** @@ -1437,24 +1468,46 @@ export interface RouteValidationConfigurationObject { * * a custom error handler function with the signature function(request, reply, source, error) see RouteFailFunction */ failAction?: 'error' | 'log' | 'ignore' | RouteFailFunction; - /** options to pass to Joi. Useful to set global options such as stripUnknown or abortEarly (the complete list is [available here](https://github.com/hapijs/joi/blob/master/API.md#validatevalue-schema-options-callback)). Defaults to no options. */ - options?: JoiValidationOptions; + /** + * options to pass to Joi. Useful to set global options such as stripUnknown or abortEarly (the complete list is [available here](https://github.com/hapijs/joi/blob/master/API.md#validatevalue-schema-options-callback)). + * If a custom validation function (see `headers`, `params`, `query`, or `payload` above) is defined then `options` can an arbitrary object that will be passed to this function as the second parameter. + * Defaults to no options. + */ + options?: ValidationOptions; } /** * a validation function using the signature function(value, options, next) where: - * For context see RouteAdditionalConfigurationOptions > validate (IRouteValidationConfigurationObject) + * For context see RouteAdditionalConfigurationOptions > validate (RouteValidationConfigurationObject) * - * TODO check `value: Response` is correct as it says "**the object containing** the response object." not just "the response object". - * TODO check `options: JoiValidationOptions` is correct - * TODO type of the returned value? * Also see ValidationFunctionForRouteResponse - * @param value - the object containing the request headers. + * @param value - the object containing the request headers, query, path params or payload. * @param options - the server validation options. - * @param next(err, value) - the callback function called when validation is completed. + * @param next([err, [value]]) - the callback function called when validation is completed. */ -export interface ValidationFunctionForRouteValidate { - (value: Response, options: JoiValidationOptions, next: ContinuationValueFunction): void; +export interface ValidationFunctionForRouteInput { + (value: any, options: RouteInputValidationContext & ValidationOptions, next: ContinuationValueFunction): void; +} + +/** + * A context for route input validation via a Joi schema or validation function. + * + * This object is merged with the route validation options and passed into the validation function. + * + * See https://github.com/hapijs/hapi/blob/v16.1.1/lib/validation.js#L122 + */ +export interface RouteInputValidationContext { + context: { + // These are only set when *not* validating the respective source (e.g. params, query and payload are set when validating headers): + // See https://github.com/hapijs/hapi/blob/v16.1.1/lib/validation.js#L132 + headers?: Dictionary; + params?: any; + query?: any; + payload?: any; + + /** The request authentication information */ + auth: RequestAuthenticationInformation; + } } /** @@ -1795,18 +1848,7 @@ export class Request extends Podium { /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name]. */ app: any; /** authentication information */ - auth: { - /** true if the request has been successfully authenticated, otherwise false. */ - isAuthenticated: boolean; - /** the credential object received during the authentication process. The presence of an object does not mean successful authentication. */ - credentials: any; - /** an artifact object received from the authentication strategy and used in authentication-related actions. */ - artifacts: any; - /** the route authentication mode. */ - mode: string; - /** the authentication error is failed and mode set to 'try'. */ - error: Error; - }; + auth: RequestAuthenticationInformation; /** the connection the request was received by. */ connection: ServerConnection; /** the node domain object used to protect against exceptions thrown in extensions, handlers and route prerequisites. Can be used to manually bind callback functions otherwise bound to other domains. Set to null when the server useDomains options is false. */ @@ -1964,6 +2006,19 @@ export class Request extends Podium { // [index: string]: any; } +export interface RequestAuthenticationInformation { + /** true if the request has been successfully authenticated, otherwise false. */ + isAuthenticated: boolean; + /** the credential object received during the authentication process. The presence of an object does not mean successful authentication. */ + credentials: any; + /** an artifact object received from the authentication strategy and used in authentication-related actions. */ + artifacts: any; + /** the route authentication mode. */ + mode: string; + /** the authentication error is failed and mode set to 'try'. */ + error: Error; +} + export type HTTP_METHODS_PARTIAL_lowercase = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'options'; export type HTTP_METHODS_PARTIAL = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | HTTP_METHODS_PARTIAL_lowercase; export type HTTP_METHODS = 'HEAD' | 'head' | HTTP_METHODS_PARTIAL; @@ -2049,7 +2104,7 @@ export interface RequestHandler { /** * Used by server extension points - * err can be BoomError or Error that will be wrapped as a BoomError + * err can be `Boom` error or Error that will be wrapped as a `Boom` error * For source [See code](https://github.com/hapijs/hapi/blob/v16.1.1/lib/reply.js#L109-L118) * For source [See code](https://github.com/hapijs/hapi/blob/v16.1.1/lib/response.js#L60-L65) */ @@ -2061,7 +2116,9 @@ export interface ContinuationFunction { * TODO Can value be typed with a useful generic? */ export interface ContinuationValueFunction { - (err: Boom.BoomError, value: any): void; + (err: Boom.BoomError): void; + (err: null | undefined, value: any): void; + (): void; } /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/types/hapi/test/route/validate.ts b/types/hapi/test/route/validate.ts index f160641016..f579bff8a8 100644 --- a/types/hapi/test/route/validate.ts +++ b/types/hapi/test/route/validate.ts @@ -13,8 +13,52 @@ const validate: Hapi.RouteValidationConfigurationObject = { query: { providerId: Joi.string(), }, + options: { + abortEarly: true, + }, }; -const config: Hapi.RouteAdditionalConfigurationOptions = { +let config: Hapi.RouteAdditionalConfigurationOptions = { validate, + response: { + schema: Joi.object(), + }, +}; + +interface CustomValidationOptions { + myOption: number; +} + +const inputValidationFunction: Hapi.ValidationFunctionForRouteInput = (value, options, next) => { + options.myOption; // check custom options + options.context.auth.artifacts; // check context + next(null, value); // check with value + next(); // check without value +}; + +const validateWithFunctions: Hapi.RouteValidationConfigurationObject = { + params: inputValidationFunction, + headers: inputValidationFunction, + payload: inputValidationFunction, + query: inputValidationFunction, + options: { + myOption: 18 + } +}; + +const responseValidationFunction: Hapi.ValidationFunctionForRouteResponse = (value, options, next) => { + options.myOption; // check custom options + options.context.auth.isAuthenticated; // check context + next(null, value); // check with value + next(); // check without value +}; + +config = { + validate: validateWithFunctions, + response: >{ + schema: responseValidationFunction, + options: { + myOption: 18 + } + } }; diff --git a/types/inert/index.d.ts b/types/inert/index.d.ts index a54841eac7..28e4efbe58 100644 --- a/types/inert/index.d.ts +++ b/types/inert/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/hapijs/inert/ // Definitions by: Steve Ognibene , AJP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as hapi from 'hapi'; diff --git a/types/nes/index.d.ts b/types/nes/index.d.ts index 87e428bc29..aab6827ed7 100644 --- a/types/nes/index.d.ts +++ b/types/nes/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/hapijs/nes // Definitions by: Ivo Stratev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/types/vision/index.d.ts b/types/vision/index.d.ts index 2b0164cc0f..4257e0f7b9 100644 --- a/types/vision/index.d.ts +++ b/types/vision/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hapijs/vision // Definitions by: Jason Swearingen , AJP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import * as Hapi from 'hapi'; From ca4f0e634ba63a4e78303ac55627085e0a69a8c5 Mon Sep 17 00:00:00 2001 From: Eric Roos Date: Wed, 7 Jun 2017 15:38:33 +0200 Subject: [PATCH 166/761] fixed curryRight tests to not be the same as a mirrod curry --- types/lodash/lodash-tests.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 4f479eab83..44d6c834ac 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5674,15 +5674,14 @@ curryResult0 = _.curryRight(testCurryRightFn)(1, 2, 3); curryResult2 = _.curryRight(testCurryRightFn)(1); curryResult0 = _(testCurryRightFn).curryRight().value()(1, 2, 3); curryResult2 = _(testCurryRightFn).curryRight().value()(1); - -let curryResult7: _.CurriedFunction1; -let curryResult8: _.CurriedFunction2; -let curryResult9: _.CurriedFunction3; -curryResult3 = _.curryRight(testCurry2)(true, 2, "1"); -curryResult3 = _.curryRight(testCurry2)(true, 2)("1"); -curryResult3 = _.curryRight(testCurry2)(true)(2, "1"); +let curryResult7: _.RightCurriedFunction1; +let curryResult8: _.RightCurriedFunction2; +let curryResult9: _.RightCurriedFunction3; +curryResult3 = _.curryRight(testCurry2)("1", 2, true); +curryResult3 = _.curryRight(testCurry2)( 2,true)("1"); +curryResult3 = _.curryRight(testCurry2)(true)( "1",2); curryResult3 = _.curryRight(testCurry2)(true)(2)("1"); -curryResult7 = _.curryRight(testCurry2)(true, 2); +curryResult7 = _.curryRight(testCurry2)(2,true); curryResult7 = _.curryRight(testCurry2)(true)(2); curryResult8 = _.curryRight(testCurry2)(true); curryResult9 = _.curryRight(testCurry2); From 887a4e87b0e7db208fc68b76b9585b158f7b1ffd Mon Sep 17 00:00:00 2001 From: Berton Zhu Date: Wed, 7 Jun 2017 21:40:21 +0800 Subject: [PATCH 167/761] fix(redux-actions): createAction(actionType: string) and createAction(actionType: string) is incorrect. (#16643) also see #15697 --- types/redux-actions/index.d.ts | 6 +++++- types/redux-actions/redux-actions-tests.ts | 11 +++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/types/redux-actions/index.d.ts b/types/redux-actions/index.d.ts index b4aaa8474e..d5b825e28c 100644 --- a/types/redux-actions/index.d.ts +++ b/types/redux-actions/index.d.ts @@ -58,6 +58,10 @@ export type ActionFunction3 = (t1: T1, t2: T2, t3: T3) => R; export type ActionFunction4 = (t1: T1, t2: T2, t3: T3, t4: T4) => R; export type ActionFunctionAny = (...args: any[]) => R; +export function createAction( + actionType: string +): ActionFunction0>; + export function createAction( actionType: string, payloadCreator: ActionFunction0 @@ -85,7 +89,7 @@ export function createAction( export function createAction( actionType: string -): ActionFunctionAny>; +): ActionFunction1>; export function createAction( actionType: string, diff --git a/types/redux-actions/redux-actions-tests.ts b/types/redux-actions/redux-actions-tests.ts index f2d7cef7d1..e4c51aa662 100644 --- a/types/redux-actions/redux-actions-tests.ts +++ b/types/redux-actions/redux-actions-tests.ts @@ -110,8 +110,11 @@ const typedActionHandlerWithReduceMap = ReduxActions.handleAction('ACTION1'); -act('hello').payload === 'hello'; +const act0 = ReduxActions.createAction('ACTION0'); +act0().payload === null; + +const act1 = ReduxActions.createAction('ACTION1'); +act1('hello').payload === 'hello'; const act2 = ReduxActions.createAction('ACTION2', (s: {load: boolean}) => s); act2({load: true}).payload.load === true; @@ -119,7 +122,7 @@ act2({load: true}).payload.load === true; const act3 = ReduxActions.createAction('ACTION3', (s: string) => ({s})); act3('hello').payload.s === 'hello'; -ReduxActions.handleAction<{ hello: string }, string>(act, (state, action) => { +ReduxActions.handleAction<{ hello: string }, string>(act1, (state, action) => { return { hello: action.payload }; }, {hello: 'greetings'}); @@ -131,7 +134,7 @@ ReduxActions.handleAction(act3, (state, action) => { return { hello: action.payload.s }; }, {hello: 'greetings'}); -ReduxActions.handleAction(ReduxActions.combineActions(act, act3, act2), (state, action) => {}, 0); +ReduxActions.handleAction(ReduxActions.combineActions(act1, act3, act2), (state, action) => {}, 0); /* can't do this until it lands in 2.2, HKTs ReduxActions.handleAction(act, (state, action) => { From f7636dec131dff3f251c4bbcb07b035f33b19bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Goetz?= Date: Wed, 7 Jun 2017 15:42:05 +0200 Subject: [PATCH 168/761] [enhanced-resolve] update signature of synchronous calls (#16429) * [enhanced-resolve] update signature of synchronous calls, return string and not ResolveResult * [enhanced-resolve] Add my name to the definition * Fix recommended changes * onlyModule is optional Fixed following recommendation of @e-cloud --- types/enhanced-resolve/index.d.ts | 35 +++++++++++--------- types/enhanced-resolve/lib/Resolver.d.ts | 3 +- types/enhanced-resolve/lib/common-types.d.ts | 5 --- types/enhanced-resolve/test/index.ts | 23 +++++++++---- 4 files changed, 37 insertions(+), 29 deletions(-) diff --git a/types/enhanced-resolve/index.d.ts b/types/enhanced-resolve/index.d.ts index d773f52b16..aa85a8336f 100644 --- a/types/enhanced-resolve/index.d.ts +++ b/types/enhanced-resolve/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for enhanced-resolve v3.0.0 // Project: http://github.com/webpack/enhanced-resolve.git -// Definitions by: e-cloud +// Definitions by: e-cloud , Onigoetz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -8,7 +8,6 @@ import fs = require('fs'); import { - ResolveResult, LoggingCallbackWrapper, ResolverRequest, ResolveContext, @@ -19,31 +18,35 @@ import Resolver = require('./lib/Resolver'); import Tapable = require('tapable'); declare namespace Resolve { - function sync(path: string, request: string): ResolveResult; - function sync(context: ResolveContext, path: string, request: string): ResolveResult; + function sync(path: string, request: string): string; + function sync(context: ResolveContext, path: string, request: string): string; function context(path: string, request: string, callback: LoggingCallbackWrapper): void; function context(context: ResolveContext, path: string, request: string, callback: LoggingCallbackWrapper): void; namespace context { - function sync(path: string, request: string): ResolveResult; - function sync(context: ResolveContext, path: string, request: string): ResolveResult; + function sync(path: string, request: string): string; + function sync(context: ResolveContext, path: string, request: string): string; } function loader(path: string, request: string, callback: LoggingCallbackWrapper): void; function loader(context: ResolveContext, path: string, request: string, callback: LoggingCallbackWrapper): void; - namespace context { - function sync(path: string, request: string): ResolveResult; - function sync(context: ResolveContext, path: string, request: string): ResolveResult; + namespace loader { + function sync(path: string, request: string): string; + function sync(context: ResolveContext, path: string, request: string): string; } - function create(path: string, request: string, callback: LoggingCallbackWrapper): void; - function create(context: ResolveContext, path: string, request: string, callback: LoggingCallbackWrapper): void; + function create(options: ResolverFactory.ResolverOption): { + (path: string, request: string, callback: LoggingCallbackWrapper): void; + (context: ResolveContext, path: string, request: string, callback: LoggingCallbackWrapper): void; + } export namespace create { - function sync(path: string, request: string): ResolveResult; - function sync(context: ResolveContext, path: string, request: string): ResolveResult; + function sync(options: ResolverFactory.ResolverOption): { + (path: string, request: string): string; + (context: ResolveContext, path: string, request: string): string; + } } export namespace ResolverFactory { @@ -54,8 +57,8 @@ declare namespace Resolve { descriptionFiles?: string[]; enforceExtension?: boolean; enforceModuleExtension?: boolean; - extensions: string[]; - fileSystem: AbstractInputFileSystem; + extensions?: string[]; + fileSystem?: AbstractInputFileSystem; mainFields?: string[]; mainFiles?: string[]; moduleExtensions?: string[]; @@ -70,7 +73,7 @@ declare namespace Resolve { interface AliasItem { alias: string; name: string; - onlyModule: boolean; + onlyModule?: boolean; } function createResolver(options: ResolverOption): Resolver; } diff --git a/types/enhanced-resolve/lib/Resolver.d.ts b/types/enhanced-resolve/lib/Resolver.d.ts index 20fc1c0914..1799fba39b 100644 --- a/types/enhanced-resolve/lib/Resolver.d.ts +++ b/types/enhanced-resolve/lib/Resolver.d.ts @@ -2,7 +2,6 @@ import Tapable = require('tapable'); import { ResolveParseResult, - ResolveResult, ResolverRequest, LoggingCallbackWrapper, AbstractInputFileSystem, @@ -14,7 +13,7 @@ declare class Resolver extends Tapable { constructor(fileSystem: AbstractInputFileSystem); - resolveSync(context: ResolveContext, path: string, request: string): ResolveResult; + resolveSync(context: ResolveContext, path: string, request: string): string; resolve(context: ResolveContext, path: string, request: string, callback: LoggingCallbackWrapper): any; diff --git a/types/enhanced-resolve/lib/common-types.d.ts b/types/enhanced-resolve/lib/common-types.d.ts index 6607dee64f..b0ec925c0b 100644 --- a/types/enhanced-resolve/lib/common-types.d.ts +++ b/types/enhanced-resolve/lib/common-types.d.ts @@ -23,11 +23,6 @@ export interface ResolveContext { issuer?: string; } -export interface ResolveResult { - path: boolean | string; - query: string; -} - export interface ResolverRequest { context: ResolveContext; descriptionFileData?: DescriptionFileData; diff --git a/types/enhanced-resolve/test/index.ts b/types/enhanced-resolve/test/index.ts index dfd5087be4..aeec1d57d8 100644 --- a/types/enhanced-resolve/test/index.ts +++ b/types/enhanced-resolve/test/index.ts @@ -1,5 +1,5 @@ import resolve = require('enhanced-resolve'); -import { ResolveResult, AbstractInputFileSystem } from 'enhanced-resolve/lib/common-types' +import { AbstractInputFileSystem } from 'enhanced-resolve/lib/common-types' import Resolver = require('enhanced-resolve/lib/Resolver') resolve('lib', 'string', function (err) { }); @@ -20,19 +20,30 @@ const nfs = new resolve.NodeJsInputFileSystem(); const cfs = new resolve.CachedInputFileSystem(nfs, 4); -let result: ResolveResult +let result: string result = resolve.sync(context, 'path', 'string'); result = resolve.sync('path', 'string'); + +// Context + resolve.context('lib', 'string', function (err) { }); resolve.context(context, 'path', 'string', function () { }); result = resolve.context.sync(context, 'path', 'string'); result = resolve.context.sync('path', 'string'); -resolve.create('lib', 'string', function (err) { }); -resolve.create(context, 'path', 'string', function () { }); +// Loader -result = resolve.create.sync(context, 'path', 'string'); -result = resolve.create.sync('path', 'string'); +resolve.loader('lib', 'string', function (err) { }); +resolve.loader(context, 'path', 'string', function () { }); + +result = resolve.loader.sync(context, 'path', 'string'); +result = resolve.loader.sync('path', 'string'); + +// Create + +resolve.create({extensions: [".js", ".json", ".node"]})(context, 'path', 'string', function () { }); + +result = resolve.create.sync({mainFields: ["loader", "main"]})(context, 'path', 'string'); From 833819c1aa9d8951400084ab0f3eb6890cd77539 Mon Sep 17 00:00:00 2001 From: "McKeown, Brendan" Date: Wed, 7 Jun 2017 09:51:24 -0400 Subject: [PATCH 169/761] Numeral.js - use new RoundingFunction type in NumeralJsFormat interface format method --- types/numeral/index.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/types/numeral/index.d.ts b/types/numeral/index.d.ts index 83ed71bdec..5e2970a0e7 100644 --- a/types/numeral/index.d.ts +++ b/types/numeral/index.d.ts @@ -22,6 +22,7 @@ interface NumeralJSLocale { }; } +type RoundingFunction = (value: number) => number; // http://numeraljs.com/#custom-formats interface NumeralJsFormat { @@ -29,14 +30,12 @@ interface NumeralJsFormat { format: RegExp, unformat: RegExp, }, - format: (value: any, format: string, roundingFunction: Function) => string, + format: (value: any, format: string, roundingFunction: RoundingFunction) => string, unformat: (value: string) => number } type RegisterType = 'format' | 'locale'; -type RoundingFunction = (value: number) => number; - // http://numeraljs.com/#use-it interface Numeral { (value?: any): Numeral; From 75372e077bd4bc115ca6224a5938af7e83ad284d Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Wed, 7 Jun 2017 16:02:25 +0200 Subject: [PATCH 170/761] add tslint and fix all errors --- types/heremaps/index.d.ts | 1142 ++++++++++++++++++++---------------- types/heremaps/tslint.json | 6 + 2 files changed, 642 insertions(+), 506 deletions(-) create mode 100644 types/heremaps/tslint.json diff --git a/types/heremaps/index.d.ts b/types/heremaps/index.d.ts index 1a801d0414..05895c5d11 100644 --- a/types/heremaps/index.d.ts +++ b/types/heremaps/index.d.ts @@ -1,14 +1,16 @@ -// Type definitions for HERE Maps API for JavaScript 3.0s +// Type definitions for HERE Maps API for JavaScript 3.0 // Project: https://developer.here.com/ // Definitions by: Joshua Efiong +// Bernd Hacker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace H { /***** Map *****/ /** - * Map class defines map instance in the application. By creating this object you will initialize a visible map object which is attached to the provided dom element. Map class is an entry point to all operations related to layers, map objects and geo-screen transformations. By specifying options you can initialize map with predefined view. + * Map class defines map instance in the application. By creating this object you will initialize a visible map object which is attached to the provided dom element. + * Map class is an entry point to all operations related to layers, map objects and geo-screen transformations. By specifying options you can initialize map with predefined view. */ - export class Map extends H.util.EventTarget { + class Map extends H.util.EventTarget { /** * Constructor * @param element {Element} - html element into which the map will be rendered @@ -81,7 +83,8 @@ declare namespace H { getCameraDataForBounds(rect: H.geo.Rect): H.map.ViewModel.CameraData; /** - * This method returns current map viewport. Viewport can be used to modify padding and margin which will reflect the position of the viewport center and the amount of extra data loaded (for margin) + * This method returns current map viewport. + * Viewport can be used to modify padding and margin which will reflect the position of the viewport center and the amount of extra data loaded (for margin) * @returns {H.map.ViewPort} */ getViewPort(): H.map.ViewPort; @@ -105,7 +108,8 @@ declare namespace H { getImprint(): H.map.Imprint; /** - * This method captures desired region of the map and objects on it. Result is returned as an HTML5 Canvas element. Origin of coordinate system for capturing is in the top left corner of the viewport. + * This method captures desired region of the map and objects on it. Result is returned as an HTML5 Canvas element. + * Origin of coordinate system for capturing is in the top left corner of the viewport. * @param callback {function(HTMLCanvasElement=)} - Callback function to call once result of the capturing is ready * @param opt_capturables {Array=} - Collection of "capturable" element(s) to draw into the resulting canvas * @param opt_x1 {number=} - The X coordinate of the left edge of the capturing rectangle defaults to 0 @@ -113,7 +117,7 @@ declare namespace H { * @param opt_x2 {number=} - The X coordinate of the right edge of the capturing rectangle defaults to viewport width * @param opt_y2 {number=} - The Y coordinate of the bottom edge of the capturing rectangle defaults to viewport height */ - capture(callback?: (canvas: HTMLCanvasElement) => void, opt_capturables?: Array, opt_x1?: number, opt_y1?: number, opt_x2?: number, opt_y2?: number): void; + capture(callback?: (canvas: HTMLCanvasElement) => void, opt_capturables?: H.util.ICapturable[], opt_x1?: number, opt_y1?: number, opt_x2?: number, opt_y2?: number): void; /** * This method sets the rendering engine type for the map. Rendering engine is responsible for displaying i.e tiles and data on the map. @@ -123,7 +127,8 @@ declare namespace H { setEngineType(type: H.Map.EngineType): H.Map; /** - * To persistently store the content of a map layer for a given area and range of zoom levels. It can be used to enable map rendering when no internet connection is established and also to reduce the download traffic for frequently visited map areas. + * To persistently store the content of a map layer for a given area and range of zoom levels. + * It can be used to enable map rendering when no internet connection is established and also to reduce the download traffic for frequently visited map areas. * @param opt_onprogress {function(H.util.Request)=} - A callback which is invoked every time when the progress state of the returned store request changes. * @param opt_bounds {H.geo.Rect=} - The area to store, default is the current view bounds * @param opt_min {number=} - The minimum zoom level to store, default is the current zoom level @@ -209,21 +214,21 @@ declare namespace H { * This method retrieves the list of all objects which have been added to the map. * @returns {Array} - the list of all use objects which are currently on the map. */ - getObjects(): Array; + getObjects(): H.map.Object[]; /** * This method adds an array of objects or an object group to the map. * @param mapObjects {Array} * @returns {H.Map} - the map instance */ - addObjects(mapObjects: Array): H.Map; + addObjects(mapObjects: H.map.Object[]): H.Map; /** * This method removes an array of object or an object group from the map. * @param mapObjects {(Array | H.map.Group)} * @returns {H.Map} - the map instance */ - removeObjects(mapObjects: (Array | H.map.Group)): H.Map; + removeObjects(mapObjects: (H.map.Object[] | H.map.Group)): H.Map; /** * Returns the top most z-ordered map object found under the specific screen coordinates. Coordinates are viewport pixel coordinates starting from top left corner as (0, 0) point. @@ -239,7 +244,7 @@ declare namespace H { * @param y {number} - map viewport y-axis pixel coordinate * @returns {Array} */ - getObjectsAt(x: number, y: number): Array; + getObjectsAt(x: number, y: number): H.map.Object[]; /** * This method will dispatch event on the event target object @@ -257,16 +262,17 @@ declare namespace H { * @param callback {Function} - The callback function. * @param opt_scope {Object=} - An optional scope to call the callback in. */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; } - export module Map { + namespace Map { /** - * It defines the number of lower and higher zoom levels, where cached content of the base map is rendered while content of the current zoom level is still loading. Example: if range was set to {lower: 3, higher: 2} and current level is 10 then rendering engine will try to display cached tiles from lower zoom levels 7, 8, 9 and higher levels 11 and 12. + * It defines the number of lower and higher zoom levels, where cached content of the base map is rendered while content of the current zoom level is still loading. + * Example: if range was set to {lower: 3, higher: 2} and current level is 10 then rendering engine will try to display cached tiles from lower zoom levels 7, 8, 9 and higher levels 11 and 12. * @property lower {number} - The number of lower zoom levels to take into account, default is 0 * @property higher {number} - The number of higher zoom levels to take into account, default is 0 */ - export interface BackgroundRange { + interface BackgroundRange { lower: number; higher: number; } @@ -274,7 +280,7 @@ declare namespace H { /** * Types of engines */ - export enum EngineType { + enum EngineType { P2D, PANORAMA, } @@ -288,17 +294,19 @@ declare namespace H { * @property engineType: {H.Map.EngineType=} - The initial engine type to use, default is P2D * @property pixelRatio {number} - The pixelRatio to use for over-sampling in cases of high-resolution displays, default is 1 * @property imprint {H.map.Imprint.Options=} - The imprint options or null to suppress the imprint - * @property renderBaseBackground {H.Map.BackgroundRange=} - Object describes how many cached zoom levels should be used as a base map background while base map tiles are loading. Example: {lower: 3, higher: 2} - * @property autoColor {boolean=} - Indicates whether the UI's colors should automatically adjusted to the base layer, default is true. Up to now only the copyright style will be adjusted. See H.map.layer.Layer.Options#dark + * @property renderBaseBackground {H.Map.BackgroundRange=} - Object describes how many cached zoom levels should be used as a base map background while base map tiles are loading. + * Example: {lower: 3, higher: 2} + * @property autoColor {boolean=} - Indicates whether the UI's colors should automatically adjusted to the base layer, default is true. Up to now only the copyright style will be adjusted. + * See H.map.layer.Layer.Options#dark * @property margin {number=} - The size in pixel of the supplemental area to render for each side of the map * @property padding {H.map.ViewPort.Padding=} - The padding in pixels for each side of the map * @property fixedCenter {boolean=} - Indicates whether the center of the map should remain unchanged if the viewport's size or padding has been changed, default is true */ - export interface Options { + interface Options { center?: H.geo.IPoint; zoom?: number; bounds?: H.geo.Rect; - layers?: Array; + layers?: H.map.layer.Layer[]; engineType?: EngineType; pixelRatio?: number; imprint?: H.map.Imprint.Options; @@ -311,7 +319,7 @@ declare namespace H { } /***** clustering *****/ - export module clustering { + namespace clustering { /** * This class represents the input data structure for data points to be clustered. * @property lat {H.geo.Latitude} - The latitude coordinate of the data point's position @@ -319,7 +327,7 @@ declare namespace H { * @property wt {number} - The weight of the data point * @property data {*} - Data associated with this data point */ - export class DataPoint implements H.geo.IPoint { + class DataPoint implements H.geo.IPoint { /** * Constructor * @param lat {H.geo.Latitude} - The latitude coordinate of the data point's position @@ -340,7 +348,7 @@ declare namespace H { /** * This interface describes a cluster of data points, which fulfill the clustering specification (i.e. data points are within the epsilon and there are enough points to form a cluster). */ - export interface ICluster { + interface ICluster { /** * Returns the maximum zoom level where this cluster doesn't fall apart into sub clusters and/or noise poinst * @returns {number} @@ -354,7 +362,8 @@ declare namespace H { getBounds(): H.geo.Rect; /** - * Invokes the specified callback for each "entry" of the cluster. That "entry" can be either a cluster which implements H.clustering.ICluster interface or a noise point which implements H.clustering.INoisePoint interface. + * Invokes the specified callback for each "entry" of the cluster. + * That "entry" can be either a cluster which implements H.clustering.ICluster interface or a noise point which implements H.clustering.INoisePoint interface. * @param callback {function(H.clustering.IResult)} - The callback gets the currently traversed entry as an argument, which is cluster or noise point. */ forEachEntry(callback: (result: H.clustering.IResult) => void): void; @@ -393,7 +402,7 @@ declare namespace H { /** * This interface represents a data point which does not belong to a cluster. */ - export interface INoisePoint { + interface INoisePoint { /** * This method returns data which coresponds to this noise point. * @returns {*} @@ -428,8 +437,7 @@ declare namespace H { /** * This interface represents the result item of a clustering operation. */ - export interface IResult { - + interface IResult { /** * Returns the geographical position of this cluster result. * @returns {H.geo.Point} @@ -458,8 +466,7 @@ declare namespace H { /** * Interface which specifies the methods a theme must implement. */ - export interface ITheme { - + interface ITheme { /** * Function returns a cluster presentation as a map object. * @param cluster {H.clustering.ICluster} @@ -476,17 +483,18 @@ declare namespace H { } /** - * The clustering provider serves clusters and noise point representation for the map depending on the provided data set. Levels for clustering as well as custom cluster representation can be set via Options. + * The clustering provider serves clusters and noise point representation for the map depending on the provided data set. + * Levels for clustering as well as custom cluster representation can be set via Options. * @property min {number} - Minimum zoom level at which provider can cluster data * @property max {number} - Maximum zoom level at which provider can cluster data */ - export class Provider extends H.util.EventTarget { + class Provider extends H.util.EventTarget { /** * Constructor * @param dataPoints {Array} * @param opt_options {H.clustering.Provider.Options=} */ - constructor(dataPoints: Array, opt_options?: H.clustering.Provider.Options); + constructor(dataPoints: H.clustering.DataPoint[], opt_options?: H.clustering.Provider.Options); /** * This method will dispatch event on the event target object @@ -504,13 +512,13 @@ declare namespace H { * @param callback {Function} * @param opt_scope {Object=} */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; /** * This method sets new data to the provider * @param dataPoints {Array} */ - setDataPoints(dataPoints: Array): void; + setDataPoints(dataPoints: H.clustering.DataPoint[]): void; /** * This method adds a data point to the provider. Beware that this method provokes reclustering of the whole data set. @@ -522,7 +530,7 @@ declare namespace H { * This method adds a list of data points to the provider. Beware that this method provokes reclustering of the whole data set. * @param dataPoints {Array} */ - addDataPoints(dataPoints: Array): void; + addDataPoints(dataPoints: H.clustering.DataPoint[]): void; /** * This method removes a data point from the provider. Beware that this method provokes reclustering of the whole data set. @@ -556,7 +564,7 @@ declare namespace H { * @param cacheOnly {boolean} - Indicates whether only cached objects are to be considered * @returns {Array} - a list of intersecting objects */ - requestDomMarkers(bounds: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): Array; + requestDomMarkers(bounds: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): H.map.DomMarker[]; /** * This method always returns true as we don't have information about visual representation until we have the clustering result and apply the theme. @@ -572,7 +580,7 @@ declare namespace H { * @param cacheOnly {boolean} - Indicates whether only cached objects are to be considered * @returns {Array} - a list of intersecting objects */ - requestMarkers(bounds: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): Array; + requestMarkers(bounds: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): H.map.Marker[]; /** * This method always returns true as we don't have information about visual representation until we have the clustering result and apply the theme. @@ -588,7 +596,7 @@ declare namespace H { * @param cacheOnly {boolean} - Indicates whether only cached objects are to be considered * @returns {Array} - a list of intersecting objects */ - requestSpatials(bounds: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): Array; + requestSpatials(bounds: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): H.map.Spatial[]; /** * Returns the spatial objects which intersect the given tile @@ -597,7 +605,7 @@ declare namespace H { * @param cacheOnly {boolean} - Indicates whether only cached objects are to be considered * @returns {Array} - a list of intersecting objects */ - requestSpatialsByTile(tile: H.map.provider.Tile, visiblesOnly: boolean, cacheOnly: boolean): Array; + requestSpatialsByTile(tile: H.map.provider.Tile, visiblesOnly: boolean, cacheOnly: boolean): H.map.Spatial[]; /** * Returns the accumulate invalidations of this provider's objects that have occurred. @@ -616,15 +624,16 @@ declare namespace H { max: number; } - export module Provider { + namespace Provider { /** * Options which are used within cluster calculations. - * @property eps {number=} - epsilon parameter for cluster calculation. For the FASTGRID strategy it must not exceed 256 and must take values that are power of 2. For the GRID and DYNAMICGRID strategies it can take values from 10 to 127. Default is 32. + * @property eps {number=} - epsilon parameter for cluster calculation. For the FASTGRID strategy it must not exceed 256 and must take values that are power of 2. + * For the GRID and DYNAMICGRID strategies it can take values from 10 to 127. Default is 32. * @property minWeight {number=} - the minimum points weight sum to form a cluster, default is 2 * @property projection {H.geo.IProjection=} - projection to use for clustering, default is H.geo.mercator * @property strategy {H.clustering.Provider.Strategy=} - clustering stretegy, defaults to H.clustering.Provider.Strategy.FASTGRID */ - export interface ClusteringOptions { + interface ClusteringOptions { eps?: number; minWeight?: number; projection?: H.geo.IProjection; @@ -638,7 +647,7 @@ declare namespace H { * @property clusteringOptions {H.clustering.Provider.ClusteringOptions=} - options for clustering algorithm * @property theme {H.clustering.ITheme=} - cluster and noise point graphical representation */ - export interface Options { + interface Options { min?: number; max?: number; clusteringOptions?: H.clustering.Provider.ClusteringOptions; @@ -646,9 +655,12 @@ declare namespace H { } /** - * Enumeration represents possible clustering strategies. FASTGRID clustering is the efficient way to cluster large sets of data points. GRID clustering is slower but has greater precision due to the bigger range of epsilon values, this strategy suitable for clustering smaller data sets (up to 1000 data points) on desktop devices. DYNAMICGRID clustering uses the same algorithm of clustering as the GRID, but clusters on the viewport basis is meant to be used with data sets that are subject to the frequent update operations. + * Enumeration represents possible clustering strategies. FASTGRID clustering is the efficient way to cluster large sets of data points. + * GRID clustering is slower but has greater precision due to the bigger range of epsilon values, this strategy suitable for clustering smaller data sets (up to 1000 data points) + * on desktop devices. DYNAMICGRID clustering uses the same algorithm of clustering as the GRID, but clusters on the viewport basis is meant to be used with data sets that are subject + * to the frequent update operations. */ - export enum Strategy { + enum Strategy { FASTGRID, GRID, DYNAMICGRID, @@ -657,11 +669,11 @@ declare namespace H { } /***** data *****/ - export module data { + namespace data { /** * An abstract reader class defines interface for data readers and has general functionality related to fetching data and reader events. */ - export class AbstractReader extends H.util.EventTarget { + class AbstractReader extends H.util.EventTarget { /** * Constructor * @param opt_url {string=} @@ -669,7 +681,8 @@ declare namespace H { constructor(opt_url?: string); /** - * Method returns H.map.layer.ObjectLayer that contains parsed data, and can be added directly to the map. It returns new instance of the class with every invocation. If data hasn't been parsed it will return H.map.layer.ObjectLayer that contains partial information, and reader will add new parsed objects to the layer's provider later on. + * Method returns H.map.layer.ObjectLayer that contains parsed data, and can be added directly to the map. It returns new instance of the class with every invocation. + * If data hasn't been parsed it will return H.map.layer.ObjectLayer that contains partial information, and reader will add new parsed objects to the layer's provider later on. * @returns {H.map.layer.ObjectLayer} */ getLayer(): H.map.layer.ObjectLayer; @@ -678,7 +691,7 @@ declare namespace H { * Method returns collection of currently parsed, and converted to H.map.Object data objects. Method returns only currently parsed objects if parsing is ongoing. * @returns {Array} */ - getParsedObjects(): Array; + getParsedObjects(): H.map.Object[]; /** * Returns URL of the current file, which is either in process of fetching/parsing or file that has been already parsed. @@ -687,7 +700,8 @@ declare namespace H { getUrl(): string | void; /** - * Method sets reader's URL. Method resets current Reader's state to its initial values (clears data about last parsed objects, etc.), and throws InvalidState exception if Reader's state is not READY or ERROR. + * Method sets reader's URL. Method resets current Reader's state to its initial values (clears data about last parsed objects, etc.), and throws + * InvalidState exception if Reader's state is not READY or ERROR. * @param url {string} - The new URL * @returns {H.data.AbstractReader} */ @@ -700,16 +714,17 @@ declare namespace H { getState(): H.data.AbstractReader.State; /** - * Method launches parsing of the data file at the current url (see H.data.AbstractReader#setUrl or H.data.AbstractReader). Method uses XHR as a transport therefore same origin policy applies, or server should respond with proper CORS headers. + * Method launches parsing of the data file at the current url (see H.data.AbstractReader#setUrl or H.data.AbstractReader). + * Method uses XHR as a transport therefore same origin policy applies, or server should respond with proper CORS headers. */ parse(): void; } - export module AbstractReader { + namespace AbstractReader { /** * The event class for state events that are dispatched by AbstractReader */ - export class Event extends H.util.Event { + class Event extends H.util.Event { /** * Constructor * @param target {(H.data.AbstractReader | H.map.Object)} - The target that's passed to event listeners @@ -723,7 +738,7 @@ declare namespace H { /** * The state types of an Reader. Possible states are: */ - export enum State { + enum State { ERROR, LOADING, VISIT, @@ -733,16 +748,16 @@ declare namespace H { } /***** geo *****/ - export module geo { + namespace geo { /** * A Geographic coordinate that specifies the height of a point in meters. A value of undefined is treated as 0. */ - export type Altitude = number; + type Altitude = number; /** * Contexts for altitudes to specify the contextual origin of an altitude's value */ - export enum AltitudeContext { + enum AltitudeContext { /** Ground level */ undefined, /** Ground level */ @@ -766,14 +781,14 @@ declare namespace H { * @property alt {H.geo.Altitude=} - The altitude coordinate. * @property ctx {H.geo.AltitudeContext=} - The altitude context. */ - export interface IPoint { + interface IPoint { lat: H.geo.Latitude; lng: Longitude; alt?: H.geo.Altitude; ctx?: H.geo.AltitudeContext; } - export interface IProjection { + interface IProjection { latLngToPoint(lat: number, lng: number, opt_out?: H.math.Point): H.math.Point; xyToGeo(x: number, y: number, opt_out?: H.geo.Point): H.geo.Point; pointToGeo(point: H.math.IPoint, opt_out?: H.geo.Point): H.geo.Point; @@ -783,12 +798,12 @@ declare namespace H { /** * A geographic coordinate that specifies the north-south position of a point on the Earth's surface in the range from -90 to + 90 degrees, inclusive. */ - export type Latitude = number; + type Latitude = number; /** * A Geographic coordinate that specifies the east-west position of a point on the Earth's surface in the range from -180 to 180 degrees, inclusive. */ - export type Longitude = number; + type Longitude = number; /** * Class represents a geographical point, which is defined by the latitude, longitude and optional altitude. @@ -797,7 +812,7 @@ declare namespace H { * @property alt {H.geo.Altitude} - The altitude coordinate. * @property ctx {H.geo.AltitudeContext} - The altitude context. */ - export class Point implements IPoint { + class Point implements IPoint { /** * Constructor * @property lat {H.geo.Latitude} - The latitude coordinate. @@ -822,7 +837,8 @@ declare namespace H { distance(other: IPoint): number; /** - * This method calculates the geographic point of a destination point using the distance and bearing specified by the caller. The altitude is ignored, instead the WGS84 Mean Radius is taken. + * This method calculates the geographic point of a destination point using the distance and bearing specified by the caller. + * The altitude is ignored, instead the WGS84 Mean Radius is taken. * @param bearing {number} - The bearing to use in the calculation in degrees. * @param distance {number} - The distance to the destination in meters. * @param opt_overGreatCircle {boolean=} - If true the computation uses the 'Great Circle' otherwise 'Rhumb Line'. @@ -831,13 +847,14 @@ declare namespace H { walk(bearing: number, distance: number, opt_overGreatCircle?: boolean): Point; /** - * This method validates the given IPoint. It checks, if lat, lng, alt and ctx have valid types. Additionally the value of the lat property is clamped into a range of -90 ... +90 and the value of the lng property is modulo into a range of -180 ... +180 plus validates the values of the alt and ctx properties + * This method validates the given IPoint. It checks, if lat, lng, alt and ctx have valid types. Additionally the value of the lat property is clamped into a range of -90 ... +90 + * and the value of the lng property is modulo into a range of -180 ... +180 plus validates the values of the alt and ctx properties * @param point {H.geo.IPoint} - The point to validate * @param opt_caller {Function=} - The caller to use for InvalidArgumentError. If omitted no error is thrown * @param opt_argNr {number=} - The argument number to use for InvalidArgumentError. * @returns {boolean} - if the given point could validate */ - static validate(point: IPoint, opt_caller?: Function, opt_argNr?: number): boolean; + static validate(point: IPoint, opt_caller?: () => void, opt_argNr?: number): boolean; /** * This method creates a Point instance from a given IPoint object. @@ -855,7 +872,7 @@ declare namespace H { /** * This class represents a rectangular geographic area. The area is defined by four geographical coordinates two (left, right) longitudes and two (top, bottom) latitudes. */ - export class Rect { + class Rect { /** * Constructor * @param top {H.geo.Latitude} - the northern-most latitude @@ -1030,7 +1047,8 @@ declare namespace H { * @param opt_out {H.geo.Rect=} - an optional rect to store the results * @returns {H.geo.Rect} - either the opt_out rect or a new rect */ - static merge(topA: H.geo.Latitude, leftA: H.geo.Longitude, bottomA: H.geo.Latitude, rightA: H.geo.Longitude, topB: H.geo.Latitude, leftB: H.geo.Longitude, bottomB: H.geo.Latitude, rightB: H.geo.Longitude, opt_out?: H.geo.Rect): H.geo.Rect; + static merge(topA: H.geo.Latitude, leftA: H.geo.Longitude, bottomA: H.geo.Latitude, rightA: H.geo.Longitude, topB: H.geo.Latitude, leftB: H.geo.Longitude, bottomB: H.geo.Latitude, + rightB: H.geo.Longitude, opt_out?: H.geo.Rect): H.geo.Rect; /** * This method creates a rectangular area from a top-left and bottom-right point pair. @@ -1047,7 +1065,7 @@ declare namespace H { * @param opt_skipValidation {boolean=} - a boolean flag indicating whether to check validity of the arguments * @returns {H.geo.Rect} - returns the minimum rectangular area covering the points or null if no point is covered */ - static coverPoints(pointArray: Array, opt_skipValidation?: boolean): H.geo.Rect; + static coverPoints(pointArray: H.geo.IPoint[], opt_skipValidation?: boolean): H.geo.Rect; /** * This method creates the minimum rectangular area covering all of the coordinates in the argument array. @@ -1055,7 +1073,7 @@ declare namespace H { * @param opt_skipValidation {boolean=} - a boolean flag indicating whether to check validity of the arguments * @returns {(H.geo.Rect | undefined)} - returns the minimum rectangular area covering the coordinates */ - static coverLatLngAlts(latLngAltArray: Array, opt_skipValidation?: boolean): H.geo.Rect | void; + static coverLatLngAlts(latLngAltArray: number[], opt_skipValidation?: boolean): H.geo.Rect | void; /** * This method creates the minimum rectangular area covering all of the rectangular areas in the argument array. @@ -1063,7 +1081,7 @@ declare namespace H { * @param opt_skipValidation {boolean=} - a boolean flag indicating whether to check validity of the arguments * @returns {(H.geo.Rect | undefined)} - returns the minimum rectangular area covering the rectangular areas */ - static coverRects(rectArray: Array, opt_skipValidation?: boolean): H.geo.Rect | void; + static coverRects(rectArray: H.geo.Rect[], opt_skipValidation?: boolean): H.geo.Rect | void; /** * This method clones the given bounding rect and resizes the clone if necessary until the location supplied by the caller is at its center. @@ -1077,13 +1095,13 @@ declare namespace H { /** * A strip is a flat list of latitude, longitude, altitude tuples in a fixed order. */ - export class Strip { + class Strip { /** * Constructor * @param opt_latLngAlts {Array=} - An optional array of latitude, longitude and altitude triples to initialize the strip with. * @param opt_ctx {H.geo.AltitudeContext=} - An optional altitude context for all altitudes contained in this strip. */ - constructor(opt_latLngAlts?: Array, opt_ctx?: H.geo.AltitudeContext); + constructor(opt_latLngAlts?: number[], opt_ctx?: H.geo.AltitudeContext); /** * This method pushes a lat, lng, alt to the end of this strip. @@ -1100,7 +1118,7 @@ declare namespace H { * @param opt_latLngAlts {Array=} - The lat, lng, alt values to add * @returns {Array} - an array of removed elements */ - spliceLatLngAlts(index: number, opt_nRemove?: number, opt_latLngAlts?: Array): Array; + spliceLatLngAlts(index: number, opt_nRemove?: number, opt_latLngAlts?: number[]): number[]; /** * This method inserts one set of lat, lng, alt values into the strip at the specified index. @@ -1145,7 +1163,8 @@ declare namespace H { extractPoint(pointIndex: number, opt_out?: H.geo.Point): H.geo.Point; /** - * This method is a utility method that iterates over the lat, lng, alt array and calls the provided function for each 3 elements passing lat, lng and alt and the virtual point index as arguments. + * This method is a utility method that iterates over the lat, lng, alt array and calls the provided function for each 3 elements passing lat, lng and alt and the virtual point + * index as arguments. * @param eachFn {function(H.geo.Latitude, H.geo.Longitude, H.geo.Altitude, number)} - the function to be called for each 3 elements * @param opt_start {number=} - an optional start index to iterate from * @param opt_end {number=} - an optional end index to iterate to @@ -1169,7 +1188,7 @@ declare namespace H { * This method returns the internal array keeping the lat, lng, alt values. Modifying this array directly can destroy the integrity of this strip. Use it only for read access. * @returns {Array} - returns the raw lat, lng, alt values of this strip */ - getLatLngAltArray(): Array; + getLatLngAltArray(): number[]; /** * This method returns the bounding box of this strip. @@ -1190,18 +1209,18 @@ declare namespace H { * @param latLngs {Array} - the array of lat, lng value. * @returns {H.geo.Strip} - the strip containing the lat, lng values */ - static fromLatLngArray(latLngs: Array): H.geo.Strip; + static fromLatLngArray(latLngs: number[]): H.geo.Strip; } } /***** lang *****/ /***** map *****/ - export module map { + namespace map { /** * This class represents marker, which offers a means of identifying a location on the map with an icon. */ - export class AbstractMarker extends H.map.Object { + class AbstractMarker extends H.map.Object { /** * Constructor * @param position {H.geo.IPoint} - The location of this marker @@ -1236,18 +1255,19 @@ declare namespace H { setIcon(icon: (H.map.Icon | H.map.DomIcon)): H.map.AbstractMarker; } - export module AbstractMarker { + namespace AbstractMarker { /** * Options used to initialize a AbstractMarker * @property min {number=} - The minimum zoom level for which the object is visible, default is -Infinity * @property max {number=} - The maximum zoom level for which the object is visible, default is Infinity * @property visibility {boolean=} - Indicates whether the map object is visible at all, default is true. * @property zIndex {number=} - The z-index value of the map object, default is 0 - * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. + * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. + * This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. * @property icon {(H.map.Icon | H.map.DomIcon)=} - The icon to use for the visual representation, if omitted a default icon is used. * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData. */ - export interface Options { + interface Options { min?: number; max?: number; visibility?: boolean; @@ -1261,7 +1281,7 @@ declare namespace H { /** * This class represents style attributes for arrows to be rendered along a polyline. A ArrowStyle instance is always treated as immutable to avoid inconstiencies and must not modified. */ - export class ArrowStyle { + class ArrowStyle { /** * Constructor * @param opt_options {(H.map.ArrowStyle | H.map.ArrowStyle.Options)=} @@ -1276,15 +1296,18 @@ declare namespace H { equals(other: (H.map.ArrowStyle | H.map.ArrowStyle.Options)): boolean; } - export module ArrowStyle { + namespace ArrowStyle { /** * An object type to specify the style of arrows to render along a polyline * @property fillColor {string=} - The CSS color value used to fill the arrow shapes. If omitted or the value evaluates to false it defaults to "rgba(255, 255, 255, 0.75)" - * @property width {number=} - The width of the arrow shape. The value is taken as a factor of the width of the line, where the arrow description is applied. If omitted or the value is <= 0 it defaults to 1.2 - * @property length {number=} - The length of the arrow shapes. The value is taken as a factor of the width of the line at the end of which the arrow is drawn. If omitted or the value is <= 0 it defaults to 1.6 - * @property frequency {number=} - The frequency of arrow shapes. The value is taken as factor of the length of the arrow. A value of 1 results in gapless arrows. If omitted or the value is false it defaults to 5 + * @property width {number=} - The width of the arrow shape. The value is taken as a factor of the width of the line, where the arrow description is applied. + * If omitted or the value is <= 0 it defaults to 1.2 + * @property length {number=} - The length of the arrow shapes. The value is taken as a factor of the width of the line at the end of which the arrow is drawn. + * If omitted or the value is <= 0 it defaults to 1.6 + * @property frequency {number=} - The frequency of arrow shapes. The value is taken as factor of the length of the arrow. A value of 1 results in gapless arrows. + * If omitted or the value is false it defaults to 5 */ - export interface Options { + interface Options { fillColor?: string; width?: number; length?: number; @@ -1295,17 +1318,18 @@ declare namespace H { /** * A Polygon with a circular shape. */ - export class Circle extends H.map.Polygon { + class Circle extends H.map.Polygon { /** * Constructor * @param center {H.geo.IPoint} - The geographical coordinates of the circle's center * @param radius {number} - The radius of the circle in meters - * @param opt_options {H.map.Circle.Options=} - An object that specifies circle options and their initial values (among these, precision has a significant impact on the shape of the circle - please see + * @param opt_options {H.map.Circle.Options=} - An object that specifies circle options and their initial values (among these, precision has a significant impact on the shape of the circle */ constructor(center: H.geo.IPoint, radius: number, opt_options?: H.map.Circle.Options); /** - * To set the geographical center point of this circle. If the specified center is an instance of H.geo.Point you must not modify this Point instance without calling setCenter immediately afterwards. + * To set the geographical center point of this circle. If the specified center is an instance of H.geo.Point you must not modify this Point instance without calling setCenter + * immediately afterwards. * @param center {H.geo.IPoint} */ setCenter(center: H.geo.IPoint): void; @@ -1341,18 +1365,22 @@ declare namespace H { getPrecision(): number; } - export module Circle { + namespace Circle { /** * @property style {H.map.SpatialStyle=} - the style to be used when tracing the polyline * @property visibility {boolean=} - An optional boolean value indicating whether this map object is visible, default is true - * @property precision {number=} - The precision of a circle as a number of segments to be used when rendering the circle. The value is clamped to the range between [4 ... 360], where 60 is the default. Note that the lower the value the more angular and the less circle-like the shape appears and, conversely, the higher the value the smoother and more rounded the result. Thus, starting at the extreme low end of the possible values, 4 produces a square, 6 a hexagon, while 30 results in a circle-like shape, although it appears increasingly angular as the zoom level increases (as you zoom in), and finally 360 produces a smooth circle. + * @property precision {number=} - The precision of a circle as a number of segments to be used when rendering the circle. The value is clamped to the range between [4 ... 360], where 60 is + * the default. Note that the lower the value the more angular and the less circle-like the shape appears and, conversely, the higher the value the smoother and more rounded the result. + * Thus, starting at the extreme low end of the possible values, 4 produces a square, 6 a hexagon, while 30 results in a circle-like shape, although it appears increasingly angular as + * the zoom level increases (as you zoom in), and finally 360 produces a smooth circle. * @property zIndex {number=} - The z-index value of the circle, default is 0 * @property min {number=} - The minimum zoom level for which the circle is visible, default is -Infinity * @property max {number=} - The maximum zoom level for which the circle is visible, default is Infinity - * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. + * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. + * This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData */ - export interface Options { + interface Options { style?: H.map.SpatialStyle | H.map.SpatialStyle.Options; visibility?: boolean; precision?: number; @@ -1365,20 +1393,21 @@ declare namespace H { } /** - * The class represents data model of the map. It holds list of layers that are rendered by map's RenderEngine. The class listens to 'update' events from layers and dispatches them to the RenderEngine. + * The class represents data model of the map. It holds list of layers that are rendered by map's RenderEngine. + * The class listens to 'update' events from layers and dispatches them to the RenderEngine. */ - export class DataModel extends H.util.OList { + class DataModel extends H.util.OList { /** * Constructor * @param opt_layers {Array=} - array of layers to be added to the data model */ - constructor(opt_layers?: Array); + constructor(opt_layers?: H.map.layer.Layer[]); } /** * A visual representation of the H.map.DomMarker. */ - export class DomIcon { + class DomIcon { /** * Constructor * @param element {!(Element | string)} - The element or markup to use for this icon @@ -1387,22 +1416,25 @@ declare namespace H { constructor(element: (Element | string), opt_options?: H.map.DomIcon.Options); } - export module DomIcon { + namespace DomIcon { /** * Options used to initialize a DomIcon - * @property onAttach {function(Element, H.map.DomIcon, H.map.DomMarker)=} - A callback which is invoked before a clone of the icon's element is appended and displayed on the map. This callback can be used to setup the clone. - * @property onDetach {function(Element, H.map.DomIcon, H.map.DomMarker)=} - A callback which is invoked after a clone of the icon's element is removed from the map. This callback can be used to clean up the clone. + * @property onAttach {function(Element, H.map.DomIcon, H.map.DomMarker)=} - A callback which is invoked before a clone of the icon's element is appended and displayed on the map. + * This callback can be used to setup the clone. + * @property onDetach {function(Element, H.map.DomIcon, H.map.DomMarker)=} - A callback which is invoked after a clone of the icon's element is removed from the map. + * This callback can be used to clean up the clone. */ - export interface Options { - onAttach?: (el: Element, icon: H.map.DomIcon, marker: H.map.DomMarker) => void; - onDetach?: (el: Element, icon: H.map.DomIcon, marker: H.map.DomMarker) => void; + interface Options { + onAttach?(el: Element, icon: H.map.DomIcon, marker: H.map.DomMarker): void; + onDetach?(el: Element, icon: H.map.DomIcon, marker: H.map.DomMarker): void; } } /** - * A marker with a visual representation in the form of a full styleable and scripteable DOM element. DomMarker are predestinated if small amounts of markers with dynamic styled and/or scripted icons should be displayed om the map (e.g. animated interactive SVG). + * A marker with a visual representation in the form of a full styleable and scripteable DOM element. DomMarker are predestinated if small amounts of markers with dynamic styled and/or + * scripted icons should be displayed om the map (e.g. animated interactive SVG). */ - export class DomMarker extends H.map.AbstractMarker { + class DomMarker extends H.map.AbstractMarker { /** * Constructor * @param position {H.geo.IPoint} @@ -1411,18 +1443,19 @@ declare namespace H { constructor(position: H.geo.IPoint, opt_options?: H.map.DomMarker.Options); } - export module DomMarker { + namespace DomMarker { /** * Options used to initialize a DomMarker * @property min {number=} - The minimum zoom level for which the object is visible, default is -Infinity * @property max {number=} - The maximum zoom level for which the object is visible, default is Infinity * @property visibility {boolean=} - Indicates whether the map object is visible at all, default is true. * @property zIndex {number=} - The z-index value of the map object, default is 0 - * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. + * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to + * instantiate an object. * @property icon {H.map.DomIcon=} - The icon to use for the visual representation, if omitted a default icon is used. * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData */ - export interface Options { + interface Options { min?: number; max?: number; visibility?: boolean; @@ -1436,7 +1469,7 @@ declare namespace H { /** * This class represents a spatial shape in geographic space. It is defined by a path containing the vertices of the shape (lat, lng, alt values). */ - export class GeoShape extends H.map.Spatial { + class GeoShape extends H.map.Spatial { /** * Constructor * @param isClosed {boolean} - Indicates whether this geographical shape is closed (a polygon) @@ -1468,7 +1501,7 @@ declare namespace H { /** * This class represents a map object which can contain other map objects. It's visibility, zIndex and object-order influences the contained map objects */ - export class Group extends H.map.Object { + class Group extends H.map.Object { /** * Constructor * @param opt_options {H.map.Group.Options=} - an optional object containing initialization values @@ -1488,7 +1521,7 @@ declare namespace H { * @param opt_recursive {boolean=} - Indicates whether objects in sub-groups are also collected . * @returns {!Array} */ - getObjects(opt_recursive?: boolean): Array; + getObjects(opt_recursive?: boolean): H.map.Object[]; /** * Method returns the bounding rectangle for the group. The rectangle is the smallest rectangle that covers all objects. If group doesn't contains objects method returns null. @@ -1507,7 +1540,7 @@ declare namespace H { * Appends a list of objects to this group * @param objects {Array} */ - addObjects(objects: Array): void; + addObjects(objects: H.map.Object[]): void; /** * Removes an object from this group. @@ -1520,7 +1553,7 @@ declare namespace H { * Removes objects from this group. * @param objects {!Array} - The list of objects to remove */ - removeObjects(objects: Array): void; + removeObjects(objects: H.map.Object[]): void; /** * Method removes all objects from the group. @@ -1528,45 +1561,46 @@ declare namespace H { removeAll(): void; } - export module Group { + namespace Group { /** * Options used to initialize a group * @property min {number=} - The minimum zoom level for which the object is visible, default is -Infinity * @property max {number=} - The maximum zoom level for which the object is visible, default is Infinity * @property visibility {boolean=} - Indicates whether the map object is visible, default is true * @property zIndex {number=} - The z-index value of the map object, default is 0 - * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. + * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate + * an object. * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData. * @property objects {Array=} - A list of map objects to add initially to this group. */ - export interface Options { + interface Options { min?: number; max?: number; visibility?: boolean; zIndex?: number; provider?: H.map.provider.Provider; data?: any; - objects?: Array; + objects?: H.map.Object[]; } } /** * This class represents an area that objects, like a marker, occupies in the screen space, meaning that object can be probed and returned by H.Map@getObjectsAt method. */ - export class HitArea { + class HitArea { /** * Constructor * @param shapeType {H.map.HitArea.ShapeType} - The shape type of the HitArea * @param opt_values {Array=} - The type-dependent values to define the shape of the hit area. The format for the different types are: */ - constructor(shapeType: H.map.HitArea.ShapeType, opt_values?: Array); + constructor(shapeType: H.map.HitArea.ShapeType, opt_values?: number[]); } - export module HitArea { + namespace HitArea { /** * Enumeration represents possible shape types that HitArea can have. */ - export enum ShapeType { + enum ShapeType { NONE, RECT, CIRCLE, @@ -1577,8 +1611,7 @@ declare namespace H { /** * Control interface defines method which are used for direct view or camera manipulation */ - export interface IControl { - + interface IControl { /** * This method starts control action for camera. This action allows to control camera animation and movement according to provided values in the H.map.IControl#control function * @param opt_kinetics {H.util.kinetics.IKinetics=} - kinetics settings @@ -1588,7 +1621,8 @@ declare namespace H { startControl(opt_kinetics?: H.util.kinetics.IKinetics, opt_atX?: number, opt_atY?: number): void; /** - * This method triggers single control action on engine. This will trigger an animation which will start modification of the view's or camera's properties according to values begin set. Modification will occur at every frame. The speed values are measure by 'levels per frame' were 1 level cooresponds to a distance to next zoom level. + * This method triggers single control action on engine. This will trigger an animation which will start modification of the view's or camera's properties according to values begin set. + * Modification will occur at every frame. The speed values are measure by 'levels per frame' were 1 level cooresponds to a distance to next zoom level. * @param moveX {number} - moves the view/cam in right/left direction * @param moveY {number} - moves the view/cam in bottom/top direction * @param moveZ {number} - moves the view/cam in depth direction (changes zoom level) @@ -1601,9 +1635,11 @@ declare namespace H { control(moveX: number, moveY: number, moveZ: number, angleX: number, angleY: number, angleZ: number, zoom: number, opt_timestamp?: number): void; /** - * This method ends current control, which will stop ongoing animation triggered by the startControl method. This method can prevent kinetics as well as it can adjust the final view if the adjust function is being passed. + * This method ends current control, which will stop ongoing animation triggered by the startControl method. This method can prevent kinetics as well as it can adjust the final view if + * the adjust function is being passed. * @param opt_preventKinetics {boolean=} - if set to true will prevent kinetics animation - * @param opt_adjustView {function(H.map.ViewModel.CameraData)=} - user defined function which can adjust the final view this function takes last requestedData from the view model and should return a modified H.map.ViewModel.CameraData which will be set as the final view + * @param opt_adjustView {function(H.map.ViewModel.CameraData)=} - user defined function which can adjust the final view this function takes last requestedData from the view model and + * should return a modified H.map.ViewModel.CameraData which will be set as the final view */ endControl(opt_preventKinetics?: boolean, opt_adjustView?: (data: H.map.ViewModel.CameraData) => void): void; } @@ -1613,15 +1649,16 @@ declare namespace H { * @property label {string} - A short textual representation of the copyright note, e.g. "DigitalGlobe 2009" * @property alt {string} - A detailed textual representation of the copyright note, e.g. "copyright 2009 DigitalGlobe, Inc." */ - export interface ICopyright { + interface ICopyright { label: string; alt: string; } /** - * Interface describes interaction with the view port. Interaction will reflect view change depending on the interaction coordinates passed and the modifiers which specify the type of interaction. + * Interface describes interaction with the view port. Interaction will reflect view change depending on the interaction coordinates passed and the modifiers which specify the type of + * interaction. */ - export interface IInteraction { + interface IInteraction { /** * This method starts the interaction with the view port. Should be called every time when new interaction is started i.e mouse grab, or touch start. * @param modifiers {number} - a bitmask which specifies what operations should performed during every interaction @@ -1649,7 +1686,7 @@ declare namespace H { /** * A visual representation of the H.map.Marker. */ - export class Icon { + class Icon { /** * Constructor * @param bitmap {!(string | HTMLImageElement | HTMLCanvasElement)} - Either an image URL, a SVG markup, an image or a canvas. @@ -1688,13 +1725,14 @@ declare namespace H { getHitArea(): H.map.HitArea; /** - * This method allows to listen for specific event triggered by the object. Keep in mind, that you must removeEventListener manually or dispose an object when you no longer need it. Otherwise memory leak is possible. + * This method allows to listen for specific event triggered by the object. Keep in mind, that you must removeEventListener manually or dispose an object when you no longer need it. + * Otherwise memory leak is possible. * @param type {string} - name of event * @param handler {Function} - event handler function * @param opt_capture {boolean=} - if set to true will listen in the capture phase (bubble otherwise) * @param opt_scope {Object=} - scope for the handler function */ - addEventListener(type: string, handler: Function, opt_capture?: boolean, opt_scope?: Object): void; + addEventListener(type: string, handler: () => void, opt_capture?: boolean, opt_scope?: {}): void; /** * This method will removed previously added listener from the event target @@ -1703,7 +1741,7 @@ declare namespace H { * @param opt_capture {boolean=} - if set to true will listen in the capture phase (bubble otherwise) * @param opt_scope {Object=} - scope for the handler function */ - removeEventListener(type: string, handler: Function, opt_capture?: boolean, opt_scope?: Object): void; + removeEventListener(type: string, handler: () => void, opt_capture?: boolean, opt_scope?: {}): void; /** * This method will dispatch event on the event target object @@ -1721,14 +1759,14 @@ declare namespace H { * @param callback {Function} - The callback function. * @param opt_scope {Object=} - An optional scope to call the callback in. */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; } - export module Icon { + namespace Icon { /** * The state types of an Icon */ - export enum State { + enum State { ERROR, LOADING, READY, @@ -1739,10 +1777,12 @@ declare namespace H { * @property size {H.math.ISize=} - The icon's size in pixel, default is the bitmap's natural size * @property anchor {H.math.IPoint=} - The anchorage point in pixel, default is bottom-center * @property hitArea {H.map.HitArea=} - The area to use for hit detection, default is the whole rectangular area - * @property asCanvas {H.map.HitArea=} - Indicates whether a non canvas bitmap is converted into a canvas, default is true. The conversion improves the rendering performance but it could also cause a higher memory consumption. - * @property crossOrigin {boolean} - Specifies whether to use anonynous Cross-Origin Resource Sharing (CORS) when fetching an image to prevent resulting canvas from tainting, default is false. The option is ignored by IE9-10. + * @property asCanvas {H.map.HitArea=} - Indicates whether a non canvas bitmap is converted into a canvas, default is true. The conversion improves the rendering performance but it could + * also cause a higher memory consumption. + * @property crossOrigin {boolean} - Specifies whether to use anonynous Cross-Origin Resource Sharing (CORS) when fetching an image to prevent resulting canvas from tainting, default is + * false. The option is ignored by IE9-10. */ - export interface Options { + interface Options { size?: H.math.ISize | number; anchor?: H.math.IPoint; hitArea?: H.map.HitArea; @@ -1754,7 +1794,7 @@ declare namespace H { /** * This class encapsulates the brand, copyright and terms of use elements on the map. */ - export class Imprint { + class Imprint { /** * Constructor * @param map {H.Map} - The map where the imprint is attached to @@ -1785,7 +1825,7 @@ declare namespace H { * @param callback {Function} * @param opt_scope {Object=} */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; /** * This method is used to capture the element view @@ -1797,14 +1837,14 @@ declare namespace H { capture(canvas: HTMLCanvasElement, pixelRatio: number, callback?: (canvas: HTMLCanvasElement) => void, opt_errback?: (s: string) => void): void; } - export module Imprint { + namespace Imprint { /** * Options to style an imprint * @property invert {boolean=} - Indicates whether the logo is inverted. If omitted the current value remains, default is false. * @property font {string=} - The font of the text. If omitted the current value remains, default is "11px Arial,sans-serif". * @property href {string=} - The URL of the "Terms of use" link. If omitted the current value remains, default is "http://here.com/terms". */ - export interface Options { + interface Options { invert?: boolean; font?: string; href?: string; @@ -1814,7 +1854,7 @@ declare namespace H { /** * A marker with a visual representation in the form of a bitmap icon. Marker are predestinated if large amounts of markers with static icons should be displayed om the map. */ - export class Marker extends H.map.AbstractMarker { + class Marker extends H.map.AbstractMarker { /** * Constructor * @param position {H.geo.IPoint} - The location of this marker @@ -1823,18 +1863,19 @@ declare namespace H { constructor(position: H.geo.IPoint, opt_options?: H.map.Marker.Options); } - export module Marker { + namespace Marker { /** * Options used to initialize a Marker * @property min {number=} - The minimum zoom level for which the object is visible, default is -Infinity * @property max {number=} - The maximum zoom level for which the object is visible, default is Infinity * @property visibility {boolean=} - Indicates whether the map object is visible at all, default is true. * @property zIndex {number=} - The z-index value of the map object, default is 0 - * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. + * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate + * an object. * @property icon {H.map.Icon=} - The icon to use for the visual representation, if omitted a default icon is used. * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData. */ - export interface Options { + interface Options { min?: number; max?: number; visibility?: boolean; @@ -1848,7 +1889,7 @@ declare namespace H { /** * This class represents the abstract base class for map objects such as polylines, polygons, markers, groups etc. */ - export class Object extends H.util.EventTarget { + class Object extends H.util.EventTarget { /** * Constructor * @param opt_options {H.map.Object.Options=} - The values to initialize this object @@ -1963,20 +2004,21 @@ declare namespace H { * @param callback {Function} - The callback function. * @param opt_scope {Object=} - An optional scope to call the callback in. */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; } - export module Object { + namespace Object { /** * Options used to initialize a map object * @property min {number=} - The minimum zoom level for which the object is visible, default is -Infinity * @property max {number=} - The maximum zoom level for which the object is visible, default is Infinity * @property visibility {boolean=} - Indicates whether the map object is visible at all, default is true * @property zIndex {number=} - The z-index value of the map object, default is 0 - * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. + * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate + * an object. * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData. */ - export interface Options { + interface Options { min?: number; max?: number; visibility?: boolean; @@ -1988,7 +2030,7 @@ declare namespace H { /** * The major types of map objects */ - export enum Type { + enum Type { /** spatial object */ ANY, /** spatial object */ @@ -2007,7 +2049,7 @@ declare namespace H { /** * This class represents an overlay, which offers a bitmap that covers a geographical reactangular area on the map. */ - export class Overlay extends H.map.Object { + class Overlay extends H.map.Object { /** * Constructor * @param bounds {H.geo.Rect} - The geographical reactangular area of this overlay @@ -2056,7 +2098,7 @@ declare namespace H { setOpacity(opacity: number): H.map.Overlay; } - export module Overlay { + namespace Overlay { /** * Options used to initialize an Overlay * @property min {number=} - The minimum zoom level for which the object is visible, default is -Infinity @@ -2064,10 +2106,11 @@ declare namespace H { * @property opacity {number=} - The opacity of the object in range from 0 (transparent) to 1 (opaque), default is 1. * @property visibility {boolean=} - Indicates whether the map object is visible at all, default is true. * @property zIndex {number=} - The z-index value of the map object, default is 0 - * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. + * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate + * an object. * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData. */ - export interface Options { + interface Options { min?: number; max?: number; opacity?: number; @@ -2079,9 +2122,11 @@ declare namespace H { } /** - * This class represents a polygon in geo-space. It is defined by a strip containing the vertices of a geo shape object (lat, lng, alt values) and a pen to use when rendering the polyline. Polygon represents a closed plane defined by the list of verticies, projected on the map display. List of vericies which define the polygon are is a list of geo coordinates encapsulated by the strip object H.geo.Strip + * This class represents a polygon in geo-space. It is defined by a strip containing the vertices of a geo shape object (lat, lng, alt values) and a pen to use when rendering the polyline. + * Polygon represents a closed plane defined by the list of verticies, projected on the map display. List of vericies which define the polygon are is a list of geo coordinates encapsulated + * by the strip object H.geo.Strip */ - export class Polygon extends H.map.GeoShape { + class Polygon extends H.map.GeoShape { /** * Constructor * @param strip {H.geo.Strip} - the strip describing this polygon's vertices @@ -2090,7 +2135,8 @@ declare namespace H { constructor(strip: H.geo.Strip, opt_options?: H.map.Spatial.Options); /** - * To set the indicator whether this polygon covers the north pole. It's needed for Polygons whose strip is defined as lines arround the world on longitude axis (for example a circle whose center is one of the poles). In this case a additional information is needed to know if the southern or northern part of the world should be covered by the poygon. + * To set the indicator whether this polygon covers the north pole. It's needed for Polygons whose strip is defined as lines arround the world on longitude axis (for example a circle whose + * center is one of the poles). In this case a additional information is needed to know if the southern or northern part of the world should be covered by the poygon. * @param flag {boolean} - A value of true means it covers the north pole, false means south pole * @returns {H.map.Polygon} - the Polygon instance itself */ @@ -2106,7 +2152,7 @@ declare namespace H { /** * This class represents a polyline in geo-space. It is defined by a path containing the vertices of a polyline (lat, lng, alt values) and a pen to use when tracing the path on the map. */ - export class Polyline extends H.map.GeoShape { + class Polyline extends H.map.GeoShape { /** * Constructor * @param strip {H.geo.Strip} - the strip describing this polygon's vertices @@ -2119,10 +2165,10 @@ declare namespace H { * @param geoRect {H.geo.Rect} * @returns {Array>} */ - clip(geoRect: H.geo.Rect): Array>; + clip(geoRect: H.geo.Rect): [number[]]; } - export module Polyline { + namespace Polyline { /** * Options which are used to initialize a polyline * @property style {(H.map.SpatialStyle | H.map.SpatialStyle.Options)=} - the style to be used when tracing the polyline @@ -2131,10 +2177,11 @@ declare namespace H { * @property zIndex {number=} - The z-index value of the map object, default is 0 * @property min {number=} - The minimum zoom level for which the object is visible, default is -Infinity * @property max {number=} - The maximum zoom level for which the object is visible, default is Infinity - * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. + * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate + * an object. * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData */ - export interface Options { + interface Options { style?: (H.map.SpatialStyle | H.map.SpatialStyle.Options); arrows?: (H.map.ArrowStyle | H.map.ArrowStyle.Options); visibility?: boolean; @@ -2149,7 +2196,7 @@ declare namespace H { /** * A Polygon with a rectangular shape. */ - export class Rect extends H.map.Polygon { + class Rect extends H.map.Polygon { /** * Constructor * @param bounds {H.geo.Rect} - The geographical bounding box for this rectangle @@ -2167,7 +2214,7 @@ declare namespace H { /** * This class represents a spatial map object which provides its projected geometry. */ - export class Spatial extends H.map.Object { + class Spatial extends H.map.Object { /** * Constructor * @param isClosed {boolean} - Indicates whether this spatial object represents a closed shape @@ -2182,14 +2229,16 @@ declare namespace H { getStyle(): H.map.SpatialStyle; /** - * To set the drawing style of this object. If the passed opt_style argument is an instance of H.map.SpatialStyle it is treated as immutable and must not be modified afterwards to prevent inconsistancies! . + * To set the drawing style of this object. If the passed opt_style argument is an instance of H.map.SpatialStyle it is treated as immutable and must not be modified afterwards to prevent + * inconsistancies! * @param opt_style {(H.map.SpatialStyle | H.map.SpatialStyle.Options)=} - The style to set. If it evaluates to a falsy the H.map.SpatialStyle.DEFAULT_STYLE is used. * @returns {H.map.Spatial} - the Spatial instance itself */ setStyle(opt_style?: (H.map.SpatialStyle | H.map.SpatialStyle.Options)): H.map.Spatial; /** - * To get the arrow style of this spatial object or undefined if no style is defined. A returned arrow style is treated as immutable and must not be modified afterwards to prevent inconsistancies! + * To get the arrow style of this spatial object or undefined if no style is defined. A returned arrow style is treated as immutable and must not be modified afterwards to prevent + * inconsistancies! * @returns {(H.map.ArrowStyle | undefined)} */ getArrows(): H.map.ArrowStyle | void; @@ -2208,7 +2257,7 @@ declare namespace H { isClosed(): boolean; } - export module Spatial { + namespace Spatial { /** * Data to used as rendering hint for a label * @property x {number} - The X coordinate of the first line's starting point @@ -2219,7 +2268,7 @@ declare namespace H { * @property color {string} - The CSS color * @property text {string} - The text content, new line characters (\u000A) are interpreted as line breaks */ - export interface Label { + interface Label { x: number; y: number; angle: number; @@ -2237,10 +2286,11 @@ declare namespace H { * @property zIndex {number=} - The z-index value of the map object, default is 0 * @property min {number=} - The minimum zoom level for which the object is visible, default is -Infinity * @property max {number=} - The maximum zoom level for which the object is visible, default is Infinity - * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object. + * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate + * an object. * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData. */ - export interface Options { + interface Options { style?: (H.map.SpatialStyle | H.map.SpatialStyle.Options); arrows?: (H.map.ArrowStyle | H.map.ArrowStyle.Options); visibility?: boolean; @@ -2253,19 +2303,21 @@ declare namespace H { } /** - * The SpatialStyle class represents a style with which spatial objects like polylines and polygons are drawn. A SpatialStyle instance is always treated as immutable to avoid inconstiencies and must not modified. + * The SpatialStyle class represents a style with which spatial objects like polylines and polygons are drawn. A SpatialStyle instance is always treated as immutable to avoid inconstiencies + * and must not modified. * @property strokeColor {string} - The color of the stroke in CSS syntax, default is 'rgba(0, 85, 170, 0.6)'. * @property fillColor {string} - The filling color in CSS syntax, default is 'rgba(0, 85, 170, 0.4)'. * @property lineWidth {number} - The width of the line in pixels, default is 2. * @property lineCap {H.map.SpatialStyle.LineCap} - The style of the end caps for a line, default is 'round'. * @property lineJoin {H.map.SpatialStyle.LineJoin} - The type of corner created, when two lines meet, default is 'miter'. * @property miterLimit {number} - The miter length is the distance between the inner corner and the outer corner where two lines meet. The default is 10. - * @property lineDash {Array} - The line dash pattern as an even numbered list of distances to alternately produce a line and a space. The default is [ ]. + * @property lineDash {Array} - The line dash pattern as an even numbered list of distances to alternately produce a line and a space. The default is []. * @property lineDashOffset {number} - The phase offset of the line dash pattern The default is 0. * @property MAX_LINE_WIDTH {number} - This constant represents the maximum line width which can be used for rendering. - * @property DEFAULT_STYLE {H.map.SpatialStyle} - This static member defines the default style for spatial objects on the map. It's value is { strokeColor: '#05A', fillColor: 'rgba(0, 85, 170, 0.4)' lineWidth: 1, lineCap: 'round', lineJoin: 'miter', miterLimit: 10, lineDash: [ ], lineDashOffset: 0 } + * @property DEFAULT_STYLE {H.map.SpatialStyle} - This static member defines the default style for spatial objects on the map. It's value is + * { strokeColor: '#05A', fillColor: 'rgba(0, 85, 170, 0.4)', lineWidth: 1, lineCap: 'round', lineJoin: 'miter', miterLimit: 10, lineDash: [], lineDashOffset: 0 } */ - export class SpatialStyle { + class SpatialStyle { /** * Constructor * @param opt_options {(H.map.SpatialStyle | H.map.SpatialStyle.Options)=} - The optional style attributes @@ -2292,22 +2344,22 @@ declare namespace H { lineCap: H.map.SpatialStyle.LineCap; lineJoin: H.map.SpatialStyle.LineJoin; miterLimit: number; - lineDash: Array; + lineDash: number[]; lineDashOffset: number; static MAX_LINE_WIDTH: number; static DEFAULT_STYLE: H.map.SpatialStyle; } - export module SpatialStyle { + namespace SpatialStyle { /** * The style of the end caps for a line, one of 'butt', 'round' or 'square'. */ - export type LineCap = 'butt' | 'round' | 'square'; + type LineCap = 'butt' | 'round' | 'square'; /** * The type of corner created, when two lines meet, one of 'round', 'bevel' or 'miter'. */ - export type LineJoin = 'round' | 'bevel' | 'miter'; + type LineJoin = 'round' | 'bevel' | 'miter'; /** * Options used to initialize a style. If a property is not set, the default value from H.map.SpatialStyle is taken. @@ -2317,25 +2369,27 @@ declare namespace H { * @property lineCap {H.map.SpatialStyle.LineCap=} - The style of the end caps for a line. * @property lineJoin {H.map.SpatialStyle.LineJoin=} - The type of corner created, when two lines meet. * @property miterLimit {number=} - The miter limit in pixel, default is 10. The maximum supported miter limit is 100 - * @property lineDash {Array} - The line dash pattern as an even numbered list of distances to alternately produce a line and a space. If the browser doesn't support this feature this style property is ignored. + * @property lineDash {Array} - The line dash pattern as an even numbered list of distances to alternately produce a line and a space. If the browser doesn't support this feature + * this style property is ignored. * @property lineDashOffset {number=} - The phase offset of the line dash pattern */ - export interface Options { + interface Options { strokeColor?: string; fillColor?: string; lineWidth?: number; lineCap?: H.map.SpatialStyle.LineCap; lineJoin?: H.map.SpatialStyle.LineJoin; miterLimit?: number; - lineDash?: Array; + lineDash?: number[]; lineDashOffset?: number; } } /** - * This class represents a view of the map. It consists of a virtual camera and a look-at point both of which have a position in geo-space and orientation angles. The view model allows to change the values of these objects in order to move or rotate the map or zoom in and out. + * This class represents a view of the map. It consists of a virtual camera and a look-at point both of which have a position in geo-space and orientation angles. The view model allows to + * change the values of these objects in order to move or rotate the map or zoom in and out. */ - export class ViewModel extends H.util.EventTarget implements H.map.IControl { + class ViewModel extends H.util.EventTarget implements H.map.IControl { /** * This method returns the camera data, which is currently rendered. * @returns {H.map.ViewModel.CameraData} - the current rendered camera data @@ -2411,10 +2465,10 @@ declare namespace H { * @param callback {Function} - The callback function. * @param opt_scope {Object=} - An optional scope to call the callback in. */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; } - export module ViewModel { + namespace ViewModel { /** * Defines camera's properties. * @property zoom {number=} - zoom level to be used by rendering engine @@ -2424,7 +2478,7 @@ declare namespace H { * @property roll {number=} - the rotation of the virtual camera along its local z-axis * @property fov {number=} - */ - export interface CameraData { + interface CameraData { zoom?: number; position: H.geo.IPoint; pitch?: number; @@ -2439,7 +2493,7 @@ declare namespace H { * @property zoom {number=} - The requested zoom level * @property animate {boolean=} - indicates if the requested transition should be animated */ - export interface RequestedData { + interface RequestedData { camera?: H.map.ViewModel.CameraData; zoom?: number; animate?: boolean; @@ -2452,7 +2506,7 @@ declare namespace H { * @property type {string} - Name of the dispatched event * @property defaultPrevented {boolean} - Indicates if preventDefault was called on the current event */ - export class UpdateEvent extends H.util.Event { + class UpdateEvent extends H.util.Event { /** * Constructor * @param requested {H.map.ViewModel.RequestedData} @@ -2477,7 +2531,8 @@ declare namespace H { } /** - * ViewPort object holds information about the HTML element where the map is rendered. It contains information regarding the element (view port) size and triggers events when the element size is changed. + * ViewPort object holds information about the HTML element where the map is rendered. It contains information regarding the element (view port) size and triggers events when the element size + * is changed. * @property element {Element} - This property holds the HTML element, which defines the viewport. * @property width {number} - This property holds this viewport's current width * @property height {number} - This property holds this viewport's current height @@ -2485,7 +2540,7 @@ declare namespace H { * @property padding {H.map.ViewPort.Padding} - This property holds this viewport's current padding * @property center {H.math.Point} - This property holds this viewport's current center point */ - export class ViewPort extends H.util.EventTarget implements H.map.IInteraction { + class ViewPort extends H.util.EventTarget implements H.map.IInteraction { /** * Constructor * @param element {Element} - html element were map will be rendered @@ -2552,7 +2607,7 @@ declare namespace H { * @param callback {Function} - The callback function. * @param opt_scope {Object=} - An optional scope to call the callback in. */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; element: Element; width: number; @@ -2562,14 +2617,14 @@ declare namespace H { center: H.math.Point; } - export module ViewPort { + namespace ViewPort { /** * Options which may be used to initialize new ViewPort instance * @property margin {number=} - The size in pixel of the supplemental area to render for each side of the map * @property padding {H.map.ViewPort.Padding=} - The padding in pixels for each side of the map * @property fixedCenter {boolean=} - Indicates whether the center of the map should remain unchanged if the viewport's size or or padding has been changed, default is true */ - export interface Options { + interface Options { margin?: number; padding?: H.map.ViewPort.Padding; fixedCenter?: boolean; @@ -2582,7 +2637,7 @@ declare namespace H { * @property bottom {number} - the padding on the bottom edge (in pixels) * @property left {number} - the padding on the left edge (in pixels) */ - export interface Padding { + interface Padding { top: number; right: number; bottom: number; @@ -2590,11 +2645,12 @@ declare namespace H { } } - export module layer { + namespace layer { /** - * BaseTileLayer encapsulates funcitonailty that is common to all layers that deliver tiles, such as H.map.layer.TileLayer. The functionality includes geo bounding box to grid calculation, tile request management. + * BaseTileLayer encapsulates funcitonailty that is common to all layers that deliver tiles, such as H.map.layer.TileLayer. The functionality includes geo bounding box to grid + * calculation, tile request management. */ - export class BaseTileLayer extends H.map.layer.Layer { + class BaseTileLayer extends H.map.layer.Layer { /** * Constructor * @param provider {H.map.provider.TileProvider} - data source for the TileLayer @@ -2643,7 +2699,8 @@ declare namespace H { cancelTile(x: number, y: number, z: number): void; /** - * This method requests tiles from the data source (provider). It can return a set of tiles which are currently loaded. All tiles which are not yet loaded will be included in response as soon as they will be available during subsequent calls. + * This method requests tiles from the data source (provider). It can return a set of tiles which are currently loaded. All tiles which are not yet loaded will be included in response + * as soon as they will be available during subsequent calls. * @param tileBounds {H.math.Rect} - bounds in tile grid * @param isCDB {boolean} * @param zoomLevel {number} - The zoom level for which the objects are requested @@ -2657,8 +2714,7 @@ declare namespace H { /** * This interface describes a layer which provides marker objects to the renderer. */ - export interface IMarkerLayer { - + interface IMarkerLayer { /** * This method requests marker objects for provided bounding rectangle. * @param boundingRect {H.geo.Rect} - the bounding rectangle for which marker are to be returned @@ -2677,18 +2733,19 @@ declare namespace H { * @param prioCenter {H.math.Point} - The priority center as an offset in screen pixel relative to the center * @returns {(H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse)} - a response object containing the number of markers and the markers themselves */ - requestDomMarkers(boundingRect: H.geo.Rect, zoomLevel: number, cacheOnly: boolean, prioCenter: H.math.Point): (H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse); + requestDomMarkers(boundingRect: H.geo.Rect, zoomLevel: number, cacheOnly: boolean, prioCenter: H.math.Point): (H.map.layer.IMarkerLayer.Response | + H.map.layer.IMarkerLayer.TiledResponse); } - export module IMarkerLayer { + namespace IMarkerLayer { /** * This type represents a response object returned by the H.map.layer.IMarkerLayer#requestMarkers function. * @property total {number} - The total number of markers, inclusive markers with not ready icons * @property markers {Array} - The marker objects for the bounding rectangle (only ready) */ - export interface Response { + interface Response { total: number; - markers: Array; + markers: H.map.AbstractMarker[]; } /** @@ -2697,17 +2754,18 @@ declare namespace H { * @property requested {number} - number of requested tiles * @property objects {Array} - the marker objects within requested tiled area */ - export interface TiledResponse { + interface TiledResponse { number: number; requested: number; - objects: Array; + objects: H.map.AbstractMarker[]; } } /** - * This interface describes a layer which provides data partitioned in quad-tree tiles in an x, y, z fashion (where z describes the level within the tree and x and y describe the absolute column and row indeces whithin the level). + * This interface describes a layer which provides data partitioned in quad-tree tiles in an x, y, z fashion (where z describes the level within the tree and x and y describe the absolute + * column and row indeces whithin the level). */ - export interface ITileLayer { + interface ITileLayer { /** * This method requests tiles for the current bounding rectangle at the given zoom level (z-value). * @param boundingRect {H.geo.Rect} - the bounding rectangle for which tiles are to be returned @@ -2737,13 +2795,13 @@ declare namespace H { cancelTile(x: number, y: number, z: number): void; } - export module ITileLayer { + namespace ITileLayer { /** * Options which are used to initialize a TileLayer object. * @property projection {H.geo.IProjection=} - an optional projection to be used for this layer, default is H.geo.mercator * @property opacity {number=} - tile layer opacity, default is 1 */ - export interface Options { + interface Options { projection?: H.geo.IProjection; opacity?: number; } @@ -2753,16 +2811,17 @@ declare namespace H { * @property total {number} - the total number of requested tiles * @property tiles {Array} - the tiles which this provider can currently return synchronously */ - export interface Response { + interface Response { total: number; - tiles: Array; + tiles: H.map.provider.Tile[]; } } /** - * The Layer class represents an object that is evaluated by the renderer in the order in which it is added to the layers collection. It provides the basic infrastructure for dispatching update events to the renderer in case new data is available. + * The Layer class represents an object that is evaluated by the renderer in the order in which it is added to the layers collection. It provides the basic infrastructure for dispatching + * update events to the renderer in case new data is available. */ - export class Layer extends H.util.EventTarget { + class Layer extends H.util.EventTarget { /** * Constructor * @param opt_options {H.map.layer.Layer.Options=} - optional configuration object @@ -2796,7 +2855,7 @@ declare namespace H { * @param level {number} - the zoom level for which to retrieve the copyright information * @returns {Array} - a list of copyright information objects for the provided area and zoom level */ - getCopyrights(bounds: H.geo.Rect, level: number): Array; + getCopyrights(bounds: H.geo.Rect, level: number): H.map.ICopyright[]; /** * This method will dispatch event on the event target object @@ -2814,10 +2873,10 @@ declare namespace H { * @param callback {Function} - The callback function. * @param opt_scope {Object=} - An optional scope to call the callback in. */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; } - export module Layer { + namespace Layer { /** * Options which can be used when creating new layer object. * @property min {number=} - The minimum zoom level for which the layer can provide data, default is 0 @@ -2826,7 +2885,7 @@ declare namespace H { * @property projection {H.geo.IProjection=} - The projection to be used for this layer, default is H.geo.mercator * @property minWorldSize {number=} - The minimal world size at zoom level 0, default is 256 */ - export interface Options { + interface Options { min?: number; max?: number; dark?: boolean; @@ -2838,7 +2897,7 @@ declare namespace H { /** * ObjectTileLayer represents map objects which are requested on a tile basis */ - export class MarkerTileLayer extends H.map.layer.BaseTileLayer implements H.map.layer.IMarkerLayer { + class MarkerTileLayer extends H.map.layer.BaseTileLayer implements H.map.layer.IMarkerLayer { /** * Constructor * @param provider {H.map.provider.MarkerTileProvider} @@ -2864,13 +2923,15 @@ declare namespace H { * @param prioCenter {H.math.Point} - The priority center as an offset in screen pixel relative to the center * @returns {(H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse)} - a response object containing the number of markers and the markers themselves */ - requestDomMarkers(boundingRect: H.geo.Rect, zoomLevel: number, cacheOnly: boolean, prioCenter: H.math.Point): (H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse); + requestDomMarkers(boundingRect: H.geo.Rect, zoomLevel: number, cacheOnly: boolean, prioCenter: H.math.Point): (H.map.layer.IMarkerLayer.Response | + H.map.layer.IMarkerLayer.TiledResponse); } /** - * This class represents a layer which renders map objects. Spatial objects like polygons and polylines a rendered to tiles before being passed to the enigne. Point objects like markers are provided as objects given an rectangular area. + * This class represents a layer which renders map objects. Spatial objects like polygons and polylines a rendered to tiles before being passed to the enigne. Point objects like markers + * are provided as objects given an rectangular area. */ - export class ObjectLayer extends H.map.layer.Layer implements H.map.layer.ITileLayer { + class ObjectLayer extends H.map.layer.Layer implements H.map.layer.ITileLayer { /** * Constructor * @param provider {H.map.provider.ObjectProvider} - the ObjectProvider which provides the map objects to this object layer. @@ -2940,10 +3001,11 @@ declare namespace H { * @param prioCenter {H.math.Point} - The priority center as an offset in screen pixel relative to the center * @returns {(H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse)} - a response object containing the number of markers and the markers themselves */ - requestDomMarkers(boundingRect: H.geo.Rect, zoomLevel: number, cacheOnly: boolean, prioCenter: H.math.Point): (H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse); + requestDomMarkers(boundingRect: H.geo.Rect, zoomLevel: number, cacheOnly: boolean, prioCenter: H.math.Point): (H.map.layer.IMarkerLayer.Response | + H.map.layer.IMarkerLayer.TiledResponse); } - export module ObjectLayer { + namespace ObjectLayer { /** * Configuration object which can be use to initialize the ObjectLayer. * @property tileSize {number=} - the size of the tiles rendered by this layer for polylines and polygons (must be power of 2, default is 256) @@ -2951,7 +3013,7 @@ declare namespace H { * @property dataCacheSize {number=} - the number of tiles to cache which have render data only, default is 512 * @property pixelRatio {number=} - The pixelRatio to use for over-sampling in cases of high-resolution displays */ - export interface Options { + interface Options { tileSize?: number; tileCacheSize?: number; dataCacheSize?: number; @@ -2963,9 +3025,9 @@ declare namespace H { * @property total {number} - The total number of overlays within the requested bounds, inclusive overlays which are not ready loaded yet * @property overlays {Array} - A list all overlays which are ready to render */ - export interface OverlaysResponse { + interface OverlaysResponse { total: number; - overlays: Array; + overlays: H.map.Overlay[]; } } @@ -2973,7 +3035,7 @@ declare namespace H { * Tile Layer, represents data shown on map on a tile basis. Can be used to show map tile images or other type of data which is partitioned into tiles. * @event update {H.util.Event} */ - export class TileLayer extends H.map.layer.BaseTileLayer implements H.map.layer.ITileLayer { + class TileLayer extends H.map.layer.BaseTileLayer implements H.map.layer.ITileLayer { /** * Constructor * @param provider {H.map.provider.TileProvider} - data source for the TileLayer @@ -2995,12 +3057,12 @@ declare namespace H { } } - export module provider { + namespace provider { /** * An ImageTileProvider uses network service to provide bitmap images as tiles. * @property tileSize {number} - Size of a tile image supported by the provider */ - export class ImageTileProvider extends H.map.provider.RemoteTileProvider { + class ImageTileProvider extends H.map.provider.RemoteTileProvider { /** * Constructor * @param options {H.map.provider.ImageTileProvider.Options} - configuration for tile provider @@ -3010,25 +3072,27 @@ declare namespace H { tileSize: number; } - export module ImageTileProvider { + namespace ImageTileProvider { /** * Options to initialize an ImageTileProvider instance - * @property uri {string=} - The provider's unique resource identifier which must not contain an underscore "_". If omitted an auto-generated unique Session ID is used. If a cross sessions consistent IDs is needed (e.g. for storing provider data) this property must be specified. + * @property uri {string=} - The provider's unique resource identifier which must not contain an underscore "_". If omitted an auto-generated unique Session ID is used. If a cross + * sessions consistent IDs is needed (e.g. for storing provider data) this property must be specified. * @property min {number=} - The minimal supported zoom level, default is 0 * @property max {number=} - The maximal supported zoom level, default is 22 * @property getCopyrights {(function(H.geo.Rect, number) : ?Array)=} - A function to replace the default implementation of H.map.provider.Provider#getCopyrights * @property tileSize {number=} - The size of a tile as edge length in pixels. It must be 2^n where n is in range [0 ... 30], default is 256 * @property getURL {function(number, number, number)} - The function to create an URL for the specified tile. If it returns a falsy the tile is not requested. - * @property crossOrigin {(string | boolean=)} - The CORS settings to use for the crossOrigin attribute for the image, if omitted or if the value evaluates to false no CORS settings are used. + * @property crossOrigin {(string | boolean=)} - The CORS settings to use for the crossOrigin attribute for the image, if omitted or if the value evaluates to false no CORS settings + * are used. */ - export interface Options { + interface Options { uri?: string; min?: number; max?: number; - getCopyrights?: ((rect: H.geo.Rect, n: number) => Array); + getCopyrights?(rect: H.geo.Rect, n: number): H.map.ICopyright[]; tileSize?: number; - getURL: (n1: number, n2: number, n3: number) => string; - crossOrigin?: (string | boolean); + getURL(n1: number, n2: number, n3: number): string; + crossOrigin?: string | boolean; } } @@ -3036,8 +3100,7 @@ declare namespace H { * This class represents invalidation states of a renderable object. A renderer can optimize its rendering strategies based on the information in this object. * @property MARK_INITIAL {H.map.provider.Invalidations.Mark} - This constant represents the initial invalidation mark an invalidations object has. */ - export class Invalidations { - + class Invalidations { /** * To update invalidation marks accordingly to the given the invalidation types. * @param mark {H.map.provider.Invalidations.Mark} - The invalidation mark to set @@ -3096,11 +3159,11 @@ declare namespace H { static MARK_INITIAL: H.map.provider.Invalidations.Mark; } - export module Invalidations { + namespace Invalidations { /** * This enumeration encapsulates bit flags for different invalidations of map objects. */ - export enum Flag { + enum Flag { NONE, VISUAL, SPATIAL, @@ -3112,7 +3175,7 @@ declare namespace H { /** * The invalidation mark represents a counter which is increased whenever an invalidation takes place. */ - export interface Mark { } + type Mark = any; } /** @@ -3125,7 +3188,7 @@ declare namespace H { * @property max {number} - Maximum zoom level at which provider can server data, set at construction time * @property uid {string} - Provider instance unique identifier, generated at construction time */ - export class MarkerTileProvider extends H.map.provider.RemoteTileProvider { + class MarkerTileProvider extends H.map.provider.RemoteTileProvider { /** * Constructor * @param options {H.map.provider.MarkerTileProvider.Options} - configuration for tile provider @@ -3146,18 +3209,19 @@ declare namespace H { providesDomMarkers(): boolean; } - export module MarkerTileProvider { + namespace MarkerTileProvider { /** * Options which are used to initialize the MarkerTileProvider object. * @property min {number=} - The minimal supported zoom level, default is 0 * @property max {number=} - The maximal supported zoom level, default is 22 - * @property requestData {function(number, number, number, function(Array), Function) : H.util.ICancelable} - function that fetches marker data and creates array of H.map.AbstractMarker that is passed success callback, if function fails to fetch data onError callback must be called + * @property requestData {function(number, number, number, function(Array), Function) : H.util.ICancelable} - function that fetches marker data and creates array + * of H.map.AbstractMarker that is passed success callback, if function fails to fetch data onError callback must be called * @property providesDomMarkers {boolean=} - indicates if markers provided are of type H.map.DomMarker or H.map.Marker, default is H.map.Marker */ - export interface Options { + interface Options { min?: number; max?: number; - requestData: (n1: number, n2: number, n3: number, markerCallback: (markers: Array) => void, f: Function) => H.util.ICancelable; + requestData(n1: number, n2: number, n3: number, markerCallback: (markers: H.map.AbstractMarker[]) => void, f: () => void): H.util.ICancelable; providesDomMarkers?: boolean; } } @@ -3165,7 +3229,7 @@ declare namespace H { /** * An abstract class to manage and provide map objects (Marker, Polyline, Polygon) */ - export class ObjectProvider extends H.map.provider.Provider { + class ObjectProvider extends H.map.provider.Provider { /** * Constructor * @param opt_options {H.map.provider.Provider.Options=} @@ -3200,7 +3264,7 @@ declare namespace H { * @param cacheOnly {boolean} - Indicates whether only cached objects are to be considered * @returns {Array} - a list of intersecting objects */ - requestOverlays(geoRect: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): Array; + requestOverlays(geoRect: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): H.map.Overlay[]; /** * Checks whether this provider is currently providing spatial map objects. A concrete implementation of ObjectProvider must override it if it currently provides Spatials. @@ -3216,7 +3280,7 @@ declare namespace H { * @param cacheOnly {boolean} - Indicates whether only cached objects are to be considered * @returns {Array} - a list of intersecting objects */ - requestSpatials(geoRect: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): Array; + requestSpatials(geoRect: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): H.map.Spatial[]; /** * Returns the spatial objects which intersect the given tile @@ -3225,7 +3289,7 @@ declare namespace H { * @param cacheOnly {boolean} - Indicates whether only cached objects are to be considered * @returns {Array} - a list of intersecting objects */ - requestSpatialsByTile(tile: H.map.provider.Tile, visiblesOnly: boolean, cacheOnly: boolean): Array; + requestSpatialsByTile(tile: H.map.provider.Tile, visiblesOnly: boolean, cacheOnly: boolean): H.map.Spatial[]; /** * Checks whether this provider is currently providing Marker map objects. A concrete implementation of ObjectProvider must override it if it currently provides Markers. @@ -3241,7 +3305,7 @@ declare namespace H { * @param cacheOnly {boolean} - Indicates whether only cached objects are to be considered * @returns {Array} - a list of intersecting objects */ - requestMarkers(geoRect: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): Array; + requestMarkers(geoRect: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): H.map.Marker[]; /** * Checks whether this provider is currently providing DomMarker map objects. A concrete implementation of ObjectProvider must override it if it currently provides Markers. @@ -3257,17 +3321,18 @@ declare namespace H { * @param cacheOnly {boolean} - Indicates whether only cached objects are to be considered * @returns {Array} - a list of intersecting objects */ - requestDomMarkers(geoRect: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): Array; + requestDomMarkers(geoRect: H.geo.Rect, zoomLevel: number, visiblesOnly: boolean, cacheOnly: boolean): H.map.DomMarker[]; } /** - * A Provider defines an object which works as a database for the map. Providers can exists in different forms they can implement client side object storage or they can request data from the remote service. + * A Provider defines an object which works as a database for the map. Providers can exists in different forms they can implement client side object storage or they can request data from + * the remote service. * @property uri {string} - This provider's unique resource identifier, if not provided at construction time it defaults to provider's uid * @property min {number} - Minimum zoom level at which provider can serve data, set at construction time * @property max {number} - Maximum zoom level at which provider can server data, set at construction time * @property uid {string} - Provider instance unique identifier, generated at construction time */ - export class Provider extends H.util.EventTarget { + class Provider extends H.util.EventTarget { /** * Constructor * @param opt_options {H.map.provider.Provider.Options=} @@ -3280,7 +3345,7 @@ declare namespace H { * @param level {number} - The zoom level for which to retrieve the copyright information * @returns {?Array} - a list of copyright information objects for the provided area and zoom level */ - getCopyrights(bounds: H.geo.Rect, level: number): Array; + getCopyrights(bounds: H.geo.Rect, level: number): H.map.ICopyright[]; /** * This method will dispatch event on the event target object @@ -3298,7 +3363,7 @@ declare namespace H { * @param callback {Function} - The callback function. * @param opt_scope {Object=} - An optional scope to call the callback in. */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; uri: string; min: number; @@ -3306,26 +3371,28 @@ declare namespace H { uid: string; } - export module Provider { + namespace Provider { /** * Options to initialize a Provider instance - * @property uri {string=} - The provider's unique resource identifier which must not contain an underscore "_". If omitted an auto-generated unique Session ID is used. If a cross sessions consistent IDs is needed (e.g. for storing provider data) this property must be specified. + * @property uri {string=} - The provider's unique resource identifier which must not contain an underscore "_". If omitted an auto-generated unique Session ID is used. If a cross + * sessions consistent IDs is needed (e.g. for storing provider data) this property must be specified. * @property min {number=} - The minimal supported zoom level, default is 0 * @property max {number=} - The maximal supported zoom level, default is 22 * @property getCopyrights {(function(H.geo.Rect, number) : ?Array)=} - A function to replace the default implementation of H.map.provider.Provider#getCopyrights */ - export interface Options { + interface Options { uri?: string; min?: number; max?: number; - getCopyrights?: (rect: H.geo.Rect, n: number) => Array; + getCopyrights?(rect: H.geo.Rect, n: number): H.map.ICopyright[]; } } /** - * RemoteTileProvider is an abstract class which should be used by classes implementing data provision on a tile basis. Every child class needs to implement 'requestInternal' (to request remote tile) and 'getCache' (to provide configured cache object were tiled data is being cached) + * RemoteTileProvider is an abstract class which should be used by classes implementing data provision on a tile basis. Every child class needs to implement 'requestInternal' + * (to request remote tile) and 'getCache' (to provide configured cache object were tiled data is being cached) */ - export class RemoteTileProvider extends H.map.provider.TileProvider { + class RemoteTileProvider extends H.map.provider.TileProvider { /** * Constructor * @param options {H.map.provider.TileProvider.Options} - The options to instantiate this TileProvider @@ -3354,7 +3421,7 @@ declare namespace H { z: number, onResponse?: ( - object: Array | HTMLImageElement | HTMLCanvasElement | ArrayBuffer, + object: H.map.Object[] | HTMLImageElement | HTMLCanvasElement | ArrayBuffer, response: any ) => void, @@ -3370,7 +3437,8 @@ declare namespace H { } /** - * Generic Tile object which represents a part of the world fiting into the Tile area represented by the Tiel coordinates (x - row, y - column) and the zoom level (z). Number of tiles at particular zoom level (which means number of areas into world is being splitted) is defined as following: numberOfRows = numberOfColumns = 2^zoomlevel + * Generic Tile object which represents a part of the world fiting into the Tile area represented by the Tiel coordinates (x - row, y - column) and the zoom level (z). Number of tiles + * at particular zoom level (which means number of areas into world is being splitted) is defined as following: numberOfRows = numberOfColumns = 2^zoomlevel * @property key {string} - Unique tile key generated by provider * @property data {*} - Tile data (an image for example) * @property valid {boolean} - This property holds a boolean flag indicating whether this tile is still valid (true) or whether it should be re-fetched (false) @@ -3378,7 +3446,7 @@ declare namespace H { * @property y {number} - Tile row * @property z {number} - Tile zoom level */ - export class Tile { + class Tile { /** * Constructor * @param x {number} - x tile coordinate (row) @@ -3405,7 +3473,7 @@ declare namespace H { * @property max {number} - Maximum zoom level at which provider can server data, set at construction time * @property uid {string} - Provider instance unique identifier, generated at construction time */ - export class TileProvider extends H.map.provider.Provider { + class TileProvider extends H.map.provider.Provider { /** * Constructor * @param options {H.map.provider.TileProvider.Options} - The options to instantiate this TileProvider @@ -3441,19 +3509,20 @@ declare namespace H { uid: string; } - export module TileProvider { + namespace TileProvider { /** - * @property uri {string=} - The provider's unique resource identifier which must not contain an underscore "_". If omitted an auto-generated unique Session ID is used. If a cross sessions consistent IDs is needed (e.g. for storing provider data) this property must be specified. + * @property uri {string=} - The provider's unique resource identifier which must not contain an underscore "_". If omitted an auto-generated unique Session ID is used. + * If a cross sessions consistent IDs is needed (e.g. for storing provider data) this property must be specified. * @property min {number=} - The minimal supported zoom level, default is 0 * @property max {number=} - The maximal supported zoom level, default is 22 * @property getCopyrights {(function(H.geo.Rect, number): Array)=} - A function to replace the default implememtation of H.map.provider.Provider#getCopyrights * @property tileSize {number=} - The size of a tile as edge length in pixels. It must be 2^n where n is in range [0 ... 30], default is 256 */ - export interface Options { + interface Options { uri?: string; min?: number; max?: number; - getCopyrights?(rect: H.geo.Rect, number: number): Array; + getCopyrights?(rect: H.geo.Rect, number: number): H.map.ICopyright[]; tileSize?: number; } } @@ -3461,14 +3530,14 @@ declare namespace H { } /***** mapevents *****/ - export module mapevents { + namespace mapevents { /** * Behavior class uses map events and adds behavior functionality to the map. This allows map panning and zooming via using mouse wheel * @property DRAGGING {number} - Map responds to user dragging via mouse or touch * @property WHEELZOOM {number} - Map zooms in or out in respond to mouse wheel events * @property DBLTAPZOOM {number} - Map zooms in or out in response to double click or double tap. For double tap if more that one touches are on the screen map will zoom out. */ - export class Behavior extends H.util.Disposable { + class Behavior extends H.util.Disposable { /** * Constructor * @param mapEvents {H.mapevents.MapEvents} - previously initialized map events instance @@ -3477,7 +3546,8 @@ declare namespace H { constructor(mapEvents: H.mapevents.MapEvents, options?: H.mapevents.Behavior.Options); /** - * This method destroys all map interaction handling. Should be used when the behavior functionality is disposed. Behavior object will also be disposed (this function will be called) when attached H.mapevents.MapEvents object is dispose. + * This method destroys all map interaction handling. Should be used when the behavior functionality is disposed. Behavior object will also be disposed (this function will be called) + * when attached H.mapevents.MapEvents object is dispose. */ dispose(): void; @@ -3505,13 +3575,13 @@ declare namespace H { static DBLTAPZOOM: number; } - export module Behavior { + namespace Behavior { /** * Options which are used to initialize the Behavior class. * @property kinetics {H.util.kinetics.IKinetics=} - The parameters for the kinetic movement. * @property enable {number=} - The bitmask of behaviors to enable like H.mapevents.Behavior.DRAGGING. All are enabled by default. */ - export interface Options { + interface Options { kinetics?: H.util.kinetics.IKinetics; enable?: H.math.BitMask; } @@ -3527,7 +3597,7 @@ declare namespace H { * @property type {string} - Name of the dispatched event * @property defaultPrevented {boolean} - Indicates if preventDefault was called on the current event */ - export class ContextMenuEvent extends H.util.Event { + class ContextMenuEvent extends H.util.Event { /** * Constructor * @param viewportX {number} - The x coordinate on the viewport @@ -3537,7 +3607,7 @@ declare namespace H { */ constructor(viewportX: number, viewportY: number, target: (H.Map | H.map.Object), originalEvent: Event); - viewportX: Array; + viewportX: H.util.ContextItem[]; viewportY: number; originalEvent: Event; } @@ -3554,7 +3624,7 @@ declare namespace H { * @property type {string} - Name of the dispatched event * @property defaultPrevented {boolean} - Indicates if preventDefault was called on the current event */ - export class Event extends H.util.Event { + class Event extends H.util.Event { /** * Constructor * @param type {string} - type of event @@ -3565,7 +3635,8 @@ declare namespace H { * @param target {(H.Map | H.map.Object)} - target map object which triggered event * @param originalEvent {Event} - original dom event */ - constructor(type: string, pointers: Array, changedPointers: Array, targetPointers: Array, currentPointer: H.mapevents.Pointer, target: (H.Map | H.map.Object), originalEvent: Event); + constructor(type: string, pointers: H.mapevents.Pointer[], changedPointers: H.mapevents.Pointer[], targetPointers: H.mapevents.Pointer[], currentPointer: H.mapevents.Pointer, + target: (H.Map | H.map.Object), originalEvent: Event); /** * Sets defaultPrevented to true. Which can be used to prevent some default behavior. @@ -3577,9 +3648,9 @@ declare namespace H { */ stopPropagation(): void; - pointers: Array; - changedPointers: Array; - targetPointers: Array; + pointers: H.mapevents.Pointer[]; + changedPointers: H.mapevents.Pointer[]; + targetPointers: H.mapevents.Pointer[]; currentPointer: H.mapevents.Pointer; originalEvent: Event; target: (H.map.Object | H.Map); @@ -3589,9 +3660,11 @@ declare namespace H { } /** - * MapEvents enable the events functionality on the map and on the map objects. By using this extension it is possible to listen to events on map objects like markers, polylines, polygons, circles and on the map object itself. Events are triggered depending on user interaction. Please check the Events Summary section for the list of events fired by this class and by the map objects. + * MapEvents enable the events functionality on the map and on the map objects. By using this extension it is possible to listen to events on map objects like markers, polylines, polygons, + * circles and on the map object itself. Events are triggered depending on user interaction. Please check the Events Summary section for the list of events fired by this class and by the map + * objects. */ - export class MapEvents extends H.util.Disposable { + class MapEvents extends H.util.Disposable { /** * Constructor * @param map {H.Map} - map instance which is used for firing events @@ -3599,7 +3672,8 @@ declare namespace H { constructor(map: H.Map); /** - * This method destroys the MapEvents by removing all handlers from the map object. After calling this function mapEvents and map objects will not trigger any events. This object will be disposed automatically if the corresponding map object is disposed. + * This method destroys the MapEvents by removing all handlers from the map object. After calling this function mapEvents and map objects will not trigger any events. This object will be + * disposed automatically if the corresponding map object is disposed. */ dispose(): void; @@ -3620,7 +3694,7 @@ declare namespace H { * @property dragTarget {(H.map.Object | H.Map)} - Object which is currently dragged by the pointer * @property button {H.mapevents.Pointer.Button} - Indicates which pointer device button has changed. */ - export class Pointer { + class Pointer { /** * Constructor * @param viewportX {number} - pointer position on x-axis @@ -3640,11 +3714,11 @@ declare namespace H { static button: H.mapevents.Pointer.Button; } - export module Pointer { + namespace Pointer { /** * Types of a button */ - export enum Button { + enum Button { /** No button */ NONE, /** Left mouse button or touch contact or pen contact */ @@ -3664,7 +3738,7 @@ declare namespace H { * - 4: Middle mouse button pressed */ // TODO not sure this is the right interpretation of the docs - export type Buttons = H.math.BitMask; + type Buttons = H.math.BitMask; } /** @@ -3678,7 +3752,7 @@ declare namespace H { * @property type {string} - Name of the dispatched event * @property defaultPrevented {boolean} - Indicates if preventDefault was called on the current event */ - export class WheelEvent extends H.util.Event { + class WheelEvent extends H.util.Event { /** * Constructor * @param deltaY {number} - The wheel move delta on y-axis @@ -3697,18 +3771,18 @@ declare namespace H { } /***** math *****/ - export module math { + namespace math { /** * A signed 32 bit integer (JS restriction) where bit operator can be applied to. The range is [-2,147,483,648 ... 2,147,483,647] or [-2^31 ... 2^31 − 1] */ - export type BitMask = number; + type BitMask = number; /** * An interface for a 2-dimensional point consisting a x and y coordinate. * @property x {number} - The point's coordinate on X-axis. * @property y {number} - The point's coordinate on Y-axis. */ - export interface IPoint { + interface IPoint { x: number; y: number; } @@ -3718,7 +3792,7 @@ declare namespace H { * @property w {number} - The size's width. * @property h {number} - The size's height. */ - export interface ISize { + interface ISize { w: number; h: number; } @@ -3728,7 +3802,7 @@ declare namespace H { * @property x {number} - The point's coordinate on X-axis. * @property y {number} - The point's coordinate on Y-axis. */ - export class Point implements IPoint { + class Point implements IPoint { /** * Constructor * @param x {number} - The point's coordinate on X-axis. @@ -3826,7 +3900,7 @@ declare namespace H { /** * Class defines a rectangle in 2-dimensional geometric space. It is used to represent the area in projected space. */ - export class Rect { + class Rect { /** * Constructor * @param left {number} - The rectangle's left edge x value @@ -3885,7 +3959,7 @@ declare namespace H { * @property w {number} - The size's width value * @property h {number} - The size's height value */ - export class Size { + class Size { /** * Constructor * @param width {number} - Width. @@ -3898,27 +3972,27 @@ declare namespace H { } /***** net *****/ - export module net { - export module Request { - export enum State { + namespace net { + namespace Request { + enum State { DONE = 2, OPENED = 1, UNSENT = 0, } // TODO no idea how this interface is set up, investigate - export interface Priority { } + type Priority = any; } } /***** places *****/ /***** service *****/ - export module service { + namespace service { /** * Abstract rest service class */ - export class AbstractRestService implements H.service.IConfigurable { + class AbstractRestService implements H.service.IConfigurable { /** * Constructor * @param opt_options {H.service.AbstractRestService.Options=} @@ -3931,22 +4005,22 @@ declare namespace H { * @param appCode {string} - The application code to identify the client against the platform (mandatory to provide) * @param useHTTPS {boolean} - Indicates whether secure communication should be used, default is false * @param useCIT {boolean} - Indicates whether the Customer Integration Testing should be used, default is false - * @param opt_baseUrl {H.service.Url=} - The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified in the opt_baseUrl to use HTTPS. + * @param opt_baseUrl {H.service.Url=} - The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified in + * the opt_baseUrl to use HTTPS. * @returns {H.service.IConfigurable} */ configure(appId: string, appCode: string, useHTTPS: boolean, useCIT: boolean, opt_baseUrl?: H.service.Url): H.service.IConfigurable; } - export module AbstractRestService { - export interface Options { - - } + namespace AbstractRestService { + type Options = any; } /** - * This class encapsulates Enterprise Routing REST API as a service stub. An instance of this class can be retrieved by calling the factory method on a platform instance. H.service.Platform#getEnterpriseRoutingService. + * This class encapsulates Enterprise Routing REST API as a service stub. An instance of this class can be retrieved by calling the factory method on a platform instance. + * H.service.Platform#getEnterpriseRoutingService. */ - export class EnterpriseRoutingService extends H.service.AbstractRestService { + class EnterpriseRoutingService extends H.service.AbstractRestService { /** * Constructor * @param opt_options {H.service.EnterpriseRoutingService.Options=} @@ -3954,7 +4028,8 @@ declare namespace H { constructor(opt_options?: H.service.EnterpriseRoutingService.Options); /** - * This method sends a "calculateroute" request to Enterprise Routing REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occurred. + * This method sends a "calculateroute" request to Enterprise Routing REST API and calls the onResult callback function once the service response was received - providing + * a H.service.ServiceResult object - or the onError callback if a communication error occurred. * @param calculateRouteParams {H.service.ServiceParameters} - the service parameters to be sent with the routing request. * @param onResult {function(H.service.ServiceResult)} - this function will be called once the Enterprise Routing REST API provides a response to the request. * @param onError {function(Error)} - this function will be called if a communication error occurs during the JSON-P request @@ -3962,7 +4037,8 @@ declare namespace H { calculateRoute(calculateRouteParams: H.service.ServiceParameters, onResult: (result: H.service.ServiceResult) => void, onError: (error: Error) => void): void; /** - * This method sends a "getroute" request to Enterprise Routing REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occurred. + * This method sends a "getroute" request to Enterprise Routing REST API and calls the onResult callback function once the service response was received - providing + * a H.service.ServiceResult object - or the onError callback if a communication error occurred. * @param getRouteParams {H.service.ServiceParameters} - the service parameters to be sent with the routing request. * @param onResult {function(H.service.ServiceResult)} - this function will be called once the Enterprise Routing REST API provides a response to the request. * @param onError {function(Error)} - this function will be called if a communication error occurs during the JSON-P request @@ -3970,7 +4046,8 @@ declare namespace H { getRoute(getRouteParams: H.service.ServiceParameters, onResult: (result: H.service.ServiceResult) => void, onError: (error: Error) => void): void; /** - * This method sends a "getlinkinfo" request to Enterprise Routing REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occured. + * This method sends a "getlinkinfo" request to Enterprise Routing REST API and calls the onResult callback function once the service response was received - providing + * a H.service.ServiceResult object - or the onError callback if a communication error occured. * @param getLinkInfoParams {H.service.ServiceParameters} - the service parameters to be sent with the routing request. * @param onResult {function(H.service.ServiceResult)} - this function will be called once the Enterprise Routing REST API provides a response to the request. * @param onError {function(Error)} - this function will be called if a communication error occurs during the JSON-P request @@ -3978,7 +4055,8 @@ declare namespace H { getLinkInfo(getLinkInfoParams: H.service.ServiceParameters, onResult: (result: H.service.ServiceResult) => void, onError: (error: Error) => void): void; /** - * This method sends a "calculateisoline" request to Enterprise Routing REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occurred. + * This method sends a "calculateisoline" request to Enterprise Routing REST API and calls the onResult callback function once the service response was received - providing + * a H.service.ServiceResult object - or the onError callback if a communication error occurred. * @param calculateIsolineParams {H.service.ServiceParameters} - the service parameters to be sent with the routing request. * @param onResult {function(H.service.ServiceResult)} - this function will be called once the Enterprise Routing REST API provides a response to the request. * @param onError {function(Error)} - this function will be called if a communication error occurs during the JSON-P request @@ -3986,13 +4064,14 @@ declare namespace H { calculateIsoline(calculateIsolineParams: H.service.ServiceParameters, onResult: (result: H.service.ServiceResult) => void, onError: (error: Error) => void): void; } - export module EnterpriseRoutingService { + namespace EnterpriseRoutingService { /** * @property subDomain {string=} - The sub-domain of the routing service relative to the platform's base URL (default is 'route') * @property path {string=} - The path of the map tile service, default is "routing/7.2" - * @property baseUrl {H.service.Url=} - The base URL of the service, defaults to the the platform's base URL if instance was created using H.service.Platform#getEnterpriseRoutingService method. + * @property baseUrl {H.service.Url=} - The base URL of the service, defaults to the the platform's base URL if instance was created using H.service.Platform#getEnterpriseRoutingService + * method. */ - export interface Options { + interface Options { subDomain?: string; path?: string; baseUrl?: H.service.Url; @@ -4002,7 +4081,7 @@ declare namespace H { /** * This class encapsulates the Geocoding REST API in a service stub with calls to its various resources implemented. */ - export class GeocodingService extends H.service.AbstractRestService { + class GeocodingService extends H.service.AbstractRestService { /** * Constructor * @param opt_options {H.service.GeocodingService.Options=} @@ -4010,7 +4089,8 @@ declare namespace H { constructor(opt_options?: H.service.GeocodingService.Options); /** - * This method sends a reverse geocoding request to Geocoder REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occured. + * This method sends a reverse geocoding request to Geocoder REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult + * object - or the onError callback if a communication error occured. * @param geoodingParams {H.service.ServiceParameters} - the service parameters to be sent with the geocoding request. * @param onResult {function(H.service.ServiceResult)} - this function will be called once the Geocoder REST API provides a response to the request. * @param onError {function(Error)} - this function will be called if a communication error occurs during the JSON-P request @@ -4019,7 +4099,8 @@ declare namespace H { geocode(geoodingParams: H.service.ServiceParameters, onResult: (result: H.service.ServiceResult) => void, onError: (error: Error) => void): H.service.JsonpRequestHandle; /** - * This method sends a reverse geocoding request to Geocoder REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occured. + * This method sends a reverse geocoding request to Geocoder REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult + * object - or the onError callback if a communication error occured. * @param reverseGeocodingParams {H.service.ServiceParameters} - the service parameters to be sent with the reverse geocoding request * @param onResult {function(H.service.ServiceResult)} - this function will be called once the Geocoder REST API provides a response to the request. * @param onError {function(Error)} - this function will be called if a communication error occurs during the JSON-P request @@ -4028,7 +4109,8 @@ declare namespace H { reverseGeocode(reverseGeocodingParams: H.service.ServiceParameters, onResult: (result: H.service.ServiceResult) => void, onError: (error: Error) => void): H.service.JsonpRequestHandle; /** - * This method sends a landmark search request to Geocoder REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occured. + * This method sends a landmark search request to Geocoder REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult + * object - or the onError callback if a communication error occured. * @param searchParams {H.service.ServiceParameters} - the service parameters to be sent with the reverse geocoding request * @param onResult {function(H.service.ServiceResult)} - this function will be called once the Geocoder REST API provides a response to the request. * @param onError {function(Error)} - this function will be called if a communication error occurs during the JSON-P request @@ -4037,12 +4119,12 @@ declare namespace H { search(searchParams: H.service.ServiceParameters, onResult: (result: H.service.ServiceResult) => void, onError: (error: Error) => void): H.service.JsonpRequestHandle; } - export module GeocodingService { + namespace GeocodingService { /** * @property subDomain {string=} - the sub-domain of the geo-coding service relative to the platform's base URL, default is 'geocoder' * @property path {string=} - the path of the Geocoding service, default is '6.2' */ - export interface Options { + interface Options { subDomain?: string; path?: string; } @@ -4051,14 +4133,15 @@ declare namespace H { /** * An interface represents an object, that can be configured credentials, settings etc. by H.service.Platform */ - export interface IConfigurable { + interface IConfigurable { /** * This methods receive configuration parameters from the platform, that can be used by the object implementing the interface. * @param appId {string} - The application ID to identify the client against the platform (mandatory to provide) * @param appCode {string} - The application code to identify the client against the platform (mandatory to provide) * @param useHTTPS {boolean} - Indicates whether secure communication should be used, default is false * @param useCIT {boolean} - Indicates whether the Customer Integration Testing should be used, default is false - * @param opt_baseUrl {H.service.Url=} - The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified in the opt_baseUrl to use HTTPS. + * @param opt_baseUrl {H.service.Url=} - The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified in + * the opt_baseUrl to use HTTPS. * @returns {H.service.IConfigurable} */ configure(appId: string, appCode: string, useHTTPS: boolean, useCIT: boolean, opt_baseUrl?: H.service.Url): H.service.IConfigurable; @@ -4068,15 +4151,15 @@ declare namespace H { * @property id {number} - the ID associated internally with this request * @property cancel {function()} - this function cancels the request and invokes the errback function */ - export interface JsonpRequestHandle { + interface JsonpRequestHandle { id: number; - cancel: () => void; + cancel(): void; } /** * This class encapsulates a map tile end point of the HERE Map Tile API. */ - export class MapTileService extends H.util.EventTarget implements H.service.IConfigurable { + class MapTileService extends H.util.EventTarget implements H.service.IConfigurable { /** * Constructor * @param opt_options {H.service.MapTileService.Options=} @@ -4111,7 +4194,8 @@ declare namespace H { * @param opt_options {H.service.TileProviderOptions=} - additional set of options for the provider * @returns {H.map.provider.ImageTileProvider} - the image tile provider */ - createTileProvider(tileType: string, scheme: string, tileSize: number, format: string, opt_additionalParameters?: H.service.ServiceParameters, opt_options?: H.service.TileProviderOptions): H.map.provider.ImageTileProvider; + createTileProvider(tileType: string, scheme: string, tileSize: number, format: string, opt_additionalParameters?: H.service.ServiceParameters, opt_options?: H.service.TileProviderOptions): + H.map.provider.ImageTileProvider; /** * This method creates a tile layer. This layer can be used as a layer on a map's data model. @@ -4125,7 +4209,8 @@ declare namespace H { * @param opt_options {H.service.TileProviderOptions=} - additional set of options for the provider * @returns {H.map.layer.TileLayer} - the tile layer */ - createTileLayer(tileType: string, scheme: string, tileSize: number, format: string, opt_additionalParameters?: H.service.ServiceParameters, opt_opacity?: number, opt_dark?: boolean, opt_options?: H.service.TileProviderOptions): H.map.layer.TileLayer; + createTileLayer(tileType: string, scheme: string, tileSize: number, format: string, opt_additionalParameters?: H.service.ServiceParameters, opt_opacity?: number, opt_dark?: boolean, + opt_options?: H.service.TileProviderOptions): H.map.layer.TileLayer; /** * This methods receive configuration parameters from the platform, that can be used by the object implementing the interface. @@ -4133,13 +4218,14 @@ declare namespace H { * @param appCode {string} - The application code to identify the client against the platform (mandatory to provide) * @param useHTTPS {boolean} - Indicates whether secure communication should be used, default is false * @param useCIT {boolean} - Indicates whether the Customer Integration Testing should be used, default is false - * @param opt_baseUrl {H.service.Url=} - The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified in the opt_baseUrl to use HTTPS. + * @param opt_baseUrl {H.service.Url=} - The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified in + * the opt_baseUrl to use HTTPS. * @returns {H.service.IConfigurable} */ configure(appId: string, appCode: string, useHTTPS: boolean, useCIT: boolean, opt_baseUrl?: H.service.Url): H.service.IConfigurable; } - export module MapTileService { + namespace MapTileService { /** * @property maps {Object} - * @property schemes {Object} - @@ -4148,7 +4234,7 @@ declare namespace H { * @property resolutions {Object} - * @property languages {Object} - */ - export interface Info { + interface Info { maps: { [key: string]: any }; schemes: { [key: string]: any }; tiletypes: { [key: string]: any }; @@ -4163,7 +4249,7 @@ declare namespace H { * @property subDomain {string=} - the sub-domain of the map tile service relative to the platform's base URL, default is 'maps' * @property path {string=} - the path of the map tile service, default is 'maptile/2.1' */ - export interface Options { + interface Options { type?: string; version?: string; subDomain?: string; @@ -4172,7 +4258,8 @@ declare namespace H { } /** - * A map type is an object holding tile layers corresponding to a map type (e.g. 'normal', 'satellite' or 'terrain'). A map type contains at least a map property which defines the basic map layer for a given map type. In addition it can hold other map layers with the given style, e.g. base, xbase, traffic etc. + * A map type is an object holding tile layers corresponding to a map type (e.g. 'normal', 'satellite' or 'terrain'). A map type contains at least a map property which defines the basic + * map layer for a given map type. In addition it can hold other map layers with the given style, e.g. base, xbase, traffic etc. * @property map {H.map.layer.TileLayer} - the basic map tiles with all features and labels * @property mapnight {H.map.layer.TileLayer} - the basic map tiles with all features and labels (night mode) * @property xbase {H.map.layer.TileLayer=} - map tiles without features and labels @@ -4186,7 +4273,7 @@ declare namespace H { * @property panoramanight {H.map.layer.TileLayer=} - map tiles highlighting areas with HERE StreetLevel coverage (night mode) * @property labels {H.map.layer.TileLayer=} - transparent map tiles with labels only */ - export interface MapType { + interface MapType { map: H.map.layer.TileLayer; mapnight: H.map.layer.TileLayer; xbase?: H.map.layer.TileLayer; @@ -4204,7 +4291,7 @@ declare namespace H { /** * Places service implements a low level places RestApi access. Please refer to Restful API documentation for providing parameters and handling response objects. */ - export class PlacesService extends H.service.AbstractRestService { + class PlacesService extends H.service.AbstractRestService { /** * Constructor * @param opt_options {H.service.PlacesService.Options=} @@ -4214,12 +4301,13 @@ declare namespace H { /** * This is generic method to query places RestAPI. * @param entryPoint {string} - can be one of available entry points H.service.PlacesService.EntryPoint i.e value of H.service.PlacesService.EntryPoint.SEARCH - * @param entryPointParams {Object} - parameter map key value pairs will be transformed into the url key=value parametes. For entry point parameters description please refer to places restful api documentation documentation for available parameters for chose entry point + * @param entryPointParams {Object} - parameter map key value pairs will be transformed into the url key=value parametes. For entry point parameters description please refer to places + * restful api documentation documentation for available parameters for chose entry point * @param onResult {Function} - callback which is called when result is returned * @param onError {Function} - callback which is called when error occured (i.e request timeout) * @returns {H.service.JsonpRequestHandle} - jsonp request handle */ - request(entryPoint: string, entryPointParams: Object, onResult: Function, onError: Function): H.service.JsonpRequestHandle; + request(entryPoint: string, entryPointParams: {}, onResult: () => void, onError: () => void): H.service.JsonpRequestHandle; /** * Function triggers places api 'search' entry point. Please refer to documentation for parameter specification and response handling. @@ -4228,7 +4316,7 @@ declare namespace H { * @param onError {Function} * @returns {H.service.JsonpRequestHandle} - jsonp request handle */ - search(searchParams: H.service.ServiceParameters, onResult: Function, onError: Function): H.service.JsonpRequestHandle; + search(searchParams: H.service.ServiceParameters, onResult: () => void, onError: () => void): H.service.JsonpRequestHandle; /** * Function triggers places api 'suggestions' entry point. Please refer to documentation for parameter specification and response handling. @@ -4237,7 +4325,7 @@ declare namespace H { * @param onError {Function} * @returns {H.service.JsonpRequestHandle} - jsonp request handle */ - suggest(suggestParams: H.service.ServiceParameters, onResult: Function, onError: Function): H.service.JsonpRequestHandle; + suggest(suggestParams: H.service.ServiceParameters, onResult: () => void, onError: () => void): H.service.JsonpRequestHandle; /** * Function triggers places api 'explore' entry point. Please refer to documentation for parameter specification and response handling. @@ -4246,7 +4334,7 @@ declare namespace H { * @param onError {Function} * @returns {H.service.JsonpRequestHandle} - jsonp request handle */ - explore(exploreParams: H.service.ServiceParameters, onResult: Function, onError: Function): H.service.JsonpRequestHandle; + explore(exploreParams: H.service.ServiceParameters, onResult: () => void, onError: () => void): H.service.JsonpRequestHandle; /** * Function triggers places api 'around' entry point. Please refer to documentation for parameter specification and response handling. @@ -4255,7 +4343,7 @@ declare namespace H { * @param onError {Function} * @returns {H.service.JsonpRequestHandle} - jsonp request handle */ - around(aroundParams: H.service.ServiceParameters, onResult: Function, onError: Function): H.service.JsonpRequestHandle; + around(aroundParams: H.service.ServiceParameters, onResult: () => void, onError: () => void): H.service.JsonpRequestHandle; /** * Function triggers places api 'here' entry point. Please refer to documentation for parameter specification and response handling. @@ -4264,7 +4352,7 @@ declare namespace H { * @param onError {Function} * @returns {H.service.JsonpRequestHandle} - jsonp request handle */ - here(hereParams: H.service.ServiceParameters, onResult: Function, onError: Function): H.service.JsonpRequestHandle; + here(hereParams: H.service.ServiceParameters, onResult: () => void, onError: () => void): H.service.JsonpRequestHandle; /** * Function triggers places api 'categories' entry point. Please refer to documentation for parameter specification and response handling. @@ -4273,7 +4361,7 @@ declare namespace H { * @param onError {Function} * @returns {H.service.JsonpRequestHandle} - jsonp request handle */ - categories(categoriesParams: H.service.ServiceParameters, onResult: Function, onError: Function): H.service.JsonpRequestHandle; + categories(categoriesParams: H.service.ServiceParameters, onResult: () => void, onError: () => void): H.service.JsonpRequestHandle; /** * This method should be used to follow hyperlinks available in results returned by dicovery queries. @@ -4283,14 +4371,14 @@ declare namespace H { * @param opt_additionalParameters {Object=} - additional parameters to send with request * @returns {H.service.JsonpRequestHandle} - jsonp resquest handle */ - follow(hyperlink: string, onResult: Function, onError: Function, opt_additionalParameters?: Object): H.service.JsonpRequestHandle; + follow(hyperlink: string, onResult: () => void, onError: () => void, opt_additionalParameters?: {}): H.service.JsonpRequestHandle; } - export module PlacesService { + namespace PlacesService { /** * List of available entry points */ - export enum EntryPoint { + enum EntryPoint { SEARCH, SUGGEST, EXPLORE, @@ -4304,7 +4392,7 @@ declare namespace H { * @property path {string=} - the path of the places service, default is 'places/v1' * @property baseUrl {H.service.Url=} - an optional base URL if it differs from the platform's default base URL */ - export interface Options { + interface Options { subDomain?: string; path?: string; baseUrl?: H.service.Url; @@ -4312,9 +4400,10 @@ declare namespace H { } /** - * The Platform class represents central class from which all other service stubs are created. It also contains the shared settings to be passed to the individual service stubs, for example the root URL of the platform, application credentials, etc. + * The Platform class represents central class from which all other service stubs are created. It also contains the shared settings to be passed to the individual service stubs, for example + * the root URL of the platform, application credentials, etc. */ - export class Platform { + class Platform { /** * Constructor * @param options {H.service.Platform.Options} @@ -4381,15 +4470,18 @@ declare namespace H { /** * This method creates a pre-configured set of HERE tile layers for convenient use with the map. - * @param opt_tileSize {(H.service.Platform.DefaultLayersOptions | number)=} - When a number – optional tile size to be queried from the HERE Map Tile API, default is 256. If the parameter is an object, then it represents options and all remaining below parameters should be omitted. + * @param opt_tileSize {(H.service.Platform.DefaultLayersOptions | number)=} - When a number – optional tile size to be queried from the HERE Map Tile API, default is 256. + * If theparameter is an object, then it represents options and all remaining below parameters should be omitted. * @param opt_ppi {number=} - optional 'ppi' parameter to use when querying tiles, default is not specified * @param opt_lang {string=} - optional primary language parameter, default is not specified * @param opt_secondaryLang {string=} - optional secondary language parameter, default is not specified * @param opt_style {string=} - optional 'style' parameter to use when querying map tiles, default is not specified - * @param opt_pois {(string | boolean)=} - indicates if pois are displayed on the map. Pass true to indicate that all pois should be visible. Alternatively you can specify mask for the POI Categories as described at the Map Tile API documentation POI Categories chapter. + * @param opt_pois {(string | boolean)=} - indicates if pois are displayed on the map. Pass true to indicate that all pois should be visible. Alternatively you can specify mask for the + * POI Categories as described at the Map Tile API documentation POI Categories chapter. * @returns {Object} - a set of tile layers ready to use */ - createDefaultLayers(opt_tileSize?: (H.service.Platform.DefaultLayersOptions | number), opt_ppi?: number, opt_lang?: string, opt_secondaryLang?: string, opt_style?: string, opt_pois?: (string | boolean)): H.service.Platform.MapTypes; + createDefaultLayers(opt_tileSize?: (H.service.Platform.DefaultLayersOptions | number), opt_ppi?: number, opt_lang?: string, opt_secondaryLang?: string, opt_style?: string, + opt_pois?: (string | boolean)): H.service.Platform.MapTypes; /** * This method returns an instance of H.service.RoutingService to query the Routing API. @@ -4419,7 +4511,7 @@ declare namespace H { getEnterpriseRoutingService(opt_options?: H.service.EnterpriseRoutingService.Options): H.service.EnterpriseRoutingService; } - export module Platform { + namespace Platform { /** * Options used to create default layers * @property tileSize {number=} - tile size to be queried from the HERE Map Tile API, default is 256 @@ -4428,9 +4520,10 @@ declare namespace H { * @property lg2 {string=} - optional secondary language parameter, default is not specified * @property style {string=} - optional 'style' parameter to use when querying map tiles, default is not specified * @property pois {boolean=} - indicates if pois are displayed on the map - * @property crossOrigin {(string | boolean=)} - indicates if CORS headers should be used for default layers, if false is specified, CORS headers are not set, defaults to 'anonymous'. Be aware that storing of content is not possible if crossOrigin is not set to true (see H.Map#storeContent). + * @property crossOrigin {(string | boolean=)} - indicates if CORS headers should be used for default layers, if false is specified, CORS headers are not set, defaults to 'anonymous'. + * Be aware that storing of content is not possible if crossOrigin is not set to true (see H.Map#storeContent). */ - export interface DefaultLayersOptions { + interface DefaultLayersOptions { tileSize?: number; ppi?: number; lg?: string; @@ -4447,7 +4540,7 @@ declare namespace H { * @property useCIT {boolean=} - Indicates whether the Customer Integration Testing should be used, default is false * @property useHTTPS {boolean=} - Indicates whether secure communication should be used, default is false */ - export interface Options { + interface Options { app_id: string; app_code: string; baseUrl?: H.service.Url; @@ -4458,7 +4551,7 @@ declare namespace H { /** * pre-configured set of HERE tile layers for convenient use with the map. */ - export interface MapTypes { + interface MapTypes { normal?: H.service.MapType; satellite?: H.service.MapType; terrain?: H.service.MapType; @@ -4467,9 +4560,10 @@ declare namespace H { } /** - * This class encapsulates the Routing REST API as a service stub. An instance of this class can be retrieved by calling the factory method on a platform instance. H.service.Platform#getRoutingService. + * This class encapsulates the Routing REST API as a service stub. An instance of this class can be retrieved by calling the factory method on a platform instance. + * H.service.Platform#getRoutingService. */ - export class RoutingService extends H.service.AbstractRestService { + class RoutingService extends H.service.AbstractRestService { /** * Constructor * @param opt_options {H.service.RoutingService.Options=} @@ -4477,7 +4571,8 @@ declare namespace H { constructor(opt_options?: H.service.RoutingService.Options); /** - * This method sends a "calculateroute" request to Routing REST API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occured. + * This method sends a "calculateroute" request to Routing REST API and calls the onResult callback function once the service response was received - providing a + * H.service.ServiceResult object - or the onError callback if a communication error occured. * @param calculateRouteParams {H.service.ServiceParameters} - the service parameters to be sent with the routing request. * @param onResult {function(H.service.ServiceResult)} - this function will be called once the Routing REST API provides a response to the request. * @param onError {function(Error)} - this function will be called if a communication error occurs during the JSON-P request @@ -4485,13 +4580,13 @@ declare namespace H { calculateRoute(calculateRouteParams: H.service.ServiceParameters, onResult: (result: H.service.ServiceResult) => void, onError: (error: Error) => void): void; } - export module RoutingService { + namespace RoutingService { /** * @property subDomain {string=} - the sub-domain of the routing service relative to the platform's base URL, default is 'route' * @property path {string=} - the path of the map tile service, default is 'routing/7.2' * @property baseUrl {H.service.Url=} - an optional base URL if it differs from the platform's default base URL */ - export interface Options { + interface Options { subDomain?: string; path?: string; baseUrl?: H.service.Url; @@ -4501,14 +4596,14 @@ declare namespace H { /** * This type encapsulates URL parameters to be sent to a HERE platform service. */ - export interface ServiceParameters { + interface ServiceParameters { [key: string]: string; } /** * This type encapsulates a response object provider by a HERE platform service. */ - export interface ServiceResult { + interface ServiceResult { [key: string]: string; } @@ -4516,14 +4611,15 @@ declare namespace H { * Options which are used to initialize the tile provider. * @property crossOrigin {boolean=} - The string to be set for the crossOrigin attribute for loaded images */ - export interface TileProviderOptions { + interface TileProviderOptions { crossOrigin?: boolean; } /** - * TrafficIncindentsService provides functionality to the low level traffic incidents api Traffic API documentation where it is possible to retrieve traffic incident information on a tile basis + * TrafficIncindentsService provides functionality to the low level traffic incidents api Traffic API documentation where it is possible to retrieve traffic incident information on a + * tile basis */ - export class TrafficIncidentsService extends H.service.AbstractRestService { + class TrafficIncidentsService extends H.service.AbstractRestService { /** * Constructor * @param opt_options {H.service.TrafficIncidentsService.Options=} @@ -4549,16 +4645,17 @@ declare namespace H { * @param opt_serviceParams {H.service.ServiceParameters=} - optional service parameters to be added to the request * @returns {H.service.JsonpRequestHandle} */ - requestIncidentsByTile(x: number, y: number, z: number, onResponse: (result: H.service.ServiceResult) => void, onError: () => void, opt_serviceParams?: H.service.ServiceParameters): H.service.JsonpRequestHandle; + requestIncidentsByTile(x: number, y: number, z: number, onResponse: (result: H.service.ServiceResult) => void, onError: () => void, opt_serviceParams?: H.service.ServiceParameters): + H.service.JsonpRequestHandle; } - export module TrafficIncidentsService { + namespace TrafficIncidentsService { /** * @property subDomain {string=} - the sub-domain of the traffic incidents service relative to the platform's base URL, default is 'traffic' * @property path {string=} - the path of the traffic incidents service, default is 'traffic/6.1' * @property baseUrl {H.service.Url=} - an optional base URL if it differs from the platform's default base URL */ - export interface Options { + interface Options { subDomain?: string; path?: string; baseUrl?: H.service.Url; @@ -4566,9 +4663,10 @@ declare namespace H { } /** - * This class represents a URL giving access to the individual parts that make up a URL,such as the scheme, host/domain, path, etc. Use the static parse method to populate a new URL object from a URL string. Be aware that URLs with user and password like "ftp://user:password@foo.bar/" are not supported! + * This class represents a URL giving access to the individual parts that make up a URL,such as the scheme, host/domain, path, etc. Use the static parse method to populate a new URL object + * from a URL string. Be aware that URLs with user and password like "ftp://user:password@foo.bar/" are not supported! */ - export class Url { + class Url { /** * Constructor * @param scheme {string} - the URL scheme (e.g. "http" or "https" or "mailto") @@ -4578,7 +4676,7 @@ declare namespace H { * @param opt_port {number=} - The port of the host on which the host listens. If a string is passed it must be convertible to an integer. * @param opt_anchor {string=} - an optional anchor part of the URL (usually preceded by '#'); */ - constructor(scheme: string, host: string, opt_path?: string, opt_params?: Object, opt_port?: number, opt_anchor?: string); + constructor(scheme: string, host: string, opt_path?: string, opt_params?: {}, opt_port?: number, opt_anchor?: string); /** * This function parses a URL string and returns a H.service.Url object. The URL string must contain at least a scheme and a host. @@ -4589,7 +4687,8 @@ declare namespace H { static parse(url: string, opt_baseURL?: string): H.service.Url; /** - * Clones this URL object. Optionally, mutations can be passed to this function to modify properties of the cloned object. Note that URL parameters are not replaced but merged with the parameters of this instance. + * Clones this URL object. Optionally, mutations can be passed to this function to modify properties of the cloned object. Note that URL parameters are not replaced but merged with the + * parameters of this instance. * @returns {H.service.Url} - the clone of the URL object */ clone(): H.service.Url; @@ -4634,11 +4733,12 @@ declare namespace H { getPath(): string | void; /** - * This function sets the specified parameters for this URL object. Keys in this object, which are associated with undefined values will be treated as query string parameters with no value. + * This function sets the specified parameters for this URL object. Keys in this object, which are associated with undefined values will be treated as query string parameters + * with no value. * @param params {(Object | undefined)} - a hash of query string parameters specifying the parameters to be set.or a boolean to clear the parameters. * @returns {H.service.Url} - this URL object */ - setQuery(params?: Object | boolean): H.service.Url; + setQuery(params?: {} | boolean): H.service.Url; /** * This function returns a boolean value indicating whether there are any query string parameter associated with this URL. @@ -4650,7 +4750,7 @@ declare namespace H { * This function returns the query object of this Url object. * @returns {Object} - the query object */ - getQuery(): Object; + getQuery(): {}; /** * This function sets the anchor of this URL object. @@ -4666,11 +4766,12 @@ declare namespace H { getAnchor(): string | void; /** - * This function merges the provided parameters into this URL's existing parameters. Key-value pairs which are defined in the argument and this URL's parameters will be overwritten. Key-value pairs which are defined in the argument and are not defined in this URL's parameters will be added. Prototype properties and function properties will not be merged. + * This function merges the provided parameters into this URL's existing parameters. Key-value pairs which are defined in the argument and this URL's parameters will be overwritten. + * Key-value pairs which are defined in the argument and are not defined in this URL's parameters will be added. Prototype properties and function properties will not be merged. * @param other {Object} - the parmeters to be merged into this URL's query string parameters * @returns {H.service.Url} - this URL object */ - mergeQuery(other: Object): H.service.Url; + mergeQuery(other: {}): H.service.Url; /** * This function adds a sub-domain to the host of this URL object. @@ -4693,11 +4794,11 @@ declare namespace H { toString(): string; } - export module metaInfo { + namespace metaInfo { /** * This class encapsulates a Metainfo Tile end point of the HERE Map Tile API. */ - export class Service extends H.util.EventTarget implements H.service.IConfigurable { + class Service extends H.util.EventTarget implements H.service.IConfigurable { /** * Constructor * @param opt_options {H.service.metaInfo.Service.Options=} - additional service parameters @@ -4726,7 +4827,8 @@ declare namespace H { * @param opt_scheme {string=} - the scheme for which the meta info tiles a requested (default is 'normal.day') * @returns {H.map.provider.TileProvider} - the tile provider */ - createTileProvider(tileSize: number, pixelRatio: number, opt_categoryFilter?: Array, opt_additionalParameters?: H.service.ServiceParameters, opt_tileType?: string, opt_scheme?: string): H.map.provider.TileProvider; + createTileProvider(tileSize: number, pixelRatio: number, opt_categoryFilter?: string[], opt_additionalParameters?: H.service.ServiceParameters, opt_tileType?: string, + opt_scheme?: string): H.map.provider.TileProvider; /** * This method creates a tile layer. This layer can be used as a layer on a map's data model. @@ -4738,7 +4840,8 @@ declare namespace H { * @param opt_scheme {string=} - the scheme for which the meta info tiles a requested (default is 'normal.day') * @returns {H.map.layer.TileLayer} - the tile layer */ - createTileLayer(tileSize: number, pixelRatio: number, opt_categoryFilter?: Array, opt_additionalParameters?: H.service.ServiceParameters, opt_tileType?: string, opt_scheme?: string): H.map.layer.TileLayer; + createTileLayer(tileSize: number, pixelRatio: number, opt_categoryFilter?: string[], opt_additionalParameters?: H.service.ServiceParameters, opt_tileType?: string, + opt_scheme?: string): H.map.layer.TileLayer; /** * This methods receive configuration parameters from the platform, that can be used by the object implementing the interface. @@ -4746,13 +4849,14 @@ declare namespace H { * @param appCode {string} - The application code to identify the client against the platform (mandatory to provide) * @param useHTTPS {boolean} - Indicates whether secure communication should be used, default is false * @param useCIT {boolean} - Indicates whether the Customer Integration Testing should be used, default is false - * @param opt_baseUrl {H.service.Url=} - The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified in the opt_baseUrl to use HTTPS. + * @param opt_baseUrl {H.service.Url=} - The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified + * in the opt_baseUrl to use HTTPS. * @returns {H.service.IConfigurable} */ configure(appId: string, appCode: string, useHTTPS: boolean, useCIT: boolean, opt_baseUrl?: H.service.Url): H.service.IConfigurable; } - export module Service { + namespace Service { /** * @property maps {Object} - * @property schemes {Object} - @@ -4761,7 +4865,7 @@ declare namespace H { * @property resolutions {Object} - * @property languages {Object} - */ - export interface Info { + interface Info { maps: { [key: string]: any }; schemes: { [key: string]: any }; tiletypes: { [key: string]: any }; @@ -4771,11 +4875,12 @@ declare namespace H { } /** - * @property type {string=} - the type of the map tile service to communicate with, e.g. 'base' (default), 'aerial', etc. (refer to the Map Tile REST API documentation for available types) + * @property type {string=} - the type of the map tile service to communicate with, e.g. 'base' (default), 'aerial', etc. (refer to the Map Tile REST API documentation for + * available types) * @property version {string=} - the map version hash to use for retrieving tiles, default is newest and will be automatically updated * @property subDomain {string=} - the sub-domain of the map tile service relative to the platform's base URL, default is 'maps' */ - export interface Options { + interface Options { type?: string; version?: string; subDomain?: string; @@ -4785,7 +4890,7 @@ declare namespace H { /** * This class utilizes Metainfo Tiles functionality provided by the Map Tile API to load meta information about map objects (buildings, labels, public transport etc.). */ - export class TileProvider extends H.map.provider.RemoteTileProvider { + class TileProvider extends H.map.provider.RemoteTileProvider { /** * Constructor * @param service {(H.service.metaInfo.Service | H.service.MapTileService)} - the tile service which holds information from about the source of the tiles @@ -4795,7 +4900,7 @@ declare namespace H { constructor(service: (H.service.metaInfo.Service | H.service.MapTileService), opt_params?: H.service.ServiceParameters, opt_options?: H.service.metaInfo.TileProvider.Options); } - export module TileProvider { + namespace TileProvider { /** * Configuration object which can be used to initialize the TileProvider. * @property tileType {string=} - The tile type for which to request meta info @@ -4805,22 +4910,22 @@ declare namespace H { * @property pixelRatio {number=} - The pixel ratio to use for over-sampling in cases of high-resolution displays * @property categoryFilter {Array=} - A list of meta-info category names which should be suppressed. See Metainfo Tile for valid category names. */ - export interface Options { + interface Options { tileType?: string; scheme?: string; tileCacheSize?: number; tileSize?: number; pixelRatio?: number; - categoryFilter?: Array; + categoryFilter?: string[]; } } } - export module venues { + namespace venues { /** * The class represents the building in the venue hiearachy (see H.service.venues.Venue) and holds floors that belong to the building. */ - export class Building extends H.map.Group { + class Building extends H.map.Group { /** * Constructor * @param provider {H.map.provider.ObjectProvider} - The object provider of this venue building @@ -4857,9 +4962,10 @@ declare namespace H { } /** - * The class represents the floor object in the venue hierarchy (see H.service.venues.Venue). The class holds information about floor geometry and spaces (see H.service.venues.Space) that belong to this floor. + * The class represents the floor object in the venue hierarchy (see H.service.venues.Venue). The class holds information about floor geometry and spaces (see H.service.venues.Space) + * that belong to this floor. */ - export class Floor extends H.map.Group { + class Floor extends H.map.Group { /** * Constructor * @param provider {H.map.provider.ObjectProvider} - The object provider of this venue floor @@ -4893,7 +4999,8 @@ declare namespace H { getBuilding(): H.service.venues.Building; /** - * Method returns raw data associated with the floor. For more details on data format see http://developer.here.com/rest-apis/documentation/venue-maps/topics/resource-type-venue-interaction-tile-floor.html + * Method returns raw data associated with the floor. For more details on data format see + * http://developer.here.com/rest-apis/documentation/venue-maps/topics/resource-type-venue-interaction-tile-floor.html * @returns {*} - the raw floor data object */ getData(): any; @@ -4909,7 +5016,7 @@ declare namespace H { /** * This class encapsulates methods to call Venue Maps API endpoints. */ - export class Service extends H.util.EventTarget implements H.service.IConfigurable { + class Service extends H.util.EventTarget implements H.service.IConfigurable { /** * Constructor * @param opt_options {H.service.venues.Service.Options=} - additional service parameters @@ -4917,7 +5024,8 @@ declare namespace H { constructor(opt_options?: H.service.venues.Service.Options); /** - * This method sends a discovery request to the Venue Maps API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object, or the onError callback if a communication error occured. + * This method sends a discovery request to the Venue Maps API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult + * object, or the onError callback if a communication error occured. * @param serviceParams {H.service.ServiceParameters} - the service parameters to be sent with the discovery request * @param onResult {function(H.service.ServiceResult)} - this function will be called once the Venue Maps API provides a response to the request * @param onError {function(string)} - this function will be called if a communication error occurs during request and error type is passed as an argument @@ -4925,7 +5033,8 @@ declare namespace H { discover(serviceParams: H.service.ServiceParameters, onResult: (res: H.service.ServiceResult) => void, onError: (s: string) => void): void; /** - * This method creates a tile layer which can be added to the map in order to see the venues. It uses Interaction Tile endpoint of the Venue Maps API, more at http://developer.here.com/rest-apis/documentation/venue-maps/topics/quick-start-get-interaction-tile.html. + * This method creates a tile layer which can be added to the map in order to see the venues. It uses Interaction Tile endpoint of the Venue Maps API, more at + * http://developer.here.com/rest-apis/documentation/venue-maps/topics/quick-start-get-interaction-tile.html. * @param opt_options {H.service.venues.TileProvider.Options=} - Tile provider options * @returns {H.map.layer.TileLayer} - the tile layer */ @@ -4943,18 +5052,19 @@ declare namespace H { * @param appCode {string} - The application code to identify the client against the platform (mandatory to provide) * @param useHTTPS {boolean} - Indicates whether secure communication should be used, default is false * @param useCIT {boolean} - Indicates whether the Customer Integration Testing should be used, default is false - * @param opt_baseUrl {H.service.Url=} - The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified in the opt_baseUrl to use HTTPS. + * @param opt_baseUrl {H.service.Url=} - The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified + * in the opt_baseUrl to use HTTPS. * @returns {H.service.IConfigurable} */ configure(appId: string, appCode: string, useHTTPS: boolean, useCIT: boolean, opt_baseUrl?: H.service.Url): H.service.IConfigurable; } - export module Service { + namespace Service { /** * @property subDomain {string=} - the sub-domain of the Venue Maps service relative to the platform's base URL, default is 'venue.maps' * @property path {string=} - the path to append after host name when making requests to the Venue Maps API, default is empty */ - export interface Options { + interface Options { subDomain?: string; path?: string; } @@ -4962,7 +5072,7 @@ declare namespace H { /** * The state types of the H.service.venues.Service. Possible states are: */ - export enum State { + enum State { ERROR, INIT, READY, @@ -4972,7 +5082,7 @@ declare namespace H { /** * Represents a spatial object for this space. Each space object contains data associated with that space and can be retrieved by using H.service.venues.Space#getData method. */ - export class Space { + class Space { /** * Constructor * @param provider {H.map.provider.ObjectProvider} - The provider of this object. @@ -4989,7 +5099,8 @@ declare namespace H { isFloorSpace(): boolean; /** - * This method sets custom style to use for rendering the labels. Should be called before the first render of the space, otherwise has no any effect. Note that due to the design consistency currently it is not allowed to change the font family and the size of the labels. + * This method sets custom style to use for rendering the labels. Should be called before the first render of the space, otherwise has no any effect. Note that due to the design + * consistency currently it is not allowed to change the font family and the size of the labels. * @param labelStyle {(H.map.SpatialStyle | H.map.SpatialStyle.Options)} - Custom label style */ initLabelStyle(labelStyle: (H.map.SpatialStyle | H.map.SpatialStyle.Options)): void; @@ -5001,16 +5112,17 @@ declare namespace H { getFloor(): H.service.venues.Floor; /** - * Method returns raw data associated with the space. For more details on data format see http://developer.here.com/rest-apis/documentation/venue-maps/topics/resource-type-venue-interaction-tile-space.html + * Method returns raw data associated with the space. For more details on data format see + * http://developer.here.com/rest-apis/documentation/venue-maps/topics/resource-type-venue-interaction-tile-space.html * @returns {Object} - raw space data object */ - getData(): Object; + getData(): {}; } /** * This class represents a Venue Maps tile provider which requests venues tiles from a platform venue tile service. */ - export class TileProvider extends H.map.provider.RemoteTileProvider { + class TileProvider extends H.map.provider.RemoteTileProvider { /** * Constructor * @param service {H.service.venues.Service} @@ -5031,24 +5143,27 @@ declare namespace H { getCurrentLevel(): number; } - export module TileProvider { + namespace TileProvider { /** * Configuration object which can be used to initialize the TileProvider. * @property tileCacheSize {number=} - The number of fully rendered spatial tiles that are cached for immediate reuse, default is 32 * @property pixelRatio {number=} - The pixel ratio to use for over-sampling in cases of high-resolution displays - * @property onSpaceCreated {function(H.service.venues.Space)=} - A callback function that is called on every created space (see H.service.venues.Space) object. The function can be used for space object styling. + * @property onSpaceCreated {function(H.service.venues.Space)=} - A callback function that is called on every created space (see H.service.venues.Space) object. The function can be + * used for space object styling. */ - export interface Options { + interface Options { tileCacheSize?: number; pixelRatio?: number; - onSpaceCreated?: (space: H.service.venues.Space) => void; + onSpaceCreated?(space: H.service.venues.Space): void; } } /** - * The class represents the venue, it is a root for the venue object heirarchy. The venue inherits from H.map.Group and holds building objects (see H.service.venues.Building). Building objects hold floor objects (see H.service.venues.Floor) and inherit from H.map.Group as well. Leaf objects are spaces (see H.service.venues.Space) that are spatial map objects and reside inside floor containers. + * The class represents the venue, it is a root for the venue object heirarchy. The venue inherits from H.map.Group and holds building objects (see H.service.venues.Building). + * Building objects hold floor objects (see H.service.venues.Floor) and inherit from H.map.Group as well. Leaf objects are spaces (see H.service.venues.Space) that are spatial map objects + * and reside inside floor containers. */ - export class Venue extends H.map.Group { + class Venue extends H.map.Group { /** * Constructor * @param provider {H.map.provider.ObjectProvider} - The object provider of this venue @@ -5073,11 +5188,11 @@ declare namespace H { } /***** ui *****/ - export module ui { + namespace ui { /** * This class represents the base class for UI controls on the map. */ - export class Control extends H.ui.base.Container { + class Control extends H.ui.base.Container { /** * This abstract method can be overridden by deriving classes to be invoked when the UI object's unit system changes. * @param unitSystem {H.ui.UnitSystem} - the unit system the UI currently uses @@ -5119,7 +5234,7 @@ declare namespace H { /** * This class represents a distance measurement control which helps calculating distances between geographical locations indicated by the user clicks. */ - export class DistanceMeasurement extends H.ui.Control { + class DistanceMeasurement extends H.ui.Control { /** * Constructor * @param opt_options {H.ui.DistanceMeasurement.Options=} - optional parameters to be passed to this control @@ -5127,7 +5242,7 @@ declare namespace H { constructor(opt_options?: H.ui.DistanceMeasurement.Options); } - export module DistanceMeasurement { + namespace DistanceMeasurement { /** * @property alignment {H.ui.LayoutAlignment=} - the layout alignment which should be applied to this control, default is H.ui.LayoutAlignment.RIGHT_BOTTOM * @property startIcon {H.map.Icon=} - the icon to use for the first measurement point @@ -5135,9 +5250,10 @@ declare namespace H { * @property endIcon {H.map.Icon=} - the icon to use for the last measurement point * @property splitIcon {H.map.Icon=} - the icon to use for indicating position under pointer over the line where new point will be created once user clicks * @property lineStyle {(H.map.SpatialStyle | H.map.SpatialStyle.Options)} - the style to use for connecting lines of the measurement points - * @property distanceFormatter {function(number)=} - Optional function used for formatting a distance. By default distance measurement tool will do the formatting according to the specified measurement unit (see H.ui.UI.Options#unitSystem) + * @property distanceFormatter {function(number)=} - Optional function used for formatting a distance. By default distance measurement tool will do the formatting according to the + * specified measurement unit (see H.ui.UI.Options#unitSystem) */ - export interface Options { + interface Options { alignment?: H.ui.LayoutAlignment; startIcon?: H.map.Icon; stopoverIcon?: H.map.Icon; @@ -5151,7 +5267,7 @@ declare namespace H { /** * This class represents an information bubble bound to a geo-position on the map. */ - export class InfoBubble extends base.Element { + class InfoBubble extends base.Element { /** * Constructor * @param position {H.geo.IPoint} - the geo-position to which this info bubble corresponds @@ -5196,24 +5312,25 @@ declare namespace H { getContentElement(): HTMLElement; /** - * This methods sets the content of the info bubble. This can either be a string (applied as innerHTML) to the content element of this info bubble or a HTML node which is appended to the content element. + * This methods sets the content of the info bubble. This can either be a string (applied as innerHTML) to the content element of this info bubble or a HTML node which is appended + * to the content element. * @param content {(string | Node)} - the content for this bubble */ setContent(content: string | Node): void; } - export module InfoBubble { + namespace InfoBubble { /** * This enumeration holds the state an info bubble can have. */ - export enum State { + enum State { /** This value represents the state where an info bubble is open and visible (value: 'open'). */ OPEN, /** This value represents the state where an info bubble is closed and invisible (value: 'closed') */ CLOSED, } - export interface Options { + interface Options { /** * a callback to be invoked when the info bubble's state changes * @param event {H.util.Event} @@ -5230,7 +5347,7 @@ declare namespace H { /** * This enumeration holds the possible layout alignments for the UI elements. */ - export enum LayoutAlignment { + enum LayoutAlignment { TOP_LEFT, TOP_CENTER, TOP_RIGHT, @@ -5248,7 +5365,7 @@ declare namespace H { /** * This class represents a menu control allowing to control which map type the map shows, etc. */ - export class MapSettingsControl extends H.ui.Control { + class MapSettingsControl extends H.ui.Control { /** * Constructor * @param opt_options {H.ui.MapSettingsControl.Options=} - optional parameters to be passed to this control @@ -5262,13 +5379,13 @@ declare namespace H { setIncidentsLayer(incidentsLayer: H.map.layer.Layer): void; } - export module MapSettingsControl { + namespace MapSettingsControl { /** * The map type entry is an object containing a display name and a map type object to which it refers. * @property name {string} - label which describes the map type * @property mapType {H.service.MapType} - reference to map type */ - export interface MapTypeEntry { + interface MapTypeEntry { name: string; mapType: H.service.MapType; } @@ -5278,9 +5395,9 @@ declare namespace H { * @property entries {Array=} - the map type entries to be shown in this map settings control * @property incidents {H.map.layer.Layer} - the traffic incidents layer to be activated by the map settings control */ - export interface Options { + interface Options { alignment?: H.ui.LayoutAlignment; - entries?: Array; + entries?: H.ui.MapSettingsControl.MapTypeEntry[]; incidents: H.map.layer.Layer; } } @@ -5288,7 +5405,7 @@ declare namespace H { /** * This class represents the UI controls for panorama */ - export class Pano extends H.ui.Control { + class Pano extends H.ui.Control { /** * Constructor * @param opt_options {H.ui.Pano.Options=} - optional parameters to be passed to the map. @@ -5296,12 +5413,12 @@ declare namespace H { constructor(opt_options?: H.ui.Pano.Options); } - export module Pano { + namespace Pano { /** * @property alignment {H.ui.LayoutAlignment=} - the layout alignment which should be applied to this control, default is H.ui.LayoutAlignment.RIGHT_BOTTOM * @property mapTypes {H.service.MapTypes} - The map types to use */ - export interface Options { + interface Options { alignment?: H.ui.LayoutAlignment; mapTypes: H.service.MapType; } @@ -5310,7 +5427,7 @@ declare namespace H { /** * This class represents a UI element showing the current zoom scale. */ - export class ScaleBar { + class ScaleBar { /** * Constructor * @param opt_options {H.ui.ScaleBar.Options=} - optional parameters to be passed to this scale bar. @@ -5318,11 +5435,11 @@ declare namespace H { constructor(opt_options?: H.ui.ScaleBar.Options); } - export module ScaleBar { + namespace ScaleBar { /** * @property alignment {H.ui.LayoutAlignment=} - the layout alignment which should be applied to this control, default is H.ui.LayoutAlignment.BOTTOM_RIGHT */ - export interface Options { + interface Options { alignment?: H.ui.LayoutAlignment; } } @@ -5330,7 +5447,7 @@ declare namespace H { /** * This class encapsulates map UI functionality. */ - export class UI implements H.util.ICapturable { + class UI implements H.util.ICapturable { /** * Constructor * @param map {H.Map} @@ -5383,7 +5500,7 @@ declare namespace H { * This method returns a list of info bubble objects which are currently attached to this UI. * @returns {Array} - the list of info bubbles */ - getBubbles(): Array; + getBubbles(): InfoBubble[]; /** * This method appends a control to the UI. @@ -5451,7 +5568,7 @@ declare namespace H { */ } - export module UI { + namespace UI { /** * Optional parameters to be passed to the UI constructor. * @property unitSystem {H.ui.UnitSystem=} - An optional unit system to be used by the UI, default is H.ui.UnitSystem.METRIC @@ -5461,9 +5578,11 @@ declare namespace H { * @property scalebar {(H.ui.ScaleBar.Options | boolean)=} - * @property panorama {(H.ui.Pano.Options | boolean)=} - * @property distancemeasurement {(H.ui.DistanceMeasurement.Options | boolean)=} - - * @property locale {(H.ui.i18n.Localization | string)=} - defines language in which UI can be rendered. It can be predefined H.ui.i18n.Localization object with custom translation map, or a string one of following 'en-US', 'de-DE', 'es-ES', 'fi-FI', 'fr-FR', 'it-IT', 'nl-NL', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'tr-TR', 'zh-CN'. If not defined ui will use 'en-US' by default + * @property locale {(H.ui.i18n.Localization | string)=} - defines language in which UI can be rendered. It can be predefined H.ui.i18n.Localization object with custom translation map, + * or a string one of following 'en-US', 'de-DE', 'es-ES', 'fi-FI', 'fr-FR', 'it-IT', 'nl-NL', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'tr-TR', 'zh-CN'. If not defined ui will use 'en-US' + * by default */ - export interface Options { + interface Options { unitSystem?: H.ui.UnitSystem; zoom?: (H.ui.ZoomControl.Options | boolean); zoomrectangle?: (H.ui.ZoomRectangle.Options | boolean); @@ -5478,7 +5597,7 @@ declare namespace H { /** * This enumeration holds the possible unit systems for the UI to display distances. */ - export enum UnitSystem { + enum UnitSystem { /** This value represents the imperial unit system using miles and feet (value: 'imperial'). */ IMPERIAL, /** This value represents the metric unit system using meters and kilometers, etc (value: 'metric'). */ @@ -5488,7 +5607,7 @@ declare namespace H { /** * This class represents the UI controls for zooming in an out of the map. */ - export class ZoomControl extends H.ui.Control { + class ZoomControl extends H.ui.Control { /** * Constructor * @param opt_options {H.ui.ZoomControl.Options=} - optional parameters to be passed to the map. @@ -5502,14 +5621,14 @@ declare namespace H { getZoomSpeed(): number; } - export module ZoomControl { + namespace ZoomControl { /** * @property zoomSpeed {number=} - the speed if zooming in and out in levels per millisecond, defaults to 0.05 * @property alignment {H.ui.LayoutAlignment=} - the layout alignment which should be applied to this control, defaults to H.ui.LayoutAlignment.RIGHT_MIDDLE * @property slider {boolean=} - flag whether to show the slider (true) or not, defaults to false * @property sliderSnaps {boolean=} - flag whether slider should snap to the integer values or not, defaults to false. This option has effect only if slider is enabled. */ - export interface Options { + interface Options { zoomSpeed?: number; alignment?: H.ui.LayoutAlignment; slider?: boolean; @@ -5520,7 +5639,7 @@ declare namespace H { /** * This class represents a zoom rectangle control element that allows zooming to the selected area on the screen. */ - export class ZoomRectangle extends H.ui.Control { + class ZoomRectangle extends H.ui.Control { /** * Constructor * @param opt_options {H.ui.ZoomRectangle.Options=} - optional parameters to be passed to this control @@ -5528,12 +5647,13 @@ declare namespace H { constructor(opt_options?: H.ui.ZoomRectangle.Options); } - export module ZoomRectangle { + namespace ZoomRectangle { /** * @property alignment {H.ui.LayoutAlignment=} - the layout alignment which should be applied to this control, default is H.ui.LayoutAlignment.BOTTOM_RIGHT - * @property adjustZoom {function(number, H.Map) : number=} - optional function that defines how zoom level should be changed, by default zoom level is picked to fit the bounding rectangle into the view port. + * @property adjustZoom {function(number, H.Map) : number=} - optional function that defines how zoom level should be changed, by default zoom level is picked to fit the + * bounding rectangle into the view port. */ - export interface Options { + interface Options { alignment?: H.ui.LayoutAlignment; adjustZoom?(n: number, m: H.Map): number; } @@ -5544,15 +5664,15 @@ declare namespace H { /** * This namespace contains basic UI elements from which the UI controls are built. */ - export module base { - export class Container extends H.util.EventTarget { + namespace base { + class Container extends H.util.EventTarget { /** * Constructor * @param opt_elementType {string=} - the type of HTML element this UI element renders as, default is 'div' * @param opt_className {string=} - an optional class name to be used on this element * @param opt_children {Array=} - optional child elements to be added to this container */ - constructor(opt_elementType?: string, opt_className?: string, opt_children?: Array); + constructor(opt_elementType?: string, opt_className?: string, opt_children?: Element[]); /** * Adds a child element to be rendered within the container element. @@ -5565,7 +5685,7 @@ declare namespace H { * Returns the child collection of this container. * @returns {Array} - Returns the child collection of this container. */ - getChildren(): Array; + getChildren(): Element[]; /** * Removes a child element from this container's child collection. @@ -5641,7 +5761,7 @@ declare namespace H { removeClass(className: string): Element; } - export class Element extends H.util.EventTarget { + class Element extends H.util.EventTarget { /** * Constructor * @param opt_elementType {string=} - the type of HTML element this UI element renders as, default is 'div' @@ -5721,16 +5841,16 @@ declare namespace H { /** * Namespace contains functionality related to internationalization. */ - export module i18n { + namespace i18n { /** * Default available locales. UI provides default translations for this set of locale codes. */ - export const defaultLocales: Array; + const defaultLocales: string[]; /** * This class is used for internationalization of UI components. */ - export class Localization { + class Localization { constructor(locale: string, opt_translationMap?: any); /** @@ -5743,7 +5863,7 @@ declare namespace H { * This method returns translation keys for current locale. Keys from this set can be used to get translations via translate method. * @returns {Array} */ - getKeys(): Array; + getKeys(): string[]; /** * This method returns a boolean value indicating whether this localization object has a translation for the specified translation key. @@ -5763,11 +5883,13 @@ declare namespace H { } /***** util *****/ - export module util { + namespace util { /** - * The cache represents a in-memory LRU-cache with a fixed size. It stores any data that is added until the cache's content exceeds a maximum size. Once the size of all content elements exceeds the maximum size the cache will drop the least recently retrieved elements until the size of the cache is within the bounds of its maximum size. Data elements are always associated with an identifier that allow to retrieve them at a later stage and their content size. + * The cache represents a in-memory LRU-cache with a fixed size. It stores any data that is added until the cache's content exceeds a maximum size. Once the size of all content elements + * exceeds the maximum size the cache will drop the least recently retrieved elements until the size of the cache is within the bounds of its maximum size. Data elements are always + * associated with an identifier that allow to retrieve them at a later stage and their content size. */ - export class Cache implements H.util.ICache { + class Cache implements H.util.ICache { /** * Constructor * @param maxSize {number} - the maximum size of the cache @@ -5819,7 +5941,8 @@ declare namespace H { drop(id: any): void; /** - * This method will execute the provided callback function on each of the cache's entries. If the optional match predicate is passed to this method the callback will only be executed on those entries for which the predicated returns true. + * This method will execute the provided callback function on each of the cache's entries. If the optional match predicate is passed to this method the callback will only be executed + * on those entries for which the predicated returns true. * @param callback {function(string, ?, number)} - the callback to be invoked for each entry * @param opt_ctx {Object=} - an optional context object to be used as this within the callback * @param opt_matcher {(function(string, ?, number) : boolean)=} - an optional match predicate to customize on which entries the callback will be called @@ -5827,8 +5950,10 @@ declare namespace H { forEach(callback: (s: string, i: any, n: number) => void, opt_ctx?: any, opt_matcher?: (s: string, i: any, n: number) => boolean): void; /** - * This method removes all data elements from the cache. If the optional match predicate is passed to this method only those data elements will be removed for which the predicate return true. - * @param opt_matcher {(function(string, ?, number) : boolean)=} - an optional function that receives an entries id, data and size and may return true or false to either remove it or leave the entry in the cache respectively + * This method removes all data elements from the cache. If the optional match predicate is passed to this method only those data elements will be removed for which the predicate + * return true. + * @param opt_matcher {(function(string, ?, number) : boolean)=} - an optional function that receives an entries id, data and size and may return true or false to either remove it or + * leave the entry in the cache respectively */ removeAll(opt_matcher?: (s: string, i: any, n: number) => boolean): void; @@ -5846,7 +5971,7 @@ declare namespace H { * @property type {string} - Name of the dispatched event * @property defaultPrevented {boolean} - Indicates if preventDefault was called on the current event */ - export class ChangeEvent extends H.util.Event { + class ChangeEvent extends H.util.Event { /** * Constructor * @param type {string} - The type of the event @@ -5875,7 +6000,7 @@ declare namespace H { * This class represents a contextual information/action. * @property SEPARATOR {H.util.ContextItem} - Separator for the context items */ - export class ContextItem extends H.util.EventTarget { + class ContextItem extends H.util.EventTarget { /** * Constructor * @param opt_options {H.util.ContextItem.Options=} - The values to initialize this context item @@ -5924,29 +6049,29 @@ declare namespace H { * @param callback {Function} - The callback function. * @param opt_scope {Object=} - An optional scope to call the callback in. */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; static SEPARATOR: H.util.ContextItem; } - export module ContextItem { + namespace ContextItem { /** * This type defines options which can be used to initialize the context item. * @property label {string=} - the label of the context item * @property disabled {boolean=} - flag indicatting whether context item is disabled or no, by default false * @property callback {function(H.util.Event)=} - Optional callback function to call once context item is selected */ - export interface Options { + interface Options { label?: string; disabled?: boolean; - callback?: (event: H.util.Event) => void; + callback?(event: H.util.Event): void; } } /** * Object which can be safely disposed. */ - export class Disposable { + class Disposable { /** * Constructor */ @@ -5957,7 +6082,7 @@ declare namespace H { * @param callback {Function} * @param opt_scope {Object=} */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; } /** @@ -5967,7 +6092,7 @@ declare namespace H { * @property type {string} - Name of the dispatched event * @property defaultPrevented {boolean} - Indicates if preventDefault was called on the current event */ - export class Event { + class Event { /** * Constructor * @param type {string} - Event Type. @@ -5994,14 +6119,15 @@ declare namespace H { /** * EventTarget enabled listening and dispatching events on all instances and derived classes. */ - export class EventTarget { + class EventTarget { /** * Constructor */ constructor(); /** - * This method allows to listen for specific event triggered by the object. Keep in mind, that you must removeEventListener manually or dispose an object when you no longer need it. Otherwise memory leak is possible. + * This method allows to listen for specific event triggered by the object. Keep in mind, that you must removeEventListener manually or dispose an object when you no longer need it. + * Otherwise memory leak is possible. * @param type {string} - name of event * @param handler {Function} - event handler function * @param opt_capture {boolean=} - if set to true will listen in the capture phase (bubble otherwise) @@ -6038,9 +6164,10 @@ declare namespace H { } /** - * An interface definition for the generic cache. Any data elements can be stored in the cache. They are always associated with an identifier to retrieve them at a later stage and their content size. + * An interface definition for the generic cache. Any data elements can be stored in the cache. They are always associated with an identifier to retrieve them at a later stage and their + * content size. */ - export interface ICache { + interface ICache { /** * This method adds an element to the cache. * @param id {*} - The identifier of this data element, the value is converted to a string. @@ -6065,16 +6192,19 @@ declare namespace H { drop(id: any): void; /** - * This method will execute the provided callback function on each of the cache's entries. If the optional match predicate is passed to this method the callback will only be executed on those entries for which the predicated returns true. + * This method will execute the provided callback function on each of the cache's entries. If the optional match predicate is passed to this method the callback will only be executed on + * those entries for which the predicated returns true. * @param callback {function(string, ?, number)} - the callback to be invoked for each entry * @param opt_ctx {Object=} - an optional context object to be used as this within the callback * @param opt_matcher {(function(string, ?, number) : boolean)=} - an optional match predicate to customize on which entries the callback will be called */ - forEach(callback: (s: string, t: any, n: number) => void, opt_ctx?: Object, opt_matcher?: ((s: string, t: any, n: number) => boolean)): void; + forEach(callback: (s: string, t: any, n: number) => void, opt_ctx?: {}, opt_matcher?: ((s: string, t: any, n: number) => boolean)): void; /** - * This method removes all data elements from the cache. If the optional match predicate is passed to this method only those data elements will be removed for which the predicate return true. - * @param opt_matcher {(function(string, ?, number) : boolean)=} - an optional function that receives an entries id, data and size and may return true or false to either remove it or leave the entry in the cache respectively + * This method removes all data elements from the cache. If the optional match predicate is passed to this method only those data elements will be removed for which the predicate + * return true. + * @param opt_matcher {(function(string, ?, number) : boolean)=} - an optional function that receives an entries id, data and size and may return true or false to either remove it or + * leave the entry in the cache respectively */ removeAll(opt_matcher?: ((s: string, t: any, n: number) => boolean)): void; @@ -6088,14 +6218,14 @@ declare namespace H { /** * An interface to cancelable requests and actions. */ - export interface ICancelable { + interface ICancelable { /** * This method is used to cancel current action */ cancel(): void; } - export interface ICapturable { + interface ICapturable { /** * This method is used to capture the element view * @param canvas {HTMLCanvasElement} - HTML Canvas element to draw the view of the capturable element @@ -6123,12 +6253,12 @@ declare namespace H { * @event set {H.util.OList.Event} - Fired when an entry was set in the list. * @event move {H.util.OList.Event} - Fired when an entry was moved within the list. */ - export class OList extends H.util.EventTarget { - + class OList extends H.util.EventTarget { /** * This method inserts an entry to the list. Optionally it can place new entry at provided index. * @param entry {?} - The entry to insert - * @param opt_idx {number=} - The index where the new entry should be inserted; if omitted or greater then the current size of the list, the entry is added at the end of the list; a negative index is treated as being relative from the end of the list + * @param opt_idx {number=} - The index where the new entry should be inserted; if omitted or greater then the current size of the list, the entry is added at the end of the list; + * a negative index is treated as being relative from the end of the list */ add(entry: any, opt_idx?: number): void; @@ -6178,7 +6308,7 @@ declare namespace H { * This method returns all list's entries as an array. * @returns {Array<*>} - The list as an array */ - asArray(): Array; + asArray(): any[]; /** * This method removes all entries from the list. @@ -6201,10 +6331,10 @@ declare namespace H { * @param callback {Function} - The callback function. * @param opt_scope {Object=} - An optional scope to call the callback in. */ - addOnDisposeCallback(callback: Function, opt_scope?: Object): void; + addOnDisposeCallback(callback: () => void, opt_scope?: {}): void; } - export module OList { + namespace OList { /** * The event class for events that are dispatched by OList * @property target {*} - Object which triggered the event @@ -6212,7 +6342,7 @@ declare namespace H { * @property type {string} - Name of the dispatched event * @property defaultPrevented {boolean} - Indicates if preventDefault was called on the current event */ - export class Event extends H.util.Event { + class Event extends H.util.Event { /** * Constructor * @param list {H.util.OList} - The OList instance which is emitting the event @@ -6244,7 +6374,7 @@ declare namespace H { /** * A generic class to represent a handle for any kind of asynchronous processed requests */ - export class Request { + class Request { /** * Constructor * @param opt_onprogress {function(H.util.Request)=} - A callback to invoke every time when the request's progress state changes @@ -6277,11 +6407,11 @@ declare namespace H { getFailed(): number; } - export module Request { + namespace Request { /** * The supported states of an request */ - export enum State { + enum State { PENDING, PROCESSING, COMPLETE, @@ -6290,11 +6420,11 @@ declare namespace H { } } - export module animation { + namespace animation { /** * This mamespace contains easing functions used for Animation class. */ - export class ease { + class ease { /** * This function defines linear ease. * @param val {number} - A value in range [0..1] to translate @@ -6332,13 +6462,13 @@ declare namespace H { } } - export module kinetics { + namespace kinetics { /** * This interface defines kinetic move parameters used by map for kinetic drag. * @property power {number} - Power multiplier. Multiplier is used to increase the speed of the kinetic move. By default map uses 1. * @property duration {number} - Defines duration of the kinetic move. */ - export interface IKinetics { + interface IKinetics { /** * Easing function modifies animation progress. In example it can modify the animation in a way it starts rapidly and then slows down at the end. * @param p {number} - current progress diff --git a/types/heremaps/tslint.json b/types/heremaps/tslint.json new file mode 100644 index 0000000000..4ac54521fe --- /dev/null +++ b/types/heremaps/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false] + } +} \ No newline at end of file From 2b5124dbb32c6525836591038af6f8558fe9d5de Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Wed, 7 Jun 2017 16:03:00 +0200 Subject: [PATCH 171/761] fix tests --- types/heremaps/heremaps-tests.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/types/heremaps/heremaps-tests.ts b/types/heremaps/heremaps-tests.ts index 43c50d417c..24c23b1a82 100644 --- a/types/heremaps/heremaps-tests.ts +++ b/types/heremaps/heremaps-tests.ts @@ -28,19 +28,19 @@ function capture(resultContainer: HTMLElement, map: H.Map, ui: H.ui.UI) { * Boilerplate map initialization code starts below: */ // Step 1: initialize communication with the platform -var platform = new H.service.Platform({ +let platform = new H.service.Platform({ app_id: 'DemoAppId01082013GAL', app_code: 'AJKnXv84fjrb0KIHawS0Tg', useHTTPS: true, useCIT: true }); -var defaultLayers = platform.createDefaultLayers(); +let defaultLayers = platform.createDefaultLayers(); -var mapContainer = document.getElementById('map'); +let mapContainer = document.getElementById('map'); // Step 2: initialize a map -var map = new H.Map(mapContainer, defaultLayers.normal.map, { +let map = new H.Map(mapContainer, defaultLayers.normal.map, { // initial center and zoom level of the map zoom: 16, // Champs-Elysees @@ -50,23 +50,22 @@ var map = new H.Map(mapContainer, defaultLayers.normal.map, { // Step 3: make the map interactive // MapEvents enables the event system // Behavior implements default interactions for pan/zoom (also on mobile touch environments) -var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map)); +let behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map)); // Step 4: Create the default UI -var ui = H.ui.UI.createDefault(map, defaultLayers, 'en-US'); - +let ui = H.ui.UI.createDefault(map, defaultLayers, 'en-US'); // Step 6: Create "Capture" button and place for showing the captured area -var resultContainer = document.getElementById('panel'); +let resultContainer = document.getElementById('panel'); // Create container for the "Capture" button -var containerNode = document.createElement('div'); +let containerNode = document.createElement('div'); containerNode.setAttribute('style', 'position:absolute;top:0;left:0;background-color:#fff; padding:10px;'); containerNode.className = 'btn-group'; // Create the "Capture" button -var captureBtn = document.createElement('input'); +let captureBtn = document.createElement('input'); captureBtn.value = 'Capture'; captureBtn.type = 'button'; captureBtn.className = 'btn btn-sm btn-default'; @@ -76,6 +75,6 @@ containerNode.appendChild(captureBtn); mapContainer.appendChild(containerNode); // Step 7: Handle capture button click event -captureBtn.onclick = function() { +captureBtn.onclick = () => { capture(resultContainer, map, ui); -}; \ No newline at end of file +}; From 3c47bbdafcfbd7855caa71edbf5e61e438e4a210 Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Wed, 7 Jun 2017 16:07:02 +0200 Subject: [PATCH 172/761] add test for #e054978b9cbc30623b8e8b2621319f21dafcc734 [e054978] --- types/heremaps/heremaps-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/heremaps/heremaps-tests.ts b/types/heremaps/heremaps-tests.ts index 24c23b1a82..31d722f042 100644 --- a/types/heremaps/heremaps-tests.ts +++ b/types/heremaps/heremaps-tests.ts @@ -78,3 +78,5 @@ mapContainer.appendChild(containerNode); captureBtn.onclick = () => { capture(resultContainer, map, ui); }; + +let icon = new H.map.Icon('svg', { size: 5, crossOrigin: false }); From 7d26db601830e3abbd2470aa575152eeda07cc5a Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Wed, 7 Jun 2017 16:38:42 +0200 Subject: [PATCH 173/761] fix documentation for param --- types/heredatalens/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/heredatalens/index.d.ts b/types/heredatalens/index.d.ts index 9b3ff44431..3499b6e9ca 100644 --- a/types/heredatalens/index.d.ts +++ b/types/heredatalens/index.d.ts @@ -618,7 +618,7 @@ declare namespace H { /** * A factory method for data-driven icons. The method allows you to build an icon from SVG markup or JsonML object. Provides caching of icons with the same markup. * @param svg {string | Array} - SVG presented as markup or JsonML Array - * @param options {H.map.Icon.Options} - Icon options (eg size and anchor). Note that the default anchor is in the middle. + * @param options {H.map.Icon.Options=} - Icon options (eg size and anchor). Note that the default anchor is in the middle. * @param options.size {H.math.ISize | number} - When the icon is a square, you can define the size as a number in pixels * @returns {H.map.Icon} - Icon which can be used for marker or cluster */ From 030cf63bc9d6b8332217d8667ac8e00f9b60e7d4 Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Wed, 7 Jun 2017 16:40:19 +0200 Subject: [PATCH 174/761] add missing function to H.datalens.ObjectLayer.Row --- types/heredatalens/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/heredatalens/index.d.ts b/types/heredatalens/index.d.ts index 3499b6e9ca..d646f79452 100644 --- a/types/heredatalens/index.d.ts +++ b/types/heredatalens/index.d.ts @@ -684,6 +684,7 @@ declare namespace H { */ interface Row { getPosition(): H.geo.Point; + isCluster(): boolean; lat: number; lng: number; } From 1dba9c6148058fad26fb4456eeb06a5bb33e4324 Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Wed, 7 Jun 2017 16:40:55 +0200 Subject: [PATCH 175/761] make properties optional in H.datalens.ObjectLayer.ObjectStyleOptions --- types/heredatalens/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/heredatalens/index.d.ts b/types/heredatalens/index.d.ts index d646f79452..5d7b9c7f18 100644 --- a/types/heredatalens/index.d.ts +++ b/types/heredatalens/index.d.ts @@ -705,9 +705,9 @@ declare namespace H { */ interface ObjectStyleOptions { icon: H.map.Icon; - style: H.map.SpatialStyle.Options; - arrows: H.map.ArrowStyle.Options; - zIndex: number; + style?: H.map.SpatialStyle.Options; + arrows?: H.map.ArrowStyle.Options; + zIndex?: number; } /** From 36fc5f5e5c435e83d1ce1e981d2fdea8dcd21707 Mon Sep 17 00:00:00 2001 From: Adrien Samson Date: Wed, 7 Jun 2017 16:48:07 +0200 Subject: [PATCH 176/761] node-getopt: options can be boolean, string or string[] --- types/node-getopt/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/node-getopt/index.d.ts b/types/node-getopt/index.d.ts index 304f09bd4c..afd0a89adf 100644 --- a/types/node-getopt/index.d.ts +++ b/types/node-getopt/index.d.ts @@ -8,8 +8,8 @@ */ -interface StringMap { - [index: string]: string; +interface OptionMap { + [index: string]: string | string[] | boolean; } /** @@ -17,14 +17,14 @@ interface StringMap { */ declare class ParsedOption { public argv: string[]; - public options: StringMap; + public options: OptionMap; - constructor(argv: string[], options: StringMap); + constructor(argv: string[], options: OptionMap); public empty(): boolean; } interface EventCallback { - (args: string[], options: StringMap): void; + (args: string[], options: OptionMap): void; } interface ErrorFunc { From 5186e49fda74d415a01a6e192b6f63bdaab42c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Nain?= Date: Wed, 7 Jun 2017 17:43:52 +0200 Subject: [PATCH 177/761] Update index.d.ts --- types/dygraphs/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/dygraphs/index.d.ts b/types/dygraphs/index.d.ts index 6d2cedf9d2..fb6f4b997d 100644 --- a/types/dygraphs/index.d.ts +++ b/types/dygraphs/index.d.ts @@ -1266,5 +1266,5 @@ declare class Dygraph { } declare module "dygraphs" { - export = Dygraph; -} \ No newline at end of file + export default Dygraph; +} From 3386890a9852298026b18c7110dfc27372fd5caa Mon Sep 17 00:00:00 2001 From: Jan Hommes Date: Wed, 7 Jun 2017 18:09:13 +0200 Subject: [PATCH 178/761] Updated o.js and odata types. --- types/o.js/index.d.ts | 9 ++- types/o.js/o.js-tests.ts | 7 +- types/odata/index.d.ts | 84 +++++++++++++++++++++ types/odata/odata-tests.ts | 151 +++++++++++++++++++++++++++++++++++++ types/odata/tsconfig.json | 26 +++++++ 5 files changed, 270 insertions(+), 7 deletions(-) create mode 100644 types/odata/index.d.ts create mode 100644 types/odata/odata-tests.ts create mode 100644 types/odata/tsconfig.json diff --git a/types/o.js/index.d.ts b/types/o.js/index.d.ts index 00a5f2b5ae..7cca909391 100644 --- a/types/o.js/index.d.ts +++ b/types/o.js/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for o.js v0.2.2 +// Type definitions for o.js v0.3.3 // Project: https://github.com/janhommes/o.js -// Definitions by: Matteo Antony Mistretta , Brad Zacher +// Definitions by: Matteo Antony Mistretta , Brad Zacher , Jan Hommes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module 'o.js' { @@ -8,13 +8,14 @@ declare module 'o.js' { interface Options { endpoint : string - json ?: boolean + format ?: string + autoFormat ?: boolean version ?: number strictMode ?: boolean start ?: () => any ready ?: () => any error ?: () => any - headers ?: string[] + headers ?: { name: string, value: string }[] username ?: string password ?: string isAsync ?: boolean diff --git a/types/o.js/o.js-tests.ts b/types/o.js/o.js-tests.ts index f40a84ac84..26cc187723 100644 --- a/types/o.js/o.js-tests.ts +++ b/types/o.js/o.js-tests.ts @@ -129,7 +129,7 @@ o().config({ }); // after you have set an endpoint, you can shorten your queries: o('Products').get(function(data) { - //same result like the first exmple on this page + //same result like the first example on this page }); @@ -137,13 +137,14 @@ o('Products').get(function(data) { //basic config o().config({ endpoint:null, // your odata endpoint for the service - json:true, // currently only json is supported + format:'json', // currently only json is supported + autoFormat: false, version:4, // oData version (currently supported version 4. However most also work with version 3.) strictMode:true, // strict mode throws exception, non strict mode only logs them start:null, // a function which is executed on loading ready:null, // a function which is executed on ready error:null, // a function which is executed on error - headers:[], // a array of additional headers e.g.: [{name:'headername',value:'headervalue'}] + headers:[{name: '', value: ''}], // a array of additional headers e.g.: [{name:'headername',value:'headervalue'}] username:null, // a basic auth username password:null, // a basic auth password isAsync:true //set this to false to make synced (a)jax calls. (dosn't work with basic auth!) diff --git a/types/odata/index.d.ts b/types/odata/index.d.ts new file mode 100644 index 0000000000..9419dd0ba4 --- /dev/null +++ b/types/odata/index.d.ts @@ -0,0 +1,84 @@ +// Type definitions for odata v0.3.3 +// Project: https://github.com/janhommes/odata +// Definitions by: Jan Hommes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'odata' { + import Q = require("q"); + + interface Options { + endpoint : string + format ?: boolean + autoFormat ?: string + version ?: number + strictMode ?: boolean + start ?: () => any + ready ?: () => any + error ?: () => any + headers ?: { name: string, value: string }[] + username ?: string + password ?: string + isAsync ?: boolean + } + + interface OHandler { + inlinecount : number + data : T + + config(options ?: Options) : OHandler + progress(callback : () => any) : OHandler + + get(callback ?: (data : T) => void) : Q.Promise> + save(callback ?: (data : T) => void) : Q.Promise> + + post(params : any) : OHandler + patch(params : any) : OHandler + put(params : any) : OHandler + remove(params ?: any) : OHandler + + routes(path : string, callback ?: (data : T) => void) : OHandler + route(path : string, callback ?: (data : T) => void) : OHandler + triggerRoute(hash : string) : OHandler + beforeRouting(callback : (routeParams : any) => boolean) : OHandler + + isEndpoint() : boolean + loading(startFn : () => any | boolean, endFn : () => any) : OHandler + + find(selector : string|number) : OHandler + + top(quantity : number) : OHandler + take(quantity : number) : OHandler + skip(quantity : number) : OHandler + first() : OHandler + + include(column : string, data : string) : OHandler + exclude(column : string, data : string) : OHandler + filterByList(column : string, data : string) : OHandler + + filter(filter : string) : OHandler + where(filter : string) : OHandler + any(filter : string, resource : string) : OHandler + search(columns : string[], term : string) : OHandler + + orderBy(column : string, direction ?: boolean) : OHandler + orderByDesc(column : string) : OHandler + select(selectStr : string) : OHandler + + count() : OHandler + inlineCount(paramName ?: string) : OHandler + + batch(resource : string) : OHandler + expand(resource : string) : OHandler + ref(resource : string, id : string | number) : OHandler + removeRef(resource : string, id : string | number) : OHandler + deleteRef(resource : string, id : string | number) : OHandler + } + + interface OFn extends OHandler { + (options ?: string | Options) : OHandler + } + + var o : OFn<{}>; + + export = o +} \ No newline at end of file diff --git a/types/odata/odata-tests.ts b/types/odata/odata-tests.ts new file mode 100644 index 0000000000..522dc3d529 --- /dev/null +++ b/types/odata/odata-tests.ts @@ -0,0 +1,151 @@ +import * as o from 'odata'; +import * as Q from "q"; + +interface Product { + ID : number; + Name : string; + Description : string; + ReleaseDate : string; + DiscontinuedDate : Date; + Rating: number; + Price: number; +} +interface Category { + ID : number; + Name : string; +} + +// copy pasta all the examples from the readme! + +o('http://services.odata.org/V4/OData/OData.svc/Products') + .get(function(data) { + console.log(data); //returns an array of Product data + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products') + .take(5) + .skip(2) + .get(function(data) { + console.log(data); //An array of 5 products skiped by 2 + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products') + .find(':0') + .route('Product/Detail/:0/:1',function(data) { + console.log('Route Product/Detail/'+this.param[0]+'/'+this.param[1]+' triggered. Result:'); + console.log(data); + }); + + + +var oHandler = o('http://services.odata.org/V4/OData/OData.svc/Products'); +//do somehtting +oHandler.find(1); +// do some more................ +//get the data +oHandler.get(function(data) { + console.log(data); + //or the saved var also contains the data: + console.log(oHandler.data); +}); + + + +Q.all([ + o('http://services.odata.org/V4/OData/OData.svc/Products(4)').get(), + o('http://services.odata.org/V4/OData/OData.svc/Categories').take(2).get() +]).then(function(oHandlerArray) { + //The oHandler array contains the Product oHandler and the Group oHandler: + console.log(oHandlerArray[0].data); // 1 Product with id 4 + console.log(oHandlerArray[1].data.length); // 2 Categories +}); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products(2)') + .get() + .then(function(oHandler) { + console.log(oHandler.data); + }).fail(function(ex) { + console.log(ex); + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products') + .post({Name:'Example 1',Description:'a'}) + .post({Name:'Example 2',Description:'b'}) + .save(function(data) { + console.log("Two Products added"); + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products(1)') + .patch({Name:'NewName'}) + .save(function(data) { + console.log("Product Name changed"); + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products(1)') + .remove() + .save(function(data) { + console.log("Product deleted"); + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products(1)') + .ref('Categories', 2) + .save(function(data) { + console.log("Product(1) associated with Categories(2)"); + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products') + .find(2) + .get() + .then(function(oHandler) { + oHandler.data.Name="NewName"; + return(o.save()); + }).then(function(oHandler) { + console.log(oHandler.data.Name); //NewName + }).fail(function(ex) { + console.log("error"); + }); + + + +// set an endpoint +o().config({ + endpoint:'http://services.odata.org/V4/OData/OData.svc' +}); +// after you have set an endpoint, you can shorten your queries: +o('Products').get(function(data) { + //same result like the first example on this page +}); + + + +//basic config +o().config({ + endpoint:null, // your odata endpoint for the service + format: 'json', + autoFormat:false, // currently only json is supported + version:4, // oData version (currently supported version 4. However most also work with version 3.) + strictMode:true, // strict mode throws exception, non strict mode only logs them + start:null, // a function which is executed on loading + ready:null, // a function which is executed on ready + error:null, // a function which is executed on error + headers:[{name: '', value: ''}], // a array of additional headers e.g.: [{name:'headername',value:'headervalue'}] + username:null, // a basic auth username + password:null, // a basic auth password + isAsync:true //set this to false to make synced (a)jax calls. (dosn't work with basic auth!) +}); \ No newline at end of file diff --git a/types/odata/tsconfig.json b/types/odata/tsconfig.json new file mode 100644 index 0000000000..6aac2e60a7 --- /dev/null +++ b/types/odata/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": false, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "q": [ "q/v0" ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "odata-tests.ts" + ] +} \ No newline at end of file From 48c9a24393713ee97f0916c781cc8dd739d0b2a1 Mon Sep 17 00:00:00 2001 From: hanssens Date: Wed, 7 Jun 2017 18:27:04 +0200 Subject: [PATCH 179/761] Export as (es2015) module, for proper import compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pretty much the only change is: - Encapsulated definitions in a “declare module” section - Exportable interface+class - Updated tests to reflect these changes --- types/packery/index.d.ts | 484 +++++++++++++++++---------------- types/packery/packery-tests.ts | 6 +- 2 files changed, 245 insertions(+), 245 deletions(-) diff --git a/types/packery/index.d.ts b/types/packery/index.d.ts index 9141bbfd52..6e27e2a9c0 100644 --- a/types/packery/index.d.ts +++ b/types/packery/index.d.ts @@ -1,293 +1,295 @@ // Type definitions for Packery v1.4.1 // Project: http://packery.metafizzy.co -// Definitions by: Piraveen Kamalathas from Kilix +// Definitions by: Piraveen Kamalathas from Kilix +// Juliën Hanssens // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module 'packery' { -interface PackeryOptions { - /** - * [itemSelector Specifies which child elements to be used as item elements. Setting itemSelector is always recommended. itemSelector is useful to exclude sizing elements] - * @type {string} - */ - itemSelector?: string; + export interface PackeryOptions { + /** + * [itemSelector Specifies which child elements to be used as item elements. Setting itemSelector is always recommended. itemSelector is useful to exclude sizing elements] + * @type {string} + */ + itemSelector?: string; - /** - * [columnWidth The width of a column of a horizontal grid. When set, Packery will align item elements horizontally to this grid] - * @type {number} - */ - columnWidth?: number; + /** + * [columnWidth The width of a column of a horizontal grid. When set, Packery will align item elements horizontally to this grid] + * @type {number} + */ + columnWidth?: number; - /** - * [rowHeight Height of a row of a vertical grid. When set, Packery will align item elements vertically to this grid] - * @type {number} - */ - rowHeight?: number; + /** + * [rowHeight Height of a row of a vertical grid. When set, Packery will align item elements vertically to this grid] + * @type {number} + */ + rowHeight?: number; - /** - * [gutter The space between item elements, both vertically and horizontally] - * @type {number} - */ - gutter?: number; + /** + * [gutter The space between item elements, both vertically and horizontally] + * @type {number} + */ + gutter?: number; - /** - * [percentPosition Will set item position in percent values, rather than pixel values. percentPosition works well with percent-width items, as items will not transition their position on resize] - * @type {boolean} - */ - percentPosition?: boolean; + /** + * [percentPosition Will set item position in percent values, rather than pixel values. percentPosition works well with percent-width items, as items will not transition their position on resize] + * @type {boolean} + */ + percentPosition?: boolean; - /** - * [stamp Specifies which elements are stamped within the layout. These are special layout elements which will not be laid out by Packery. Rather, Packery will layout item elements around stamped elements] - * @type {string} - */ - stamp?: string; + /** + * [stamp Specifies which elements are stamped within the layout. These are special layout elements which will not be laid out by Packery. Rather, Packery will layout item elements around stamped elements] + * @type {string} + */ + stamp?: string; - /** - * [isHorizontal Arranges items horizontally instead of vertically] - * @type {boolean} - */ - isHorizontal?: boolean; + /** + * [isHorizontal Arranges items horizontally instead of vertically] + * @type {boolean} + */ + isHorizontal?: boolean; - /** - * [isOriginLeft Controls the horizontal flow of the layout. By default, item elements start positioning at the left. Set to false for right-to-left layouts] - * @type {boolean} - */ - isOriginLeft?: boolean; + /** + * [isOriginLeft Controls the horizontal flow of the layout. By default, item elements start positioning at the left. Set to false for right-to-left layouts] + * @type {boolean} + */ + isOriginLeft?: boolean; - /** - * [isOriginTop Controls the vertical flow of the layout. By default, item elements start positioning at the top. Set to false for bottom-up layouts. It’s like Tetris!] - * @type {boolean} - */ - isOriginTop?: boolean; + /** + * [isOriginTop Controls the vertical flow of the layout. By default, item elements start positioning at the top. Set to false for bottom-up layouts. It’s like Tetris!] + * @type {boolean} + */ + isOriginTop?: boolean; - /** - * [transitionDuration The time duration of transitions for item elements] - * @type {string} - */ - transitionDuration?: string; + /** + * [transitionDuration The time duration of transitions for item elements] + * @type {string} + */ + transitionDuration?: string; - /** - * [containerStyle CSS styles that are applied to the container element. To disable Packery from setting any CSS to the container element, set containerStyle: null] - * @type {Object} - */ - containerStyle?: Object; + /** + * [containerStyle CSS styles that are applied to the container element. To disable Packery from setting any CSS to the container element, set containerStyle: null] + * @type {Object} + */ + containerStyle?: Object; - /** - * [isResizeBound Binds layout to window resizing] - * @type {boolean} - */ - isResizeBound?: boolean; + /** + * [isResizeBound Binds layout to window resizing] + * @type {boolean} + */ + isResizeBound?: boolean; - /** - * [isInitLayout Enables layout on initialization. Set this to false to disable layout on initialization, so you can use methods or add events before the initial layout] - * @type {boolean} - */ - isInitLayout?: boolean; -} + /** + * [isInitLayout Enables layout on initialization. Set this to false to disable layout on initialization, so you can use methods or add events before the initial layout] + * @type {boolean} + */ + isInitLayout?: boolean; + } -declare class Packery { - constructor(element: Element, options?: Object); + export class Packery { + constructor(element: Element, options?: Object); - /** - * [addItems Add item elements to the Packery instance] - * @param {Element} elements [description] - */ - addItems(elements: Element): void; + /** + * [addItems Add item elements to the Packery instance] + * @param {Element} elements [description] + */ + addItems(elements: Element): void; - /** - * [addItems Add item elements to the Packery instance] - * @param {NodeList} elements [description] - */ - addItems(elements: NodeList): void; + /** + * [addItems Add item elements to the Packery instance] + * @param {NodeList} elements [description] + */ + addItems(elements: NodeList): void; - /** - * [addItems Add item elements to the Packery instance] - * @param {Array} elements [description] - */ - addItems(elements: Array): void; + /** + * [addItems Add item elements to the Packery instance] + * @param {Array} elements [description] + */ + addItems(elements: Array): void; - /** - * [appended Add and lay out newly appended item elements] - * @param {Element} elements [description] - */ - appended(elements: Element): void; + /** + * [appended Add and lay out newly appended item elements] + * @param {Element} elements [description] + */ + appended(elements: Element): void; - /** - * [appended Add and lay out newly appended item elements] - * @param {NodeList} elements [description] - */ - appended(elements: NodeList): void; + /** + * [appended Add and lay out newly appended item elements] + * @param {NodeList} elements [description] + */ + appended(elements: NodeList): void; - /** - * [appended Add and lay out newly appended item elements] - * @param {Array} elements [description] - */ - appended(elements: Array): void; + /** + * [appended Add and lay out newly appended item elements] + * @param {Array} elements [description] + */ + appended(elements: Array): void; - /** - * [bindDraggabillyEvents Bind Draggabilly events, so that the Packery instance will layout around the dragged element] - * @param {any} draggie [description] - */ - bindDraggabillyEvents(draggie: any): void; + /** + * [bindDraggabillyEvents Bind Draggabilly events, so that the Packery instance will layout around the dragged element] + * @param {any} draggie [description] + */ + bindDraggabillyEvents(draggie: any): void; - /** - * [bindResize Binds event listener to window resize, so layout is triggered when the browser window is resized] - */ - bindResize(): void; + /** + * [bindResize Binds event listener to window resize, so layout is triggered when the browser window is resized] + */ + bindResize(): void; - /** - * [bindUIDraggableEvents Bind jQuery UI Draggable events, so that the Packery instance will layout around the dragged element] - * @param {any} elements [jQuery UI] - */ - bindUIDraggableEvents($element: any): void; + /** + * [bindUIDraggableEvents Bind jQuery UI Draggable events, so that the Packery instance will layout around the dragged element] + * @param {any} elements [jQuery UI] + */ + bindUIDraggableEvents($element: any): void; - /** - * [data Get the Packery instance from an element. Note this method is of Packery, rather than of a Packery instance] - * @param {Element} element [description] - * @return {Packery} [description] - */ - data(element: Element): Packery; + /** + * [data Get the Packery instance from an element. Note this method is of Packery, rather than of a Packery instance] + * @param {Element} element [description] + * @return {Packery} [description] + */ + data(element: Element): Packery; - /** - * [destroy Removes the Packery functionality completely. This will return the element back to its pre-initialized state] - */ - destroy(): void; + /** + * [destroy Removes the Packery functionality completely. This will return the element back to its pre-initialized state] + */ + destroy(): void; - /** - * [fit Fit an item element within the layout, and have other item elements laid out around it. This method is useful when expanding an element, and keeping it in its same position.] - * @param {any} element [description] - * @param {number} x [description] - * @param {number} y [description] - */ - fit(element: Element, x?: number, y?: number): void; + /** + * [fit Fit an item element within the layout, and have other item elements laid out around it. This method is useful when expanding an element, and keeping it in its same position.] + * @param {any} element [description] + * @param {number} x [description] + * @param {number} y [description] + */ + fit(element: Element, x?: number, y?: number): void; - /** - * [getItemElements Get an array of elements used as the Packery instance's items.] - * @return {Array} [description] - */ - getItemElements(): Array; + /** + * [getItemElements Get an array of elements used as the Packery instance's items.] + * @return {Array} [description] + */ + getItemElements(): Array; - /** - * [getItem Get a Packery.Item from an element] - * @param {Element} element [description] - * @return {any} [Packery.item] - */ - getItem(element: Element): any; + /** + * [getItem Get a Packery.Item from an element] + * @param {Element} element [description] + * @return {any} [Packery.item] + */ + getItem(element: Element): any; - /** - * [layout Lay out all item elements.] - */ - layout(): void; + /** + * [layout Lay out all item elements.] + */ + layout(): void; - /** - * [layoutItems Lay out specified items] - * @param {Array} items [description] - */ - layoutItems(items: Array): void; + /** + * [layoutItems Lay out specified items] + * @param {Array} items [description] + */ + layoutItems(items: Array): void; - /** - * [off Remove an event listener] - * @param {string} eventName [description] - * @param {Function} listener [description] - * @return {Packery} [description] - */ - off(eventName: string, listener: Function): Packery; + /** + * [off Remove an event listener] + * @param {string} eventName [description] + * @param {Function} listener [description] + * @return {Packery} [description] + */ + off(eventName: string, listener: Function): Packery; - /** - * [on Add an event listener for certain events] - * @param {string} eventName [description] - * @param {Function} listener [description] - * @return {Packery} [description] - */ - on(eventName: string, listener: Function): Packery; + /** + * [on Add an event listener for certain events] + * @param {string} eventName [description] + * @param {Function} listener [description] + * @return {Packery} [description] + */ + on(eventName: string, listener: Function): Packery; - /** - * [once Add an event listener for certain events, to be triggered once] - * @param {string} eventName [description] - * @param {Function} listener [description] - */ - once(eventName: string, listener: Function): void; + /** + * [once Add an event listener for certain events, to be triggered once] + * @param {string} eventName [description] + * @param {Function} listener [description] + */ + once(eventName: string, listener: Function): void; - /** - * [prepended Add and lay out newly prepended item elements at the beginning of layout] - * @param {Element} elements [description] - */ - prepended(elements: Element): void; + /** + * [prepended Add and lay out newly prepended item elements at the beginning of layout] + * @param {Element} elements [description] + */ + prepended(elements: Element): void; - /** - * [prepended Add and lay out newly prepended item elements at the beginning of layout] - * @param {NodeList} elements [description] - */ - prepended(elements: NodeList): void; + /** + * [prepended Add and lay out newly prepended item elements at the beginning of layout] + * @param {NodeList} elements [description] + */ + prepended(elements: NodeList): void; - /** - * [prepended Add and lay out newly prepended item elements at the beginning of layout] - * @param {Array} elements [description] - */ - prepended(elements: Array): void; + /** + * [prepended Add and lay out newly prepended item elements at the beginning of layout] + * @param {Array} elements [description] + */ + prepended(elements: Array): void; - /** - * [reloadItems Recollect all item elements] - */ - reloadItems(): void; + /** + * [reloadItems Recollect all item elements] + */ + reloadItems(): void; - /** - * [remove Remove elements from the Packery instance, then from the DOM] - * @param {Element} elements [description] - */ - remove(elements: Element): void; + /** + * [remove Remove elements from the Packery instance, then from the DOM] + * @param {Element} elements [description] + */ + remove(elements: Element): void; - /** - * [remove Remove elements from the Packery instance, then from the DOM] - * @param {NodeList} elements [description] - */ - remove(elements: NodeList): void; + /** + * [remove Remove elements from the Packery instance, then from the DOM] + * @param {NodeList} elements [description] + */ + remove(elements: NodeList): void; - /** - * [remove Remove elements from the Packery instance, then from the DOM] - * @param {Array} elements [description] - */ - remove(elements: Array): void; + /** + * [remove Remove elements from the Packery instance, then from the DOM] + * @param {Array} elements [description] + */ + remove(elements: Array): void; - /** - * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] - * @param {Element} elements [description] - */ - stamp(elements: Element): void; + /** + * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] + * @param {Element} elements [description] + */ + stamp(elements: Element): void; - /** - * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] - * @param {NodeList} elements [description] - */ - stamp(elements: NodeList): void; + /** + * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] + * @param {NodeList} elements [description] + */ + stamp(elements: NodeList): void; - /** - * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] - * @param {Array} elements [description] - */ - stamp(elements: Array): void; + /** + * [stamp Stamp the elements in the layout. Packery will lay out item elements around stamped element] + * @param {Array} elements [description] + */ + stamp(elements: Array): void; - /** - * [unbindResize Un-bind layout to window resize event] - */ - unbindResize(): void; + /** + * [unbindResize Un-bind layout to window resize event] + */ + unbindResize(): void; - /** - * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] - * @param {Element} element [description] - */ - unstamp(element: Element): void; + /** + * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] + * @param {Element} element [description] + */ + unstamp(element: Element): void; - /** - * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] - * @param {NodeList} element [description] - */ - unstamp(element: NodeList): void; + /** + * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] + * @param {NodeList} element [description] + */ + unstamp(element: NodeList): void; - /** - * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] - * @param {Array} element [description] - */ - unstamp(element: Array): void; -} + /** + * [unstamp Un-stamp the elements, so that Packery will no longer layout item elements around them] + * @param {Array} element [description] + */ + unstamp(element: Array): void; + } -export = Packery; +} \ No newline at end of file diff --git a/types/packery/packery-tests.ts b/types/packery/packery-tests.ts index e8faff1b3f..91065331c0 100644 --- a/types/packery/packery-tests.ts +++ b/types/packery/packery-tests.ts @@ -1,7 +1,5 @@ - -/// - -import Packery = require('packery'); +import { Packery, PackeryOptions } from 'packery'; +import * as $ from 'jquery'; // TODO Add Draggabilly to bind Draggabilly Events var container = document.querySelector('#container'); From b86997197f305d8985242c66a1fe69eb19d42a52 Mon Sep 17 00:00:00 2001 From: pilagod Date: Thu, 8 Jun 2017 00:28:12 +0800 Subject: [PATCH 180/761] refine getSync definition --- types/stacktrace-js/index.d.ts | 2 +- types/stacktrace-js/stacktrace-js-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/stacktrace-js/index.d.ts b/types/stacktrace-js/index.d.ts index 7f3c972508..96be8bfbf5 100644 --- a/types/stacktrace-js/index.d.ts +++ b/types/stacktrace-js/index.d.ts @@ -52,7 +52,7 @@ declare namespace StackTrace { * @param options Options Object * @return Array[StackFrame] */ - export function getSync(options?: { filter?: (stackFrame: StackFrame) => boolean }): StackFrame[] + export function getSync(options?: StackTraceOptions): StackFrame[]; /** * Given an error object, parse it. diff --git a/types/stacktrace-js/stacktrace-js-tests.ts b/types/stacktrace-js/stacktrace-js-tests.ts index 1de6abb185..6fac703c7f 100644 --- a/types/stacktrace-js/stacktrace-js-tests.ts +++ b/types/stacktrace-js/stacktrace-js-tests.ts @@ -29,7 +29,7 @@ const options: StackTrace.StackTraceOptions = { const error = new Error('BOOM!'); StackTrace.get(options).then(logger); -logger(StackTrace.getSync({ filter: options.filter })) +logger(StackTrace.getSync(options)) StackTrace.fromError(error, options).then(logger); StackTrace.generateArtificially(options).then(logger); From 7ea548f1fac2fd82e3e5d65c014a2e3c30d77a01 Mon Sep 17 00:00:00 2001 From: Alexander James Phillips Date: Wed, 7 Jun 2017 17:37:40 +0100 Subject: [PATCH 181/761] [Boom] Add data type to BoomError #16956 (#17022) * [Boom] Add data type to BoomError #16956 * [Boom] Update TypeScript version to 2.3 in packages that import Boom --- types/boom/boom-tests.ts | 151 +++++++++++++++++++++++++++++---------- types/boom/index.d.ts | 77 +++++++++++--------- types/catbox/index.d.ts | 2 +- 3 files changed, 160 insertions(+), 70 deletions(-) diff --git a/types/boom/boom-tests.ts b/types/boom/boom-tests.ts index b25607c4b4..e64ac44922 100644 --- a/types/boom/boom-tests.ts +++ b/types/boom/boom-tests.ts @@ -1,45 +1,124 @@ - import Boom = require('boom'); -var bo = Boom.wrap(new Error('test'), 400, 'some message'); -var a: string = bo.output.headers['some header']; +// 4xx and data type -Boom.create(500, 'Internal server error', { timestamp: Date.now() }); +const badRequestError = Boom.badRequest('message', {some: 'data'}); +badRequestError.data.some; -Boom.badRequest('message', {some: 'data'}); -Boom.unauthorized('message', 'scheme', {some: 'data'}); -Boom.unauthorized(null, 'scheme', 'data'); -Boom.paymentRequired('message', {some: 'data'}); -Boom.forbidden('message', {some: 'data'}); -Boom.notFound('message', {some: 'data'}); -Boom.methodNotAllowed('message', {some: 'data'}); -Boom.notAcceptable('message', {some: 'data'}); -Boom.proxyAuthRequired('message', {some: 'data'}); -Boom.clientTimeout('message', {some: 'data'}); -Boom.conflict('message', {some: 'data'}); -Boom.resourceGone('message', {some: 'data'}); -Boom.lengthRequired('message', {some: 'data'}); -Boom.preconditionFailed('message', {some: 'data'}); -Boom.entityTooLarge('message', {some: 'data'}); -Boom.uriTooLong('message', {some: 'data'}); -Boom.unsupportedMediaType('message', {some: 'data'}); -Boom.rangeNotSatisfiable('message', {some: 'data'}); -Boom.expectationFailed('message', {some: 'data'}); -Boom.teapot('message', {some: 'data'}); -Boom.badData('message', {some: 'data'}); -Boom.locked('message', {some: 'data'}); -Boom.preconditionRequired('message', {some: 'data'}); -Boom.tooManyRequests('message', {some: 'data'}); -Boom.illegal('message', {some: 'data'}); +const unauthorizedError1 = Boom.unauthorized('message', 'scheme', {some: 'attribute'}); +unauthorizedError1.output.payload.attributes === { some: 'attribute', error: 'message' }; +unauthorizedError1.output.headers === { 'WWW-Authenticate': 'scheme some="attribute", error="message"' }; -Boom.badImplementation('message', {some: 'data'}); -Boom.internal('message', {some: 'data'}); -Boom.notImplemented('message', {some: 'data'}); -Boom.badGateway('message', {some: 'data'}); -Boom.serverUnavailable('message', {some: 'data'}); -Boom.gatewayTimeout('message', {some: 'data'}); +const unauthorizedError2 = Boom.unauthorized('message', ['scheme']); +unauthorizedError2.output.payload.attributes === undefined; +unauthorizedError2.output.headers === { 'WWW-Authenticate': 'scheme' }; -Boom.unauthorized() as Error; +const unauthorizedError3 = Boom.unauthorized(null, 'scheme', 'attribute'); +unauthorizedError3.output.payload.attributes === 'attribute'; +unauthorizedError3.output.headers === { 'WWW-Authenticate': 'scheme attribute' }; + +const unauthorizedError4 = Boom.unauthorized(null, 'scheme', {some: 'attribute'}); +unauthorizedError4.output.payload.attributes === { some: 'attribute' }; +unauthorizedError4.output.headers === { 'WWW-Authenticate': 'scheme some="attribute"' }; + +const paymentRequiredError = Boom.paymentRequired('message', {some: 'data'}); +paymentRequiredError.data.some; + +const forbiddenError = Boom.forbidden('message', {some: 'data'}); +forbiddenError.data.some; + +const notFoundError = Boom.notFound('message', {some: 'data'}); +notFoundError.data.some; + +const methodNotAllowedError = Boom.methodNotAllowed('message', {some: 'data'}); +methodNotAllowedError.data.some; + +const notAcceptableError = Boom.notAcceptable('message', {some: 'data'}); +notAcceptableError.data.some; + +const proxyAuthRequiredError = Boom.proxyAuthRequired('message', {some: 'data'}); +proxyAuthRequiredError.data.some; + +const clientTimeoutError = Boom.clientTimeout('message', {some: 'data'}); +clientTimeoutError.data.some; + +const conflictError = Boom.conflict('message', {some: 'data'}); +conflictError.data.some; + +const resourceGoneError = Boom.resourceGone('message', {some: 'data'}); +resourceGoneError.data.some; + +const lengthRequiredError = Boom.lengthRequired('message', {some: 'data'}); +lengthRequiredError.data.some; + +const preconditionFailedError = Boom.preconditionFailed('message', {some: 'data'}); +preconditionFailedError.data.some; + +const entityTooLargeError = Boom.entityTooLarge('message', {some: 'data'}); +entityTooLargeError.data.some; + +const uriTooLongError = Boom.uriTooLong('message', {some: 'data'}); +uriTooLongError.data.some; + +const unsupportedMediaTypeError = Boom.unsupportedMediaType('message', {some: 'data'}); +unsupportedMediaTypeError.data.some; + +const rangeNotSatisfiableError = Boom.rangeNotSatisfiable('message', {some: 'data'}); +rangeNotSatisfiableError.data.some; + +const expectationFailedError = Boom.expectationFailed('message', {some: 'data'}); +expectationFailedError.data.some; + +const teapotError = Boom.teapot('message', {some: 'data'}); +teapotError.data.some; + +const badDataError = Boom.badData('message', {some: 'data'}); +badDataError.data.some; + +const lockedError = Boom.locked('message', {some: 'data'}); +lockedError.data.some; + +const preconditionRequiredError = Boom.preconditionRequired('message', {some: 'data'}); +preconditionRequiredError.data.some; + +const tooManyRequestsError = Boom.tooManyRequests('message', {some: 'data'}); +tooManyRequestsError.data.some; + +const illegalError = Boom.illegal('message', {some: 'data'}); +illegalError.data.some; + +// 5xx and data type + +const badImplementationError = Boom.badImplementation('message', {some: 'data'}); +badImplementationError.data.some; + +const internalError = Boom.internal('message', {some: 'data'}); +internalError.data.some; + +const notImplementedError = Boom.notImplemented('message', {some: 'data'}); +notImplementedError.data.some; + +const badGatewayError = Boom.badGateway('message', {some: 'data'}); +badGatewayError.data.some; + +const serverUnavailableError = Boom.serverUnavailable('message', {some: 'data'}); +serverUnavailableError.data.some; + +const gatewayTimeoutError = Boom.gatewayTimeout('message', {some: 'data'}); +gatewayTimeoutError.data.some; + +// wrap and create + +const wrappedError = Boom.wrap(new Error('test'), 400, 'some message'); + +const error1 = Boom.create(500, 'Internal server error', { timestamp: Date.now() }); +error1.data.timestamp; + +// type widden asserting + +const unauthorizedError = Boom.unauthorized() as Error; + +// status code and reformat const error = Boom.badRequest('Cannot feed after midnight'); error.output.statusCode = 499; // Assign a custom error code diff --git a/types/boom/index.d.ts b/types/boom/index.d.ts index 80a1827886..02cf60c6b8 100644 --- a/types/boom/index.d.ts +++ b/types/boom/index.d.ts @@ -2,6 +2,7 @@ // Project: http://github.com/hapijs/boom // Definitions by: Igor Rogatty , AJP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 export = Boom; @@ -11,7 +12,7 @@ declare namespace Boom { * boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: * @see {@link https://github.com/hapijs/boom#boom} */ - export interface BoomError extends Error { + export interface BoomError extends Error { /** isBoom - if true, indicates this is a Boom object instance. */ isBoom: boolean; /** isServer - convenience bool indicating status code >= 500. */ @@ -24,6 +25,8 @@ declare namespace Boom { reformat: () => string; /** "If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object." mentioned in @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} */ isMissing?: boolean; + /** https://github.com/hapijs/boom#createstatuscode-message-data */ + data: Data; } export interface Output { @@ -34,6 +37,7 @@ declare namespace Boom { /** payload - the formatted object used as the response payload (stringified). Can be directly manipulated but any changes will be lost if reformat() is called. Any content allowed and by default includes the following content: */ payload: Payload; } + export interface Payload { /** statusCode - the HTTP status code, derived from error.output.statusCode. */ statusCode: number; @@ -41,6 +45,11 @@ declare namespace Boom { error: string; /** message - the error message derived from error.message. */ message: string; + /** + * "Every key/value pair will be included ... in the response payload under the attributes key." + * [see docs](https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes) + */ + attributes?: any; // Excluded this to aid typing of the other values. See tests for example casting to a custom interface to manipulate the payload // [anyContent: string]: any; } @@ -61,7 +70,7 @@ declare namespace Boom { * @param data additional error data set to error.data property. * @see {@link https://github.com/hapijs/boom#createstatuscode-message-data} */ - export function create(statusCode: number, message?: string, data?: any): BoomError; + export function create(statusCode: number, message?: string, data?: Data): BoomError; // 4xx /** @@ -70,7 +79,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadrequestmessage-data} */ - export function badRequest(message?: string, data?: any): BoomError; + export function badRequest(message?: string, data?: Data): BoomError; /** * Returns a 401 Unauthorized error @@ -81,8 +90,10 @@ declare namespace Boom { * @param attributes an object of values to use while setting the 'WWW-Authenticate' header. This value is only used when scheme is a string, otherwise it is ignored. Every key/value pair will be included in the 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the attributes key. Alternatively value can be a string which is use to set the value of the scheme, for example setting the token value for negotiate header. If string is used message parameter must be null. null and undefined will be replaced with an empty string. If attributes is set, message will be used as the 'error' segment of the 'WWW-Authenticate' header. If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object. * @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} */ - export function unauthorized(message?: string, scheme?: string | string[], attributes?: {[index: string]: string}): BoomError; - export function unauthorized(message?: null, scheme?: string | string[], attributes?: string): BoomError; + export function unauthorized(message?: string, scheme?: string, attributes?: {[index: string]: string}): BoomError; + export function unauthorized(message?: string, scheme?: string[]): BoomError; + export function unauthorized(message?: null, scheme?: string, attributes?: {[index: string]: string} | string): BoomError; + export function unauthorized(message?: null, scheme?: string[]): BoomError; /** * Returns a 402 Payment Required error @@ -90,7 +101,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompaymentrequiredmessage-data} */ - export function paymentRequired(message?: string, data?: any): BoomError; + export function paymentRequired(message?: string, data?: Data): BoomError; /** * Returns a 403 Forbidden error @@ -98,7 +109,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomforbiddenmessage-data} */ - export function forbidden(message?: string, data?: any): BoomError; + export function forbidden(message?: string, data?: Data): BoomError; /** * Returns a 404 Not Found error @@ -106,7 +117,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotfoundmessage-data} */ - export function notFound(message?: string, data?: any): BoomError; + export function notFound(message?: string, data?: Data): BoomError; /** * Returns a 405 Method Not Allowed error @@ -115,7 +126,7 @@ declare namespace Boom { * @param allow optional string or array of strings (to be combined and separated by ', ') which is set to the 'Allow' header. * @see {@link https://github.com/hapijs/boom#boommethodnotallowedmessage-data-allow} */ - export function methodNotAllowed(message?: string, data?: any, allow?: string | string[]): BoomError; + export function methodNotAllowed(message?: string, data?: Data, allow?: string | string[]): BoomError; /** * Returns a 406 Not Acceptable error @@ -123,7 +134,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotacceptablemessage-data} */ - export function notAcceptable(message?: string, data?: any): BoomError; + export function notAcceptable(message?: string, data?: Data): BoomError; /** * Returns a 407 Proxy Authentication Required error @@ -131,7 +142,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomproxyauthrequiredmessage-data} */ - export function proxyAuthRequired(message?: string, data?: any): BoomError; + export function proxyAuthRequired(message?: string, data?: Data): BoomError; /** * Returns a 408 Request Time-out error @@ -139,7 +150,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomclienttimeoutmessage-data} */ - export function clientTimeout(message?: string, data?: any): BoomError; + export function clientTimeout(message?: string, data?: Data): BoomError; /** * Returns a 409 Conflict error @@ -147,7 +158,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomconflictmessage-data} */ - export function conflict(message?: string, data?: any): BoomError; + export function conflict(message?: string, data?: Data): BoomError; /** * Returns a 410 Gone error @@ -155,7 +166,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomresourcegonemessage-data} */ - export function resourceGone(message?: string, data?: any): BoomError; + export function resourceGone(message?: string, data?: Data): BoomError; /** * Returns a 411 Length Required error @@ -163,7 +174,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomlengthrequiredmessage-data} */ - export function lengthRequired(message?: string, data?: any): BoomError; + export function lengthRequired(message?: string, data?: Data): BoomError; /** * Returns a 412 Precondition Failed error @@ -171,7 +182,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompreconditionfailedmessage-data} */ - export function preconditionFailed(message?: string, data?: any): BoomError; + export function preconditionFailed(message?: string, data?: Data): BoomError; /** * Returns a 413 Request Entity Too Large error @@ -179,7 +190,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomentitytoolargemessage-data} */ - export function entityTooLarge(message?: string, data?: any): BoomError; + export function entityTooLarge(message?: string, data?: Data): BoomError; /** * Returns a 414 Request-URI Too Large error @@ -187,7 +198,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomuritoolongmessage-data} */ - export function uriTooLong(message?: string, data?: any): BoomError; + export function uriTooLong(message?: string, data?: Data): BoomError; /** * Returns a 415 Unsupported Media Type error @@ -195,7 +206,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomunsupportedmediatypemessage-data} */ - export function unsupportedMediaType(message?: string, data?: any): BoomError; + export function unsupportedMediaType(message?: string, data?: Data): BoomError; /** * Returns a 416 Requested Range Not Satisfiable error @@ -203,7 +214,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomrangenotsatisfiablemessage-data} */ - export function rangeNotSatisfiable(message?: string, data?: any): BoomError; + export function rangeNotSatisfiable(message?: string, data?: Data): BoomError; /** * Returns a 417 Expectation Failed error @@ -211,7 +222,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomexpectationfailedmessage-data} */ - export function expectationFailed(message?: string, data?: any): BoomError; + export function expectationFailed(message?: string, data?: Data): BoomError; /** * Returns a 418 I'm a Teapot error @@ -219,7 +230,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomteapotmessage-data} */ - export function teapot(message?: string, data?: any): BoomError; + export function teapot(message?: string, data?: Data): BoomError; /** * Returns a 422 Unprocessable Entity error @@ -227,7 +238,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombaddatamessage-data} */ - export function badData(message?: string, data?: any): BoomError; + export function badData(message?: string, data?: Data): BoomError; /** * Returns a 423 Locked error @@ -235,7 +246,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomlockedmessage-data} */ - export function locked(message?: string, data?: any): BoomError; + export function locked(message?: string, data?: Data): BoomError; /** * Returns a 428 Precondition Required error @@ -243,7 +254,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompreconditionrequiredmessage-data} */ - export function preconditionRequired(message?: string, data?: any): BoomError; + export function preconditionRequired(message?: string, data?: Data): BoomError; /** * Returns a 429 Too Many Requests error @@ -251,7 +262,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomtoomanyrequestsmessage-data} */ - export function tooManyRequests(message?: string, data?: any): BoomError; + export function tooManyRequests(message?: string, data?: Data): BoomError; /** * Returns a 451 Unavailable For Legal Reasons error @@ -259,7 +270,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomillegalmessage-data} */ - export function illegal(message?: string, data?: any): BoomError; + export function illegal(message?: string, data?: Data): BoomError; // 5xx /** @@ -269,7 +280,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} */ - export function badImplementation(message?: string, data?: any): BoomError; + export function badImplementation(message?: string, data?: Data): BoomError; /** * Returns a 500 Internal Server Error error @@ -278,7 +289,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} */ - export function internal(message?: string, data?: any): BoomError; + export function internal(message?: string, data?: Data): BoomError; /** * Returns a 501 Not Implemented error with your error message to the user @@ -286,7 +297,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotimplementedmessage-data} */ - export function notImplemented(message?: string, data?: any): BoomError; + export function notImplemented(message?: string, data?: Data): BoomError; /** * Returns a 502 Bad Gateway error with your error message to the user @@ -294,7 +305,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadgatewaymessage-data} */ - export function badGateway(message?: string, data?: any): BoomError; + export function badGateway(message?: string, data?: Data): BoomError; /** * Returns a 503 Service Unavailable error with your error message to the user @@ -302,7 +313,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomserverunavailablemessage-data} */ - export function serverUnavailable(message?: string, data?: any): BoomError; + export function serverUnavailable(message?: string, data?: Data): BoomError; /** * Returns a 504 Gateway Time-out error with your error message to the user @@ -310,5 +321,5 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomgatewaytimeoutmessage-data} */ - export function gatewayTimeout(message?: string, data?: any): BoomError; + export function gatewayTimeout(message?: string, data?: Data): BoomError; } diff --git a/types/catbox/index.d.ts b/types/catbox/index.d.ts index e832f58446..5dad5af29a 100644 --- a/types/catbox/index.d.ts +++ b/types/catbox/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hapijs/catbox // Definitions by: Jason Swearingen , AJP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import * as Boom from 'boom'; From 30a54db2bfa81aefece96b2306a0ca419d37f65a Mon Sep 17 00:00:00 2001 From: Jan Hommes Date: Wed, 7 Jun 2017 18:48:25 +0200 Subject: [PATCH 182/761] Fixed options interface. --- types/odata/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/odata/index.d.ts b/types/odata/index.d.ts index 9419dd0ba4..3f436667f9 100644 --- a/types/odata/index.d.ts +++ b/types/odata/index.d.ts @@ -8,8 +8,8 @@ declare module 'odata' { interface Options { endpoint : string - format ?: boolean - autoFormat ?: string + format ?: string + autoFormat ?: boolean version ?: number strictMode ?: boolean start ?: () => any From 7fc16440808f188c89e58fe47ba433e6ef3337bd Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Wed, 7 Jun 2017 19:41:33 +0200 Subject: [PATCH 183/761] [mongodb] Added support for default generic types (#16198) * Added support for ts2.3 default generic types * Updated find and findOne * Capitalized TypeScript Version * Added missing TypeScript Version: 2.3 * Added TypeScript Version: 2.3 to express-brute-mongo; removed easy-jsend test dependency on mongoose --- types/acl/index.d.ts | 1 + types/agenda/index.d.ts | 1 + types/connect-mongo/index.d.ts | 1 + types/easy-jsend/easy-jsend-tests.ts | 11 +++++----- types/express-brute-mongo/index.d.ts | 6 +++--- types/gridfs-stream/index.d.ts | 1 + types/mongodb/index.d.ts | 26 +++++++++++++----------- types/mongodb/mongodb-tests.ts | 8 +++++--- types/mongoose-auto-increment/index.d.ts | 2 +- types/mongoose-deep-populate/index.d.ts | 2 +- types/mongoose-mock/index.d.ts | 2 +- types/mongoose-paginate/index.d.ts | 1 + types/mongoose-promise/index.d.ts | 1 + types/mongoose-sequence/index.d.ts | 1 + types/mongoose/index.d.ts | 2 +- types/passport-local-mongoose/index.d.ts | 1 + 16 files changed, 40 insertions(+), 27 deletions(-) diff --git a/types/acl/index.d.ts b/types/acl/index.d.ts index 069631d2e0..3aa81de8e3 100644 --- a/types/acl/index.d.ts +++ b/types/acl/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/optimalbits/node_acl // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index e859de3188..fe8ecc45a6 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/rschmukler/agenda // Definitions by: Meir Gottlieb // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/connect-mongo/index.d.ts b/types/connect-mongo/index.d.ts index b469d08d00..0b7443f7e1 100644 --- a/types/connect-mongo/index.d.ts +++ b/types/connect-mongo/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/kcbanner/connect-mongo // Definitions by: Mizuki Yamamoto // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/easy-jsend/easy-jsend-tests.ts b/types/easy-jsend/easy-jsend-tests.ts index 705fe5b7e1..0ea41f4418 100644 --- a/types/easy-jsend/easy-jsend-tests.ts +++ b/types/easy-jsend/easy-jsend-tests.ts @@ -1,14 +1,15 @@ -import mongoose = require('mongoose'); +// import mongoose = require('mongoose'); import express = require('express'); import jSend = require('easy-jsend'); -var schema = new mongoose.Schema({ - name: {type: String} -}); +// var schema = new mongoose.Schema({ +// name: {type: String} +// }); -var Model = mongoose.model('model', schema); +// var Model = mongoose.model('model', schema); +var Model = {}; jSend.init({partial: true}); diff --git a/types/express-brute-mongo/index.d.ts b/types/express-brute-mongo/index.d.ts index cf248f8883..9714fedd5d 100644 --- a/types/express-brute-mongo/index.d.ts +++ b/types/express-brute-mongo/index.d.ts @@ -2,9 +2,9 @@ // Project: https://github.com/auth0/express-brute-mongo // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 - - +import { Collection } from "mongodb"; /** * @summary MongoDB store adapter. @@ -17,5 +17,5 @@ export = class MongoStore { * @param {Function} getCollection The collection. * @param {Object} options The otpions. */ - constructor(getCollection: (collection: any) => void, options?: Object); + constructor(getCollection: (collection: (c: Collection) => void) => void, options?: Object); } diff --git a/types/gridfs-stream/index.d.ts b/types/gridfs-stream/index.d.ts index 1c803348ad..80f87bb6c5 100644 --- a/types/gridfs-stream/index.d.ts +++ b/types/gridfs-stream/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/aheckmann/gridfs-stream // Definitions by: Lior Mualem // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index d83df18cf5..e115aa0666 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/mongodb/node-mongodb-native/tree/2.2 // Definitions by: Federico Caselli // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Documentation : http://mongodb.github.io/node-mongodb-native/2.2/api/ @@ -496,14 +497,13 @@ export interface Collection { dropIndexes(): Promise; dropIndexes(callback?: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#find - find(query?: Object): Cursor; - find(query?: Object): Cursor; + find(query?: Object): Cursor; /** @deprecated */ - find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; + find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOne - findOne(filter: Object, callback: MongoCallback): void; - findOne(filter: Object, options?: FindOneOptions): Promise; - findOne(filter: Object, options: FindOneOptions, callback: MongoCallback): void; + findOne(filter: Object, callback: MongoCallback): void; + findOne(filter: Object, options?: FindOneOptions): Promise; + findOne(filter: Object, options: FindOneOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndDelete findOneAndDelete(filter: Object, callback: MongoCallback): void; findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise; @@ -996,8 +996,10 @@ export interface WriteOpResult { //http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html#~resultCallback export type CursorResult = any | void | boolean; +type Default = { [key: string]: any }; + //http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html -export class Cursor extends Readable { +export class Cursor extends Readable { sortValue: string; timeout: boolean; @@ -1048,8 +1050,8 @@ export class Cursor extends Readable { // http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html#min min(min: number): Cursor; // http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html#next - next(): Promise; - next(callback: MongoCallback): void; + next(): Promise; + next(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html#project project(value: Object): Cursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html#read @@ -1101,7 +1103,7 @@ export interface EndCallback { //http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#~resultCallback export type AggregationCursorResult = any | void; //http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html -export class AggregationCursor extends Readable { +export class AggregationCursor extends Readable { // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#batchSize batchSize(value: number): AggregationCursor; // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#clone @@ -1127,8 +1129,8 @@ export class AggregationCursor extends Readable { // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#maxTimeMS maxTimeMS(value: number): AggregationCursor; // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#next - next(): Promise; - next(callback: MongoCallback): void; + next(): Promise; + next(callback: MongoCallback): void; // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#out out(destination: string): AggregationCursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#project diff --git a/types/mongodb/mongodb-tests.ts b/types/mongodb/mongodb-tests.ts index a41fd4ba7e..e4c7f3bd8a 100644 --- a/types/mongodb/mongodb-tests.ts +++ b/types/mongodb/mongodb-tests.ts @@ -53,7 +53,7 @@ let options = { }); { - let cursor: mongodb.Cursor ; + let cursor: mongodb.Cursor; cursor = collection.find(); cursor = cursor.addCursorFlag('',true); cursor = cursor.addQueryModifier('',true); @@ -81,14 +81,16 @@ let options = { // Collection .findM() & .agggregate() generic tests { let bag : {cost: number, color: string}; - type bag = typeof bag; + type bag = typeof bag; let cursor: mongodb.Cursor = collection.find({color: 'black'}) cursor.toArray(function (err,r) { r[0].cost} ); cursor.forEach(function (bag ) { bag.color }, () => {}); + collection.findOne({ color: 'white' }).then(() => { }) + collection.findOne({ color: 'white' }).then(b => { b.cost; }) } { let payment: {total: number}; - type payment = typeof payment; + type payment = typeof payment; let cursor: mongodb.AggregationCursor = collection.aggregate([{}]) } }) diff --git a/types/mongoose-auto-increment/index.d.ts b/types/mongoose-auto-increment/index.d.ts index 3604b2feaa..fc8813cba7 100644 --- a/types/mongoose-auto-increment/index.d.ts +++ b/types/mongoose-auto-increment/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/codetunnel/mongoose-auto-increment // Definitions by: Aya Morisawa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.3 import { Connection, Schema, Mongoose } from 'mongoose'; diff --git a/types/mongoose-deep-populate/index.d.ts b/types/mongoose-deep-populate/index.d.ts index 9c2de04b49..db01549d67 100644 --- a/types/mongoose-deep-populate/index.d.ts +++ b/types/mongoose-deep-populate/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/buunguyen/mongoose-deep-populate // Definitions by: Aya Morisawa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.3 import { Mongoose, Schema } from 'mongoose'; diff --git a/types/mongoose-mock/index.d.ts b/types/mongoose-mock/index.d.ts index d5adb581d0..0358620566 100644 --- a/types/mongoose-mock/index.d.ts +++ b/types/mongoose-mock/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/JohanObrink/mongoose-mock // Definitions by: jt000 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.3 import mongoose = require('mongoose'); diff --git a/types/mongoose-paginate/index.d.ts b/types/mongoose-paginate/index.d.ts index 6b06c65ac5..2b27c30ad5 100644 --- a/types/mongoose-paginate/index.d.ts +++ b/types/mongoose-paginate/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/edwardhotchkiss/mongoose-paginate // Definitions by: Linus Brolin , simonxca // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/mongoose-promise/index.d.ts b/types/mongoose-promise/index.d.ts index d730876e9f..a5e75ea4ab 100644 --- a/types/mongoose-promise/index.d.ts +++ b/types/mongoose-promise/index.d.ts @@ -2,6 +2,7 @@ // Project: http://mongoosejs.com/ // Definitions by: simonxca // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// diff --git a/types/mongoose-sequence/index.d.ts b/types/mongoose-sequence/index.d.ts index b01081944c..f4a4e77f1d 100644 --- a/types/mongoose-sequence/index.d.ts +++ b/types/mongoose-sequence/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/ramiel/mongoose-sequence // Definitions by: Linus Brolin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 8f5d6bdad6..25cf1eb49d 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -2,7 +2,7 @@ // Project: http://mongoosejs.com/ // Definitions by: simonxca , horiuchi , sindrenm // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 /// /// diff --git a/types/passport-local-mongoose/index.d.ts b/types/passport-local-mongoose/index.d.ts index acc61d0217..8a2d036c9f 100644 --- a/types/passport-local-mongoose/index.d.ts +++ b/types/passport-local-mongoose/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/saintedlama/passport-local-mongoose // Definitions by: Linus Brolin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// From c7ec25e724ae31140f45a793f7d5a51ba1d8f24a Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Tue, 6 Jun 2017 18:07:46 -0400 Subject: [PATCH 184/761] Add react-virtualized-select. --- types/react-virtualized-select/index.d.ts | 34 +++++++++++++++++++ .../react-virtualized-select-tests.tsx | 12 +++++++ types/react-virtualized-select/tsconfig.json | 23 +++++++++++++ types/react-virtualized-select/tslint.json | 1 + 4 files changed, 70 insertions(+) create mode 100644 types/react-virtualized-select/index.d.ts create mode 100644 types/react-virtualized-select/react-virtualized-select-tests.tsx create mode 100644 types/react-virtualized-select/tsconfig.json create mode 100644 types/react-virtualized-select/tslint.json diff --git a/types/react-virtualized-select/index.d.ts b/types/react-virtualized-select/index.d.ts new file mode 100644 index 0000000000..d73b06cfc8 --- /dev/null +++ b/types/react-virtualized-select/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for react-virtualized-select 3.0 +// Project: https://github.com/bvaughn/react-virtualized-select +// Definitions by: Sean Kelley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import * as React from "react"; +import { ReactSelectProps } from "react-select"; +import { ListProps } from "react-virtualized"; + +export interface VirtualizedOptionRenderOptions { + focusedOption: T; + focusedOptionIndex: number; + focusOption(option: T): void; + key: string; + labelKey: keyof T; + listProps: ListProps; + option: T; + options: T[]; + selectValue(option: T): void; + style: Record; + valueArray: T[]; +} + +export interface VirtualizedSelectProps extends ReactSelectProps { + async?: boolean; + maxHeight?: number; + optionHeight?: number; + optionRenderer?(options: VirtualizedOptionRenderOptions): JSX.Element; + selectComponent?: React.ComponentClass | React.StatelessComponent; +} + +declare class VirtualizedSelect extends React.PureComponent {} +export default VirtualizedSelect; diff --git a/types/react-virtualized-select/react-virtualized-select-tests.tsx b/types/react-virtualized-select/react-virtualized-select-tests.tsx new file mode 100644 index 0000000000..ced2f20b41 --- /dev/null +++ b/types/react-virtualized-select/react-virtualized-select-tests.tsx @@ -0,0 +1,12 @@ +import * as React from "react"; +import Select = require("react-select"); +import VirtualizedSelect from "react-virtualized-select"; + +

} + selectComponent={Select} + options={[]} +/>; diff --git a/types/react-virtualized-select/tsconfig.json b/types/react-virtualized-select/tsconfig.json new file mode 100644 index 0000000000..8795f8aae5 --- /dev/null +++ b/types/react-virtualized-select/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-virtualized-select-tests.tsx" + ] +} diff --git a/types/react-virtualized-select/tslint.json b/types/react-virtualized-select/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-virtualized-select/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d3601e3783b70accf4eb1b0e503133ab809e0862 Mon Sep 17 00:00:00 2001 From: jimjaeger Date: Wed, 7 Jun 2017 22:19:41 +0200 Subject: [PATCH 185/761] Update index.d.ts Add preservePath parameter as described https://github.com/expressjs/multer --- types/multer/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/multer/index.d.ts b/types/multer/index.d.ts index 35e71a251d..c1cda87f6b 100644 --- a/types/multer/index.d.ts +++ b/types/multer/index.d.ts @@ -34,6 +34,9 @@ declare namespace multer { parts?: number; /** For multipart forms, the max number of header key=> value pairs to parse Default: 2000(same as node's http). */ headerPairs?: number; + /** Keep the full path of files instead of just the base name (Default: false) */ + preservePath?: boolean; + }; /** A function to control which files to upload and which to skip. */ fileFilter?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error, acceptFile: boolean) => void) => void; From e99d48a0e147ab9d4e9c9ae59c87c4299961321e Mon Sep 17 00:00:00 2001 From: marshall007 Date: Wed, 7 Jun 2017 16:47:13 -0500 Subject: [PATCH 186/761] @types/bull: add missing `createClient` option --- types/bull/bull-tests.tsx | 24 +++++++++++++++++++++++- types/bull/index.d.ts | 8 +++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index 1552febf85..e0854cfafa 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -2,12 +2,12 @@ * Created by Bruno Grieder */ +import * as Redis from "ioredis"; import * as Queue from "bull"; const videoQueue = new Queue('video transcoding', 'redis://127.0.0.1:6379'); const audioQueue = new Queue('audio transcoding', {redis: {port: 6379, host: '127.0.0.1'}}); // Specify Redis connection using object const imageQueue = new Queue('image transcoding'); -const pdfQueue = new Queue('pdf transcoding'); videoQueue.process((job, done) => { // job.data contains the custom data passed when the job was created @@ -67,6 +67,28 @@ videoQueue.add({video: 'http://example.com/video1.mov'}); audioQueue.add({audio: 'http://example.com/audio1.mp3'}); imageQueue.add({image: 'http://example.com/image1.tiff'}); +////////////////////////////////////////////////////////////////////////////////// +// +// Re-using Redis Connections +// +////////////////////////////////////////////////////////////////////////////////// + +const client = new Redis(); +const subscriber = new Redis(); + +const pdfQueue = new Queue('pdf transcoding', { + createClient: (type: string, options: Redis.RedisOptions) => { + switch (type) { + case 'client': + return client; + case 'subscriber': + return subscriber; + default: + return new Redis(options); + } + } +}); + ////////////////////////////////////////////////////////////////////////////////// // // Using Promises diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 926952f6c2..fcab3c282e 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -12,7 +12,7 @@ import * as Redis from "ioredis"; * It creates a new Queue that is persisted in Redis. * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session. */ -declare var Bull: { +declare const Bull: { // tslint:disable:unified-signatures (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; (queueName: string, url?: string): Bull.Queue; @@ -28,6 +28,12 @@ declare namespace Bull { */ redis?: Redis.RedisOptions; + /** + * When specified, the `Queue` will use this function to create new `ioredis` client connections. + * This is useful if you want to re-use connections. + */ + createClient?(type: 'client' | 'subscriber', redisOpts?: Redis.RedisOptions): Redis.Redis; + /** * Prefix to use for all redis keys */ From baf6a3bb98495e3feeb29a3a6b5d6dd36f48ca1a Mon Sep 17 00:00:00 2001 From: marshall007 Date: Wed, 7 Jun 2017 17:34:50 -0500 Subject: [PATCH 187/761] @types/bull: `ready` event was replaced by `Queue#isReady()` --- types/bull/bull-tests.tsx | 1 - types/bull/index.d.ts | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index e0854cfafa..cbdcc83e0a 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -120,7 +120,6 @@ videoQueue.add({ video: 'http://example.com/video1.mov' }, { jobId: 1 }) ////////////////////////////////////////////////////////////////////////////////// pdfQueue -.on('ready', () => undefined) .on('error', (err: Error) => undefined) .on('active', (job: Queue.Job, jobPromise: Queue.JobPromise) => jobPromise.cancel()) .on('active', (job: Queue.Job) => undefined) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index fcab3c282e..82a31a4ff3 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -207,6 +207,12 @@ declare namespace Bull { } interface Queue { + /** + * Returns a promise that resolves when Redis is connected and the queue is ready to accept jobs. + * This replaces the `ready` event emitted on Queue in previous verisons. + */ + isReady(): Promise; + /** * Defines a processing function for the jobs placed into a given Queue. * @@ -329,11 +335,6 @@ declare namespace Bull { */ on(event: string, callback: (...args: any[]) => void): this; - /** - * Redis is connected and the queue is ready to accept jobs - */ - on(event: 'ready', callback: EventCallback): this; - /** * An error occured */ From a586ed6d0c5b431a0d81ad93b770b07af8a81e0e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 23:43:14 +0100 Subject: [PATCH 188/761] Added CertHostKey --- types/nodegit/cert-host-key.d.ts | 6 ++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 8 insertions(+) create mode 100644 types/nodegit/cert-host-key.d.ts diff --git a/types/nodegit/cert-host-key.d.ts b/types/nodegit/cert-host-key.d.ts new file mode 100644 index 0000000000..428d04b727 --- /dev/null +++ b/types/nodegit/cert-host-key.d.ts @@ -0,0 +1,6 @@ +export class CertHostkey { + certType: number; + type: number; + hashMd5: string; + hashSha1: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 7b485e2980..bd7f7791c6 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -11,6 +11,7 @@ export { Blame } from './blame'; export { Blob } from './blob'; export { Branch } from './branch'; export { Buf } from './buf'; +export { CertHostKey } from './cert-host-key'; export { Cert } from './cert'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 366b54206a..15398d46c4 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -24,6 +24,7 @@ "blob.d.ts", "branch.d.ts", "buf.d.ts", + "cert-host-key.d.ts", "cert.d.ts", "checkout-options.d.ts", "checkout.d.ts", From 7fb59e070da6791587be6733aed6399ac4f81530 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 23:48:32 +0100 Subject: [PATCH 189/761] Added Cert X509 --- types/nodegit/cert-x509.d.ts | 5 +++++ types/nodegit/index.d.ts | 3 ++- types/nodegit/tsconfig.json | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 types/nodegit/cert-x509.d.ts diff --git a/types/nodegit/cert-x509.d.ts b/types/nodegit/cert-x509.d.ts new file mode 100644 index 0000000000..14f38ac5fc --- /dev/null +++ b/types/nodegit/cert-x509.d.ts @@ -0,0 +1,5 @@ +export class CertX509 { + certType: number; + data: Buffer; + len: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index bd7f7791c6..9b446aa056 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -11,7 +11,8 @@ export { Blame } from './blame'; export { Blob } from './blob'; export { Branch } from './branch'; export { Buf } from './buf'; -export { CertHostKey } from './cert-host-key'; +export { CertHostkey } from './cert-host-key'; +export { CertX509 } from './cert-x509'; export { Cert } from './cert'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 15398d46c4..02fa864776 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -25,6 +25,7 @@ "branch.d.ts", "buf.d.ts", "cert-host-key.d.ts", + "cert-x509.d.ts", "cert.d.ts", "checkout-options.d.ts", "checkout.d.ts", From 959bd0bf845e080e2fda767e9edad8dacd35e6a3 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 23:51:00 +0100 Subject: [PATCH 190/761] Added Cherrypick --- types/nodegit/cherry-pick.d.ts | 9 +++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 11 insertions(+) create mode 100644 types/nodegit/cherry-pick.d.ts diff --git a/types/nodegit/cherry-pick.d.ts b/types/nodegit/cherry-pick.d.ts new file mode 100644 index 0000000000..333831a29b --- /dev/null +++ b/types/nodegit/cherry-pick.d.ts @@ -0,0 +1,9 @@ +import { Repository } from './repository'; +import { Commit } from './commit'; +import { MergeOptions } from './merge-options'; + +export class Cherrypick { + static cherrypick(repo: Repository, commit: Commit, options?: CherrypickOptions): Promise; + static commit(repo: Repository, cherrypickCommit: Commit, ourCommit: Commit, mainline: number, mergeOptions?: MergeOptions): Promise; + static initOptions(opts: CherrypickOptions, version: number): number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 9b446aa056..30e306c5a9 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -16,6 +16,7 @@ export { CertX509 } from './cert-x509'; export { Cert } from './cert'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; +export { Cherrypick } from './cherry-pick'; export { CloneOptions } from './clone-options'; export { Clone } from './clone'; export { Commit } from './commit'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 02fa864776..5fd6456c5e 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "cert.d.ts", "checkout-options.d.ts", "checkout.d.ts", + "cherry-pick.d.ts", "clone-options.d.ts", "clone.d.ts", "commit.d.ts", From 45e2febe28d41e587bbde6aaf9a21f85ca8981d9 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 00:39:50 +0100 Subject: [PATCH 191/761] Added CherrypickOptions --- types/nodegit/cherry-pick-options.d.ts | 9 +++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 11 insertions(+) create mode 100644 types/nodegit/cherry-pick-options.d.ts diff --git a/types/nodegit/cherry-pick-options.d.ts b/types/nodegit/cherry-pick-options.d.ts new file mode 100644 index 0000000000..7c6ec6976c --- /dev/null +++ b/types/nodegit/cherry-pick-options.d.ts @@ -0,0 +1,9 @@ +import { MergeOptions } from './merge-options'; +import { CheckoutOptions } from './checkout-options'; + +export interface CherrypickOptions { + version: number; + mainline: number; + mergeOpts: MergeOptions; + checkoutOpts: CheckoutOptions; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 30e306c5a9..6fea8d24f3 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -16,6 +16,7 @@ export { CertX509 } from './cert-x509'; export { Cert } from './cert'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; +export { CherrypickOptions } from './cherry-pick-options'; export { Cherrypick } from './cherry-pick'; export { CloneOptions } from './clone-options'; export { Clone } from './clone'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 5fd6456c5e..e1239f9251 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "cert.d.ts", "checkout-options.d.ts", "checkout.d.ts", + "cherry-pick-options.d.ts", "cherry-pick.d.ts", "clone-options.d.ts", "clone.d.ts", From 41aff746508bce9b830df40fc848cd1619ced261 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 00:43:36 +0100 Subject: [PATCH 192/761] Added Cred --- types/nodegit/cred.d.ts | 22 ++++++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 24 insertions(+) create mode 100644 types/nodegit/cred.d.ts diff --git a/types/nodegit/cred.d.ts b/types/nodegit/cred.d.ts new file mode 100644 index 0000000000..759e43d814 --- /dev/null +++ b/types/nodegit/cred.d.ts @@ -0,0 +1,22 @@ +export namespace Cred { + enum TYPE { + USERPASS_PLAINTEXT = 1, + SSH_KEY = 2, + SSH_CUSTOM = 4, + DEFAULT = 8, + SSH_INTERACTIVE = 16, + USERNAME = 32, + SSH_MEMORY = 64 + } +} + +export class Cred { + static defaultNew(): Cred; + static sshKeyFromAgent(username: string): Cred; + static sshKeyMemoryNew(username: string, publickey: string, privatekey: string, passphrase: string): Promise; + static sshKeyNew(username: string, publickey: string, privatekey: string, passphrase: string): Cred; + static usernameNew(username: string): Promise; + static userpassPlaintextNew(username: string, password: string): Cred; + + hasUsername(): number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 6fea8d24f3..79276255c6 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -23,6 +23,7 @@ export { Clone } from './clone'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { Cred } from './cred'; export { CvarMap } from './cvar-map'; export { DescribeFormatOptions } from './describe-format-options'; export { DescribeOptions } from './describe-options'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index e1239f9251..74e9c7ad1c 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -36,6 +36,7 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "cred.d.ts", "cvar-map.d.ts", "describe-format-options.d.ts", "describe-options.d.ts", From 0233c0dd42af75fddf98b65d002f5aa64f726d11 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 01:43:53 +0100 Subject: [PATCH 193/761] Added CredUsername and CredUserpassPayload --- types/nodegit/cred-user-pass-payload.d.ts | 4 ++++ types/nodegit/cred-username.d.ts | 6 ++++++ types/nodegit/index.d.ts | 2 ++ types/nodegit/tsconfig.json | 2 ++ 4 files changed, 14 insertions(+) create mode 100644 types/nodegit/cred-user-pass-payload.d.ts create mode 100644 types/nodegit/cred-username.d.ts diff --git a/types/nodegit/cred-user-pass-payload.d.ts b/types/nodegit/cred-user-pass-payload.d.ts new file mode 100644 index 0000000000..95beeb9f3a --- /dev/null +++ b/types/nodegit/cred-user-pass-payload.d.ts @@ -0,0 +1,4 @@ +export class CredUserpassPayload { + username: string; + password: string; +} diff --git a/types/nodegit/cred-username.d.ts b/types/nodegit/cred-username.d.ts new file mode 100644 index 0000000000..d7b619eb5d --- /dev/null +++ b/types/nodegit/cred-username.d.ts @@ -0,0 +1,6 @@ +import { Cred } from './cred'; + +export class CredUsername { + parent: Cred; + username: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 79276255c6..32b86ba19f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -23,6 +23,8 @@ export { Clone } from './clone'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { CredUserpassPayload } from './cred-user-pass-payload'; +export { CredUsername } from './cred-username'; export { Cred } from './cred'; export { CvarMap } from './cvar-map'; export { DescribeFormatOptions } from './describe-format-options'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 74e9c7ad1c..31f9ee0497 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -36,6 +36,8 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "cred-user-pass-payload.d.ts", + "cred-username.d.ts", "cred.d.ts", "cvar-map.d.ts", "describe-format-options.d.ts", From 66a6426d595f70fbf2d00386cb76cea2b93e565d Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 01:44:11 +0100 Subject: [PATCH 194/761] Fixed some errors --- types/nodegit/blame-hunk.d.ts | 2 +- types/nodegit/cherry-pick.d.ts | 1 + types/nodegit/diff.d.ts | 2 +- types/nodegit/filter.d.ts | 8 +++++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/types/nodegit/blame-hunk.d.ts b/types/nodegit/blame-hunk.d.ts index 601a7dbdfd..58ab8e7191 100644 --- a/types/nodegit/blame-hunk.d.ts +++ b/types/nodegit/blame-hunk.d.ts @@ -1,5 +1,5 @@ import { Oid } from './oid'; -import { Signature } from './Signature'; +import { Signature } from './signature'; export class BlameHunk { linesInHunk: number; diff --git a/types/nodegit/cherry-pick.d.ts b/types/nodegit/cherry-pick.d.ts index 333831a29b..291c5e0223 100644 --- a/types/nodegit/cherry-pick.d.ts +++ b/types/nodegit/cherry-pick.d.ts @@ -1,6 +1,7 @@ import { Repository } from './repository'; import { Commit } from './commit'; import { MergeOptions } from './merge-options'; +import { CherrypickOptions } from './cherry-pick-options'; export class Cherrypick { static cherrypick(repo: Repository, commit: Commit, options?: CherrypickOptions): Promise; diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 3612e402a4..d675b36acf 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -126,7 +126,7 @@ export namespace Diff { export class Diff { static blobToBuffer(old_blob: Blob, oldAsPath: string, - buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; + buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; static indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise; static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; diff --git a/types/nodegit/filter.d.ts b/types/nodegit/filter.d.ts index aedc0dbd6f..da1f71c2b9 100644 --- a/types/nodegit/filter.d.ts +++ b/types/nodegit/filter.d.ts @@ -1,3 +1,5 @@ +import { WriteStream } from 'fs'; + import { Repository } from './repository'; import { Blob } from './blob'; import { Buf } from './buf'; @@ -20,9 +22,9 @@ export class Filter { static listContains(filters: any, name: string): number; static listLength(fl: any): number; static listNew(repo: Repository, mode: number, options: number): Promise; - static listStreamBlob(filters: any, blob: Blob, target: Writestream): number; - static listStreamData(filters: any, data: Buf, target: Writestream): number; - static listStreamFile(filters: any, repo: Repository, path: string, target: Writestream): number; + static listStreamBlob(filters: any, blob: Blob, target: WriteStream): number; + static listStreamData(filters: any, data: Buf, target: WriteStream): number; + static listStreamFile(filters: any, repo: Repository, path: string, target: WriteStream): number; static unregister(name: string): number; lookup(name: string): Filter; From 98e2a4a83f2f327d121369248f22aeb51e64ae9d Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 01:57:03 +0100 Subject: [PATCH 195/761] Added some tests --- types/nodegit/annotated-commit.d.ts | 27 ++++++++++++++++++- types/nodegit/attr.d.ts | 2 +- types/nodegit/nodegit-tests.ts | 42 +++++++++++++++++++++++++++-- 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/types/nodegit/annotated-commit.d.ts b/types/nodegit/annotated-commit.d.ts index f0f9d4d925..0fb5465647 100644 --- a/types/nodegit/annotated-commit.d.ts +++ b/types/nodegit/annotated-commit.d.ts @@ -3,11 +3,36 @@ import { Oid } from './oid'; import { Reference } from './reference'; export class AnnotatedCommit { - static fromFetchhead(repo: Repository, branch_name: string, remote_url: string, id: Oid): Promise; + /** + * + * + * @static + * @param {Repository} repo - repository that contains the given commit + * @param {string} branchName - name of the (remote) branch + * @param {string} remoteUrl - url of the remote + * @param {Oid} id - the commit object id of the remote branch + * @returns {Promise} + * + * @memberof AnnotatedCommit + */ + static fromFetchhead(repo: Repository, branchName: string, remoteUrl: string, id: Oid): Promise; static fromRef(repo: Repository, ref: Reference): Promise; static fromRevspec(repo: Repository, revspec: string): Promise; static lookup(repo: Repository, id: Oid): Promise; + /** + * + * + * + * @memberof AnnotatedCommit + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof AnnotatedCommit + */ id(): Oid; } diff --git a/types/nodegit/attr.d.ts b/types/nodegit/attr.d.ts index 84a701f2b1..4966c407e0 100644 --- a/types/nodegit/attr.d.ts +++ b/types/nodegit/attr.d.ts @@ -13,6 +13,6 @@ export class Attr { static addMacro(repo: Repository, name: string, values: string): number; static cacheFlush(repo: Repository): void; static get(repo: Repository, flags: number, path: string, name: string): Promise; - static getMany(repo: Repository, flags: number, path: string, num_attr: number, names: string): any[]; + static getMany(repo: Repository, flags: number, path: string, numAttr: number, names: string): any[]; static value(attr: string): number; } diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index c4c57854b7..370369eed4 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -1,9 +1,47 @@ import * as Git from 'nodegit'; Git.Repository.discover("startPath", 1, "ceilingDirs").then((string) => { - // Use string + // Use string }); Git.Repository.init("path", true).then((repository) => { - // Use repository + // Use repository }); + +const repo = new Git.Repository(); +const id = new Git.Oid(); +const ref = new Git.Reference(); + +// AnnotatedCommit Tests + +Git.AnnotatedCommit.fromFetchhead(repo, "branch_name", "remote_url", id).then((annotatedCommit) => { + // Use annotatedCommit +}); + +Git.AnnotatedCommit.fromRef(repo, ref).then((annotatedCommit) => { + // Use annotatedCommit +}); + +Git.AnnotatedCommit.fromRevspec(repo, "revspec").then((annotatedCommit) => { + // Use annotatedCommit +}); + +Git.AnnotatedCommit.lookup(repo, id).then((annotatedCommit) => { + // Use annotatedCommit + annotatedCommit.free(); + annotatedCommit.id(); +}); + +// Attr tests + +let result = Git.Attr.addMacro(repo, "name", "values"); + +Git.Attr.cacheFlush(repo); + +Git.Attr.get(repo, 1, "path", "name").then((string) => { + // Use string +}); + +let array = Git.Attr.getMany(repo, 1, "path", 1, "names"); + +result = Git.Attr.value("attr"); From 73c4f21d978d6c5ea86ed54c56509fac69b52656 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:07:21 +0100 Subject: [PATCH 196/761] Added documentation --- types/nodegit/attr.d.ts | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/types/nodegit/attr.d.ts b/types/nodegit/attr.d.ts index 4966c407e0..41c1aa5eb2 100644 --- a/types/nodegit/attr.d.ts +++ b/types/nodegit/attr.d.ts @@ -10,9 +10,62 @@ export namespace Attr { } export class Attr { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} values + * @returns {number} + * + * @memberof Attr + */ static addMacro(repo: Repository, name: string, values: string): number; + /** + * + * + * @static + * @param {Repository} repo + * + * @memberof Attr + */ static cacheFlush(repo: Repository): void; + /** + * + * + * @static + * @param {Repository} repo - The repository containing the path. + * @param {number} flags - A combination of GIT_ATTR_CHECK... flags. + * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). + * @param {string} name - The name of the attribute to look up. + * @returns {Promise} - Output of the value of the attribute. Use the GIT_ATTR_... + * + * @memberof Attr + */ static get(repo: Repository, flags: number, path: string, name: string): Promise; + /** + * + * + * @static + * @param {Repository} repo - The repository containing the path. + * @param {number} flags - A combination of GIT_ATTR_CHECK... flags. + * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). + * @param {number} numAttr - The number of attributes being looked up + * @param {string} names - An array of num_attr strings containing attribute names. + * @returns {any[]} + * + * @memberof Attr + */ static getMany(repo: Repository, flags: number, path: string, numAttr: number, names: string): any[]; + /** + * + * + * @static + * @param {string} attr - The attribute + * @returns {number}- the value type for the attribute + * + * @memberof Attr + */ static value(attr: string): number; } From 20499792a7a8215cb4922291466683fed97cf173 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:13:24 +0100 Subject: [PATCH 197/761] Added documentation to Blame --- types/nodegit/blame-hunk.d.ts | 48 ++++++++++++++++++++++++ types/nodegit/blame-options.d.ts | 44 +++++++++++++++++++++- types/nodegit/blame.d.ts | 63 +++++++++++++++++++++++++++++++- types/nodegit/nodegit-tests.ts | 2 + 4 files changed, 154 insertions(+), 3 deletions(-) diff --git a/types/nodegit/blame-hunk.d.ts b/types/nodegit/blame-hunk.d.ts index 58ab8e7191..83dd1cc410 100644 --- a/types/nodegit/blame-hunk.d.ts +++ b/types/nodegit/blame-hunk.d.ts @@ -2,12 +2,60 @@ import { Oid } from './oid'; import { Signature } from './signature'; export class BlameHunk { + /** + * + * + * @type {number} + * @memberof BlameHunk + */ linesInHunk: number; + /** + * + * + * @type {Oid} + * @memberof BlameHunk + */ finalCommitId: Oid; + /** + * + * + * @type {number} + * @memberof BlameHunk + */ finalStartLineNumber: number; + /** + * + * + * @type {Signature} + * @memberof BlameHunk + */ finalSignature: Signature; + /** + * + * + * @type {Oid} + * @memberof BlameHunk + */ origCommitId: Oid; + /** + * + * + * @type {string} + * @memberof BlameHunk + */ origPath: string; + /** + * + * + * @type {number} + * @memberof BlameHunk + */ origStartLineNumber: number; + /** + * + * + * @type {Signature} + * @memberof BlameHunk + */ origSignature: Signature; } diff --git a/types/nodegit/blame-options.d.ts b/types/nodegit/blame-options.d.ts index ca5f1f50df..eac4c2f4f0 100644 --- a/types/nodegit/blame-options.d.ts +++ b/types/nodegit/blame-options.d.ts @@ -1,11 +1,53 @@ import {Oid} from './oid'; -export interface BlameOptions { +export class BlameOptions { + /** + * + * + * @type {number} + * @memberof BlameOptions + */ version: number; + /** + * + * + * @type {number} + * @memberof BlameOptions + */ flags: number; + /** + * + * + * @type {number} + * @memberof BlameOptions + */ minMatchCharacters: number; + /** + * + * + * @type {Oid} + * @memberof BlameOptions + */ newestCommit: Oid; + /** + * + * + * @type {Oid} + * @memberof BlameOptions + */ oldestCommit: Oid; + /** + * + * + * @type {number} + * @memberof BlameOptions + */ minLine: number; + /** + * + * + * @type {number} + * @memberof BlameOptions + */ maxLine: number; } diff --git a/types/nodegit/blame.d.ts b/types/nodegit/blame.d.ts index e5b5d90ec8..c6efdc133b 100644 --- a/types/nodegit/blame.d.ts +++ b/types/nodegit/blame.d.ts @@ -14,12 +14,71 @@ export namespace Blame { } export class Blame { + /** + * Retrieve the blame of a file + * + * @static + * @param {Repository} repo - Repository that contains the file + * @param {string} path - to the file to get the blame of + * @param {BlameOptions} [options] - Options for the blame + * @returns {Blame} + * + * @memberof Blame + */ static file(repo: Repository, path: string, options?: BlameOptions): Blame; + /** + * + * + * @static + * @param {BlameOptions} opts - The git_blame_options struct to initialize + * @param {number} version - Version of struct; pass GIT_BLAME_OPTIONS_VERSION + * @returns {number} + * + * @memberof Blame + */ static initOptions(opts: BlameOptions, version: number): number; - buffer(buffer: string, buffer_len: number): Promise; + /** + * + * + * @param {string} buffer + * @param {number} bufferLen + * @returns {Promise} + * + * @memberof Blame + */ + buffer(buffer: string, bufferLen: number): Promise; + /** + * + * + * + * @memberof Blame + */ free(): void; + /** + * + * + * @param {number} index + * @returns {BlameHunk} - the hunk at the given index, or NULL on error + * + * @memberof Blame + */ getHunkByIndex(index: number): BlameHunk; - getHunkByLine(lineno: number): BlameHunk; + /** + * + * + * @param {number} lineNo + * @returns {BlameHunk} - the hunk that contains the given line, or NULL on error + * + * @memberof Blame + */ + getHunkByLine(lineNo: number): BlameHunk; + /** + * + * + * @returns {number} + * + * @memberof Blame + */ getHunkCount(): number; } diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index 370369eed4..e9bceb601e 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -45,3 +45,5 @@ Git.Attr.get(repo, 1, "path", "name").then((string) => { let array = Git.Attr.getMany(repo, 1, "path", 1, "names"); result = Git.Attr.value("attr"); + +const blameOptions = new Git.BlameOptions(); From 415a39e089f22a85621b8a58464947ac43e33702 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:20:50 +0100 Subject: [PATCH 198/761] Added documentation and more methods to blob --- types/nodegit/blob.d.ts | 139 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 138 insertions(+), 1 deletion(-) diff --git a/types/nodegit/blob.d.ts b/types/nodegit/blob.d.ts index 32f020b0ce..edd0eb62f7 100644 --- a/types/nodegit/blob.d.ts +++ b/types/nodegit/blob.d.ts @@ -1,20 +1,157 @@ +import { WriteStream } from 'fs'; + import { Repository } from './repository'; import { Oid } from './oid'; export class Blob { + /** + * + * + * @static + * @param {Repository} repo - repository where to blob will be written + * @param {Buffer} buffer - data to be written into the blob + * @param {number} len - length of the data + * @returns {Oid} - return the id of the written blob + * + * @memberof Blob + */ static createFromBuffer(repo: Repository, buffer: Buffer, len: number): Oid; + /** + * + * + * @static + * @param {Oid} id - return the id of the written blob + * @param {Repository} repo - repository where the blob will be written. this repository can be bare or not + * @param {string} path - file from which the blob will be created + * @returns {number} + * + * @memberof Blob + */ static createFromDisk(id: Oid, repo: Repository, path: string): number; - static createFromWorkdir(id: Oid, repo: Repository, relative_path: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} hintPath + * @returns {Promise} + * + * @memberof Blob + */ + static createFromStream(repo: Repository, hintPath: string): Promise; + /** + * + * + * @static + * @param {Oid} id - return the id of the written blob + * @param {Repository} repo - repository where the blob will be written. this repository cannot be bare + * @param {string} relativePath - file from which the blob will be created, relative to the repository's working dir + * @returns {number} - 0 or an error code + * + * @memberof Blob + */ + static createFromWorkdir(id: Oid, repo: Repository, relativePath: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {(string | Oid | Blob)} id + * @returns {Promise} + * + * @memberof Blob + */ static lookup(repo: Repository, id: string | Oid | Blob): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} len + * @returns {Promise} + * + * @memberof Blob + */ static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + /** + * + * + * + * @memberof Blob + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Blob + */ id(): Oid; + /** + * + * + * @returns {number} + * + * @memberof Blob + */ isBinary(): number; + /** + * + * + * @returns {Repository} + * + * @memberof Blob + */ owner(): Repository; + /** + * + * + * @returns {Buffer} + * + * @memberof Blob + */ rawcontent(): Buffer; + /** + * + * + * @returns {number} + * + * @memberof Blob + */ rawsize(): number; + /** + * + * + * @returns {Buffer} + * + * @memberof Blob + */ content(): Buffer; + /** + * + * + * @returns {string} + * + * @memberof Blob + */ toString(): string; + /** + * + * + * @returns {number} + * + * @memberof Blob + */ filemode(): number; + /** + * + * + * @returns {Promise} + * + * @memberof Blob + */ + dup(): Promise; } From b54f72f4fdc599ec885558653073b74dfa2efd99 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:22:49 +0100 Subject: [PATCH 199/761] Added documentation for Branch --- types/nodegit/branch.d.ts | 114 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 108 insertions(+), 6 deletions(-) diff --git a/types/nodegit/branch.d.ts b/types/nodegit/branch.d.ts index d121650864..4c48d32101 100644 --- a/types/nodegit/branch.d.ts +++ b/types/nodegit/branch.d.ts @@ -12,14 +12,116 @@ export namespace Branch { } export class Branch { - static create(repo: Repository, branch_name: string, target: Commit, force: number): Promise; - static createFromAnnotated(repository: Repository, branch_name: string, commit: AnnotatedCommit, force: number): Reference; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} branchName + * @param {Commit} target + * @param {number} force + * @returns {Promise} + * + * @memberof Branch + */ + static create(repo: Repository, branchName: string, target: Commit, force: number): Promise; + /** + * + * + * @static + * @param {Repository} repository + * @param {string} branchName + * @param {AnnotatedCommit} commit + * @param {number} force + * @returns {Reference} + * + * @memberof Branch + */ + static createFromAnnotated(repository: Repository, branchName: string, commit: AnnotatedCommit, force: number): Reference; + /** + * + * + * @static + * @param {Reference} branch + * @returns {number} + * + * @memberof Branch + */ static delete(branch: Reference): number; + /** + * + * + * @static + * @param {Reference} branch + * @returns {number} + * + * @memberof Branch + */ static isHead(branch: Reference): number; - static iteratorNew(repo: Repository, list_flags: number): Promise; - static lookup(repo: Repository, branch_name: string, branch_type: number): Promise; - static move(branch: Reference, new_branch_name: string, force: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {number} listFlags + * @returns {Promise} + * + * @memberof Branch + */ + static iteratorNew(repo: Repository, listFlags: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} branchName + * @param {number} branchType + * @returns {Promise} + * + * @memberof Branch + */ + static lookup(repo: Repository, branchName: string, branchType: number): Promise; + /** + * + * + * @static + * @param {Reference} branch + * @param {string} newBranchName + * @param {number} force + * @returns {Promise} + * + * @memberof Branch + */ + static move(branch: Reference, newBranchName: string, force: number): Promise; + /** + * + * + * @static + * @param {Reference} ref + * @returns {Promise} + * + * @memberof Branch + */ static name(ref: Reference): Promise; - static setUpstream(branch: Reference, upstream_name: string): Promise; + /** + * + * + * @static + * @param {Reference} branch + * @param {string} upstreamName + * @returns {Promise} + * + * @memberof Branch + */ + static setUpstream(branch: Reference, upstreamName: string): Promise; + /** + * + * + * @static + * @param {Reference} branch + * @returns {Promise} + * + * @memberof Branch + */ static upstream(branch: Reference): Promise; } From 29a0cd79eb39c9dde5b27833f56a1c1a2653846c Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:27:21 +0100 Subject: [PATCH 200/761] Added documentation --- types/nodegit/attr.d.ts | 6 ++++-- types/nodegit/branch.d.ts | 4 ++-- types/nodegit/nodegit-tests.ts | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/types/nodegit/attr.d.ts b/types/nodegit/attr.d.ts index 41c1aa5eb2..fdcf4dc56b 100644 --- a/types/nodegit/attr.d.ts +++ b/types/nodegit/attr.d.ts @@ -37,7 +37,8 @@ export class Attr { * @static * @param {Repository} repo - The repository containing the path. * @param {number} flags - A combination of GIT_ATTR_CHECK... flags. - * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). + * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. + * The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). * @param {string} name - The name of the attribute to look up. * @returns {Promise} - Output of the value of the attribute. Use the GIT_ATTR_... * @@ -50,7 +51,8 @@ export class Attr { * @static * @param {Repository} repo - The repository containing the path. * @param {number} flags - A combination of GIT_ATTR_CHECK... flags. - * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). + * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. + * The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). * @param {number} numAttr - The number of attributes being looked up * @param {string} names - An array of num_attr strings containing attribute names. * @returns {any[]} diff --git a/types/nodegit/branch.d.ts b/types/nodegit/branch.d.ts index 4c48d32101..0c52131a51 100644 --- a/types/nodegit/branch.d.ts +++ b/types/nodegit/branch.d.ts @@ -75,12 +75,12 @@ export class Branch { * @static * @param {Repository} repo * @param {string} branchName - * @param {number} branchType + * @param {Branch.BRANCH} branchType * @returns {Promise} * * @memberof Branch */ - static lookup(repo: Repository, branchName: string, branchType: number): Promise; + static lookup(repo: Repository, branchName: string, branchType: Branch.BRANCH): Promise; /** * * diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index e9bceb601e..c8d296ea09 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -47,3 +47,7 @@ let array = Git.Attr.getMany(repo, 1, "path", 1, "names"); result = Git.Attr.value("attr"); const blameOptions = new Git.BlameOptions(); + +Git.Branch.lookup(repo, "branch_name", Git.Branch.BRANCH.LOCAL).then(function (reference) { + // Use reference +}); From 2dc0287a6b84ed7d177bea46a79e218da9223efd Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:28:00 +0100 Subject: [PATCH 201/761] Made enums all constants --- types/nodegit/attr.d.ts | 2 +- types/nodegit/blame.d.ts | 2 +- types/nodegit/branch.d.ts | 2 +- types/nodegit/cert.d.ts | 4 ++-- types/nodegit/checkout.d.ts | 4 ++-- types/nodegit/clone.d.ts | 2 +- types/nodegit/config.d.ts | 2 +- types/nodegit/cred.d.ts | 2 +- types/nodegit/diff-binary.d.ts | 2 +- types/nodegit/diff.d.ts | 16 ++++++++-------- types/nodegit/enums.d.ts | 10 +++++----- types/nodegit/error.d.ts | 4 ++-- types/nodegit/fetch.d.ts | 2 +- types/nodegit/filter.d.ts | 4 ++-- types/nodegit/hash-sig.d.ts | 2 +- types/nodegit/index_.d.ts | 4 ++-- types/nodegit/lib-git2.d.ts | 2 +- types/nodegit/merge.d.ts | 10 +++++----- types/nodegit/odb.d.ts | 2 +- types/nodegit/pack-builder.d.ts | 2 +- types/nodegit/path-spec.d.ts | 2 +- types/nodegit/rebase-operation.d.ts | 2 +- types/nodegit/reference.d.ts | 4 ++-- types/nodegit/remote.d.ts | 4 ++-- types/nodegit/reset.d.ts | 2 +- types/nodegit/rev-parse.d.ts | 2 +- types/nodegit/rev-walk.d.ts | 2 +- types/nodegit/stash.d.ts | 6 +++--- types/nodegit/status.d.ts | 6 +++--- types/nodegit/submodule.d.ts | 8 ++++---- types/nodegit/transport.d.ts | 2 +- types/nodegit/tree-entry.d.ts | 2 +- types/nodegit/tree.d.ts | 2 +- 33 files changed, 62 insertions(+), 62 deletions(-) diff --git a/types/nodegit/attr.d.ts b/types/nodegit/attr.d.ts index fdcf4dc56b..c7b2d3ea22 100644 --- a/types/nodegit/attr.d.ts +++ b/types/nodegit/attr.d.ts @@ -1,7 +1,7 @@ import { Repository } from './repository'; export namespace Attr { - enum STATES { + const enum STATES { UNSPECIFIED_T = 0, TRUE_T = 1, FALSE_T = 2, diff --git a/types/nodegit/blame.d.ts b/types/nodegit/blame.d.ts index c6efdc133b..684db81b6c 100644 --- a/types/nodegit/blame.d.ts +++ b/types/nodegit/blame.d.ts @@ -3,7 +3,7 @@ import { BlameOptions } from './blame-options'; import {BlameHunk} from './blame-hunk'; export namespace Blame { - enum FLAG { + const enum FLAG { NORMAL = 0, TRACK_COPIES_SAME_FILE = 1, TRACK_COPIES_SAME_COMMIT_MOVES = 2, diff --git a/types/nodegit/branch.d.ts b/types/nodegit/branch.d.ts index 0c52131a51..47bd1ec76f 100644 --- a/types/nodegit/branch.d.ts +++ b/types/nodegit/branch.d.ts @@ -4,7 +4,7 @@ import { Commit } from './commit'; import { AnnotatedCommit } from './annotated-commit'; export namespace Branch { - enum BRANCH { + const enum BRANCH { LOCAL = 1, REMOTE = 2, ALL = 3 diff --git a/types/nodegit/cert.d.ts b/types/nodegit/cert.d.ts index f910453700..fd749beba9 100644 --- a/types/nodegit/cert.d.ts +++ b/types/nodegit/cert.d.ts @@ -1,12 +1,12 @@ export namespace Cert { - enum TYPE { + const enum TYPE { NONE = 0, X509 = 1, HOSTKEY_LIBSSH2 = 2, STRARRAY = 3 } - enum SSH { + const enum SSH { MD5 = 1, SHA1 = 2 } diff --git a/types/nodegit/checkout.d.ts b/types/nodegit/checkout.d.ts index a7bc6d63fc..af5f66faf3 100644 --- a/types/nodegit/checkout.d.ts +++ b/types/nodegit/checkout.d.ts @@ -7,7 +7,7 @@ import { Commit } from './commit'; import { Index } from './index'; export namespace Checkout { - enum NOTIFY { + const enum NOTIFY { NONE = 0, CONFLICT = 1, DIRTY = 2, @@ -17,7 +17,7 @@ export namespace Checkout { ALL = 65535 } - enum STRATEGY { + const enum STRATEGY { NONE = 0, SAFE = 1, FORCE = 2, diff --git a/types/nodegit/clone.d.ts b/types/nodegit/clone.d.ts index e0b92bb9ea..c038a8e26a 100644 --- a/types/nodegit/clone.d.ts +++ b/types/nodegit/clone.d.ts @@ -2,7 +2,7 @@ import { Repository } from './repository'; import { CloneOptions } from './clone-options'; export namespace Clone { - enum LOCAL { + const enum LOCAL { AUTO = 0, LOCAL = 1, NO_LOCAL = 2, diff --git a/types/nodegit/config.d.ts b/types/nodegit/config.d.ts index ad8df1a327..ea61c52d3c 100644 --- a/types/nodegit/config.d.ts +++ b/types/nodegit/config.d.ts @@ -1,7 +1,7 @@ import { Buf } from './buf'; export namespace Config { - enum LEVEL { + const enum LEVEL { SYSTEM = 1, XDG = 2, GLOBAL = 3, diff --git a/types/nodegit/cred.d.ts b/types/nodegit/cred.d.ts index 759e43d814..9de014311b 100644 --- a/types/nodegit/cred.d.ts +++ b/types/nodegit/cred.d.ts @@ -1,5 +1,5 @@ export namespace Cred { - enum TYPE { + const enum TYPE { USERPASS_PLAINTEXT = 1, SSH_KEY = 2, SSH_CUSTOM = 4, diff --git a/types/nodegit/diff-binary.d.ts b/types/nodegit/diff-binary.d.ts index fa6643038d..d01181c92a 100644 --- a/types/nodegit/diff-binary.d.ts +++ b/types/nodegit/diff-binary.d.ts @@ -1,7 +1,7 @@ import { DiffBinaryFile } from './diff-binary-file'; export namespace DiffBinary { - enum DIFF_BINARY { + const enum DIFF_BINARY { NONE = 0, LITERAL = 1, DELTA = 2 diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index d675b36acf..6926527124 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -18,7 +18,7 @@ export interface DiffFindOptions { } export namespace Diff { - enum DELTA { + const enum DELTA { UNMODIFIED = 0, ADDED = 1, DELETED = 2, @@ -32,7 +32,7 @@ export namespace Diff { CONFLICTED = 10 } - enum FIND { + const enum FIND { BY_CONFIG = 0, RENAMES = 1, RENAMES_FROM_REWRITES = 2, @@ -51,14 +51,14 @@ export namespace Diff { REMOVE_UNMODIFIED = 65536 } - enum FLAG { + const enum FLAG { BINARY = 1, NOT_BINARY = 2, VALID_ID = 4, EXISTS = 8 } - enum FORMAT { + const enum FORMAT { PATCH = 1, PATCH_HEADER = 2, RAW = 3, @@ -66,12 +66,12 @@ export namespace Diff { NAME_STATUS = 5 } - enum FORMAT_EMAIL_FLAGS { + const enum FORMAT_EMAIL_FLAGS { FORMAT_EMAIL_NONE = 0, FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = 1 } - enum LINE { + const enum LINE { CONTEXT = 32, ADDITION = 43, DELETION = 45, @@ -83,7 +83,7 @@ export namespace Diff { BINARY = 66 } - enum OPTION { + const enum OPTION { NORMAL = 0, REVERSE = 1, INCLUDE_IGNORED = 2, @@ -115,7 +115,7 @@ export namespace Diff { SHOW_BINARY = 1073741824 } - enum STATS_FORMAT { + const enum STATS_FORMAT { STATS_NONE = 0, STATS_FULL = 1, STATS_SHORT = 2, diff --git a/types/nodegit/enums.d.ts b/types/nodegit/enums.d.ts index 850979ac51..4fb44850ca 100644 --- a/types/nodegit/enums.d.ts +++ b/types/nodegit/enums.d.ts @@ -1,23 +1,23 @@ export namespace Enums { - enum CVAR { + const enum CVAR { FALSE = 0, TRUE = 1, INT32 = 2, string = 3 } - enum DIRECTION { + const enum DIRECTION { FETCH = 0, PUSH = 1 } - enum FEATURE { + const enum FEATURE { THREADS = 1, HTTPS = 2, SSH = 4 } - enum IDXENTRY_EXTENDED_FLAG { + const enum IDXENTRY_EXTENDED_FLAG { IDXENTRY_INTENT_TO_ADD = 8192, IDXENTRY_SKIP_WORKTREE = 16384, IDXENTRY_EXTENDED2 = 32768, @@ -34,7 +34,7 @@ export namespace Enums { IDXENTRY_NEW_SKIP_WORKTREE = 512 } - enum INDXENTRY_FLAG { + const enum INDXENTRY_FLAG { IDXENTRY_EXTENDED = 16384, IDXENTRY_VALID = 32768 } diff --git a/types/nodegit/error.d.ts b/types/nodegit/error.d.ts index e1267c082b..c259749e8b 100644 --- a/types/nodegit/error.d.ts +++ b/types/nodegit/error.d.ts @@ -1,5 +1,5 @@ export namespace Error { - enum ERROR { + const enum ERROR { GITERR_NONE = 0, GITERR_NOMEMORY = 1, GITERR_OS = 2, @@ -33,7 +33,7 @@ export namespace Error { GITERR_FILESYSTEM = 30 } - enum CODE { + const enum CODE { OK = 0, ERROR = -1, ENOTFOUND = -3, diff --git a/types/nodegit/fetch.d.ts b/types/nodegit/fetch.d.ts index 2e71097ba3..db0980586f 100644 --- a/types/nodegit/fetch.d.ts +++ b/types/nodegit/fetch.d.ts @@ -1,7 +1,7 @@ import { FetchOptions } from './fetch-options'; export namespace Fetch { - enum PRUNE { + const enum PRUNE { GIT_FETCH_PRUNE_UNSPECIFIED = 0, GIT_FETCH_PRUNE = 1, GIT_FETCH_NO_PRUNE = 2 diff --git a/types/nodegit/filter.d.ts b/types/nodegit/filter.d.ts index da1f71c2b9..066a51183e 100644 --- a/types/nodegit/filter.d.ts +++ b/types/nodegit/filter.d.ts @@ -5,12 +5,12 @@ import { Blob } from './blob'; import { Buf } from './buf'; export namespace Filter { - enum FLAG { + const enum FLAG { DEFAULT = 0, ALLOW_UNSAFE = 1 } - enum MODE { + const enum MODE { TO_WORKTREE = 0, SMUDGE = 0, TO_ODB = 1, diff --git a/types/nodegit/hash-sig.d.ts b/types/nodegit/hash-sig.d.ts index afa9bc121c..5e9897450f 100644 --- a/types/nodegit/hash-sig.d.ts +++ b/types/nodegit/hash-sig.d.ts @@ -1,5 +1,5 @@ export namespace Hashsig { - enum OPTION { + const enum OPTION { NORMAL = 0, IGNORE_WHITESPACE = 1, SMART_WHITESPACE = 2, diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index 9902b53d35..6fd80f5047 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -5,14 +5,14 @@ import { Tree } from './tree'; import { Strarray } from './str-array'; export namespace Index { - enum ADD_OPTION { + const enum ADD_OPTION { ADD_DEFAULT = 0, ADD_FORCE = 1, ADD_DISABLE_PATHSPEC_MATCH = 2, ADD_CHECK_PATHSPEC = 4 } - enum CAP { + const enum CAP { IGNORE_CASE = 1, NO_FILEMODE = 2, NO_SYMLINKS = 4, diff --git a/types/nodegit/lib-git2.d.ts b/types/nodegit/lib-git2.d.ts index 9d7f1a5281..be5a5d1856 100644 --- a/types/nodegit/lib-git2.d.ts +++ b/types/nodegit/lib-git2.d.ts @@ -1,5 +1,5 @@ export namespace Libgit2 { - enum OPT { + const enum OPT { GET_MWINDOW_SIZE = 0, SET_MWINDOW_SIZE = 1, GET_MWINDOW_MAPPED_LIMIT = 2, diff --git a/types/nodegit/merge.d.ts b/types/nodegit/merge.d.ts index fb135e178f..737d3c5a04 100644 --- a/types/nodegit/merge.d.ts +++ b/types/nodegit/merge.d.ts @@ -10,7 +10,7 @@ import { MergeOptions } from './merge-options'; import { MergeFileInput } from './merge-file-input'; export namespace Merge { - enum ANALYSIS { + const enum ANALYSIS { NONE = 0, NORMAL = 1, UP_TO_DATE = 2, @@ -18,14 +18,14 @@ export namespace Merge { UNBORN = 8 } - enum FILE_FAVOR { + const enum FILE_FAVOR { NORMAL = 0, OURS = 1, THEIRS = 2, UNION = 3 } - enum FILE_FLAGS { + const enum FILE_FLAGS { FILE_DEFAULT = 0, FILE_STYLE_MERGE = 1, FILE_STYLE_DIFF3 = 2, @@ -37,13 +37,13 @@ export namespace Merge { FILE_DIFF_MINIMAL = 128 } - enum PREFERENCE { + const enum PREFERENCE { NONE = 0, NO_FASTFORWARD = 1, FASTFORWARD_ONLY = 2 } - enum TREE_FLAG { + const enum TREE_FLAG { TREE_FIND_RENAMES = 1 } } diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index f43f1673db..c0cbfd8725 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -2,7 +2,7 @@ import { Oid } from './oid'; import { OdbObject } from './odb-object'; export namespace Odb { - enum STREAM { + const enum STREAM { RDONLY = 2, WRONLY = 4, RW = 6 diff --git a/types/nodegit/pack-builder.d.ts b/types/nodegit/pack-builder.d.ts index 0f21f5f328..ed0fa0a2cc 100644 --- a/types/nodegit/pack-builder.d.ts +++ b/types/nodegit/pack-builder.d.ts @@ -3,7 +3,7 @@ import { Oid } from './oid'; import { Revwalk } from './rev-walk'; export namespace Packbuilder { - enum STAGE { + const enum STAGE { ADDING_OBJECTS = 0, DELTAFICATION = 1 } diff --git a/types/nodegit/path-spec.d.ts b/types/nodegit/path-spec.d.ts index d09d2812da..99435d5e0d 100644 --- a/types/nodegit/path-spec.d.ts +++ b/types/nodegit/path-spec.d.ts @@ -6,7 +6,7 @@ import { Index } from './index'; import { Strarray } from './str-array'; export namespace Pathspec { - enum FLAG { + const enum FLAG { DEFAULT = 0, IGNORE_CASE = 1, USE_CASE = 2, diff --git a/types/nodegit/rebase-operation.d.ts b/types/nodegit/rebase-operation.d.ts index a6e6e53bfa..7144ebe6a9 100644 --- a/types/nodegit/rebase-operation.d.ts +++ b/types/nodegit/rebase-operation.d.ts @@ -1,7 +1,7 @@ import { Oid } from './oid'; export namespace RebaseOperation { - enum REBASE_OPERATION { + const enum REBASE_OPERATION { PICK = 0, REWORD = 1, EDIT = 2, diff --git a/types/nodegit/reference.d.ts b/types/nodegit/reference.d.ts index e2148f6a07..4edd34d2da 100644 --- a/types/nodegit/reference.d.ts +++ b/types/nodegit/reference.d.ts @@ -3,14 +3,14 @@ import { Oid } from './oid'; import { Object } from './object'; export namespace Reference { - enum TYPE { + const enum TYPE { INVALID = 0, OID = 1, SYMBOLIC = 2, LISTALL = 3 } - enum NORMALIZE { + const enum NORMALIZE { REF_FORMAT_NORMAL = 0, REF_FORMAT_ALLOW_ONELEVEL = 1, REF_FORMAT_REFSPEC_PATTERN = 2, diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 0c3923c57c..bba1f640fb 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -9,14 +9,14 @@ import { PushOptions } from './push-options'; import { Refspec } from './ref-spec'; export namespace Remote { - enum AUTOTAG_OPTION { + const enum AUTOTAG_OPTION { DOWNLOAD_TAGS_UNSPECIFIED = 0, DOWNLOAD_TAGS_AUTO = 1, DOWNLOAD_TAGS_NONE = 2, DOWNLOAD_TAGS_ALL = 3 } - enum COMPLETION_TYPE { + const enum COMPLETION_TYPE { COMPLETION_DOWNLOAD = 0, COMPLETION_INDEXING = 1, COMPLETION_ERROR = 2 diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 8af3919ff4..25ff5ae563 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -5,7 +5,7 @@ import { Strarray } from './str-array'; import { CheckoutOptions } from './checkout-options'; export namespace Reset { - enum TYPE { + const enum TYPE { SOFT = 1, MIXED = 2, HARD = 3 diff --git a/types/nodegit/rev-parse.d.ts b/types/nodegit/rev-parse.d.ts index 9d0136cac6..7bdbc80676 100644 --- a/types/nodegit/rev-parse.d.ts +++ b/types/nodegit/rev-parse.d.ts @@ -3,7 +3,7 @@ import { Repository } from './repository'; import { Reference } from './reference'; export namespace Revparse { - enum MODE { + const enum MODE { SINGLE = 1, RANGE = 2, MERGE_BASE = 4 diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts index ad54969164..643220b492 100644 --- a/types/nodegit/rev-walk.d.ts +++ b/types/nodegit/rev-walk.d.ts @@ -3,7 +3,7 @@ import { Oid } from './oid'; import { Commit } from './commit'; export namespace Revwalk { - enum SORT { + const enum SORT { NONE = 0, TOPOLOGICAL = 1, TIME = 2, diff --git a/types/nodegit/stash.d.ts b/types/nodegit/stash.d.ts index 5208fa7e5f..39a6893140 100644 --- a/types/nodegit/stash.d.ts +++ b/types/nodegit/stash.d.ts @@ -4,12 +4,12 @@ import { Oid } from './oid'; import { CheckoutOptions } from './checkout-options'; export namespace Stash { - enum APPLY_FLAGS { + const enum APPLY_FLAGS { APPLY_DEFAULT = 0, APPLY_REINSTATE_INDEX = 1 } - enum APPLY_PROGRESS { + const enum APPLY_PROGRESS { NONE = 0, LOADING_STASH = 1, ANALYZE_INDEX = 2, @@ -20,7 +20,7 @@ export namespace Stash { DONE = 7 } - enum FLAGS { + const enum FLAGS { DEFAULT = 0, KEEP_INDEX = 1, INCLUDE_UNTRACKED = 2, diff --git a/types/nodegit/status.d.ts b/types/nodegit/status.d.ts index 92bbe564f3..49ad0fd142 100644 --- a/types/nodegit/status.d.ts +++ b/types/nodegit/status.d.ts @@ -4,7 +4,7 @@ import { StatusEntry } from './status-entry'; import { StatusOptions } from './status-options'; export namespace Status { - enum STATUS { + const enum STATUS { CURRENT = 0, INDEX_NEW = 1, INDEX_MODIFIED = 2, @@ -21,7 +21,7 @@ export namespace Status { CONFLICTED = 32768 } - enum OPT { + const enum OPT { INCLUDE_UNTRACKED = 1, INCLUDE_IGNORED = 2, INCLUDE_UNMODIFIED = 4, @@ -40,7 +40,7 @@ export namespace Status { INCLUDE_UNREADABLE_AS_UNTRACKED = 32768 } - enum SHOW { + const enum SHOW { INDEX_AND_WORKDIR = 0, INDEX_ONLY = 1, WORKDIR_ONLY = 2 diff --git a/types/nodegit/submodule.d.ts b/types/nodegit/submodule.d.ts index b3c1576db4..fd64a1c8ac 100644 --- a/types/nodegit/submodule.d.ts +++ b/types/nodegit/submodule.d.ts @@ -4,7 +4,7 @@ import { Oid } from './oid'; import { SubmoduleUpdateOptions } from './submodule-update-options'; export namespace Submodule { - enum IGNORE { + const enum IGNORE { UNSPECIFIED = -1, NONE = 1, UNTRACKED = 2, @@ -12,13 +12,13 @@ export namespace Submodule { ALL = 4 } - enum RECURSE { + const enum RECURSE { NO = 0, YES = 1, ONDEMAND = 2 } - enum STATUS { + const enum STATUS { IN_HEAD = 1, IN_INDEX = 2, IN_CONFIG = 4, @@ -35,7 +35,7 @@ export namespace Submodule { WD_UNTRACKED = 8192 } - enum UPDATE { + const enum UPDATE { CHECKOUT = 1, REBASE = 2, MERGE = 3, diff --git a/types/nodegit/transport.d.ts b/types/nodegit/transport.d.ts index 9d1a82b061..189985c469 100644 --- a/types/nodegit/transport.d.ts +++ b/types/nodegit/transport.d.ts @@ -2,7 +2,7 @@ import { Remote } from './remote'; import { Strarray } from './str-array'; export namespace Transport { - enum FLAGS { + const enum FLAGS { NONE = 0 } } diff --git a/types/nodegit/tree-entry.d.ts b/types/nodegit/tree-entry.d.ts index 8d1b5d553e..844f5da90c 100644 --- a/types/nodegit/tree-entry.d.ts +++ b/types/nodegit/tree-entry.d.ts @@ -3,7 +3,7 @@ import { Oid } from './oid'; import { Blob } from './blob'; export namespace TreeEntry { - enum FILEMODE { + const enum FILEMODE { UNREADABLE = 0, TREE = 16384, BLOB = 33188, diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index b9ac62f9e2..c20037cb0a 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -6,7 +6,7 @@ import { Treebuilder } from './tree-builder'; import { DiffFile } from './diff-file'; export namespace Tree { - enum WALK_MODE { + const enum WALK_MODE { WALK_PRE = 0, WALK_POST = 1 } From 7097c37505310eb083657671f0e36e681b5ce50c Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:31:06 +0100 Subject: [PATCH 202/761] Fixed tests --- types/nodegit/clone-options.d.ts | 4 ++-- types/nodegit/diff-options.d.ts | 2 +- types/nodegit/nodegit-tests.ts | 2 +- types/nodegit/note.d.ts | 2 +- types/nodegit/stash.d.ts | 4 ++-- types/nodegit/status.d.ts | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/types/nodegit/clone-options.d.ts b/types/nodegit/clone-options.d.ts index b8acc9aad0..8535b28c81 100644 --- a/types/nodegit/clone-options.d.ts +++ b/types/nodegit/clone-options.d.ts @@ -8,6 +8,6 @@ export class CloneOptions { bare?: number; local?: number; checkoutBranch?: string; - repositoryCbPayload?: void; - remoteCbPayload?: void; + repositoryCbPayload?: any; + remoteCbPayload?: any; } diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts index e78de28aac..32dec9943f 100644 --- a/types/nodegit/diff-options.d.ts +++ b/types/nodegit/diff-options.d.ts @@ -6,7 +6,7 @@ export interface DiffOptions { ignoreSubmodules: number; pathspec: Strarray; notifyCb: Function; - notifyPayload: void; + notifyPayload: any; contextLines: number; interhunkLines: number; idAbbrev: number; diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index c8d296ea09..c10dfef127 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -48,6 +48,6 @@ result = Git.Attr.value("attr"); const blameOptions = new Git.BlameOptions(); -Git.Branch.lookup(repo, "branch_name", Git.Branch.BRANCH.LOCAL).then(function (reference) { +Git.Branch.lookup(repo, "branch_name", Git.Branch.BRANCH.LOCAL).then((reference) => { // Use reference }); diff --git a/types/nodegit/note.d.ts b/types/nodegit/note.d.ts index 2ea74b9df8..c5c9152bb2 100644 --- a/types/nodegit/note.d.ts +++ b/types/nodegit/note.d.ts @@ -4,7 +4,7 @@ import {Oid} from './oid'; export class Note { static create(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid, note: string, force: number): Promise; - static foreach(repo: Repository, notes_ref: string, note_cb: Function, payload: void): Promise; + static foreach(repo: Repository, notes_ref: string, note_cb: Function, payload: any): Promise; static iteratorNew(repo: Repository, notes_ref: string): Promise; static next(note_id: Oid, annotated_id: Oid, it: any): number; static read(repo: Repository, notes_ref: string, oid: Oid): Promise; diff --git a/types/nodegit/stash.d.ts b/types/nodegit/stash.d.ts index 39a6893140..c81e94b7b6 100644 --- a/types/nodegit/stash.d.ts +++ b/types/nodegit/stash.d.ts @@ -33,14 +33,14 @@ export interface StashApplyOptions { flags: number; checkoutOptions: CheckoutOptions; progressCb: Function; - progressPayload: void; + progressPayload: any; } export class Stash { static apply(repo: Repository, index: number, options: StashApplyOptions): Promise; static applyInitOptions(opts: StashApplyOptions, version: number): number; static drop(repo: Repository, index: number): Promise; - static foreach(repo: Repository, callback: Function, payload: void): Promise; + static foreach(repo: Repository, callback: Function, payload: any): Promise; static pop(repo: Repository, index: number, options: StashApplyOptions): Promise; static save(repo: Repository, stasher: Signature, message: string, flags: number): Promise; } diff --git a/types/nodegit/status.d.ts b/types/nodegit/status.d.ts index 49ad0fd142..1059dd6bff 100644 --- a/types/nodegit/status.d.ts +++ b/types/nodegit/status.d.ts @@ -50,7 +50,7 @@ export namespace Status { export class Status { static byIndex(statuslist: StatusList, idx: number): StatusEntry; static file(repo: Repository, path: string): number; - static foreach(repo: Repository, callback: Function, payload: void): Promise; - static foreachExt(repo: Repository, opts: StatusOptions, callback: Function, payload: void): Promise; + static foreach(repo: Repository, callback: Function, payload: any): Promise; + static foreachExt(repo: Repository, opts: StatusOptions, callback: Function, payload: any): Promise; static shouldIgnore(ignored: number, repo: Repository, path: string): number; } From 39a54fd1d7f660cac8fe2d027ab617ed1eaa5a33 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:32:35 +0100 Subject: [PATCH 203/761] Added documentation for Buf --- types/nodegit/buf.d.ts | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/types/nodegit/buf.d.ts b/types/nodegit/buf.d.ts index 53886615ed..d9670bb293 100644 --- a/types/nodegit/buf.d.ts +++ b/types/nodegit/buf.d.ts @@ -1,12 +1,67 @@ /// export class Buf { + /** + * + * + * @returns {number} + * + * @memberof Buf + */ containsNul(): number; + /** + * + * + * + * @memberof Buf + */ free(): void; + /** + * + * + * @param {number} target_size + * @returns {Promise} + * + * @memberof Buf + */ grow(target_size: number): Promise; + /** + * + * + * @returns {number} + * + * @memberof Buf + */ isBinary(): number; + /** + * + * + * @param {Buffer} data + * @param {number} datalen + * @returns {Promise} + * + * @memberof Buf + */ set(data: Buffer, datalen: number): Promise; + /** + * + * + * @type {string} + * @memberof Buf + */ ptr: string; + /** + * + * + * @type {number} + * @memberof Buf + */ asize: number; + /** + * + * + * @type {number} + * @memberof Buf + */ size: number; } From 65727b3bdb9a597acd3b524502a4363c53bac711 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:34:49 +0100 Subject: [PATCH 204/761] Added documentation for CertHostkey --- types/nodegit/cert-host-key.d.ts | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/types/nodegit/cert-host-key.d.ts b/types/nodegit/cert-host-key.d.ts index 428d04b727..c4947d347c 100644 --- a/types/nodegit/cert-host-key.d.ts +++ b/types/nodegit/cert-host-key.d.ts @@ -1,6 +1,32 @@ +import { Cert } from './cert'; + export class CertHostkey { - certType: number; + /** + * + * + * @type {Cert} + * @memberof CertHostkey + */ + parent: Cert; + /** + * + * + * @type {number} + * @memberof CertHostkey + */ type: number; + /** + * + * + * @type {string} + * @memberof CertHostkey + */ hashMd5: string; + /** + * + * + * @type {string} + * @memberof CertHostkey + */ hashSha1: string; } From 5217c986509016f65bcc5f63d2be8c385bd2b9c7 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:35:38 +0100 Subject: [PATCH 205/761] Added documentation for CertX509 --- types/nodegit/cert-x509.d.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/types/nodegit/cert-x509.d.ts b/types/nodegit/cert-x509.d.ts index 14f38ac5fc..dd395a755d 100644 --- a/types/nodegit/cert-x509.d.ts +++ b/types/nodegit/cert-x509.d.ts @@ -1,5 +1,25 @@ +import { Cert } from './cert'; + export class CertX509 { - certType: number; + /** + * + * + * @type {Buffer} + * @memberof CertX509 + */ data: Buffer; + /** + * + * + * @type {number} + * @memberof CertX509 + */ len: number; + /** + * + * + * @type {Cert} + * @memberof CertX509 + */ + parent: Cert; } From d2a75d9ecc969f045494881b55563d11625707b4 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:37:10 +0100 Subject: [PATCH 206/761] Added documentation --- types/nodegit/cert-host-key.d.ts | 8 +------- types/nodegit/cert.d.ts | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/types/nodegit/cert-host-key.d.ts b/types/nodegit/cert-host-key.d.ts index c4947d347c..f69210ca37 100644 --- a/types/nodegit/cert-host-key.d.ts +++ b/types/nodegit/cert-host-key.d.ts @@ -8,13 +8,7 @@ export class CertHostkey { * @memberof CertHostkey */ parent: Cert; - /** - * - * - * @type {number} - * @memberof CertHostkey - */ - type: number; + type: Cert.TYPE; /** * * diff --git a/types/nodegit/cert.d.ts b/types/nodegit/cert.d.ts index fd749beba9..fde86569b9 100644 --- a/types/nodegit/cert.d.ts +++ b/types/nodegit/cert.d.ts @@ -13,5 +13,5 @@ export namespace Cert { } export class Cert { - certType: number; + certType: Cert.TYPE; } From a483653f42fa1be3a0194871803748b8c69ccea7 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:38:37 +0100 Subject: [PATCH 207/761] Added documentation --- types/nodegit/checkout-options.d.ts | 120 ++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index 4122dfbe28..253755d7fb 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -3,24 +3,144 @@ import { Tree } from './tree'; import { Index } from './index'; export class CheckoutOptions { + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ version?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ checkoutStrategy?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ disableFilters?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ dirMode?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ fileMode?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ fileOpenFlags?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ notifyFlags?: number; + /** + * + * + * @type {*} + * @memberof CheckoutOptions + */ notifyCb?: any; + /** + * + * + * @type {undefined} + * @memberof CheckoutOptions + */ notifyPayload?: undefined; + /** + * + * + * @type {*} + * @memberof CheckoutOptions + */ progressCb?: any; + /** + * + * + * @type {undefined} + * @memberof CheckoutOptions + */ progressPayload?: undefined; + /** + * + * + * @type {Strarray} + * @memberof CheckoutOptions + */ paths?: Strarray; + /** + * + * + * @type {Tree} + * @memberof CheckoutOptions + */ baseline?: Tree; + /** + * + * + * @type {Index} + * @memberof CheckoutOptions + */ baselineIndex?: Index; + /** + * + * + * @type {string} + * @memberof CheckoutOptions + */ targetDirectory?: string; + /** + * + * + * @type {string} + * @memberof CheckoutOptions + */ ancestorLabel?: string; + /** + * + * + * @type {string} + * @memberof CheckoutOptions + */ ourLabel?: string; + /** + * + * + * @type {string} + * @memberof CheckoutOptions + */ theirLabel?: string; + /** + * + * + * @type {*} + * @memberof CheckoutOptions + */ perfdataCb?: any; + /** + * + * + * @type {undefined} + * @memberof CheckoutOptions + */ perfdataPayload?: undefined; } From 79e1866c4d273eb7e2613665e834370b007656e9 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:40:20 +0100 Subject: [PATCH 208/761] Added documentation for Checkout --- types/nodegit/checkout.d.ts | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/types/nodegit/checkout.d.ts b/types/nodegit/checkout.d.ts index af5f66faf3..a6ce5ff991 100644 --- a/types/nodegit/checkout.d.ts +++ b/types/nodegit/checkout.d.ts @@ -44,8 +44,50 @@ export namespace Checkout { } export class Checkout { + /** + * Patch head checkout to automatically coerce objects. + * + * @static + * @param {Repository} repo + * @param {CheckoutOptions} [options] + * @returns {Promise} + * + * @memberof Checkout + */ static head(repo: Repository, options?: CheckoutOptions): Promise; + /** + * Patch index checkout to automatically coerce objects. + * + * @static + * @param {Repository} repo + * @param {Index} The + * @param {CheckoutOptions} [options] + * @returns {Promise} + * + * @memberof Checkout + */ static index(repo: Repository, The: Index, options?: CheckoutOptions): Promise; + /** + * + * + * @static + * @param {CheckoutOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Checkout + */ static initOptions(opts: CheckoutOptions, version: number): number; + /** + * Patch tree checkout to automatically coerce objects. + * + * @static + * @param {Repository} repo + * @param {(Oid | Tree | Commit | Reference)} treeish + * @param {CheckoutOptions} [options] + * @returns {Promise} + * + * @memberof Checkout + */ static tree(repo: Repository, treeish: Oid | Tree | Commit | Reference, options?: CheckoutOptions): Promise; } From 9dd615be310d3037e3b81bf8757147909fd0e143 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:41:41 +0100 Subject: [PATCH 209/761] Documented Cherrypick --- types/nodegit/cherry-pick-options.d.ts | 24 ++++++++++++++++++ types/nodegit/cherry-pick.d.ts | 34 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/types/nodegit/cherry-pick-options.d.ts b/types/nodegit/cherry-pick-options.d.ts index 7c6ec6976c..8743217b47 100644 --- a/types/nodegit/cherry-pick-options.d.ts +++ b/types/nodegit/cherry-pick-options.d.ts @@ -2,8 +2,32 @@ import { MergeOptions } from './merge-options'; import { CheckoutOptions } from './checkout-options'; export interface CherrypickOptions { + /** + * + * + * @type {number} + * @memberof CherrypickOptions + */ version: number; + /** + * + * + * @type {number} + * @memberof CherrypickOptions + */ mainline: number; + /** + * + * + * @type {MergeOptions} + * @memberof CherrypickOptions + */ mergeOpts: MergeOptions; + /** + * + * + * @type {CheckoutOptions} + * @memberof CherrypickOptions + */ checkoutOpts: CheckoutOptions; } diff --git a/types/nodegit/cherry-pick.d.ts b/types/nodegit/cherry-pick.d.ts index 291c5e0223..b895845301 100644 --- a/types/nodegit/cherry-pick.d.ts +++ b/types/nodegit/cherry-pick.d.ts @@ -4,7 +4,41 @@ import { MergeOptions } from './merge-options'; import { CherrypickOptions } from './cherry-pick-options'; export class Cherrypick { + /** + * Cherrypick a commit and, changing the index and working directory + * + * @static + * @param {Repository} repo + * @param {Commit} commit + * @param {CherrypickOptions} [options] + * @returns {Promise} + * + * @memberof Cherrypick + */ static cherrypick(repo: Repository, commit: Commit, options?: CherrypickOptions): Promise; + /** + * Cherrypicks the given commit against "our" commit, producing an index that reflects the result of the cherrypick. The index is not backed by a repo. + * + * @static + * @param {Repository} repo + * @param {Commit} cherrypickCommit + * @param {Commit} ourCommit + * @param {number} mainline + * @param {MergeOptions} [mergeOptions] + * @returns {Promise} + * + * @memberof Cherrypick + */ static commit(repo: Repository, cherrypickCommit: Commit, ourCommit: Commit, mainline: number, mergeOptions?: MergeOptions): Promise; + /** + * + * + * @static + * @param {CherrypickOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Cherrypick + */ static initOptions(opts: CherrypickOptions, version: number): number; } From 1f3527ba51b6b58d06ea4202a42134876f93e4f5 Mon Sep 17 00:00:00 2001 From: beary Date: Thu, 8 Jun 2017 10:58:40 +0800 Subject: [PATCH 210/761] Add default type argument to Collection interface --- types/mongodb/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index a84fc60a40..a7c73e0799 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -443,7 +443,7 @@ export interface FSyncOptions { } // Documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html -export interface Collection { +export interface Collection { // Get the collection name. collectionName: string; // Get the full collection namespace. From bbbe989ebe6c830391181ac04321f43444b3267e Mon Sep 17 00:00:00 2001 From: Jordan Amos Date: Wed, 7 Jun 2017 21:27:43 -0700 Subject: [PATCH 211/761] update tween.js to version v16.6.0 --- types/tween.js/index.d.ts | 190 +++++++++++++++++++------------------- 1 file changed, 97 insertions(+), 93 deletions(-) diff --git a/types/tween.js/index.d.ts b/types/tween.js/index.d.ts index c2c5a22297..7fb8d866b0 100644 --- a/types/tween.js/index.d.ts +++ b/types/tween.js/index.d.ts @@ -1,105 +1,109 @@ -// Type definitions for tween.js r12 -// Project: https://github.com/sole/tween.js/ -// Definitions by: sunetos , jzarnikov +// Type definitions for tween.js v16.6.0 +// Project: https://github.com/tweenjs/tween.js/ +// Definitions by: jordan , sunetos , jzarnikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace TWEEN { - export var REVISION: string; - export function getAll(): Tween[]; - export function removeAll(): void; - export function add(tween:Tween): void; - export function remove(tween:Tween): void; - export function update(time?:number): boolean; + export function getAll(): Tween[]; + export function removeAll(): void; + export function add(tween: Tween): void; + export function remove(tween: Tween): void; + export function update(time?: number): boolean; + export function now(): number; - export class Tween { - constructor(object?:any); - to(properties:any, duration:number): Tween; - start(time?:number): Tween; - stop(): Tween; - delay(amount:number): Tween; - easing(easing: (k: number) => number): Tween; - interpolation(interpolation: (v:number[], k:number) => number): Tween; - chain(...tweens:Tween[]): Tween; - onStart(callback: (object?: any) => void): Tween; - onStop(callback: (object?: any) => void): Tween; - onUpdate(callback: (object?: any) => void): Tween; - onComplete(callback: (object?: any) => void): Tween; - update(time: number): boolean; - repeat(times: number): Tween; - yoyo(enable: boolean): Tween; - } - export var Easing: TweenEasing; - export var Interpolation: TweenInterpolation; + export class Tween { + constructor(object?: any); + to(properties: any, duration: number): Tween; + start(time?: number): Tween; + stop(): Tween; + end(): Tween; + stopChainedTweens(): Tween; + delay(amount: number): Tween; + repeat(times: number): Tween; + repeatDelay(times: number): Tween; + yoyo(enable: boolean): Tween; + easing(easing: (k: number) => number): Tween; + interpolation(interpolation: (v: number[], k: number) => number): Tween; + chain(...tweens: Tween[]): Tween; + onStart(callback: (object?: any) => void): Tween; + onStop(callback: (object?: any) => void): Tween; + onUpdate(callback: (object?: any) => void): Tween; + onComplete(callback: (object?: any) => void): Tween; + update(time: number): boolean; + } + export var Easing: Easing; + export var Interpolation: Interpolation; } -interface TweenEasing { - Linear: { - None(k:number): number; - }; - Quadratic: { - In(k:number): number; - Out(k:number): number; - InOut(k:number): number; - }; - Cubic: { - In(k:number): number; - Out(k:number): number; - InOut(k:number): number; - }; - Quartic: { - In(k:number): number; - Out(k:number): number; - InOut(k:number): number; - }; - Quintic: { - In(k:number): number; - Out(k:number): number; - InOut(k:number): number; - }; - Sinusoidal: { - In(k:number): number; - Out(k:number): number; - InOut(k:number): number; - }; - Exponential: { - In(k:number): number; - Out(k:number): number; - InOut(k:number): number; - }; - Circular: { - In(k:number): number; - Out(k:number): number; - InOut(k:number): number; - }; - Elastic: { - In(k:number): number; - Out(k:number): number; - InOut(k:number): number; - }; - Back: { - In(k:number): number; - Out(k:number): number; - InOut(k:number): number; - }; - Bounce: { - In(k:number): number; - Out(k:number): number; - InOut(k:number): number; - }; +interface Easing { + Linear: { + None(k: number): number; + }; + Quadratic: { + In(k: number): number; + Out(k: number): number; + InOut(k: number): number; + }; + Cubic: { + In(k: number): number; + Out(k: number): number; + InOut(k: number): number; + }; + Quartic: { + In(k: number): number; + Out(k: number): number; + InOut(k: number): number; + }; + Quintic: { + In(k: number): number; + Out(k: number): number; + InOut(k: number): number; + }; + Sinusoidal: { + In(k: number): number; + Out(k: number): number; + InOut(k: number): number; + }; + Exponential: { + In(k: number): number; + Out(k: number): number; + InOut(k: number): number; + }; + Circular: { + In(k: number): number; + Out(k: number): number; + InOut(k: number): number; + }; + Elastic: { + In(k: number): number; + Out(k: number): number; + InOut(k: number): number; + }; + Back: { + In(k: number): number; + Out(k: number): number; + InOut(k: number): number; + }; + Bounce: { + In(k: number): number; + Out(k: number): number; + InOut(k: number): number; + }; } -interface TweenInterpolation { - Linear(v:number[], k:number): number; - Bezier(v:number[], k:number): number; - CatmullRom(v:number[], k:number): number; +interface Interpolation { + Linear(v: number[], k: number): number; + Bezier(v: number[], k: number): number; + CatmullRom(v: number[], k: number): number; - Utils: { - Linear(p0:number, p1:number, t:number): number; - Bernstein(n:number, i:number): number; - Factorial(n:number): number; - }; + Utils: { + Linear(p0: number, p1: number, t: number): number; + Bernstein(n: number, i: number): number; + Factorial(n: number): number; + CatmullRom(p0: number, p1: number, p2: number, p3: number, t: number): number; + }; } -declare module 'tween.js' { - export = TWEEN; +declare module "tween.js" { + export = TWEEN; } From 492bc7ac0f6197ef1819fed07086f03b9b03f712 Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Thu, 8 Jun 2017 09:07:44 +0200 Subject: [PATCH 212/761] add test --- types/heredatalens/heredatalens-tests.ts | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/types/heredatalens/heredatalens-tests.ts b/types/heredatalens/heredatalens-tests.ts index 37f20f2f84..40e68902c5 100644 --- a/types/heredatalens/heredatalens-tests.ts +++ b/types/heredatalens/heredatalens-tests.ts @@ -121,3 +121,41 @@ let spatialLayerOptions: H.datalens.SpatialLayer.Options = { }; let spatialLayer = new H.datalens.SpatialLayer(provider, spatialProvider, spatialLayerOptions); + +let layer = new H.datalens.ObjectLayer( + provider, + { + rowToMapObject: (cluster) => { + return new H.map.Marker(cluster.getPosition()); + }, + clustering: { + rowToDataPoint: (row) => { + return new H.clustering.DataPoint(row.lat, row.lng, 1); + }, + options: () => { + return { + eps: 25 * devicePixelRatio, // px + minWeight: 20 + }; + } + }, + rowToStyle: (cluster) => { + const size = 32; + + let icon = H.datalens.ObjectLayer.createIcon([ + 'svg', + { + viewBox: [-size, -size, 2 * size, 2 * size] + }, + ['circle', { + cx: 0, + cy: 0, + r: size, + fill: cluster.isCluster() ? 'orange' : 'transparent' + }] + ], { size, crossOrigin: false }); + + return { icon }; + } + } +); From 046b7d5ff9a7f8754628595153c783f231a0bb11 Mon Sep 17 00:00:00 2001 From: Niklas Wulf Date: Thu, 8 Jun 2017 15:33:24 +0200 Subject: [PATCH 213/761] [Boom, Hapi] Add default generic type to all error creation functions (#17048) * [Boom] Add default generic type to all error creation functions * [Boom] Change default generic Data type to any instead of null * [Boom] Add tests for error creation without custom data * [Boom, Hapi] Move tests for passing Boom errors to Hapi continuation functions into hapi package * [boom] add wrap and unauthorized return BoomError with data as null --- types/boom/boom-tests.ts | 59 +++++++++++++++++++- types/boom/index.d.ts | 74 +++++++++++++------------- types/hapi/test/continuation/errors.ts | 57 ++++++++++++++++++++ types/hapi/tsconfig.json | 1 + 4 files changed, 153 insertions(+), 38 deletions(-) create mode 100644 types/hapi/test/continuation/errors.ts diff --git a/types/boom/boom-tests.ts b/types/boom/boom-tests.ts index e64ac44922..38dc39058f 100644 --- a/types/boom/boom-tests.ts +++ b/types/boom/boom-tests.ts @@ -1,9 +1,11 @@ import Boom = require('boom'); +import * as Hapi from 'hapi'; // 4xx and data type const badRequestError = Boom.badRequest('message', {some: 'data'}); badRequestError.data.some; +const badRequestError2: Boom.BoomError = Boom.badImplementation('message'); const unauthorizedError1 = Boom.unauthorized('message', 'scheme', {some: 'attribute'}); unauthorizedError1.output.payload.attributes === { some: 'attribute', error: 'message' }; @@ -23,89 +25,116 @@ unauthorizedError4.output.headers === { 'WWW-Authenticate': 'scheme some="attrib const paymentRequiredError = Boom.paymentRequired('message', {some: 'data'}); paymentRequiredError.data.some; +const paymentRequiredError2: Boom.BoomError = Boom.paymentRequired('message'); const forbiddenError = Boom.forbidden('message', {some: 'data'}); forbiddenError.data.some; +const forbiddenError2: Boom.BoomError = Boom.forbidden('message'); const notFoundError = Boom.notFound('message', {some: 'data'}); notFoundError.data.some; +const notFoundError2: Boom.BoomError = Boom.notFound('message'); const methodNotAllowedError = Boom.methodNotAllowed('message', {some: 'data'}); methodNotAllowedError.data.some; +const methodNotAllowedError2: Boom.BoomError = Boom.methodNotAllowed('message'); const notAcceptableError = Boom.notAcceptable('message', {some: 'data'}); notAcceptableError.data.some; +const notAcceptableError2: Boom.BoomError = Boom.notAcceptable('message'); const proxyAuthRequiredError = Boom.proxyAuthRequired('message', {some: 'data'}); proxyAuthRequiredError.data.some; +const proxyAuthRequiredError2: Boom.BoomError = Boom.proxyAuthRequired('message'); const clientTimeoutError = Boom.clientTimeout('message', {some: 'data'}); clientTimeoutError.data.some; +const clientTimeoutError2: Boom.BoomError = Boom.clientTimeout('message'); const conflictError = Boom.conflict('message', {some: 'data'}); conflictError.data.some; const resourceGoneError = Boom.resourceGone('message', {some: 'data'}); resourceGoneError.data.some; +const resourceGoneError2: Boom.BoomError = Boom.resourceGone('message'); const lengthRequiredError = Boom.lengthRequired('message', {some: 'data'}); lengthRequiredError.data.some; +const lengthRequiredError2: Boom.BoomError = Boom.lengthRequired('message'); const preconditionFailedError = Boom.preconditionFailed('message', {some: 'data'}); preconditionFailedError.data.some; +const preconditionFailedError2: Boom.BoomError = Boom.preconditionFailed('message'); const entityTooLargeError = Boom.entityTooLarge('message', {some: 'data'}); entityTooLargeError.data.some; +const entityTooLargeError2: Boom.BoomError = Boom.lengthRequired('message'); const uriTooLongError = Boom.uriTooLong('message', {some: 'data'}); uriTooLongError.data.some; +const uriTooLongError2: Boom.BoomError = Boom.uriTooLong('message'); const unsupportedMediaTypeError = Boom.unsupportedMediaType('message', {some: 'data'}); unsupportedMediaTypeError.data.some; +const unsupportedMediaTypeError2: Boom.BoomError = Boom.unsupportedMediaType('message'); const rangeNotSatisfiableError = Boom.rangeNotSatisfiable('message', {some: 'data'}); rangeNotSatisfiableError.data.some; +const rangeNotSatisfiableError2: Boom.BoomError = Boom.rangeNotSatisfiable('message'); const expectationFailedError = Boom.expectationFailed('message', {some: 'data'}); expectationFailedError.data.some; +const expectationFailedError2: Boom.BoomError = Boom.expectationFailed('message'); const teapotError = Boom.teapot('message', {some: 'data'}); teapotError.data.some; +const teapotError2: Boom.BoomError = Boom.teapot('message'); const badDataError = Boom.badData('message', {some: 'data'}); badDataError.data.some; +const badDataError2: Boom.BoomError = Boom.badData('message'); const lockedError = Boom.locked('message', {some: 'data'}); lockedError.data.some; +const lockedError2: Boom.BoomError = Boom.locked('message'); const preconditionRequiredError = Boom.preconditionRequired('message', {some: 'data'}); preconditionRequiredError.data.some; +const preconditionRequiredError2: Boom.BoomError = Boom.preconditionRequired('message'); const tooManyRequestsError = Boom.tooManyRequests('message', {some: 'data'}); tooManyRequestsError.data.some; +const tooManyRequestsError2: Boom.BoomError = Boom.tooManyRequests('message'); const illegalError = Boom.illegal('message', {some: 'data'}); illegalError.data.some; +const illegalError2: Boom.BoomError = Boom.illegal('message'); // 5xx and data type const badImplementationError = Boom.badImplementation('message', {some: 'data'}); badImplementationError.data.some; +const badImplementationError2: Boom.BoomError = Boom.badImplementation('message'); const internalError = Boom.internal('message', {some: 'data'}); internalError.data.some; +const internalError2: Boom.BoomError = Boom.internal('message'); const notImplementedError = Boom.notImplemented('message', {some: 'data'}); notImplementedError.data.some; +const notImplementedError2: Boom.BoomError = Boom.notImplemented('message'); const badGatewayError = Boom.badGateway('message', {some: 'data'}); badGatewayError.data.some; +const badGatewayError2: Boom.BoomError = Boom.badGateway('message'); const serverUnavailableError = Boom.serverUnavailable('message', {some: 'data'}); serverUnavailableError.data.some; +const serverUnavailableError2: Boom.BoomError = Boom.serverUnavailable('message'); const gatewayTimeoutError = Boom.gatewayTimeout('message', {some: 'data'}); gatewayTimeoutError.data.some; +const gatewayTimeoutError2: Boom.BoomError = Boom.gatewayTimeout('message'); // wrap and create @@ -113,8 +142,9 @@ const wrappedError = Boom.wrap(new Error('test'), 400, 'some message'); const error1 = Boom.create(500, 'Internal server error', { timestamp: Date.now() }); error1.data.timestamp; +const error2: Boom.BoomError = Boom.create(500, 'Internal server error'); -// type widden asserting +// type widen asserting const unauthorizedError = Boom.unauthorized() as Error; @@ -133,3 +163,30 @@ interface CustomPayload extends Boom.Payload { } (error.output.payload as CustomPayload).custom = 'abc_123'; + +/** + * Test assignment of custom error data: + */ +const errorWithData = Boom.badImplementation('', { custom1: 'test', customType: 'Custom1', isCustom: true } as CustomData1); +const errorWithNoExplicitDataType: Boom.BoomError = errorWithData; // can assign to error without explicit data type +const errorWithExplicitType: Boom.BoomError = errorWithData; // can assign to union data type +const errorWithConcreteCustomData: Boom.BoomError = errorWithData; // can assign to concrete data type +// assignment to CustomData2 would not be possible +// const errorWithConcreteCustomData2: Boom.BoomError = errorWithData; + +// Some complex error data types for testing purposes: +interface CustomDataBase { + isCustom: true; +} + +interface CustomData1 extends CustomDataBase { + customType: 'Custom1'; + custom1: string; +} + +interface CustomData2 extends CustomDataBase { + customType: 'Custom2'; + custom2: string; +} + +type CustomData = CustomData1 | CustomData2; diff --git a/types/boom/index.d.ts b/types/boom/index.d.ts index 02cf60c6b8..b8f41a85be 100644 --- a/types/boom/index.d.ts +++ b/types/boom/index.d.ts @@ -12,7 +12,7 @@ declare namespace Boom { * boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: * @see {@link https://github.com/hapijs/boom#boom} */ - export interface BoomError extends Error { + export interface BoomError extends Error { /** isBoom - if true, indicates this is a Boom object instance. */ isBoom: boolean; /** isServer - convenience bool indicating status code >= 500. */ @@ -25,7 +25,7 @@ declare namespace Boom { reformat: () => string; /** "If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object." mentioned in @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} */ isMissing?: boolean; - /** https://github.com/hapijs/boom#createstatuscode-message-data */ + /** https://github.com/hapijs/boom#createstatuscode-message-data and https://github.com/hapijs/boom/blob/v4.3.0/lib/index.js#L99 */ data: Data; } @@ -61,7 +61,7 @@ declare namespace Boom { * @param message optional message string. If the error already has a message, it adds the message as a prefix. Defaults to no message. * @see {@link https://github.com/hapijs/boom#wraperror-statuscode-message} */ - export function wrap(error: Error, statusCode?: number, message?: string): BoomError; + export function wrap(error: Error, statusCode?: number, message?: string): BoomError; /** * Generates an Error object with the boom decorations @@ -70,7 +70,7 @@ declare namespace Boom { * @param data additional error data set to error.data property. * @see {@link https://github.com/hapijs/boom#createstatuscode-message-data} */ - export function create(statusCode: number, message?: string, data?: Data): BoomError; + export function create(statusCode: number, message?: string, data?: Data): BoomError; // 4xx /** @@ -79,7 +79,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadrequestmessage-data} */ - export function badRequest(message?: string, data?: Data): BoomError; + export function badRequest(message?: string, data?: Data): BoomError; /** * Returns a 401 Unauthorized error @@ -90,10 +90,10 @@ declare namespace Boom { * @param attributes an object of values to use while setting the 'WWW-Authenticate' header. This value is only used when scheme is a string, otherwise it is ignored. Every key/value pair will be included in the 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the attributes key. Alternatively value can be a string which is use to set the value of the scheme, for example setting the token value for negotiate header. If string is used message parameter must be null. null and undefined will be replaced with an empty string. If attributes is set, message will be used as the 'error' segment of the 'WWW-Authenticate' header. If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object. * @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} */ - export function unauthorized(message?: string, scheme?: string, attributes?: {[index: string]: string}): BoomError; - export function unauthorized(message?: string, scheme?: string[]): BoomError; - export function unauthorized(message?: null, scheme?: string, attributes?: {[index: string]: string} | string): BoomError; - export function unauthorized(message?: null, scheme?: string[]): BoomError; + export function unauthorized(message?: string, scheme?: string, attributes?: {[index: string]: string}): BoomError; + export function unauthorized(message?: string, scheme?: string[]): BoomError; + export function unauthorized(message?: null, scheme?: string, attributes?: {[index: string]: string} | string): BoomError; + export function unauthorized(message?: null, scheme?: string[]): BoomError; /** * Returns a 402 Payment Required error @@ -101,7 +101,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompaymentrequiredmessage-data} */ - export function paymentRequired(message?: string, data?: Data): BoomError; + export function paymentRequired(message?: string, data?: Data): BoomError; /** * Returns a 403 Forbidden error @@ -109,7 +109,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomforbiddenmessage-data} */ - export function forbidden(message?: string, data?: Data): BoomError; + export function forbidden(message?: string, data?: Data): BoomError; /** * Returns a 404 Not Found error @@ -117,7 +117,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotfoundmessage-data} */ - export function notFound(message?: string, data?: Data): BoomError; + export function notFound(message?: string, data?: Data): BoomError; /** * Returns a 405 Method Not Allowed error @@ -126,7 +126,7 @@ declare namespace Boom { * @param allow optional string or array of strings (to be combined and separated by ', ') which is set to the 'Allow' header. * @see {@link https://github.com/hapijs/boom#boommethodnotallowedmessage-data-allow} */ - export function methodNotAllowed(message?: string, data?: Data, allow?: string | string[]): BoomError; + export function methodNotAllowed(message?: string, data?: Data, allow?: string | string[]): BoomError; /** * Returns a 406 Not Acceptable error @@ -134,7 +134,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotacceptablemessage-data} */ - export function notAcceptable(message?: string, data?: Data): BoomError; + export function notAcceptable(message?: string, data?: Data): BoomError; /** * Returns a 407 Proxy Authentication Required error @@ -142,7 +142,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomproxyauthrequiredmessage-data} */ - export function proxyAuthRequired(message?: string, data?: Data): BoomError; + export function proxyAuthRequired(message?: string, data?: Data): BoomError; /** * Returns a 408 Request Time-out error @@ -150,7 +150,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomclienttimeoutmessage-data} */ - export function clientTimeout(message?: string, data?: Data): BoomError; + export function clientTimeout(message?: string, data?: Data): BoomError; /** * Returns a 409 Conflict error @@ -158,7 +158,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomconflictmessage-data} */ - export function conflict(message?: string, data?: Data): BoomError; + export function conflict(message?: string, data?: Data): BoomError; /** * Returns a 410 Gone error @@ -166,7 +166,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomresourcegonemessage-data} */ - export function resourceGone(message?: string, data?: Data): BoomError; + export function resourceGone(message?: string, data?: Data): BoomError; /** * Returns a 411 Length Required error @@ -174,7 +174,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomlengthrequiredmessage-data} */ - export function lengthRequired(message?: string, data?: Data): BoomError; + export function lengthRequired(message?: string, data?: Data): BoomError; /** * Returns a 412 Precondition Failed error @@ -182,7 +182,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompreconditionfailedmessage-data} */ - export function preconditionFailed(message?: string, data?: Data): BoomError; + export function preconditionFailed(message?: string, data?: Data): BoomError; /** * Returns a 413 Request Entity Too Large error @@ -190,7 +190,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomentitytoolargemessage-data} */ - export function entityTooLarge(message?: string, data?: Data): BoomError; + export function entityTooLarge(message?: string, data?: Data): BoomError; /** * Returns a 414 Request-URI Too Large error @@ -198,7 +198,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomuritoolongmessage-data} */ - export function uriTooLong(message?: string, data?: Data): BoomError; + export function uriTooLong(message?: string, data?: Data): BoomError; /** * Returns a 415 Unsupported Media Type error @@ -206,7 +206,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomunsupportedmediatypemessage-data} */ - export function unsupportedMediaType(message?: string, data?: Data): BoomError; + export function unsupportedMediaType(message?: string, data?: Data): BoomError; /** * Returns a 416 Requested Range Not Satisfiable error @@ -214,7 +214,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomrangenotsatisfiablemessage-data} */ - export function rangeNotSatisfiable(message?: string, data?: Data): BoomError; + export function rangeNotSatisfiable(message?: string, data?: Data): BoomError; /** * Returns a 417 Expectation Failed error @@ -222,7 +222,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomexpectationfailedmessage-data} */ - export function expectationFailed(message?: string, data?: Data): BoomError; + export function expectationFailed(message?: string, data?: Data): BoomError; /** * Returns a 418 I'm a Teapot error @@ -230,7 +230,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomteapotmessage-data} */ - export function teapot(message?: string, data?: Data): BoomError; + export function teapot(message?: string, data?: Data): BoomError; /** * Returns a 422 Unprocessable Entity error @@ -238,7 +238,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombaddatamessage-data} */ - export function badData(message?: string, data?: Data): BoomError; + export function badData(message?: string, data?: Data): BoomError; /** * Returns a 423 Locked error @@ -246,7 +246,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomlockedmessage-data} */ - export function locked(message?: string, data?: Data): BoomError; + export function locked(message?: string, data?: Data): BoomError; /** * Returns a 428 Precondition Required error @@ -254,7 +254,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompreconditionrequiredmessage-data} */ - export function preconditionRequired(message?: string, data?: Data): BoomError; + export function preconditionRequired(message?: string, data?: Data): BoomError; /** * Returns a 429 Too Many Requests error @@ -262,7 +262,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomtoomanyrequestsmessage-data} */ - export function tooManyRequests(message?: string, data?: Data): BoomError; + export function tooManyRequests(message?: string, data?: Data): BoomError; /** * Returns a 451 Unavailable For Legal Reasons error @@ -270,7 +270,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomillegalmessage-data} */ - export function illegal(message?: string, data?: Data): BoomError; + export function illegal(message?: string, data?: Data): BoomError; // 5xx /** @@ -280,7 +280,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} */ - export function badImplementation(message?: string, data?: Data): BoomError; + export function badImplementation(message?: string, data?: Data): BoomError; /** * Returns a 500 Internal Server Error error @@ -289,7 +289,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} */ - export function internal(message?: string, data?: Data): BoomError; + export function internal(message?: string, data?: Data): BoomError; /** * Returns a 501 Not Implemented error with your error message to the user @@ -297,7 +297,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotimplementedmessage-data} */ - export function notImplemented(message?: string, data?: Data): BoomError; + export function notImplemented(message?: string, data?: Data): BoomError; /** * Returns a 502 Bad Gateway error with your error message to the user @@ -305,7 +305,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadgatewaymessage-data} */ - export function badGateway(message?: string, data?: Data): BoomError; + export function badGateway(message?: string, data?: Data): BoomError; /** * Returns a 503 Service Unavailable error with your error message to the user @@ -313,7 +313,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomserverunavailablemessage-data} */ - export function serverUnavailable(message?: string, data?: Data): BoomError; + export function serverUnavailable(message?: string, data?: Data): BoomError; /** * Returns a 504 Gateway Time-out error with your error message to the user @@ -321,5 +321,5 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomgatewaytimeoutmessage-data} */ - export function gatewayTimeout(message?: string, data?: Data): BoomError; + export function gatewayTimeout(message?: string, data?: Data): BoomError; } diff --git a/types/hapi/test/continuation/errors.ts b/types/hapi/test/continuation/errors.ts new file mode 100644 index 0000000000..165e5214df --- /dev/null +++ b/types/hapi/test/continuation/errors.ts @@ -0,0 +1,57 @@ + +import * as Hapi from 'hapi'; +import * as Boom from 'boom'; + +// Assignment of a typical function to ContinuationValueFunction is possible +const handleError: Hapi.ContinuationValueFunction = (err?: Boom.BoomError | null, value?: any) => { + if (!err || !err.data.isCustom === true) { + return; + } + + // assignment is possible due to default generic Data = any + const customError: Boom.BoomError = err; + + // Discriminated union type works: + switch (customError.data.customType) { + case 'Custom1': + customError.data.custom1; + break; + case 'Custom2': + customError.data.custom2; + break; + } +}; + +// Accepts a simple Boom error +handleError(Boom.badData()); + +// Accepts an error with custom data +const errorWithData = Boom.badImplementation('', { custom1: 'test', customType: <'Custom1'>'Custom1', isCustom: true }); +handleError(errorWithData); + +// Accepts an error with a more explicit type +const errorWithExplicitType: Boom.BoomError = errorWithData; +handleError(errorWithExplicitType); + +// Accepts an error with an even more explicit type +const errorWithConcreteCustomData: Boom.BoomError = errorWithData; // assignment to CustomData2 would not be possible +handleError(errorWithConcreteCustomData); + +/** + * Some complex error data types: + */ +interface CustomDataBase { + isCustom: true; +} + +interface CustomData1 extends CustomDataBase { + customType: 'Custom1'; + custom1: string; +} + +interface CustomData2 extends CustomDataBase { + customType: 'Custom2'; + custom2: string; +} + +type CustomData = CustomData1 | CustomData2; diff --git a/types/hapi/tsconfig.json b/types/hapi/tsconfig.json index ef8e454667..01c5a12c89 100644 --- a/types/hapi/tsconfig.json +++ b/types/hapi/tsconfig.json @@ -18,6 +18,7 @@ "files": [ "index.d.ts", "test/connection/table.ts", + "test/continuation/errors.ts", "test/getting-started/01-creating-a-server.ts", "test/getting-started/02-adding-routes.ts", "test/getting-started/03-serving-static-content.ts", From 35f275c0812af7ff70cd5d044bc5370e242adb4f Mon Sep 17 00:00:00 2001 From: York Yao Date: Thu, 8 Jun 2017 21:39:20 +0800 Subject: [PATCH 214/761] [electron]remove electron because the it bundles one now (#16928) * remove electron because the it bundles one now * update asOfVersion * fix asOfVersion --- notNeededPackages.json | 6 + types/electron/.editorconfig | 2 - types/electron/index.d.ts | 6147 ------------------------------- types/electron/test/index.ts | 5 - types/electron/test/main.ts | 1138 ------ types/electron/test/renderer.ts | 311 -- types/electron/tsconfig.json | 25 - 7 files changed, 6 insertions(+), 7628 deletions(-) delete mode 100644 types/electron/.editorconfig delete mode 100644 types/electron/index.d.ts delete mode 100644 types/electron/test/index.ts delete mode 100644 types/electron/test/main.ts delete mode 100644 types/electron/test/renderer.ts delete mode 100644 types/electron/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index b251774ee9..d6e99fbf9b 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -126,6 +126,12 @@ "sourceRepoURL": "https://github.com/bterlson/ecmarkup", "asOfVersion": "3.4.0" }, + { + "libraryName": "electron", + "typingsPackageName": "electron", + "sourceRepoURL": "https://github.com/electron/electron", + "asOfVersion": "1.6.10" + }, { "libraryName": "electron-builder", "typingsPackageName": "electron-builder", diff --git a/types/electron/.editorconfig b/types/electron/.editorconfig deleted file mode 100644 index 2d98d905de..0000000000 --- a/types/electron/.editorconfig +++ /dev/null @@ -1,2 +0,0 @@ -[*.ts] -indent_style = tab diff --git a/types/electron/index.d.ts b/types/electron/index.d.ts deleted file mode 100644 index 6905671344..0000000000 --- a/types/electron/index.d.ts +++ /dev/null @@ -1,6147 +0,0 @@ -// Type definitions for Electron v1.4.8 -// Project: http://electron.atom.io/ -// Definitions by: jedmao , rhysd , Milan Burda , aliib , Daniel Perez Alvarez , Markus Olsson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace Electron { - - interface Event { - preventDefault: Function; - sender: NodeJS.EventEmitter; - } - - type Point = { - x: number; - y: number; - } - - type Size = { - width: number; - height: number; - } - - type Rectangle = { - x: number; - y: number; - width: number; - height: number; - } - - interface Destroyable { - /** - * Destroys the object. - */ - destroy(): void; - /** - * @returns Whether the object is destroyed. - */ - isDestroyed(): boolean; - } - - // https://github.com/electron/electron/blob/master/docs/api/app.md - - type VibrancyType = 'appearance-based' | 'light' | 'dark' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'medium-light' | 'ultra-dark'; - - /** - * The app module is responsible for controlling the application's lifecycle. - */ - interface App extends NodeJS.EventEmitter { - /** - * 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 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. - * - * In most cases, you should just do everything in the ready event handler. - */ - on(event: 'will-finish-launching', listener: Function): this; - /** - * Emitted when Electron has finished initialization. - */ - on(event: 'ready', listener: (event: Event, launchInfo: Object) => void): this; - /** - * Emitted when all windows have been closed. - * - * 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. - */ - on(event: 'window-all-closed', listener: Function): this; - /** - * Emitted before the application starts closing its windows. - * Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. - */ - on(event: 'before-quit', listener: (event: Event) => void): this; - /** - * Emitted when all windows have been closed and the application will quit. - * Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. - */ - on(event: 'will-quit', listener: (event: Event) => void): this; - /** - * Emitted when the application is quitting. - */ - on(event: 'quit', listener: (event: Event, exitCode: number) => void): this; - /** - * Emitted when the user wants to open a file with the application. - * The open-file event is usually emitted when the application is already open - * and the OS wants to reuse the application to open the file. - * open-file is also emitted when a file is dropped onto the dock and the application - * is not yet running. Make sure to listen for the open-file event very early - * in your application startup to handle this case (even before the ready event is emitted). - * - * You should call event.preventDefault() if you want to handle this event. - * - * Note: This is only implemented on macOS. - */ - on(event: 'open-file', listener: (event: Event, url: string) => void): this; - /** - * Emitted when the user wants to open a URL with the application. - * The URL scheme must be registered to be opened by your application. - * - * You should call event.preventDefault() if you want to handle this event. - * - * 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 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. - */ - on(event: 'browser-window-blur', listener: (event: Event, browserWindow: BrowserWindow) => void): this; - /** - * Emitted when a browserWindow gets focused. - */ - on(event: 'browser-window-focus', listener: (event: Event, browserWindow: BrowserWindow) => void): this; - /** - * 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). - */ - on(event: 'certificate-error', listener: (event: Event, - webContents: WebContents, - url: string, - error: string, - certificate: Certificate, - callback: (trust: boolean) => void - ) => void): this; - /** - * Emitted when a client certificate is requested. - * - * The url corresponds to the navigation entry requesting the client certificate - * and callback needs to be called with an entry filtered from the list. - * Using event.preventDefault() prevents the application from using the first certificate from the store. - */ - on(event: 'select-client-certificate', listener: (event: Event, - webContents: WebContents, - url: string, - certificateList: Certificate[], - callback: (certificate: Certificate) => void - ) => void): this; - /** - * Emitted when webContents wants to do basic auth. - * - * The default behavior is to cancel all authentications, to override this - * you should prevent the default behavior with event.preventDefault() - * and call callback(username, password) with the credentials. - */ - on(event: 'login', listener: (event: Event, - webContents: WebContents, - request: LoginRequest, - authInfo: LoginAuthInfo, - callback: (username: string, password: string) => void - ) => void): this; - /** - * Emitted when the gpu process crashes. - */ - on(event: 'gpu-process-crashed', listener: (event: Event, killed: boolean) => void): this; - /** - * Emitted when Chrome's accessibility support changes. - * - * Note: This API is only available on macOS and Windows. - */ - 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. - * If all windows are successfully closed, the will-quit event will be emitted - * and by default the application would be terminated. - * - * This method guarantees all beforeunload and unload handlers are correctly - * executed. It is possible that a window cancels the quitting by returning - * false in beforeunload handler. - */ - quit(): void; - /** - * Exits immediately with exitCode. - * All windows will be closed immediately without asking user - * 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; - /** - * @returns Whether Electron has finished initializing. - */ - isReady(): boolean; - /** - * On Linux, focuses on the first visible window. - * 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 macOS. - */ - hide(): void; - /** - * Shows application windows after they were hidden. Does not automatically focus them. - * Note: This is only implemented on macOS. - */ - show(): void; - /** - * Returns the current application directory. - */ - getAppPath(): string; - /** - * @returns The path to a special directory or file associated with name. - * On failure an Error would throw. - */ - getPath(name: AppPathName): string; - /** - * Overrides the path to a special directory or file associated with name. - * If the path specifies a directory that does not exist, the directory will - * be created by this method. On failure an Error would throw. - * - * You can only override paths of names defined in app.getPath. - * - * By default web pages' cookies and caches will be stored under userData - * directory, if you want to change this location, you have to override the - * userData path before the ready event of app module gets emitted. - */ - setPath(name: AppPathName, path: string): void; - /** - * @returns The version of loaded application, if no version is found in - * application's package.json, the version of current bundle or executable. - */ - getVersion(): string; - /** - * @returns The current application's name, the name in package.json would be used. - * Usually the name field of package.json is a short lowercased name, according to - * the spec of npm modules. So usually you should also specify a productName field, - * which is your application's full capitalized name, and it will be preferred over - * name by Electron. - */ - getName(): string; - /** - * Overrides the current application's name. - */ - setName(name: string): void; - /** - * @returns The current application locale. - */ - getLocale(): string; - /** - * 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 macOS you can visit it from dock menu. - * - * Note: This is only implemented on macOS and Windows. - */ - addRecentDocument(path: string): void; - /** - * Clears the recent documents list. - * - * 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 opened with the current executable. - * The whole link, including protocol, will be passed to your application as a parameter. - * - * On Windows you can provide optional parameters path, the path to your executable, - * and args, an array of arguments to be passed to your executable when it launches. - * - * @param protocol The name of your protocol, without ://. - * @param path Defaults to process.execPath. - * @param args Defaults to an empty array. - * - * 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, path?: string, args?: string[]): boolean; - /** - * Removes the current executable as the default handler for a protocol (aka URI scheme). - * - * @param protocol The name of your protocol, without ://. - * @param path Defaults to process.execPath. - * @param args Defaults to an empty array. - * - * Note: This is only implemented on macOS and Windows. - */ - removeAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean; - /** - * @param protocol The name of your protocol, without ://. - * @param path Defaults to process.execPath. - * @param args Defaults to an empty array. - * - * @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, path?: string, args?: string[]): boolean; - /** - * Adds tasks to the Tasks category of JumpList on Windows. - * - * Note: This API is only available on Windows. - */ - setUserTasks(tasks: Task[]): boolean; - /** - * Note: This API is only available on Windows. - */ - getJumpListSettings(): JumpListSettings; - /** - * Sets or removes a custom Jump List for the application. - * - * If categories is null the previously set custom Jump List (if any) will be replaced - * by the standard Jump List for the app (managed by Windows). - * - * Note: This API is only available on Windows. - */ - setJumpList(categories: JumpListCategory[]): SetJumpListResult; - /** - * 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) => 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. - * - * Note: This is only implemented on Windows. - */ - 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 - * while any other value indicates failure according to chromium net_error_list. - * - * 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; - /** - * 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; - /** - * @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; - /** - * Set the about panel options. This will override the values defined in the app's .plist file. - * See the Apple docs for more details. - * - * Note: This API is only available on macOS. - */ - setAboutPanelOptions(options: AboutPanelOptions): void; - commandLine: CommandLine; - /** - * Note: This API is only available on macOS. - */ - dock: Dock; - } - - type AppPathName = 'home'|'appData'|'userData'|'temp'|'exe'|'module'|'desktop'|'documents'|'downloads'|'music'|'pictures'|'videos'|'pepperFlashSystemPlugin'; - - interface ImportCertificateOptions { - /** - * Path for the pkcs12 file. - */ - certificate: string; - /** - * Passphrase for the certificate. - */ - password: string; - } - - interface CommandLine { - /** - * Append a switch [with optional value] to Chromium's command line. - * - * 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): void; - /** - * Append an argument to Chromium's command line. The argument will quoted properly. - * - * Note: This will not affect process.argv. - */ - appendArgument(value: string): void; - } - - interface Dock { - /** - * When critical is passed, the dock icon will bounce until either the - * application becomes active or the request is canceled. - * - * When informational is passed, the dock icon will bounce for one second. - * However, the request remains active until either the application becomes - * active or the request is canceled. - * - * @param type The default is informational. - * @returns An ID representing the request. - */ - bounce(type?: 'critical' | 'informational'): number; - /** - * Cancel the bounce of id. - * - * 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 macOS. - */ - setBadge(text: string): void; - /** - * Returns the badge string of the dock. - * - * Note: This API is only available on macOS. - */ - getBadge(): string; - /** - * Hides the dock icon. - * - * Note: This API is only available on macOS. - */ - hide(): void; - /** - * Shows the dock icon. - * - * 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 macOS. - */ - setMenu(menu: Menu): void; - /** - * Sets the image associated with this dock icon. - * - * Note: This API is only available on macOS. - */ - setIcon(icon: NativeImage | string): void; - } - - interface Task { - /** - * Path of the program to execute, usually you should specify process.execPath - * which opens current program. - */ - program: string; - /** - * The arguments of command line when program is executed. - */ - arguments: string; - /** - * The string to be displayed in a JumpList. - */ - title: string; - /** - * Description of this task. - */ - description?: string; - /** - * The absolute path to an icon to be displayed in a JumpList, it can be - * arbitrary resource file that contains an icon, usually you can specify - * process.execPath to show the icon of the program. - */ - iconPath: string; - /** - * The icon index in the icon file. If an icon file consists of two or more - * icons, set this value to identify the icon. If an icon file consists of - * one icon, this value is 0. - */ - iconIndex?: number; - } - - /** - * ok - Nothing went wrong. - * error - One or more errors occured, enable runtime logging to figure out the likely cause. - * invalidSeparatorError - An attempt was made to add a separator to a custom category in the Jump List. - * Separators are only allowed in the standard Tasks category. - * fileTypeRegistrationError - An attempt was made to add a file link to the Jump List - * for a file type the app isn't registered to handle. - * customCategoryAccessDeniedError - Custom categories can't be added to the Jump List - * due to user privacy or group policy settings. - */ - type SetJumpListResult = 'ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError'; - - interface JumpListSettings { - /** - * The minimum number of items that will be shown in the Jump List. - */ - minItems: number; - /** - * Items that the user has explicitly removed from custom categories in the Jump List. - */ - removedItems: JumpListItem[]; - } - - interface JumpListCategory { - /** - * tasks - Items in this category will be placed into the standard Tasks category. - * frequent - Displays a list of files frequently opened by the app, the name of the category and its items are set by Windows. - * recent - Displays a list of files recently opened by the app, the name of the category and its items are set by Windows. - * custom - Displays tasks or file links, name must be set by the app. - */ - type?: 'tasks' | 'frequent' | 'recent' | 'custom'; - /** - * Must be set if type is custom, otherwise it should be omitted. - */ - name?: string; - /** - * Array of JumpListItem objects if type is tasks or custom, otherwise it should be omitted. - */ - items?: JumpListItem[]; - } - - interface JumpListItem { - /** - * task - A task will launch an app with specific arguments. - * separator - Can be used to separate items in the standard Tasks category. - * file - A file link will open a file using the app that created the Jump List. - */ - type: 'task' | 'separator' | 'file'; - /** - * Path of the file to open, should only be set if type is file. - */ - path?: string; - /** - * Path of the program to execute, usually you should specify process.execPath which opens the current program. - * Should only be set if type is task. - */ - program?: string; - /** - * The command line arguments when program is executed. Should only be set if type is task. - */ - args?: string; - /** - * The text to be displayed for the item in the Jump List. Should only be set if type is task. - */ - title?: string; - /** - * Description of the task (displayed in a tooltip). Should only be set if type is task. - */ - description?: string; - /** - * The absolute path to an icon to be displayed in a Jump List, which can be an arbitrary - * resource file that contains an icon (e.g. .ico, .exe, .dll). - * You can usually specify process.execPath to show the program icon. - */ - iconPath?: string; - /** - * The index of the icon in the resource file. If a resource file contains multiple icons - * this value can be used to specify the zero-based index of the icon that should be displayed - * for this task. If a resource file contains only one icon, this property should be set to zero. - */ - 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; - } - - interface AboutPanelOptions { - /** - * The app's name. - */ - applicationName?: string; - /** - * The app's version. - */ - applicationVersion?: string; - /** - * Copyright information. - */ - copyright?: string; - /** - * Credit information. - */ - credits?: string; - /** - * The app's build version number. - */ - version?: string; - } - - // https://github.com/electron/electron/blob/master/docs/api/auto-updater.md - - /** - * This module provides an interface for the Squirrel auto-updater framework. - */ - interface AutoUpdater extends NodeJS.EventEmitter { - /** - * Emitted when there is an error while updating. - */ - on(event: 'error', listener: (error: Error) => void): this; - /** - * Emitted when checking if an update has started. - */ - on(event: 'checking-for-update', listener: Function): this; - /** - * Emitted when there is an available update. The update is downloaded automatically. - */ - on(event: 'update-available', listener: Function): this; - /** - * Emitted when there is no available update. - */ - on(event: 'update-not-available', listener: Function): this; - /** - * Emitted when an update has been downloaded. - * Note: On Windows only releaseName is available. - */ - on(event: 'update-downloaded', listener: (event: Event, releaseNotes: string, releaseName: string, releaseDate: Date, updateURL: string) => void): this; - on(event: string, listener: Function): this; - /** - * Set the url and initialize the auto updater. - */ - 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 - */ - checkForUpdates(): void; - /** - * Restarts the app and installs the update after it has been downloaded. - * It should only be called after update-downloaded has been emitted. - */ - quitAndInstall(): void; - } - - // https://github.com/electron/electron/blob/master/docs/api/browser-window.md - - /** - * The BrowserWindow class gives you ability to create a browser window. - * You can also create a window without chrome by using Frameless Window API. - */ - class BrowserWindow extends NodeJS.EventEmitter implements Destroyable { - /** - * Emitted when the document changed its title, - * calling event.preventDefault() would prevent the native window’s title to change. - */ - on(event: 'page-title-updated', listener: (event: Event, title: string) => void): this; - /** - * Emitted when the window is going to be closed. It’s emitted before the beforeunload - * and unload event of the DOM. Calling event.preventDefault() will cancel the close. - */ - on(event: 'close', listener: (event: Event) => void): this; - /** - * Emitted when the window is closed. After you have received this event - * you should remove the reference to the window and avoid using it anymore. - */ - on(event: 'closed', listener: Function): this; - /** - * Emitted when the web page becomes unresponsive. - */ - on(event: 'unresponsive', listener: Function): this; - /** - * Emitted when the unresponsive web page becomes responsive again. - */ - on(event: 'responsive', listener: Function): this; - /** - * Emitted when the window loses focus. - */ - on(event: 'blur', listener: Function): this; - /** - * Emitted when the window gains focus. - */ - on(event: 'focus', listener: Function): this; - /** - * Emitted when the window is shown. - */ - on(event: 'show', listener: Function): this; - /** - * 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. - */ - on(event: 'maximize', listener: Function): this; - /** - * Emitted when the window exits from maximized state. - */ - on(event: 'unmaximize', listener: Function): this; - /** - * Emitted when the window is minimized. - */ - on(event: 'minimize', listener: Function): this; - /** - * Emitted when the window is restored from minimized state. - */ - on(event: 'restore', listener: Function): this; - /** - * Emitted when the window is getting resized. - */ - on(event: 'resize', listener: Function): this; - /** - * Emitted when the window is getting moved to a new position. - */ - on(event: 'move', listener: Function): this; - /** - * Emitted when the window enters full screen state. - */ - on(event: 'enter-full-screen', listener: Function): this; - /** - * Emitted when the window leaves full screen state. - */ - on(event: 'leave-full-screen', listener: Function): this; - /** - * Emitted when the window enters full screen state triggered by HTML API. - */ - on(event: 'enter-html-full-screen', listener: Function): this; - /** - * Emitted when the window leaves full screen state triggered by HTML API. - */ - on(event: 'leave-html-full-screen', listener: Function): this; - /** - * Emitted when an App Command is invoked. These are typically related - * to keyboard media keys or browser commands, as well as the "Back" / - * "Forward" buttons built into some mice on Windows. - * Note: This is only implemented on Windows. - */ - 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 macOS. - */ - on(event: 'scroll-touch-begin', listener: Function): this; - /** - * Emitted when scroll wheel event phase has ended. - * Note: This is only implemented on macOS. - */ - on(event: 'scroll-touch-end', listener: Function): this; - /** - * Emitted when scroll wheel event phase filed upon reaching the edge of element. - * Note: This is only implemented on macOS. - */ - on(event: 'scroll-touch-edge', listener: Function): this; - /** - * Emitted on 3-finger swipe. - * 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. - */ - static getAllWindows(): BrowserWindow[]; - /** - * @returns The window that is focused in this application. - */ - static getFocusedWindow(): BrowserWindow; - /** - * Find a window according to the webContents it owns. - */ - static fromWebContents(webContents: WebContents): BrowserWindow; - /** - * Find a window according to its ID. - */ - static fromId(id: number): BrowserWindow; - /** - * 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. - * Note: Users should never store this object because it may become null when - * the renderer process (web page) has crashed. - */ - webContents: WebContents; - /** - * Get the unique ID of this window. - */ - id: number; - /** - * Force closing the window, the unload and beforeunload event won't be emitted - * for the web page, and close event would also not be emitted for this window, - * but it would guarantee the closed event to be emitted. - * You should only use this method when the renderer process (web page) has crashed. - */ - destroy(): void; - /** - * Try to close the window, this has the same effect with user manually clicking - * the close button of the window. The web page may cancel the close though, - * see the close event. - */ - close(): void; - /** - * Focus on the window. - */ - focus(): void; - /** - * Remove focus on the window. - */ - blur(): void; - /** - * @returns Whether the window is focused. - */ - isFocused(): boolean; - /** - * @returns Whether the window is destroyed. - */ - isDestroyed(): boolean; - /** - * Shows and gives focus to the window. - */ - show(): void; - /** - * Shows the window but doesn't focus on it. - */ - showInactive(): void; - /** - * Hides the window. - */ - hide(): void; - /** - * @returns Whether the window is visible to the user. - */ - isVisible(): boolean; - /** - * @returns Whether the window is a modal window. - */ - isModal(): boolean; - /** - * Maximizes the window. - */ - maximize(): void; - /** - * Unmaximizes the window. - */ - unmaximize(): void; - /** - * @returns Whether the window is maximized. - */ - isMaximized(): boolean; - /** - * Minimizes the window. On some platforms the minimized window will be - * shown in the Dock. - */ - minimize(): void; - /** - * Restores the window from minimized state to its previous state. - */ - restore(): void; - /** - * @returns Whether the window is minimized. - */ - isMinimized(): boolean; - /** - * Sets whether the window should be in fullscreen mode. - */ - setFullScreen(flag: boolean): void; - /** - * @returns Whether the window is in fullscreen mode. - */ - isFullScreen(): boolean; - /** - * This will have a window maintain an aspect ratio. - * The extra size allows a developer to have space, specified in pixels, - * 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 macOS. - */ - setAspectRatio(aspectRatio: number, extraSize?: Size): void; - /** - * Uses Quick Look to preview a file at a given path. - * - * @param path The absolute path to the file to preview with QuickLook. - * @param displayName The name of the file to display on the Quick Look modal view. - * Note: This API is available only on macOS. - */ - previewFile(path: string, displayName?: string): void; - /** - * Resizes and moves the window to width, height, x, y. - */ - setBounds(options: Rectangle, animate?: boolean): void; - /** - * @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. - */ - setSize(width: number, height: number, animate?: boolean): void; - /** - * @returns The window's width and height. - */ - getSize(): number[]; - /** - * Resizes the window's client area (e.g. the web page) to width and height. - */ - setContentSize(width: number, height: number, animate?: boolean): void; - /** - * @returns The window's client area's width and height. - */ - getContentSize(): number[]; - /** - * Sets the minimum size of window to width and height. - */ - setMinimumSize(width: number, height: number): void; - /** - * @returns The window's minimum width and height. - */ - getMinimumSize(): number[]; - /** - * Sets the maximum size of window to width and height. - */ - setMaximumSize(width: number, height: number): void; - /** - * @returns The window's maximum width and height. - */ - getMaximumSize(): number[]; - /** - * Sets whether the window can be manually resized by user. - */ - setResizable(resizable: boolean): void; - /** - * @returns Whether the window can be manually resized by user. - */ - isResizable(): boolean; - /** - * Sets whether the window can be moved by user. On Linux does nothing. - * Note: This API is available only on macOS and Windows. - */ - setMovable(movable: boolean): void; - /** - * 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 macOS and Windows. - */ - setMinimizable(minimizable: boolean): void; - /** - * 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 macOS and Windows. - */ - setMaximizable(maximizable: boolean): void; - /** - * 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; - /** - * Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window. - */ - setFullScreenable(fullscreenable: boolean): void; - /** - * @returns Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window. - */ - isFullScreenable(): boolean; - /** - * Sets whether the window can be manually closed by user. On Linux does nothing. - * Note: This API is available only on macOS and Windows. - */ - setClosable(closable: boolean): void; - /** - * 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; - /** - * Sets whether the window should show always on top of other windows. After - * setting this, the window is still a normal window, not a toolbox window - * which can not be focused on. - */ - setAlwaysOnTop(flag: boolean, level?: WindowLevel): void; - /** - * @returns Whether the window is always on top of other windows. - */ - isAlwaysOnTop(): boolean; - /** - * Moves window to the center of the screen. - */ - center(): void; - /** - * Moves window to x and y. - */ - setPosition(x: number, y: number, animate?: boolean): void; - /** - * @returns The window's current position. - */ - getPosition(): number[]; - /** - * Changes the title of native window to title. - */ - setTitle(title: string): void; - /** - * Note: The title of web page can be different from the title of the native window. - * @returns The title of the native window. - */ - getTitle(): string; - /** - * Changes the attachment point for sheets on macOS. - * Note: This API is available only on macOS. - */ - setSheetOffset(offsetY: number, offsetX?: number): void; - /** - * Starts or stops flashing the window to attract user's attention. - */ - flashFrame(flag: boolean): void; - /** - * Makes the window do not show in Taskbar. - */ - setSkipTaskbar(skip: boolean): void; - /** - * Enters or leaves the kiosk mode. - */ - setKiosk(flag: boolean): void; - /** - * @returns Whether the window is in kiosk mode. - */ - isKiosk(): boolean; - /** - * 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. - */ - getNativeWindowHandle(): Buffer; - /** - * Hooks a windows message. The callback is called when the message is received in the WndProc. - * Note: This API is available only on Windows. - */ - hookWindowMessage(message: number, callback: Function): void; - /** - * @returns Whether the message is hooked. - */ - isWindowMessageHooked(message: number): boolean; - /** - * Unhook the window message. - */ - unhookWindowMessage(message: number): void; - /** - * Unhooks all of the window messages. - */ - unhookAllWindowMessages(): void; - /** - * 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 macOS. - */ - setRepresentedFilename(filename: string): void; - /** - * 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 macOS. - */ - setDocumentEdited(edited: boolean): void; - /** - * Note: This API is available only on macOS. - * @returns Whether the window's document has been edited. - */ - isDocumentEdited(): boolean; - focusOnWebView(): void; - blurWebView(): 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(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 as webContents.loadURL(url). - */ - loadURL(url: string, options?: LoadURLOptions): void; - /** - * Same as webContents.reload. - */ - reload(): void; - /** - * Sets the menu as the window top menu. - * Note: This API is not available on macOS. - */ - setMenu(menu: Menu | null): void; - /** - * Sets the progress value in the progress bar. - * On Linux platform, only supports Unity desktop environment, you need to - * specify the *.desktop file name to desktopName field in package.json. - * By default, it will assume app.getName().desktop. - * @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, 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. - * Note: This API is only available on Windows 7 or above. - * @param overlay The icon to display on the bottom right corner of the Taskbar - * icon. If this parameter is null, the overlay is cleared - * @param description Provided to Accessibility screen readers. - */ - 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 macOS. - */ - setHasShadow(hasShadow: boolean): void; - /** - * Note: This API is available only on macOS. - * @returns whether the window has a shadow. On Windows and Linux always returns true. - */ - hasShadow(): boolean; - /** - * 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; - /** - * 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. - * If the menu bar is already visible, calling setAutoHideMenuBar(true) won't - * hide it immediately. - */ - setAutoHideMenuBar(hide: boolean): void; - /** - * @returns Whether menu bar automatically hides itself. - */ - isMenuBarAutoHide(): boolean; - /** - * Sets whether the menu bar should be visible. If the menu bar is auto-hide, - * users can still bring up the menu bar by pressing the single Alt key. - */ - setMenuBarVisibility(visibile: boolean): void; - /** - * @returns Whether the menu bar is visible. - */ - isMenuBarVisible(): boolean; - /** - * Sets whether the window should be visible on all workspaces. - * Note: This API does nothing on Windows. - */ - setVisibleOnAllWorkspaces(visible: boolean): void; - /** - * Note: This API always returns false on Windows. - * @returns Whether the window is visible on all workspaces. - */ - isVisibleOnAllWorkspaces(): boolean; - /** - * 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[]; - /** - * Adds a vibrancy effect to the browser window. Passing null or - * an empty string will remove the vibrancy effect on the window. - * - * Note: This API is available only on macOS. - */ - setVibrancy(type: VibrancyType): void; - } - - type WindowLevel = 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock'; - type SwipeDirection = 'up' | 'right' | 'down' | 'left'; - type ThumbarButtonFlags = 'enabled' | 'disabled' | 'dismissonclick' | 'nobackground' | 'hidden' | 'noninteractive'; - - interface ThumbarButton { - icon: NativeImage | string; - click: Function; - tooltip?: string; - flags?: ThumbarButtonFlags[]; - } - - interface DevToolsExtensions { - [name: string]: { - name: string; - value: string; - } - } - - interface WebPreferences { - /** - * Whether to enable DevTools. - * If it is set to false, can not use BrowserWindow.webContents.openDevTools() to open DevTools. - * Default: true. - */ - devTools?: boolean; - /** - * Whether node integration is enabled. - * Default: true. - */ - nodeIntegration?: boolean; - /** - * Specifies a script that will be loaded before other scripts run in the page. - * This script will always have access to node APIs no matter whether node integration is turned on or off. - * The value should be the absolute file path to the script. - * When node integration is turned off, the preload script can reintroduce - * Node global symbols back to the global scope. - */ - preload?: string; - /** - * Sets the session used by the page. Instead of passing the Session object directly, - * you can also choose to use the partition option instead, which accepts a partition string. - * When both session and partition are provided, session would be preferred. - * Default: the default session. - */ - session?: Session; - /** - * Sets the session used by the page according to the session’s partition string. - * If partition starts with persist:, the page will use a persistent session available - * to all pages in the app with the same partition. if there is no persist: prefix, - * the page will use an in-memory session. By assigning the same partition, - * multiple pages can share the same session. - * Default: the default session. - */ - partition?: string; - /** - * The default zoom factor of the page, 3.0 represents 300%. - * Default: 1.0. - */ - zoomFactor?: number; - /** - * Enables JavaScript support. - * Default: true. - */ - javascript?: boolean; - /** - * When setting false, it will disable the same-origin policy (Usually using testing - * websites by people), and set allowDisplayingInsecureContent and allowRunningInsecureContent - * to true if these two options are not set by user. - * Default: true. - */ - webSecurity?: boolean; - /** - * Allow an https page to display content like images from http URLs. - * Default: false. - */ - allowDisplayingInsecureContent?: boolean; - /** - * Allow a https page to run JavaScript, CSS or plugins from http URLs. - * Default: false. - */ - allowRunningInsecureContent?: boolean; - /** - * Enables image support. - * Default: true. - */ - images?: boolean; - /** - * Make TextArea elements resizable. - * Default: true. - */ - textAreasAreResizable?: boolean; - /** - * Enables WebGL support. - * Default: true. - */ - webgl?: boolean; - /** - * Enables WebAudio support. - * Default: true. - */ - webaudio?: boolean; - /** - * Whether plugins should be enabled. - * Default: false. - */ - plugins?: boolean; - /** - * Enables Chromium’s experimental features. - * Default: false. - */ - experimentalFeatures?: boolean; - /** - * Enables Chromium’s experimental canvas features. - * Default: false. - */ - experimentalCanvasFeatures?: boolean; - /** - * Enables DirectWrite font rendering system on Windows. - * Default: true. - */ - directWrite?: boolean; - /** - * 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. - */ - defaultFontFamily?: { - /** - * Default: Times New Roman. - */ - standard?: string; - /** - * Default: Times New Roman. - */ - serif?: string; - /** - * Default: Arial. - */ - sansSerif?: string; - /** - * Default: Courier New. - */ - monospace?: string; - }; - /** - * Default: 16. - */ - defaultFontSize?: number; - /** - * Default: 13. - */ - defaultMonospaceFontSize?: number; - /** - * Default: 0. - */ - minimumFontSize?: number; - /** - * Default: ISO-8859-1. - */ - defaultEncoding?: string; - /** - * Whether to throttle animations and timers when the page becomes background. - * Default: true. - */ - backgroundThrottling?: boolean; - /** - * Whether to enable offscreen rendering for the browser window. - * Default: false. - */ - offscreen?: boolean; - /** - * Whether to enable Chromium OS-level sandbox. - * Default: false. - */ - sandbox?: boolean; - } - - interface BrowserWindowOptions { - /** - * Window’s width in pixels. - * Default: 800. - */ - width?: number; - /** - * Window’s height in pixels. - * Default: 600. - */ - height?: number; - /** - * Window’s left offset from screen. - * Default: center the window. - */ - x?: number; - /** - * Window’s top offset from screen. - * Default: center the window. - */ - y?: number; - /** - * The width and height would be used as web page’s size, which means - * the actual window’s size will include window frame’s size and be slightly larger. - * Default: false. - */ - useContentSize?: boolean; - /** - * Show window in the center of the screen. - * Default: true - */ - center?: boolean; - /** - * Window’s minimum width. - * Default: 0. - */ - minWidth?: number; - /** - * Window’s minimum height. - * Default: 0. - */ - minHeight?: number; - /** - * Window’s maximum width. - * Default: no limit. - */ - maxWidth?: number; - /** - * Window’s maximum height. - * Default: no limit. - */ - maxHeight?: number; - /** - * Whether window is resizable. - * Default: true. - */ - resizable?: boolean; - /** - * Whether window is movable. - * Note: This is not implemented on Linux. - * Default: true. - */ - movable?: boolean; - /** - * Whether window is minimizable. - * Note: This is not implemented on Linux. - * Default: true. - */ - minimizable?: boolean; - /** - * Whether window is maximizable. - * Note: This is not implemented on Linux. - * Default: true. - */ - maximizable?: boolean; - /** - * Whether window is closable. - * Note: This is not implemented on Linux. - * 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. - */ - alwaysOnTop?: boolean; - /** - * Whether the window should show in fullscreen. - * When explicitly set to false the fullscreen button will be hidden or disabled on macOS. - * Default: false. - */ - fullscreen?: boolean; - /** - * 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; - /** - * Whether to show the window in taskbar. - * Default: false. - */ - skipTaskbar?: boolean; - /** - * The kiosk mode. - * Default: false. - */ - kiosk?: boolean; - /** - * Default window title. - * Default: "Electron". - */ - title?: string; - /** - * The window icon, when omitted on Windows the executable’s icon would be used as window icon. - */ - icon?: NativeImage|string; - /** - * Whether window should be shown when created. - * Default: true. - */ - show?: boolean; - /** - * Specify false to create a Frameless Window. - * 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. - */ - acceptFirstMouse?: boolean; - /** - * Whether to hide cursor when typing. - * Default: false. - */ - disableAutoHideCursor?: boolean; - /** - * Auto hide the menu bar unless the Alt key is pressed. - * Default: true. - */ - autoHideMenuBar?: boolean; - /** - * Enable the window to be resized larger than screen. - * Default: false. - */ - enableLargerThanScreen?: boolean; - /** - * Window’s background color as Hexadecimal value, like #66CD00 or #FFF or #80FFFFFF (alpha is supported). - * Default: #FFF (white). - */ - backgroundColor?: string; - /** - * Whether window should have a shadow. - * Note: This is only implemented on macOS. - * Default: true. - */ - hasShadow?: boolean; - /** - * Forces using dark theme for the window. - * Note: Only works on some GTK+3 desktop environments. - * Default: false. - */ - darkTheme?: boolean; - /** - * Makes the window transparent. - * Default: false. - */ - transparent?: boolean; - /** - * The type of window, default is normal window. - */ - type?: BrowserWindowType; - /** - * The style of window title bar. - */ - titleBarStyle?: 'default' | 'hidden' | 'hidden-inset'; - /** - * Use WS_THICKFRAME style for frameless windows on Windows - */ - thickFrame?: boolean; - /** - * Add a type of vibrancy effect to the window, only on macOS - */ - vibrancy?: VibrancyType; - /** - * Settings of web page’s features. - */ - webPreferences?: WebPreferences; - } - - type BrowserWindowType = BrowserWindowTypeLinux | BrowserWindowTypeMac | BrowserWindowTypeWindows; - type BrowserWindowTypeLinux = 'desktop' | 'dock' | 'toolbar' | 'splash' | 'notification'; - type BrowserWindowTypeMac = 'desktop' | 'textured'; - type BrowserWindowTypeWindows = 'toolbar'; - - // https://github.com/electron/electron/blob/master/docs/api/clipboard.md - - /** - * The clipboard module provides methods to perform copy and paste operations. - */ - interface Clipboard { - /** - * @returns The contents of the clipboard as plain text. - */ - readText(type?: ClipboardType): string; - /** - * Writes the text into the clipboard as plain text. - */ - writeText(text: string, type?: ClipboardType): void; - /** - * @returns The contents of the clipboard as markup. - */ - readHTML(type?: ClipboardType): string; - /** - * Writes markup to the clipboard. - */ - writeHTML(markup: string, type?: ClipboardType): void; - /** - * @returns The contents of the clipboard as a NativeImage. - */ - readImage(type?: ClipboardType): NativeImage; - /** - * Writes the image into the clipboard. - */ - writeImage(image: NativeImage, type?: ClipboardType): void; - /** - * @returns The contents of the clipboard as RTF. - */ - readRTF(type?: ClipboardType): string; - /** - * Writes the text into the clipboard in RTF. - */ - writeRTF(text: string, type?: ClipboardType): void; - /** - * Clears everything in clipboard. - */ - clear(type?: ClipboardType): void; - /** - * @returns Array available formats for the clipboard type. - */ - availableFormats(type?: ClipboardType): string[]; - /** - * Returns whether the clipboard supports the format of specified data. - * Note: This API is experimental and could be removed in future. - * @returns Whether the clipboard has data in the specified format. - */ - has(format: string, type?: ClipboardType): boolean; - /** - * Reads the data in the clipboard of the specified format. - * Note: This API is experimental and could be removed in future. - */ - read(format: string, type?: ClipboardType): string | NativeImage; - /** - * Writes data to the clipboard. - */ - write(data: { text: string; bookmark?: string; } | { rtf: string; } | { 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; - /** - * The text on the find pasteboard. This method uses synchronous IPC when called from the renderer process. - * The cached value is reread from the find pasteboard whenever the application is activated. - * - * Note: This API is available on macOS. - */ - readFindText(): string; - /** - * Writes the text into the find pasteboard as plain text. - * This method uses synchronous IPC when called from the renderer process. - * - * Note: This API is available on macOS. - */ - writeFindText(text: string): void; - } - - type ClipboardType = '' | 'selection'; - - interface Bookmark { - title: string; - url: string; - } - - // https://github.com/electron/electron/blob/master/docs/api/content-tracing.md - - /** - * The content-tracing module is used to collect tracing data generated by the underlying Chromium content module. - * This module does not include a web interface so you need to open chrome://tracing/ - * in a Chrome browser and load the generated file to view the result. - */ - interface ContentTracing { - /** - * Get a set of category groups. The category groups can change as new code paths are reached. - * - * @param callback Called once all child processes have acknowledged the getCategories request. - */ - getCategories(callback: (categoryGroups: string[]) => void): void; - /** - * Start recording on all processes. Recording begins immediately locally and asynchronously - * on child processes as soon as they receive the EnableRecording request. - * - * @param callback Called once all child processes have acknowledged the startRecording request. - */ - startRecording(options: ContentTracingOptions, callback: Function): void; - /** - * Stop recording on all processes. Child processes typically are caching trace data and - * only rarely flush and send trace data back to the main process. That is because it may - * be an expensive operation to send the trace data over IPC, and we would like to avoid - * much runtime overhead of tracing. So, to end tracing, we must asynchronously ask all - * child processes to flush any pending trace data. - * - * @param resultFilePath Trace data will be written into this file if it is not empty, - * or into a temporary file. - * @param callback Called once all child processes have acknowledged the stopRecording request. - */ - stopRecording(resultFilePath: string, callback: (filePath: string) => void): void; - /** - * Start monitoring on all processes. Monitoring begins immediately locally and asynchronously - * on child processes as soon as they receive the startMonitoring request. - * - * @param callback Called once all child processes have acked to the startMonitoring request. - */ - startMonitoring(options: ContentTracingOptions, callback: Function): void; - /** - * Stop monitoring on all processes. - * - * @param callback Called once all child processes have acknowledged the stopMonitoring request. - */ - stopMonitoring(callback: Function): void; - /** - * Get the current monitoring traced data. Child processes typically are caching trace data - * and only rarely flush and send trace data back to the main process. That is because it may - * be an expensive operation to send the trace data over IPC, and we would like to avoid much - * runtime overhead of tracing. So, to end tracing, we must asynchronously ask all child - * processes to flush any pending trace data. - * - * @param callback Called once all child processes have acknowledged the captureMonitoringSnapshot request. - */ - captureMonitoringSnapshot(resultFilePath: string, callback: (filePath: string) => void): void; - /** - * Get the maximum usage across processes of trace buffer as a percentage of the full state. - * - * @param callback Called when the TraceBufferUsage value is determined. - */ - getTraceBufferUsage(callback: Function): void; - /** - * @param callback Called every time the given event occurs on any process. - */ - setWatchEvent(categoryName: string, eventName: string, callback: Function): void; - /** - * Cancel the watch event. This may lead to a race condition with the watch event callback if tracing is enabled. - */ - cancelWatchEvent(): void; - } - - interface ContentTracingOptions { - /** - * Filter to control what category groups should be traced. - * A filter can have an optional - prefix to exclude category groups - * that contain a matching category. Having both included and excluded - * category patterns in the same list is not supported. - * - * Examples: - * test_MyTest* - * test_MyTest*,test_OtherStuff - * -excluded_category1,-excluded_category2 - */ - categoryFilter: string; - /** - * Controls what kind of tracing is enabled, it is a comma-delimited list. - * - * Possible options are: - * record-until-full - * record-continuously - * trace-to-console - * enable-sampling - * enable-systrace - * - * The first 3 options are trace recoding modes and hence mutually exclusive. - * If more than one trace recording modes appear in the traceOptions string, - * the last one takes precedence. If none of the trace recording modes are specified, - * recording mode is record-until-full. - * - * The trace option will first be reset to the default option (record_mode set - * to record-until-full, enable_sampling and enable_systrace set to false) - * before options parsed from traceOptions are applied on it. - */ - traceOptions: string; - } - - // https://github.com/electron/electron/blob/master/docs/api/crash-reporter.md - - /** - * The crash-reporter module enables sending your app's crash reports. - */ - interface CrashReporter { - /** - * You are required to call this method before using other crashReporter APIs. - * - * 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. - */ - start(options: CrashReporterStartOptions): void; - /** - * @returns The crash report. When there was no crash report - * sent or the crash reporter is not started, null will be returned. - */ - getLastCrashReport(): CrashReport; - /** - * @returns All uploaded crash reports. - */ - getUploadedReports(): CrashReport[]; - } - - interface CrashReporterStartOptions { - /** - * Default: app.getName() - */ - productName?: string; - companyName: string; - /** - * URL that crash reports would be sent to as POST. - */ - submitURL: string; - /** - * Send the crash report without user interaction. - * Default: true. - */ - autoSubmit?: boolean; - /** - * Default: false. - */ - ignoreSystemCrashHandler?: boolean; - /** - * An object you can define that will be sent along with the report. - * Only string properties are sent correctly, nested objects are not supported. - */ - extra?: {[prop: string]: string}; - } - - interface CrashReport { - id: string; - date: Date; - } - - // https://github.com/electron/electron/blob/master/docs/api/desktop-capturer.md - - /** - * The desktopCapturer module can be used to get available sources - * that can be used to be captured with getUserMedia. - */ - interface DesktopCapturer { - /** - * Starts a request to get all desktop sources. - * - * Note: There is no guarantee that the size of source.thumbnail is always - * the same as the thumnbailSize in options. It also depends on the scale of the screen or window. - */ - getSources(options: DesktopCapturerOptions, callback: (error: Error, sources: DesktopCapturerSource[]) => any): void; - } - - interface DesktopCapturerOptions { - /** - * The types of desktop sources to be captured. - */ - types?: ('screen' | 'window')[]; - /** - * The suggested size that thumbnail should be scaled. - * Default: {width: 150, height: 150} - */ - thumbnailSize?: Size; - } - - interface DesktopCapturerSource { - /** - * The id of the captured window or screen used in navigator.webkitGetUserMedia. - * The format looks like window:XX or screen:XX where XX is a random generated number. - */ - id: string; - /** - * The described name of the capturing screen or window. - * If the source is a screen, the name will be Entire Screen or Screen ; - * if it is a window, the name will be the window’s title. - */ - name: string; - /** - * A thumbnail image. - */ - thumbnail: NativeImage; - } - - // https://github.com/electron/electron/blob/master/docs/api/dialog.md - - /** - * The dialog module provides APIs to show native system dialogs, such as opening files or alerting, - * so web applications can deliver the same user experience as native applications. - */ - interface Dialog { - /** - * Note: On Windows and Linux an open dialog can not be both a file selector and a directory selector, - * so if you set properties to ['openFile', 'openDirectory'] on these platforms, a directory selector will be shown. - * - * @param callback If supplied, the API call will be asynchronous. - * @returns On success, returns an array of file paths chosen by the user, - * otherwise returns undefined. - */ - showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions, callback?: (fileNames: string[]) => void): string[]; - /** - * Note: On Windows and Linux an open dialog can not be both a file selector and a directory selector, - * so if you set properties to ['openFile', 'openDirectory'] on these platforms, a directory selector will be shown. - * - * @param callback If supplied, the API call will be asynchronous. - * @returns On success, returns an array of file paths chosen by the user, - * otherwise returns undefined. - */ - showOpenDialog(options: OpenDialogOptions, callback?: (fileNames: string[]) => void): string[]; - /** - * @param callback If supplied, the API call will be asynchronous. - * @returns On success, returns the path of file chosen by the user, otherwise - * returns undefined. - */ - showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions, callback?: (fileName: string) => void): string; - /** - * @param callback If supplied, the API call will be asynchronous. - * @returns On success, returns the path of file chosen by the user, otherwise - * returns undefined. - */ - showSaveDialog(options: SaveDialogOptions, callback?: (fileName: string) => void): string; - /** - * Shows a message box. It will block until the message box is closed. - * @param callback If supplied, the API call will be asynchronous. - * @returns The index of the clicked button. - */ - showMessageBox(browserWindow: BrowserWindow, options: ShowMessageBoxOptions, callback?: (response: number) => void): number; - /** - * Shows a message box. It will block until the message box is closed. - * @param callback If supplied, the API call will be asynchronous. - * @returns The index of the clicked button. - */ - showMessageBox(options: ShowMessageBoxOptions, callback?: (response: number) => void): number; - /** - * Displays a modal dialog that shows an error message. - * - * This API can be called safely before the ready event the app module emits, - * it is usually used to report errors in early stage of startup. - * If called before the app readyevent on Linux, the message will be emitted to stderr, - * and no GUI dialog will appear. - */ - showErrorBox(title: string, content: string): void; - } - - 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. - */ - filters?: { - name: string; - /** - * Extensions without wildcards or dots (e.g. 'png' is good but '.png' and '*.png' are bad). - * To show all files, use the '*' wildcard (no other wildcard is supported). - */ - extensions: string[]; - }[]; - /** - * Contains which features the dialog should use. - */ - properties?: ('openFile' | 'openDirectory' | 'multiSelections' | 'createDirectory' | 'showHiddenFiles' | 'promptToCreate' | 'noResolveAliases')[]; - /** - * Normalize the keyboard access keys across platforms. - */ - normalizeAccessKeys?: boolean; - /** - * Message to display above input boxes. - */ - message?: string; - } - - 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. - */ - filters?: { - name: string; - extensions: string[]; - }[]; - /** - * macOS - Message to display above text fields. - */ - message?: string; - /** - * macOS - Custom label for the text displayed in front of the filename text field. - */ - nameFieldLabel?: string; - /** - * macOS - Show the tags input box, defaults to true. - */ - showsTagField?: boolean; - } - - interface ShowMessageBoxOptions { - /** - * On Windows, "question" displays the same icon as "info", unless you set an icon using the "icon" option. - */ - type?: 'none' | 'info' | 'error' | 'question' | 'warning'; - /** - * Texts for buttons. On Windows, an empty array will result in one button labeled "OK". - */ - buttons?: string[]; - /** - * Index of the button in the buttons array which will be selected by default when the message box opens. - */ - defaultId?: number; - /** - * Title of the message box (some platforms will not show it). - */ - title?: string; - /** - * Contents of the message box. - */ - message?: string; - /** - * Extra information of the message. - */ - detail?: string; - icon?: NativeImage; - /** - * 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 macOS and Windows the index of "Cancel" button - * will always be used as cancelId, not matter whether it is already specified. - */ - cancelId?: number; - /** - * On Windows Electron will try to figure out which one of the buttons are common buttons - * (like "Cancel" or "Yes"), and show the others as command links in the dialog. - * This can make the dialog appear in the style of modern Windows apps. - * If you don’t like this behavior, you can set noLink to true. - */ - noLink?: boolean; - } - - // https://github.com/electron/electron/blob/master/docs/api/download-item.md - - /** - * DownloadItem represents a download item in Electron. - */ - interface DownloadItem extends NodeJS.EventEmitter { - /** - * Emitted when the download has been updated and is not done. - */ - 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. - */ - on(event: 'done', listener: (event: Event, state: 'completed' | 'cancelled' | 'interrupted') => void): this; - on(event: string, listener: Function): this; - /** - * Set the save file path of the download item. - * Note: The API is only available in session’s will-download callback function. - * If user doesn’t set the save path via the API, Electron will use the original - * 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. - */ - cancel(): void; - /** - * @returns The origin url where the item is downloaded from. - */ - getURL(): string; - /** - * @returns The mime type. - */ - getMimeType(): string; - /** - * @returns Whether the download has user gesture. - */ - hasUserGesture(): boolean; - /** - * @returns The file name of the download item. - * Note: The file name is not always the same as the actual one saved in local disk. - * If user changes the file name in a prompted download saving dialog, - * the actual name of saved file will be different. - */ - getFilename(): string; - /** - * @returns The total size in bytes of the download item. If the size is unknown, it returns 0. - */ - getTotalBytes(): number; - /** - * @returns The received bytes of the download item. - */ - getReceivedBytes(): number; - /** - * @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 - - /** - * The globalShortcut module can register/unregister a global keyboard shortcut - * with the operating system so that you can customize the operations for various shortcuts. - * Note: The shortcut is global; it will work even if the app does not have the keyboard focus. - * You should not use this module until the ready event of the app module is emitted. - */ - interface GlobalShortcut { - /** - * Registers a global shortcut of accelerator. - * @param accelerator Represents a keyboard shortcut. It can contain modifiers - * and key codes, combined by the "+" character. - * @param callback Called when the registered shortcut is pressed by the user. - */ - register(accelerator: string, callback: Function): void; - /** - * @param accelerator Represents a keyboard shortcut. It can contain modifiers - * and key codes, combined by the "+" character. - * @returns Whether the accelerator is registered. - */ - isRegistered(accelerator: string): boolean; - /** - * Unregisters the global shortcut of keycode. - * @param accelerator Represents a keyboard shortcut. It can contain modifiers - * and key codes, combined by the "+" character. - */ - unregister(accelerator: string): void; - /** - * Unregisters all the global shortcuts. - */ - unregisterAll(): void; - } - - // https://github.com/electron/electron/blob/master/docs/api/ipc-main.md - - /** - * The ipcMain module handles asynchronous and synchronous messages - * sent from a renderer process (web page). - * Messages sent from a renderer will be emitted to this module. - */ - interface IpcMain extends NodeJS.EventEmitter { - addListener(channel: string, listener: IpcMainEventListener): this; - on(channel: string, listener: IpcMainEventListener): this; - once(channel: string, listener: IpcMainEventListener): this; - removeListener(channel: string, listener: IpcMainEventListener): this; - removeAllListeners(channel?: string): this; - } - - type IpcMainEventListener = (event: IpcMainEvent, ...args: any[]) => void; - - interface IpcMainEvent { - /** - * Set this to the value to be returned in a synchronous message. - */ - returnValue?: any; - /** - * Returns the webContents that sent the message, you can call sender.send - * to reply to the asynchronous message. - */ - sender: WebContents; - } - - // https://github.com/electron/electron/blob/master/docs/api/ipc-renderer.md - - /** - * The ipcRenderer module provides a few methods so you can send synchronous - * and asynchronous messages from the render process (web page) to the main process. - * You can also receive replies from the main process. - */ - interface IpcRenderer extends NodeJS.EventEmitter { - addListener(channel: string, listener: IpcRendererEventListener): this; - on(channel: string, listener: IpcRendererEventListener): this; - once(channel: string, listener: IpcRendererEventListener): this; - removeListener(channel: string, listener: IpcRendererEventListener): this; - removeAllListeners(channel?: string): this; - /** - * Send ...args to the renderer via channel in asynchronous message, the main - * process can handle it by listening to the channel event of ipc module. - */ - send(channel: string, ...args: any[]): void; - /** - * Send ...args to the renderer via channel in synchronous message, and returns - * the result sent from main process. The main process can handle it by listening - * to the channel event of ipc module, and returns by setting event.returnValue. - * Note: Usually developers should never use this API, since sending synchronous - * message would block the whole renderer process. - * @returns The result sent from the main process. - */ - sendSync(channel: string, ...args: any[]): any; - /** - * Like ipc.send but the message will be sent to the host page instead of the main process. - * This is mainly used by the page in to communicate with host page. - */ - sendToHost(channel: string, ...args: any[]): void; - } - - type IpcRendererEventListener = (event: IpcRendererEvent, ...args: any[]) => void; - - interface IpcRendererEvent { - /** - * You can call sender.send to reply to the asynchronous message. - */ - sender: IpcRenderer; - } - - // https://github.com/electron/electron/blob/master/docs/api/menu-item.md - // https://github.com/electron/electron/blob/master/docs/api/accelerator.md - - /** - * The MenuItem allows you to add items to an application or context menu. - */ - class MenuItem { - /** - * Create a new menu item. - */ - constructor(options: MenuItemOptions); - - /** - * A function that is fired when the MenuItem receives a click event - */ - click: (event: Event, browserWindow: BrowserWindow, webContents: WebContents) => void; - - /** - * Read-only property. - */ - type: MenuItemType; - /** - * Read-only property. - */ - role: MenuItemRole | MenuItemRoleMac; - /** - * Read-only property. - */ - accelerator: string; - /** - * Read-only property. - */ - icon: NativeImage | string; - /** - * Read-only property. - */ - submenu: Menu | MenuItemOptions[]; - - label: string; - sublabel: string; - enabled: boolean; - visible: boolean; - checked: boolean; - } - - type MenuItemType = 'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio'; - type MenuItemRole = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteandmatchstyle' | 'selectall' | 'delete' | 'minimize' | 'close' | 'quit' | 'togglefullscreen' | 'resetzoom' | 'zoomin' | 'zoomout' | 'editMenu' | 'windowMenu' | 'reload' | 'forcereload' | 'toggledevtools'; - type MenuItemRoleMac = 'about' | 'hide' | 'hideothers' | 'unhide' | 'startspeaking' | 'stopspeaking' | 'front' | 'zoom' | 'window' | 'help' | 'services'; - - interface MenuItemOptions { - /** - * Callback when the menu item is clicked. - */ - click?: (menuItem: MenuItem, browserWindow: BrowserWindow, event: Event) => void; - /** - * Can be normal, separator, submenu, checkbox or radio. - */ - type?: MenuItemType; - label?: string; - sublabel?: string; - /** - * An accelerator is string that represents a keyboard shortcut, it can contain - * multiple modifiers and key codes, combined by the + character. - * - * Examples: - * CommandOrControl+A - * CommandOrControl+Shift+Z - * - * Platform notice: - * On Linux and Windows, the Command key would not have any effect, - * 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 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 macOS. - * - * Available modifiers: - * Command (or Cmd for short) - * Control (or Ctrl for short) - * CommandOrControl (or CmdOrCtrl for short) - * Alt - * Option - * AltGr - * Shift - * Super - * - * Available key codes: - * 0 to 9 - * A to Z - * F1 to F24 - * Punctuations like ~, !, @, #, $, etc. - * Plus - * Space - * Tab - * Backspace - * Delete - * Insert - * Return (or Enter as alias) - * Up, Down, Left and Right - * Home and End - * PageUp and PageDown - * Escape (or Esc for short) - * VolumeUp, VolumeDown and VolumeMute - * MediaNextTrack, MediaPreviousTrack, MediaStop and MediaPlayPause - * PrintScreen - */ - accelerator?: string; - /** - * In Electron for the APIs that take images, you can pass either file paths - * or NativeImage instances. When passing null, an empty image will be used. - */ - icon?: NativeImage|string; - /** - * If false, the menu item will be greyed out and unclickable. - */ - enabled?: boolean; - /** - * If false, the menu item will be entirely hidden. - */ - visible?: boolean; - /** - * Should only be specified for 'checkbox' or 'radio' type menu items. - */ - checked?: boolean; - /** - * Should be specified for submenu type menu item, when it's specified the - * type: 'submenu' can be omitted for the menu item - */ - submenu?: Menu|MenuItemOptions[]; - /** - * Unique within a single menu. If defined then it can be used as a reference - * to this item by the position attribute. - */ - id?: string; - /** - * This field allows fine-grained definition of the specific location within - * a given menu. - */ - position?: string; - /** - * Define the action of the menu item, when specified the click property will be ignored - */ - role?: MenuItemRole | MenuItemRoleMac; - } - - // https://github.com/electron/electron/blob/master/docs/api/menu.md - - /** - * The Menu class is used to create native menus that can be used as application - * menus and context menus. This module is a main process module which can be used - * in a render process via the remote module. - * - * Each menu consists of multiple menu items, and each menu item can have a submenu. - */ - class Menu extends NodeJS.EventEmitter { - /** - * Creates a new menu. - */ - constructor(); - /** - * Sets menu as the application menu on macOS. On Windows and Linux, the - * menu will be set as each window's top menu. - * - * Passing null will remove the menu bar on Windows and Linux but has no - * effect on macOS. - */ - static setApplicationMenu(menu: Menu | null): void; - /** - * @returns The application menu if set, or null if not set. - */ - static getApplicationMenu(): Menu | null; - /** - * 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 macOS only. - */ - static sendActionToFirstResponder(action: string): void; - /** - * @param template Generally, just an array of options for constructing MenuItem. - * You can also attach other fields to element of the template, and they will - * become properties of the constructed menu items. - */ - static buildFromTemplate(template: MenuItemOptions[]): Menu; - /** - * 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. - * @param y Vertical coordinate where the menu will be placed. - */ - popup(browserWindow?: BrowserWindow, x?: number, y?: number): void; - /** - * Appends the menuItem to the menu. - */ - append(menuItem: MenuItem): void; - /** - * Inserts the menuItem to the pos position of the menu. - */ - insert(position: number, menuItem: MenuItem): void; - /** - * @returns an array containing the menu’s items. - */ - items: MenuItem[]; - } - - // https://github.com/electron/electron/blob/master/docs/api/native-image.md - - /** - * This class is used to represent an image. - */ - class NativeImage { - /** - * Creates an empty NativeImage instance. - */ - static createEmpty(): NativeImage; - /** - * Creates a new NativeImage instance from file located at path. - * This method returns an empty image if the path does not exist, cannot be read, or is not a valid image. - */ - static createFromPath(path: string): NativeImage; - /** - * Creates a new NativeImage instance from buffer. - * @param scaleFactor 1.0 by default. - */ - static createFromBuffer(buffer: Buffer, scaleFactor?: number): NativeImage; - /** - * Creates a new NativeImage instance from dataURL - */ - static createFromDataURL(dataURL: string): NativeImage; - /** - * @returns Buffer that contains the image's PNG encoded data. - */ - toPNG(): Buffer; - /** - * @returns Buffer that contains the image's JPEG encoded data. - */ - 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 The data URL of the image. - */ - toDataURL(): string; - /** - * 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; - /** - * @returns Whether the image is empty. - */ - isEmpty(): boolean; - /** - * @returns The size of the image. - */ - getSize(): Size; - /** - * Marks the image as template image. - */ - setTemplateImage(option: boolean): void; - /** - * Returns a boolean whether the image is a template image. - */ - isTemplateImage(): boolean; - } - - // https://github.com/electron/electron/blob/master/docs/api/net.md - - /** - * The net module is a client-side API for issuing HTTP(S) requests. - * It is similar to the HTTP and HTTPS modules of Node.js but uses Chromium’s native - * networking library instead of the Node.js implementation, offering better support - * for web proxies. - * The following is a non-exhaustive list of why you may consider using the net module - * instead of the native Node.js modules: - * - Automatic management of system proxy configuration, support of the wpad protocol - * and proxy pac configuration files. - * - Automatic tunneling of HTTPS requests. - * - Support for authenticating proxies using basic, digest, NTLM, Kerberos or negotiate - * authentication schemes. - * - Support for traffic monitoring proxies: Fiddler-like proxies used for access control - * and monitoring. - * - * The net module API has been specifically designed to mimic, as closely as possible, - * the familiar Node.js API. The API components including classes, methods, - * properties and event names are similar to those commonly used in Node.js. - * - * The net API can be used only after the application emits the ready event. - * Trying to use the module before the ready event will throw an error. - */ - interface Net extends NodeJS.EventEmitter { - /** - * @param options The ClientRequest constructor options. - * @param callback A one time listener for the response event. - * - * @returns a ClientRequest instance using the provided options which are directly - * forwarded to the ClientRequest constructor. - */ - request(options: string | RequestOptions, callback?: (response: IncomingMessage) => void): ClientRequest; - } - - /** - * The RequestOptions interface allows to define various options for an HTTP request. - */ - interface RequestOptions { - /** - * The HTTP request method. Defaults to the GET method. - */ - method?: string; - /** - * The request URL. Must be provided in the absolute form with the protocol - * scheme specified as http or https. - */ - url?: string; - /** - * The Session instance with which the request is associated. - */ - session?: Session; - /** - * The name of the partition with which the request is associated. - * Defaults to the empty string. The session option prevails on partition. - * Thus if a session is explicitly specified, partition is ignored. - */ - partition?: string; - /** - * The protocol scheme in the form ‘scheme:’. Currently supported values are ‘http:’ or ‘https:’. - * Defaults to ‘http:’. - */ - protocol?: 'http:' | 'https:'; - /** - * The server host provided as a concatenation of the hostname and the port number ‘hostname:port’. - */ - host?: string; - /** - * The server host name. - */ - hostname?: string; - /** - * The server’s listening port number. - */ - port?: number; - /** - * The path part of the request URL. - */ - path?: string; - /** - * A map specifying extra HTTP header name/value. - */ - headers?: { [key: string]: any }; - } - - /** - * The ClientRequest class represents an HTTP request. - */ - class ClientRequest extends NodeJS.EventEmitter { - /** - * Emitted when an HTTP response is received for the request. - */ - on(event: 'response', listener: (response: IncomingMessage) => void): this; - /** - * Emitted when an authenticating proxy is asking for user credentials. - * The callback function is expected to be called back with user credentials. - * Providing empty credentials will cancel the request and report an authentication - * error on the response object. - */ - on(event: 'login', listener: (authInfo: LoginAuthInfo, callback: (username?: string, password?: string) => void) => void): this; - /** - * Emitted just after the last chunk of the request’s data has been written into - * the request object. - */ - on(event: 'finish', listener: () => void): this; - /** - * Emitted when the request is aborted. The abort event will not be fired if the - * request is already closed. - */ - on(event: 'abort', listener: () => void): this; - /** - * Emitted when the net module fails to issue a network request. - * Typically when the request object emits an error event, a close event will - * subsequently follow and no response object will be provided. - */ - on(event: 'error', listener: (error: Error) => void): this; - /** - * Emitted as the last event in the HTTP request-response transaction. - * The close event indicates that no more events will be emitted on either the - * request or response objects. - */ - on(event: 'close', listener: () => void): this; - on(event: string, listener: Function): this; - /** - * A Boolean specifying whether the request will use HTTP chunked transfer encoding or not. - * Defaults to false. The property is readable and writable, however it can be set only before - * the first write operation as the HTTP headers are not yet put on the wire. - * Trying to set the chunkedEncoding property after the first write will throw an error. - * - * Using chunked encoding is strongly recommended if you need to send a large request - * body as data will be streamed in small chunks instead of being internally buffered - * inside Electron process memory. - */ - chunkedEncoding: boolean; - /** - * @param options If options is a String, it is interpreted as the request URL. - * If it is an object, it is expected to be a RequestOptions. - * @param callback A one time listener for the response event. - */ - constructor(options: string | RequestOptions, callback?: (response: IncomingMessage) => void); - /** - * Adds an extra HTTP header. The header name will issued as it is without lowercasing. - * It can be called only before first write. Calling this method after the first write - * will throw an error. - * @param name An extra HTTP header name. - * @param value An extra HTTP header value. - */ - setHeader(name: string, value: string): void; - /** - * @param name Specify an extra header name. - * @returns The value of a previously set extra header name. - */ - getHeader(name: string): string; - /** - * Removes a previously set extra header name. This method can be called only before first write. - * Trying to call it after the first write will throw an error. - * @param name Specify an extra header name. - */ - removeHeader(name: string): void; - /** - * Adds a chunk of data to the request body. The first write operation may cause the - * request headers to be issued on the wire. - * After the first write operation, it is not allowed to add or remove a custom header. - * @param chunk A chunk of the request body’s data. If it is a string, it is converted - * into a Buffer using the specified encoding. - * @param encoding Used to convert string chunks into Buffer objects. Defaults to ‘utf-8’. - * @param callback Called after the write operation ends. - */ - write(chunk: string | Buffer, encoding?: string, callback?: Function): boolean; - /** - * Sends the last chunk of the request data. Subsequent write or end operations will not be allowed. - * The finish event is emitted just after the end operation. - * @param chunk A chunk of the request body’s data. If it is a string, it is converted into - * a Buffer using the specified encoding. - * @param encoding Used to convert string chunks into Buffer objects. Defaults to ‘utf-8’. - * @param callback Called after the write operation ends. - * - */ - end(chunk?: string | Buffer, encoding?: string, callback?: Function): boolean; - /** - * Cancels an ongoing HTTP transaction. If the request has already emitted the close event, - * the abort operation will have no effect. - * Otherwise an ongoing event will emit abort and close events. - * Additionally, if there is an ongoing response object,it will emit the aborted event. - */ - abort(): void - } - - /** - * An IncomingMessage represents an HTTP response. - */ - interface IncomingMessage extends NodeJS.ReadableStream { - /** - * The data event is the usual method of transferring response data into applicative code. - */ - on(event: 'data', listener: (chunk: Buffer) => void): this; - /** - * Indicates that response body has ended. - */ - on(event: 'end', listener: () => void): this; - /** - * Emitted when a request has been canceled during an ongoing HTTP transaction. - */ - on(event: 'aborted', listener: () => void): this; - /** - * Emitted when an error was encountered while streaming response data events. - * For instance, if the server closes the underlying while the response is still - * streaming, an error event will be emitted on the response object and a close - * event will subsequently follow on the request object. - */ - on(event: 'error', listener: (error: Error) => void): this; - on(event: string, listener: Function): this; - /** - * An Integer indicating the HTTP response status code. - */ - statusCode: number; - /** - * A String representing the HTTP status message. - */ - statusMessage: string; - /** - * An object representing the response HTTP headers. The headers object is formatted as follows: - * - All header names are lowercased. - * - Each header name produces an array-valued property on the headers object. - * - Each header value is pushed into the array associated with its header name. - */ - headers: { - [key: string]: string[] - }; - /** - * A string indicating the HTTP protocol version number. Typical values are ‘1.0’ or ‘1.1’. - */ - httpVersion: string; - /** - * An integer-valued read-only property that returns the HTTP major version number. - */ - httpVersionMajor: number; - /** - * An integer-valued read-only property that returns the HTTP minor version number. - */ - httpVersionMinor: number; - } - - // https://github.com/electron/electron/blob/master/docs/api/power-monitor.md - - /** - * The power-monitor module is used to monitor power state changes. - * You should not use this module until the ready event of the app module is emitted. - */ - interface PowerMonitor extends NodeJS.EventEmitter { - /** - * Emitted when the system is suspending. - */ - on(event: 'suspend', listener: Function): this; - /** - * Emitted when system is resuming. - */ - on(event: 'resume', listener: Function): this; - /** - * Emitted when the system changes to AC power. - */ - on(event: 'on-ac', listener: Function): this; - /** - * Emitted when system changes to battery power. - */ - on(event: 'on-battery', listener: Function): this; - on(event: string, listener: Function): this; - } - - // https://github.com/electron/electron/blob/master/docs/api/power-save-blocker.md - - /** - * The powerSaveBlocker module is used to block the system from entering - * low-power (sleep) mode and thus allowing the app to keep the system and screen active. - */ - interface PowerSaveBlocker { - /** - * Starts preventing the system from entering lower-power mode. - * @returns The blocker ID that is assigned to this power blocker. - * Note: prevent-display-sleep has higher has precedence over prevent-app-suspension. - */ - start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number; - /** - * @param id The power save blocker id returned by powerSaveBlocker.start. - * Stops the specified power save blocker. - */ - stop(id: number): void; - /** - * @param id The power save blocker id returned by powerSaveBlocker.start. - * @returns Whether the corresponding powerSaveBlocker has started. - */ - isStarted(id: number): boolean; - } - - // https://github.com/electron/electron/blob/master/docs/api/protocol.md - - /** - * The protocol module can register a custom protocol or intercept an existing protocol. - */ - interface Protocol { - /** - * Registers custom schemes as standard schemes. - */ - registerStandardSchemes(schemes: string[]): void; - /** - * Registers custom schemes to handle service workers. - */ - registerServiceWorkerSchemes(schemes: string[]): void; - /** - * Registers a protocol of scheme that will send the file as a response. - */ - 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: BufferProtocolHandler, completion?: (error: Error) => void): void; - /** - * Registers a protocol of scheme that will send a String as a response. - */ - 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: HttpProtocolHandler, completion?: (error: Error) => void): void; - /** - * Unregisters the custom protocol of scheme. - */ - unregisterProtocol(scheme: string, completion?: (error: Error) => void): void; - /** - * The callback will be called with a boolean that indicates whether there is already a handler for scheme. - */ - isProtocolHandled(scheme: string, callback: (handled: boolean) => void): void; - /** - * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a file as a response. - */ - 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: 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: 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; - method: string; - uploadData?: { - /** - * Content being sent. - */ - bytes: Buffer, - /** - * Path of file being uploaded. - */ - file: string, - /** - * UUID of blob data. Use session.getBlobData method to retrieve the data. - */ - blobUUID: string; - }[]; - } - - interface ProtocolCallback { - (error: number): void; - (obj: { - error: number - }): void; - (): void; - } - - interface FileProtocolCallback extends ProtocolCallback { - (filePath: string): void; - (obj: { - path: string - }): void; - } - - interface BufferProtocolCallback extends ProtocolCallback { - (buffer: Buffer): void; - (obj: { - data: Buffer, - mimeType: string, - charset?: string - }): void; - } - - interface StringProtocolCallback extends ProtocolCallback { - (str: string): void; - (obj: { - data: string, - mimeType: string, - charset?: string - }): void; - } - - interface HttpProtocolCallback extends ProtocolCallback { - (redirectRequest: { - url: string; - method: string; - session?: Object; - uploadData?: { - contentType: string; - data: string; - }; - }): void; - } - - // https://github.com/electron/electron/blob/master/docs/api/remote.md - - /** - * The remote module provides a simple way to do inter-process communication (IPC) - * between the renderer process (web page) and the main process. - */ - interface Remote extends CommonElectron { - /** - * @returns The object returned by require(module) in the main process. - */ - require(module: string): any; - /** - * @returns The BrowserWindow object which this web page belongs to. - */ - getCurrentWindow(): BrowserWindow; - /** - * @returns The WebContents object of this web page. - */ - getCurrentWebContents(): WebContents; - /** - * @returns The global variable of name (e.g. global[name]) in the main process. - */ - getGlobal(name: string): any; - /** - * Returns the process object in the main process. This is the same as - * remote.getGlobal('process'), but gets cached. - */ - process: NodeJS.Process; - } - - // https://github.com/electron/electron/blob/master/docs/api/screen.md - - /** - * The Display object represents a physical display connected to the system. - * A fake Display may exist on a headless system, or a Display may correspond to a remote, virtual display. - */ - interface Display { - /** - * Unique identifier associated with the display. - */ - id: number; - bounds: Rectangle; - workArea: Rectangle; - size: Size; - workAreaSize: Size; - /** - * Output device’s pixel scale factor. - */ - scaleFactor: number; - /** - * Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees. - */ - rotation: number; - touchSupport: 'available' | 'unavailable' | 'unknown'; - } - - type DisplayMetrics = 'bounds' | 'workArea' | 'scaleFactor' | 'rotation'; - - /** - * The screen module retrieves information about screen size, displays, cursor position, etc. - * You can not use this module until the ready event of the app module is emitted. - */ - interface Screen extends NodeJS.EventEmitter { - /** - * Emitted when newDisplay has been added. - */ - on(event: 'display-added', listener: (event: Event, newDisplay: Display) => void): this; - /** - * Emitted when oldDisplay has been removed. - */ - on(event: 'display-removed', listener: (event: Event, oldDisplay: Display) => void): this; - /** - * Emitted when one or more metrics change in a display. - */ - on(event: 'display-metrics-changed', listener: (event: Event, display: Display, changedMetrics: DisplayMetrics[]) => void): this; - on(event: string, listener: Function): this; - /** - * @returns The current absolute position of the mouse pointer. - */ - getCursorScreenPoint(): Point; - /** - * @returns The primary display. - */ - getPrimaryDisplay(): Display; - /** - * @returns An array of displays that are currently available. - */ - getAllDisplays(): Display[]; - /** - * @returns The display nearest the specified point. - */ - getDisplayNearestPoint(point: Point): Display; - /** - * @returns The display that most closely intersects the provided bounds. - */ - getDisplayMatching(rect: Rectangle): Display; - } - - // https://github.com/electron/electron/blob/master/docs/api/session.md - - /** - * The session module can be used to create new Session objects. - * You can also access the session of existing pages by using - * the session property of webContents which is a property of BrowserWindow. - */ - class Session extends NodeJS.EventEmitter { - /** - * @returns a new Session instance from partition string. - */ - static fromPartition(partition: string, options?: FromPartitionOptions): Session; - /** - * @returns the default session object of the app. - */ - static defaultSession: Session; - /** - * Emitted when Electron is about to download item in webContents. - * Calling event.preventDefault() will cancel the download - * and item will not be available from next tick of the process. - */ - on(event: 'will-download', listener: (event: Event, item: DownloadItem, webContents: WebContents) => void): this; - on(event: string, listener: Function): this; - /** - * The cookies gives you ability to query and modify cookies. - */ - cookies: SessionCookies; - /** - * @returns the session’s current cache size. - */ - getCacheSize(callback: (size: number) => void): void; - /** - * Clears the session’s HTTP cache. - */ - clearCache(callback: Function): void; - /** - * Clears the data of web storages. - */ - clearStorageData(callback: Function): void; - /** - * Clears the data of web storages. - */ - clearStorageData(options: ClearStorageDataOptions, callback: Function): void; - /** - * Writes any unwritten DOMStorage data to disk. - */ - flushStorageData(): void; - /** - * Sets the proxy settings. - */ - setProxy(config: ProxyConfig, callback: Function): void; - /** - * Resolves the proxy information for url. - */ - resolveProxy(url: URL, callback: (proxy: string) => void): void; - /** - * Sets download saving directory. - * By default, the download directory will be the Downloads under the respective app folder. - */ - setDownloadPath(path: string): void; - /** - * Emulates network with the given configuration for the session. - */ - enableNetworkEmulation(options: NetworkEmulationOptions): void; - /** - * Disables any network emulation already active for the session. - * Resets to the original network configuration. - */ - disableNetworkEmulation(): void; - /** - * Sets the certificate verify proc for session, the proc will be called - * whenever a server certificate verification is requested. - * - * Calling setCertificateVerifyProc(null) will revert back to default certificate verify proc. - */ - setCertificateVerifyProc(proc: ((hostname: string, cert: Certificate, callback: (accepted: boolean) => void) => void) | null): void; - /** - * Sets the handler which can be used to respond to permission requests for the session. - */ - setPermissionRequestHandler(handler: (webContents: WebContents, permission: Permission, callback: (allow: boolean) => void) => void): void; - /** - * 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; - /** - * Returns the blob data associated with the identifier. - */ - getBlobData(identifier: string, callback: (result: Buffer) => void): void; - /** - * 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. - */ - origin?: string; - /** - * The types of storages to clear. - */ - storages?: ('appcache' | 'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers')[]; - /** - * The types of quotas to clear. - */ - 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. - * Default: false. - */ - offline?: boolean; - /** - * RTT in ms. - * Default: 0, which will disable latency throttling. - */ - latency?: number; - /** - * Download rate in Bps. - * Default: 0, which will disable download throttling. - */ - downloadThroughput?: number; - /** - * Upload rate in Bps. - * Default: 0, which will disable upload throttling. - */ - uploadThroughput?: number; - } - - interface CookieFilter { - /** - * Retrieves cookies which are associated with url. Empty implies retrieving cookies of all urls. - */ - url?: string; - /** - * Filters cookies by name. - */ - name?: string; - /** - * Retrieves cookies whose domains match or are subdomains of domains. - */ - domain?: string; - /** - * Retrieves cookies whose path matches path. - */ - path?: string; - /** - * Filters cookies by their Secure property. - */ - secure?: boolean; - /** - * Filters out session or persistent cookies. - */ - session?: boolean; - } - - interface Cookie { - /** - * Emitted when a cookie is changed because it was added, edited, removed, or expired. - */ - on(event: 'changed', listener: (event: Event, cookie: Cookie, cause: CookieChangedCause) => void): this; - on(event: string, listener: Function): this; - /** - * The name of the cookie. - */ - name: string; - /** - * The value of the cookie. - */ - value: string; - /** - * The domain of the cookie. - */ - domain: string; - /** - * Whether the cookie is a host-only cookie. - */ - hostOnly: string; - /** - * The path of the cookie. - */ - path: string; - /** - * Whether the cookie is marked as secure. - */ - secure: boolean; - /** - * Whether the cookie is marked as HTTP only. - */ - httpOnly: boolean; - /** - * Whether the cookie is a session cookie or a persistent cookie with an expiration date. - */ - session: boolean; - /** - * The expiration date of the cookie as the number of seconds since the UNIX epoch. - * Not provided for session cookies. - */ - expirationDate?: number; - } - - type CookieChangedCause = 'explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'; - - interface CookieDetails { - /** - * The URL associated with the cookie. - */ - url: string; - /** - * The name of the cookie. - * Default: empty. - */ - name?: string; - /** - * The value of the cookie. - * Default: empty. - */ - value?: string; - /** - * The domain of the cookie. - * Default: empty. - */ - domain?: string; - /** - * The path of the cookie. - * Default: empty. - */ - path?: string; - /** - * Whether the cookie should be marked as secure. - * Default: false. - */ - secure?: boolean; - /** - * Whether the cookie should be marked as HTTP only. - * Default: false. - */ - httpOnly?: boolean; - /** - * The expiration date of the cookie as the number of seconds since the UNIX epoch. - * If omitted, the cookie becomes a session cookie. - */ - expirationDate?: number; - } - - interface SessionCookies { - /** - * Sends a request to get all cookies matching filter. - */ - get(filter: CookieFilter, callback: (error: Error, cookies: Cookie[]) => void): void; - /** - * Sets the cookie with details. - */ - set(details: CookieDetails, callback: (error: Error) => void): void; - /** - * Removes the cookies matching url and name. - */ - remove(url: string, name: string, callback: (error: Error) => void): void; - } - - /** - * Each API accepts an optional filter and a listener, the listener will be called when the API's event has happened. - * Passing null as listener will unsubscribe from the event. - * - * The filter will be used to filter out the requests that do not match the URL patterns. - * If the filter is omitted then all requests will be matched. - * - * For certain events the listener is passed with a callback, - * which should be called with an response object when listener has done its work. - */ - interface WebRequest { - /** - * The listener will be called when a request is about to occur. - */ - onBeforeRequest(listener: (details: WebRequest.BeforeRequestDetails, callback: WebRequest.BeforeRequestCallback) => void): void; - /** - * The listener will be called when a request is about to occur. - */ - onBeforeRequest(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeRequestDetails, callback: WebRequest.BeforeRequestCallback) => void): void; - /** - * The listener will be called before sending an HTTP request, once the request headers are available. - * This may occur after a TCP connection is made to the server, but before any http data is sent. - */ - onBeforeSendHeaders(listener: (details: WebRequest.BeforeSendHeadersDetails, callback: WebRequest.BeforeSendHeadersCallback) => void): void; - /** - * The listener will be called before sending an HTTP request, once the request headers are available. - * This may occur after a TCP connection is made to the server, but before any http data is sent. - */ - onBeforeSendHeaders(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeSendHeadersDetails, callback: WebRequest.BeforeSendHeadersCallback) => void): void; - /** - * The listener will be called just before a request is going to be sent to the server, - * modifications of previous onBeforeSendHeaders response are visible by the time this listener is fired. - */ - onSendHeaders(listener: (details: WebRequest.SendHeadersDetails) => void): void; - /** - * The listener will be called just before a request is going to be sent to the server, - * modifications of previous onBeforeSendHeaders response are visible by the time this listener is fired. - */ - onSendHeaders(filter: WebRequest.Filter, listener: (details: WebRequest.SendHeadersDetails) => void): void; - /** - * The listener will be called when HTTP response headers of a request have been received. - */ - onHeadersReceived(listener: (details: WebRequest.HeadersReceivedDetails, callback: WebRequest.HeadersReceivedCallback) => void): void; - /** - * The listener will be called when HTTP response headers of a request have been received. - */ - onHeadersReceived(filter: WebRequest.Filter, listener: (details: WebRequest.HeadersReceivedDetails, callback: WebRequest.HeadersReceivedCallback) => void): void; - /** - * The listener will be called when first byte of the response body is received. - * For HTTP requests, this means that the status line and response headers are available. - */ - onResponseStarted(listener: (details: WebRequest.ResponseStartedDetails) => void): void; - /** - * The listener will be called when first byte of the response body is received. - * For HTTP requests, this means that the status line and response headers are available. - */ - onResponseStarted(filter: WebRequest.Filter, listener: (details: WebRequest.ResponseStartedDetails) => void): void; - /** - * The listener will be called when a server initiated redirect is about to occur. - */ - onBeforeRedirect(listener: (details: WebRequest.BeforeRedirectDetails) => void): void; - /** - * The listener will be called when a server initiated redirect is about to occur. - */ - onBeforeRedirect(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeRedirectDetails) => void): void; - /** - * The listener will be called when a request is completed. - */ - onCompleted(listener: (details: WebRequest.CompletedDetails) => void): void; - /** - * The listener will be called when a request is completed. - */ - onCompleted(filter: WebRequest.Filter, listener: (details: WebRequest.CompletedDetails) => void): void; - /** - * The listener will be called when an error occurs. - */ - onErrorOccurred(listener: (details: WebRequest.ErrorOccurredDetails) => void): void; - /** - * The listener will be called when an error occurs. - */ - onErrorOccurred(filter: WebRequest.Filter, listener: (details: WebRequest.ErrorOccurredDetails) => void): void; - } - - namespace WebRequest { - interface Filter { - urls: string[]; - } - - interface Details { - id: number; - url: string; - method: string; - resourceType: string; - timestamp: number; - } - - interface UploadData { - /** - * Content being sent. - */ - bytes: Buffer; - /** - * Path of file being uploaded. - */ - file: string; - /** - * UUID of blob data. Use session.getBlobData method to retrieve the data. - */ - blobUUID: string; - } - - interface BeforeRequestDetails extends Details { - uploadData?: UploadData[]; - } - - type BeforeRequestCallback = (response: { - cancel?: boolean; - /** - * The original request is prevented from being sent or completed, and is instead redirected to the given URL. - */ - redirectURL?: string; - }) => void; - - interface BeforeSendHeadersDetails extends Details { - requestHeaders: Headers; - } - - type BeforeSendHeadersCallback = (response: { - cancel?: boolean; - /** - * When provided, request will be made with these headers. - */ - requestHeaders?: Headers; - }) => void; - - interface SendHeadersDetails extends Details { - requestHeaders: Headers; - } - - interface HeadersReceivedDetails extends Details { - statusLine: string; - statusCode: number; - responseHeaders: Headers; - } - - type HeadersReceivedCallback = (response: { - cancel?: boolean; - /** - * When provided, the server is assumed to have responded with these headers. - */ - responseHeaders?: Headers; - /** - * Should be provided when overriding responseHeaders to change header status - * otherwise original response header's status will be used. - */ - statusLine?: string; - }) => void; - - interface ResponseStartedDetails extends Details { - responseHeaders: Headers; - fromCache: boolean; - statusCode: number; - statusLine: string; - } - - interface BeforeRedirectDetails extends Details { - redirectURL: string; - statusCode: number; - ip?: string; - fromCache: boolean; - responseHeaders: Headers; - } - - interface CompletedDetails extends Details { - responseHeaders: Headers; - fromCache: boolean; - statusCode: number; - statusLine: string; - } - - interface ErrorOccurredDetails extends Details { - fromCache: boolean; - error: string; - } - } - - // https://github.com/electron/electron/blob/master/docs/api/shell.md - - /** - * The shell module provides functions related to desktop integration. - */ - interface Shell { - /** - * Show the given file in a file manager. If possible, select the file. - * @returns Whether the item was successfully shown. - */ - showItemInFolder(fullPath: string): boolean; - /** - * Open the given file in the desktop's default manner. - * @returns Whether the item was successfully shown. - */ - openItem(fullPath: string): boolean; - /** - * Open the given external protocol URL in the desktop's default manner - * (e.g., mailto: URLs in the default mail user agent). - * @returns Whether an application was available to open the URL. - */ - openExternal(url: string, options?: { - /** - * Bring the opened application to the foreground. - * Default: true. - */ - activate: boolean; - }): boolean; - /** - * Move the given file to trash. - * @returns Whether the item was successfully moved to the trash. - */ - moveItemToTrash(fullPath: string): boolean; - /** - * 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 - - type SystemColor = - '3d-dark-shadow' | // Dark shadow for three-dimensional display elements. - '3d-face' | // Face color for three-dimensional display elements and for dialog box backgrounds. - '3d-highlight' | // Highlight color for three-dimensional display elements. - '3d-light' | // Light color for three-dimensional display elements. - '3d-shadow' | // Shadow color for three-dimensional display elements. - 'active-border' | // Active window border. - 'active-caption' | // Active window title bar. Specifies the left side color in the color gradient of an active window's title bar if the gradient effect is enabled. - 'active-caption-gradient' | // Right side color in the color gradient of an active window's title bar. - 'app-workspace' | // Background color of multiple document interface (MDI) applications. - 'button-text' | // Text on push buttons. - 'caption-text' | // Text in caption, size box, and scroll bar arrow box. - 'desktop' | // Desktop background color. - 'disabled-text' | // Grayed (disabled) text. - 'highlight' | // Item(s) selected in a control. - 'highlight-text' | // Text of item(s) selected in a control. - 'hotlight' | // Color for a hyperlink or hot-tracked item. - 'inactive-border' | // Inactive window border. - 'inactive-caption' | // Inactive window caption. Specifies the left side color in the color gradient of an inactive window's title bar if the gradient effect is enabled. - 'inactive-caption-gradient' | // Right side color in the color gradient of an inactive window's title bar. - 'inactive-caption-text' | // Color of text in an inactive caption. - 'info-background' | // Background color for tooltip controls. - 'info-text' | // Text color for tooltip controls. - 'menu' | // Menu background. - 'menu-highlight' | // The color used to highlight menu items when the menu appears as a flat menu. - 'menubar' | // The background color for the menu bar when menus appear as flat menus. - 'menu-text' | // Text in menus. - 'scrollbar' | // Scroll bar gray area. - 'window' | // Window background. - 'window-frame' | // Window frame. - 'window-text'; // Text in windows. - - /** - * Get system preferences. - */ - interface SystemPreferences { - /** - * Note: This is only implemented on Windows. - */ - on(event: 'accent-color-changed', listener: (event: Event, newColor: string) => void): this; - /** - * Note: This is only implemented on Windows. - */ - on(event: 'color-changed', listener: (event: Event) => void): this; - /** - * Note: This is only implemented on Windows. - */ - on(event: 'inverted-color-scheme-changed', listener: ( - event: Event, - /** - * @param invertedColorScheme true if an inverted color scheme, such as a high contrast theme, is being used, false otherwise. - */ - invertedColorScheme: boolean - ) => void): this; - on(event: string, listener: Function): this; - /** - * @returns Whether the system is in Dark Mode. - * - * Note: This is only implemented on macOS. - */ - isDarkMode(): boolean; - /** - * @returns Whether 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; - /** - * @returns Whether DWM composition (Aero Glass) is enabled. - * - * Note: This is only implemented on Windows. - */ - isAeroGlassEnabled(): boolean; - /** - * @returns The users current system wide color preference in the form of an RGBA hexadecimal string. - * - * Note: This is only implemented on Windows. - */ - getAccentColor(): string; - /** - * @returns true if an inverted color scheme, such as a high contrast theme, is active, false otherwise. - * - * Note: This is only implemented on Windows. - */ - isInvertedColorScheme(): boolean; - /** - * @returns The system color setting in RGB hexadecimal form (#ABCDEF). See the Windows docs for more details. - * - * Note: This is only implemented on Windows. - */ - getColor(color: SystemColor): string; - } - - // https://github.com/electron/electron/blob/master/docs/api/tray.md - - /** - * A Tray represents an icon in an operating system's notification area. - */ - class Tray extends NodeJS.EventEmitter implements Destroyable { - /** - * Emitted when the tray icon is clicked. - * Note: The bounds payload is only implemented on macOS and Windows. - */ - on(event: 'click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; - /** - * Emitted when the tray icon is right clicked. - * Note: This is only implemented on macOS and Windows. - */ - 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 macOS and Windows. - */ - on(event: 'double-click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; - /** - * Emitted when the tray balloon shows. - * Note: This is only implemented on Windows. - */ - on(event: 'balloon-show', listener: Function): this; - /** - * Emitted when the tray balloon is clicked. - * Note: This is only implemented on Windows. - */ - on(event: 'balloon-click', listener: Function): this; - /** - * Emitted when the tray balloon is closed because of timeout or user manually closes it. - * Note: This is only implemented on Windows. - */ - on(event: 'balloon-closed', listener: Function): this; - /** - * Emitted when any dragged items are dropped on the tray icon. - * 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 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 macOS - */ - on(event: 'drag-enter', listener: Function): this; - /** - * Emitted when a drag operation exits the tray icon. - * 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 macOS - */ - on(event: 'drag-end', listener: Function): this; - on(event: string, listener: Function): this; - /** - * Creates a new tray icon associated with the image. - */ - constructor(image: NativeImage|string); - /** - * Destroys the tray icon immediately. - */ - destroy(): void; - /** - * Sets the image associated with this tray icon. - */ - setImage(image: NativeImage|string): void; - /** - * Sets the image associated with this tray icon when pressed. - */ - setPressedImage(image: NativeImage): void; - /** - * Sets the hover text for this tray icon. - */ - setToolTip(toolTip: string): void; - /** - * Sets the title displayed aside of the tray icon in the status bar. - * Note: This is only implemented on macOS. - */ - setTitle(title: string): void; - /** - * Sets when the tray's icon background becomes highlighted. - * Note: This is only implemented on macOS. - */ - setHighlightMode(mode: 'selection' | 'always' | 'never'): void; - /** - * Displays a tray balloon. - * Note: This is only implemented on Windows. - */ - displayBalloon(options?: { - icon?: NativeImage; - title?: string; - content?: string; - }): void; - /** - * 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 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; - /** - * @returns Whether the tray icon is destroyed. - */ - isDestroyed(): boolean; - } - - interface Modifiers { - altKey: boolean; - shiftKey: boolean; - ctrlKey: boolean; - 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 WebContents instances. 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; - /** - * Find a WebContents instance according to its ID. - */ - fromId(id: number): WebContents; - } - - /** - * A WebContents is responsible for rendering and controlling a web page. - */ - interface WebContents extends NodeJS.EventEmitter { - /** - * Emitted when the navigation is done, i.e. the spinner of the tab has stopped spinning, - * and the onload event was dispatched. - */ - on(event: 'did-finish-load', listener: Function): this; - /** - * This event is like did-finish-load but emitted when the load failed or was cancelled, - * e.g. window.stop() is invoked. - */ - on(event: 'did-fail-load', listener: (event: Event, errorCode: number, errorDescription: string, validatedURL: string, isMainFrame: boolean) => void): this; - /** - * Emitted when a frame has done navigation. - */ - on(event: 'did-frame-finish-load', listener: (event: Event, isMainFrame: boolean) => void): this; - /** - * Corresponds to the points in time when the spinner of the tab started spinning. - */ - on(event: 'did-start-loading', listener: Function): this; - /** - * Corresponds to the points in time when the spinner of the tab stopped spinning. - */ - on(event: 'did-stop-loading', listener: Function): this; - /** - * Emitted when details regarding a requested resource are available. - * status indicates the socket connection to download the resource. - */ - on(event: 'did-get-response-details', listener: (event: Event, - status: boolean, - newURL: string, - originalURL: string, - httpResponseCode: number, - requestMethod: string, - referrer: string, - headers: Headers, - resourceType: string - ) => void): this; - /** - * Emitted when a redirect is received while requesting a resource. - */ - on(event: 'did-get-redirect-request', listener: (event: Event, - oldURL: string, - newURL: string, - isMainFrame: boolean, - httpResponseCode: number, - requestMethod: string, - referrer: string, - headers: Headers - ) => void): this; - /** - * Emitted when the document in the given frame is loaded. - */ - on(event: 'dom-ready', listener: (event: Event) => void): this; - /** - * Emitted when page receives favicon URLs. - */ - on(event: 'page-favicon-updated', listener: (event: Event, favicons: string[]) => void): this; - /** - * Emitted when the page requests to open a new window for a url. - * It could be requested by window.open or an external link like . - * - * By default a new BrowserWindow will be created for the url. - * - * Calling event.preventDefault() will prevent creating new windows. - */ - on(event: 'new-window', listener: (event: Event, - url: string, - frameName: string, - disposition: NewWindowDisposition, - options: BrowserWindowOptions - ) => void): this; - /** - * Emitted when a user or the page wants to start navigation. - * It can happen when the window.location object is changed or a user clicks a link in the page. - * - * This event will not emit when the navigation is started programmatically with APIs like - * webContents.loadURL and webContents.back. - * - * It is also not emitted for in-page navigations, such as clicking anchor links - * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. - * - * Calling event.preventDefault() will prevent the navigation. - */ - on(event: 'will-navigate', listener: (event: Event, url: string) => void): this; - /** - * Emitted when a navigation is done. - * - * This event is not emitted for in-page navigations, such as clicking anchor links - * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. - */ - on(event: 'did-navigate', listener: (event: Event, url: string) => void): this; - /** - * Emitted when an in-page navigation happened. - * - * When in-page navigation happens, the page URL changes but does not cause - * navigation outside of the page. Examples of this occurring are when anchor links - * are clicked or when the DOM hashchange event is triggered. - */ - on(event: 'did-navigate-in-page', listener: (event: Event, url: string, isMainFrame: boolean) => void): this; - /** - * Emitted when the renderer process has crashed. - */ - on(event: 'crashed', listener: (event: Event, killed: boolean) => void): this; - /** - * Emitted when a plugin process has crashed. - */ - on(event: 'plugin-crashed', listener: (event: Event, name: string, version: string) => void): this; - /** - * Emitted when webContents is destroyed. - */ - on(event: 'destroyed', listener: Function): this; - /** - * Emitted when DevTools is opened. - */ - on(event: 'devtools-opened', listener: Function): this; - /** - * Emitted when DevTools is closed. - */ - on(event: 'devtools-closed', listener: Function): this; - /** - * Emitted when DevTools is focused / opened. - */ - on(event: 'devtools-focused', listener: Function): this; - /** - * Emitted when failed to verify the certificate for url. - * The usage is the same with the "certificate-error" event of app. - */ - on(event: 'certificate-error', listener: (event: Event, - url: string, - error: string, - certificate: Certificate, - callback: (trust: boolean) => void - ) => void): this; - /** - * Emitted when a client certificate is requested. - * The usage is the same with the "select-client-certificate" event of app. - */ - on(event: 'select-client-certificate', listener: (event: Event, - url: string, - certificateList: Certificate[], - callback: (certificate: Certificate) => void - ) => void): this; - /** - * Emitted when webContents wants to do basic auth. - * The usage is the same with the "login" event of app. - */ - on(event: 'login', listener: (event: Event, - request: LoginRequest, - authInfo: LoginAuthInfo, - callback: (username: string, password: string) => void - ) => void): this; - /** - * Emitted when a result is available for webContents.findInPage request. - */ - on(event: 'found-in-page', listener: (event: Event, result: FoundInPageResult) => void): this; - /** - * Emitted when media starts playing. - */ - on(event: 'media-started-playing', listener: Function): this; - /** - * Emitted when media is paused or done playing. - */ - on(event: 'media-paused', listener: Function): this; - /** - * Emitted when a page’s theme color changes. This is usually due to encountering a meta tag: - * - */ - 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 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, 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. - * @param url Must contain the protocol prefix (e.g., the http:// or file://). - */ - loadURL(url: string, options?: LoadURLOptions): void; - /** - * Initiates a download of the resource at url without navigating. - * The will-download event of session will be triggered. - */ - downloadURL(url: string): void; - /** - * @returns The URL of current web page. - */ - getURL(): string; - /** - * @returns The title of web page. - */ - getTitle(): string; - /** - * @returns Whether the web page is destroyed. - */ - isDestroyed(): boolean; - /** - * @returns Whether the web page is focused. - */ - isFocused(): boolean; - /** - * @returns Whether web page is still loading resources. - */ - isLoading(): boolean; - /** - * @returns Whether the main frame (and not just iframes or frames within it) is still loading. - */ - isLoadingMainFrame(): boolean; - /** - * @returns Whether web page is waiting for a first-response for the main - * resource of the page. - */ - isWaitingForResponse(): boolean; - /** - * Stops any pending navigation. - */ - stop(): void; - /** - * Reloads current page. - */ - reload(): void; - /** - * Reloads current page and ignores cache. - */ - reloadIgnoringCache(): void; - /** - * @returns Whether the web page can go back. - */ - canGoBack(): boolean; - /** - * @returns Whether the web page can go forward. - */ - canGoForward(): boolean; - /** - * @returns Whether the web page can go to offset. - */ - canGoToOffset(offset: number): boolean; - /** - * Clears the navigation history. - */ - clearHistory(): void; - /** - * Makes the web page go back. - */ - goBack(): void; - /** - * Makes the web page go forward. - */ - goForward(): void; - /** - * Navigates to the specified absolute index. - */ - goToIndex(index: number): void; - /** - * Navigates to the specified offset from the "current entry". - */ - goToOffset(offset: number): void; - /** - * @returns Whether the renderer process has crashed. - */ - isCrashed(): boolean; - /** - * Overrides the user agent for this page. - */ - setUserAgent(userAgent: string): void; - /** - * @returns The user agent for this web page. - */ - getUserAgent(): string; - /** - * Injects CSS into this page. - */ - insertCSS(css: string): void; - /** - * Evaluates code in page. - * @param code Code to evaluate. - * - * @returns Promise - */ - executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise; - /** - * Mute the audio on the current web page. - */ - setAudioMuted(muted: boolean): void; - /** - * @returns Whether this page has been muted. - */ - isAudioMuted(): boolean; - /** - * 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. - */ - setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; - /** - * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. - */ - setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; - /** - * Executes the editing command undo in web page. - */ - undo(): void; - /** - * Executes the editing command redo in web page. - */ - redo(): void; - /** - * Executes the editing command cut in web page. - */ - cut(): void; - /** - * Executes the editing command copy in web page. - */ - copy(): void; - /** - * 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 the editing command pasteAndMatchStyle in web page. - */ - pasteAndMatchStyle(): void; - /** - * Executes the editing command delete in web page. - */ - delete(): void; - /** - * Executes the editing command selectAll in web page. - */ - selectAll(): void; - /** - * Executes the editing command unselect in web page. - */ - unselect(): void; - /** - * Executes the editing command replace in web page. - */ - replace(text: string): void; - /** - * Executes the editing command replaceMisspelling in web page. - */ - replaceMisspelling(text: string): void; - /** - * Inserts text to the focused element. - */ - insertText(text: string): void; - /** - * Starts a request to find all matches for the text in the web page. - * The result of the request can be obtained by subscribing to found-in-page event. - * @returns The request id used for the request. - */ - findInPage(text: string, options?: FindInPageOptions): number; - /** - * Stops any findInPage request for the webContents with the provided action. - */ - stopFindInPage(action: StopFindInPageAtion): void; - /** - * Checks if any serviceworker is registered. - */ - hasServiceWorker(callback: (hasServiceWorker: boolean) => void): void; - /** - * Unregisters any serviceworker if present. - */ - unregisterServiceWorker(callback: (isFulfilled: boolean) => void): void; - /** - * Prints window's web page. When silent is set to false, Electron will pick up system's default printer and default settings for printing. - * Calling window.print() in web page is equivalent to call WebContents.print({silent: false, printBackground: false}). - * Note: On Windows, the print API relies on pdf.dll. If your application doesn't need print feature, you can safely remove pdf.dll in saving binary size. - */ - print(options?: PrintOptions): void; - /** - * Prints windows' web page as PDF with Chromium's preview printing custom settings. - */ - printToPDF(options: PrintToPDFOptions, callback: (error: Error, data: Buffer) => void): void; - /** - * Adds the specified path to DevTools workspace. - */ - addWorkSpace(path: string): void; - /** - * Removes the specified path from DevTools workspace. - */ - removeWorkSpace(path: string): void; - /** - * Opens the developer tools. - */ - openDevTools(options?: { - /** - * Opens the devtools with specified dock state. Defaults to last used dock state. - */ - mode?: 'right' | 'bottom' | 'undocked' | 'detach' - }): void; - /** - * Closes the developer tools. - */ - closeDevTools(): void; - /** - * Returns whether the developer tools are opened. - */ - isDevToolsOpened(): boolean; - /** - * Returns whether the developer tools are focussed. - */ - isDevToolsFocused(): boolean; - /** - * Toggle the developer tools. - */ - toggleDevTools(): void; - /** - * Starts inspecting element at position (x, y). - */ - inspectElement(x: number, y: number): void; - /** - * Opens the developer tools for the service worker context. - */ - inspectServiceWorker(): void; - /** - * Send args.. to the web page via channel in asynchronous message, the web page - * can handle it by listening to the channel event of ipc module. - * Note: - * 1. The IPC message handler in web pages do not have a event parameter, - * which is different from the handlers on the main process. - * 2. There is no way to send synchronous messages from the main process - * to a renderer process, because it would be very easy to cause dead locks. - */ - send(channel: string, ...args: any[]): void; - /** - * Enable device emulation with the given parameters. - */ - enableDeviceEmulation(parameters: DeviceEmulationParameters): void; - /** - * Disable device emulation. - */ - disableDeviceEmulation(): void; - /** - * Sends an input event to the page. - */ - sendInputEvent(event: SendInputEvent): void; - /** - * Begin subscribing for presentation events and captured frames, - * The callback will be called when there is a presentation event. - */ - 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. - */ - endFrameSubscription(): void; - /** - * @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; - /** - * If offscreen rendering is enabled invalidates the frame and generates a new one through the 'paint' event. - */ - invalidate(): void; - /** - * 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. - */ - session: Session; - /** - * @returns The WebContents that might own this WebContents. - */ - hostWebContents: WebContents; - /** - * @returns The WebContents of DevTools for this WebContents. - * Note: Users should never store this object because it may become null - * when the DevTools has been closed. - */ - devToolsWebContents: WebContents; - /** - * @returns Debugger API - */ - 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; - } - - type NewWindowDisposition = 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'; - - /** - * Specifies the action to take place when ending webContents.findInPage request. - * 'clearSelection' - Clear the selection. - * 'keepSelection' - Translate the selection into a normal selection. - * 'activateSelection' - Focus and click the selection node. - */ - type StopFindInPageAtion = 'clearSelection' | 'keepSelection' | 'activateSelection'; - - type CursorType = 'default' | 'crosshair' | 'pointer' | 'text' | 'wait' | 'help' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ns-resize' | 'ew-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'm-panning' | 'e-panning' | 'n-panning' | 'ne-panning' | 'nw-panning' | 's-panning' | 'se-panning' |'sw-panning' | 'w-panning' | 'move' | 'vertical-text' | 'cell' | 'context-menu' | 'alias' | 'progress' | 'nodrop' | 'copy' | 'none' | 'not-allowed' | 'zoom-in' | 'zoom-out' | 'grab' | 'grabbing' | 'custom'; - - interface LoadURLOptions { - /** - * HTTP Referrer URL. - */ - httpReferrer?: string; - /** - * User agent originating the request. - */ - userAgent?: string; - /** - * Extra headers separated by "\n" - */ - extraHeaders?: string; - /** - * POST data - */ - postData?: (UploadRawData | UploadFileSystem | UploadBlob)[]; - } - - interface UploadRawData { - /** - * rawData - */ - type: 'rawData'; - /** - * Data to be uploaded. - */ - bytes: Buffer; - } - - interface UploadFileSystem { - /** - * fileSystem - */ - type: 'fileSystem'; - /** - * FileSystem url to read data for upload. - */ - fileSystemURL: string; - /** - * Defaults to 0. - */ - offset: number; - /** - * Number of bytes to read from offset. Defaults to 0. - */ - length: number; - /** - * Last Modification time in number of seconds sine the UNIX epoch. - */ - modificationTime: number; - } - - interface UploadBlob { - /** - * blob - */ - type: 'blob'; - /** - * UUID of blob data to upload. - */ - blobUUID: string; - } - - interface PrintOptions { - /** - * Don't ask user for print settings. - * Defaults: false. - */ - silent?: boolean; - /** - * Also prints the background color and image of the web page. - * Defaults: false. - */ - printBackground?: boolean; - } - - interface PrintToPDFOptions { - /** - * Specify the type of margins to use. - * 0 - default - * 1 - none - * 2 - minimum - * Default: 0 - */ - marginsType?: number; - /** - * Specify page size of the generated PDF. - * Default: A4. - */ - pageSize?: 'A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid' | Size; - /** - * Whether to print CSS backgrounds. - * Default: false. - */ - printBackground?: boolean; - /** - * Whether to print selection only. - * Default: false. - */ - printSelectionOnly?: boolean; - /** - * true for landscape, false for portrait. - * Default: false. - */ - landscape?: boolean; - } - - interface Certificate { - /** - * PEM encoded data. - */ - data: string; - /** - * Issuer principal - */ - issuer: CertificatePrincipal; - /** - * Issuer's Common Name. - */ - issuerName: string; - /** - * Issuer certificate (if not self-signed) - */ - issuerCert: Certificate; - /** - * Subject principal - */ - subject: CertificatePrincipal; - /** - * 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 CertificatePrincipal { - /** - * Common Name - */ - commonName: string; - /** - * Organization names - */ - organizations: string[]; - /** - * Organization Unit names - */ - organizationUnits: string[]; - /** - * Locality - */ - locality: string; - /** - * State or province - */ - state: string; - /** - * Country or region - */ - country: string; - } - - interface LoginRequest { - method: string; - url: string; - referrer: string; - } - - interface LoginAuthInfo { - isProxy: boolean; - scheme: string; - host: string; - port: number; - realm: string; - } - - interface FindInPageOptions { - /** - * Whether to search forward or backward, defaults to true - */ - forward?: boolean; - /** - * Whether the operation is first request or a follow up, defaults to false. - */ - findNext?: boolean; - /** - * Whether search should be case-sensitive, defaults to false. - */ - matchCase?: boolean; - /** - * Whether to look only at the start of words. defaults to false. - */ - wordStart?: boolean; - /** - * When combined with wordStart, accepts a match in the middle of a word - * if the match begins with an uppercase letter followed by a lowercase - * or non-letter. Accepts several other intra-word matches, defaults to false. - */ - medialCapitalAsWordStart?: boolean; - } - - interface FoundInPageResult { - requestId: number; - /** - * Indicates if more responses are to follow. - */ - finalUpdate: boolean; - /** - * Position of the active match. - */ - activeMatchOrdinal?: number; - /** - * Number of Matches. - */ - matches?: number; - /** - * Coordinates of first match region. - */ - selectionArea?: Rectangle; - } - - interface DeviceEmulationParameters { - /** - * Specify the screen type to emulated - * Default: desktop - */ - screenPosition?: 'desktop' | 'mobile'; - /** - * Set the emulated screen size (screenPosition == mobile) - */ - screenSize?: Size; - /** - * Position the view on the screen (screenPosition == mobile) - * Default: {x: 0, y: 0} - */ - viewPosition?: Point; - /** - * Set the device scale factor (if zero defaults to original device scale factor) - * Default: 0 - */ - deviceScaleFactor: number; - /** - * Set the emulated view size (empty means no override). - */ - viewSize?: Size; - /** - * Whether emulated view should be scaled down if necessary to fit into available space - * Default: false - */ - fitToView?: boolean; - /** - * Offset of the emulated view inside available space (not in fit to view mode) - * Default: {x: 0, y: 0} - */ - offset?: Point; - /** - * Scale of emulated view inside available space (not in fit to view mode) - * Default: 1 - */ - scale: number; - } - - interface SendInputEvent { - type: 'mouseDown' | 'mouseUp' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'mouseMove' | 'keyDown' | 'keyUp' | 'char'; - modifiers: ('shift' | 'control' | 'alt' | 'meta' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right')[]; - } - - interface SendInputKeyboardEvent extends SendInputEvent { - keyCode: string; - } - - interface SendInputMouseEvent extends SendInputEvent { - x: number; - y: number; - button?: 'left' | 'middle' | 'right'; - globalX?: number; - globalY?: number; - movementX?: number; - movementY?: number; - clickCount?: number; - } - - interface SendInputMouseWheelEvent extends SendInputEvent { - deltaX?: number; - deltaY?: number; - wheelTicksX?: number; - wheelTicksY?: number; - accelerationRatioX?: number; - accelerationRatioY?: number; - hasPreciseScrollingDeltas?: boolean; - canScroll?: boolean; - } - - /** - * Debugger API serves as an alternate transport for remote debugging protocol. - */ - interface Debugger extends NodeJS.EventEmitter { - /** - * Attaches the debugger to the webContents. - * @param protocolVersion Requested debugging protocol version. - */ - attach(protocolVersion?: string): void; - /** - * @returns Whether a debugger is attached to the webContents. - */ - isAttached(): boolean; - /** - * Detaches the debugger from the webContents. - */ - detach(): void; - /** - * Send given command to the debugging target. - * @param method Method name, should be one of the methods defined by the remote debugging protocol. - * @param commandParams JSON object with request parameters. - * @param callback Response defined by the ‘returns’ attribute of the command description in the remote debugging protocol. - */ - sendCommand(method: string, commandParams?: any, callback?: (error: Error, result: any) => void): void; - /** - * Emitted when debugging session is terminated. This happens either when - * webContents is closed or devtools is invoked for the attached webContents. - */ - on(event: 'detach', listener: (event: Event, reason: string) => void): this; - /** - * Emitted whenever debugging target issues instrumentation event. - * Event parameters defined by the ‘parameters’ attribute in the remote debugging protocol. - */ - on(event: 'message', listener: (event: Event, method: string, params: any) => void): this; - on(event: string, listener: Function): this; - } - - // https://github.com/electron/electron/blob/master/docs/api/web-frame.md - - /** - * The web-frame module allows you to customize the rendering of the current web page. - */ - interface WebFrame { - /** - * Changes the zoom factor to the specified factor, zoom factor is - * zoom percent / 100, so 300% = 3.0. - */ - setZoomFactor(factor: number): void; - /** - * @returns The current zoom factor. - */ - getZoomFactor(): number; - /** - * Changes the zoom level to the specified level, 0 is "original size", 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; - /** - * @returns The current zoom level. - */ - getZoomLevel(): number; - /** - * Sets the maximum and minimum zoom level. - */ - setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; - /** - * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. - */ - setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; - /** - * Sets a provider for spell checking in input fields and text areas. - */ - setSpellCheckProvider(language: string, autoCorrectWord: boolean, provider: { - /** - * @returns Whether the word passed is correctly spelled. - */ - spellCheck: (text: string) => boolean; - }): void; - /** - * Sets the scheme as secure scheme. Secure schemes do not trigger mixed content - * warnings. For example, https and data are secure schemes because they cannot be - * corrupted by active network attackers. - */ - registerURLSchemeAsSecure(scheme: string): void; - /** - * Resources will be loaded from this scheme regardless of the current page’s Content Security Policy. - */ - registerURLSchemeAsBypassingCSP(scheme: string): void; - /** - * Registers the scheme as secure, bypasses content security policy for resources, - * allows registering ServiceWorker and supports fetch API. - */ - registerURLSchemeAsPrivileged(scheme: string, options?: RegisterURLSchemeOptions): void; - /** - * Inserts text to the focused element. - */ - insertText(text: string): void; - /** - * Evaluates `code` in page. - * In the browser window some HTML APIs like `requestFullScreen` can only be - * invoked by a gesture from the user. Setting `userGesture` to `true` will remove - * this limitation. - * - * @returns Promise - */ - executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise; - /** - * @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; - } - - interface RegisterURLSchemeOptions { - secure?: boolean; - bypassCSP?: boolean; - allowServiceWorkers?: boolean; - supportFetchAPI?: boolean; - corsEnabled?: boolean; - } - - // https://github.com/electron/electron/blob/master/docs/api/web-view-tag.md - - /** - * Use the webview tag to embed 'guest' content (such as web pages) in your Electron app. - * The guest content is contained within the webview container. - * An embedded page within your app controls how the guest content is laid out and rendered. - * - * Unlike an iframe, the webview runs in a separate process than your app. - * It doesn't have the same permissions as your web page and all interactions between your app - * and embedded content will be asynchronous. This keeps your app safe from the embedded content. - */ - interface WebViewElement extends HTMLElement { - /** - * Returns the visible URL. Writing to this attribute initiates top-level navigation. - * Assigning src its own value will reload the current page. - * The src attribute can also accept data URLs, such as data:text/plain,Hello, world!. - */ - src: string; - /** - * If "on", the webview container will automatically resize within the bounds specified - * by the attributes minwidth, minheight, maxwidth, and maxheight. - * These constraints do not impact the webview unless autosize is enabled. - * When autosize is enabled, the webview container size cannot be less than - * the minimum values or greater than the maximum. - */ - autosize: string; - /** - * If "on", the guest page in webview will have node integration and can use node APIs - * like require and process to access low level system resources. - */ - nodeintegration: string; - /** - * If "on", the guest page in webview will be able to use browser plugins. - */ - plugins: string; - /** - * Specifies a script that will be loaded before other scripts run in the guest page. - * The protocol of script's URL must be either file: or asar:, - * because it will be loaded by require in guest page under the hood. - * - * When the guest page doesn't have node integration this script will still have access to all Node APIs, - * but global objects injected by Node will be deleted after this script has finished executing. - */ - preload: string; - /** - * Sets the referrer URL for the guest page. - */ - httpreferrer: string; - /** - * Sets the user agent for the guest page before the page is navigated to. - * Once the page is loaded, use the setUserAgent method to change the user agent. - */ - useragent: string; - /** - * If "on", the guest page will have web security disabled. - */ - disablewebsecurity: string; - /** - * Sets the session used by the page. If partition starts with persist:, - * the page will use a persistent session available to all pages in the app with the same partition. - * If there is no persist: prefix, the page will use an in-memory session. - * By assigning the same partition, multiple pages can share the same session. - * If the partition is unset then default session of the app will be used. - * - * This value can only be modified before the first navigation, - * since the session of an active renderer process cannot change. - * Subsequent attempts to modify the value will fail with a DOM exception. - */ - partition: string; - /** - * If "on", the guest page will be allowed to open new windows. - */ - allowpopups: string; - /** - * A list of strings which specifies the web preferences to be set on the webview, separated by ,. - */ - webpreferences: string; - /** - * 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; - /** - * A value that links the webview to a specific webContents. - * When a webview first loads a new webContents is created and this attribute is set - * to its instance identifier. Setting this attribute on a new or existing webview connects - * it to the existing webContents that currently renders in a different webview. - * - * The existing webview will see the destroy event and will then create a new webContents when a new url is loaded. - */ - guestinstance: string; - /** - * Loads the url in the webview, the url must contain the protocol prefix, e.g. the http:// or file://. - */ - loadURL(url: string, options?: LoadURLOptions): void; - /** - * @returns URL of guest page. - */ - getURL(): string; - /** - * @returns The title of guest page. - */ - getTitle(): string; - /** - * @returns Whether the web page is destroyed. - */ - isDestroyed(): boolean; - /** - * @returns Whether the web page is focused. - */ - isFocused(): boolean; - /** - * @returns Whether guest page is still loading resources. - */ - isLoading(): boolean; - /** - * Returns a boolean whether the guest page is waiting for a first-response for the main resource of the page. - */ - isWaitingForResponse(): boolean; - /** - * Stops any pending navigation. - */ - stop(): void; - /** - * Reloads the guest page. - */ - reload(): void; - /** - * Reloads the guest page and ignores cache. - */ - reloadIgnoringCache(): void; - /** - * @returns Whether the guest page can go back. - */ - canGoBack(): boolean; - /** - * @returns Whether the guest page can go forward. - */ - canGoForward(): boolean; - /** - * @returns Whether the guest page can go to offset. - */ - canGoToOffset(offset: number): boolean; - /** - * Clears the navigation history. - */ - clearHistory(): void; - /** - * Makes the guest page go back. - */ - goBack(): void; - /** - * Makes the guest page go forward. - */ - goForward(): void; - /** - * Navigates to the specified absolute index. - */ - goToIndex(index: number): void; - /** - * Navigates to the specified offset from the "current entry". - */ - goToOffset(offset: number): void; - /** - * @returns Whether the renderer process has crashed. - */ - isCrashed(): boolean; - /** - * Overrides the user agent for the guest page. - */ - setUserAgent(userAgent: string): void; - /** - * @returns The user agent for guest page. - */ - getUserAgent(): string; - /** - * Injects CSS into the guest page. - */ - insertCSS(css: string): void; - /** - * Evaluates code in page. If userGesture is set, it will create the user gesture context in the page. - * HTML APIs like requestFullScreen, which require user action, can take advantage of this option for automation. - * - * @returns Promise - */ - executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise; - /** - * Opens a DevTools window for guest page. - */ - openDevTools(): void; - /** - * Closes the DevTools window of guest page. - */ - closeDevTools(): void; - /** - * @returns Whether guest page has a DevTools window attached. - */ - isDevToolsOpened(): boolean; - /** - * @returns Whether DevTools window of guest page is focused. - */ - isDevToolsFocused(): boolean; - /** - * Starts inspecting element at position (x, y) of guest page. - */ - inspectElement(x: number, y: number): void; - /** - * Opens the DevTools for the service worker context present in the guest page. - */ - inspectServiceWorker(): void; - /** - * Set guest page muted. - */ - setAudioMuted(muted: boolean): void; - /** - * @returns Whether guest page has been muted. - */ - isAudioMuted(): boolean; - /** - * Executes editing command undo in page. - */ - undo(): void; - /** - * Executes editing command redo in page. - */ - redo(): void; - /** - * Executes editing command cut in page. - */ - cut(): void; - /** - * Executes editing command copy in page. - */ - copy(): void; - /** - * Executes editing command paste in page. - */ - paste(): void; - /** - * Executes editing command pasteAndMatchStyle in page. - */ - pasteAndMatchStyle(): void; - /** - * Executes editing command delete in page. - */ - delete(): void; - /** - * Executes editing command selectAll in page. - */ - selectAll(): void; - /** - * Executes editing command unselect in page. - */ - unselect(): void; - /** - * Executes editing command replace in page. - */ - replace(text: string): void; - /** - * Executes editing command replaceMisspelling in page. - */ - replaceMisspelling(text: string): void; - /** - * Inserts text to the focused element. - */ - insertText(text: string): void; - /** - * Starts a request to find all matches for the text in the web page. - * The result of the request can be obtained by subscribing to found-in-page event. - * @returns The request id used for the request. - */ - findInPage(text: string, options?: FindInPageOptions): number; - /** - * Stops any findInPage request for the webview with the provided action. - */ - stopFindInPage(action: StopFindInPageAtion): void; - /** - * Prints webview's web page. Same with webContents.print([options]). - */ - print(options?: PrintOptions): void; - /** - * Prints webview's web page as PDF, Same with webContents.printToPDF(options, callback) - */ - printToPDF(options: PrintToPDFOptions, callback: (error: Error, data: Buffer) => void): void; - /** - * Send an asynchronous message to renderer process via channel, you can also send arbitrary arguments. - * The renderer process can handle the message by listening to the channel event with the ipcRenderer module. - * See webContents.send for examples. - */ - send(channel: string, ...args: any[]): void; - /** - * Sends an input event to the page. - * See webContents.sendInputEvent for detailed description of event object. - */ - sendInputEvent(event: SendInputEvent): void - /** - * Changes the zoom factor to the specified factor. - * Zoom factor is zoom percent divided by 100, so 300% = 3.0. - */ - setZoomFactor(factor: number): 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; - /** - * 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. - */ - addEventListener(type: 'load-commit', listener: (event: WebViewElement.LoadCommitEvent) => void, useCapture?: boolean): void; - /** - * Fired when the navigation is done, i.e. the spinner of the tab will stop spinning, and the onload event is dispatched. - */ - addEventListener(type: 'did-finish-load', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * This event is like did-finish-load, but fired when the load failed or was cancelled, e.g. window.stop() is invoked. - */ - addEventListener(type: 'did-fail-load', listener: (event: WebViewElement.DidFailLoadEvent) => void, useCapture?: boolean): void; - /** - * Fired when a frame has done navigation. - */ - addEventListener(type: 'did-frame-finish-load', listener: (event: WebViewElement.DidFrameFinishLoadEvent) => void, useCapture?: boolean): void; - /** - * Corresponds to the points in time when the spinner of the tab starts spinning. - */ - addEventListener(type: 'did-start-loading', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Corresponds to the points in time when the spinner of the tab stops spinning. - */ - addEventListener(type: 'did-stop-loading', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when details regarding a requested resource is available. - * status indicates socket connection to download the resource. - */ - addEventListener(type: 'did-get-response-details', listener: (event: WebViewElement.DidGetResponseDetails) => void, useCapture?: boolean): void; - /** - * Fired when a redirect was received while requesting a resource. - */ - addEventListener(type: 'did-get-redirect-request', listener: (event: WebViewElement.DidGetRedirectRequestEvent) => void, useCapture?: boolean): void; - /** - * Fired when document in the given frame is loaded. - */ - addEventListener(type: 'dom-ready', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when page title is set during navigation. explicitSet is false when title is synthesized from file URL. - */ - addEventListener(type: 'page-title-updated', listener: (event: WebViewElement.PageTitleUpdatedEvent) => void, useCapture?: boolean): void; - /** - * Fired when page receives favicon URLs. - */ - addEventListener(type: 'page-favicon-updated', listener: (event: WebViewElement.PageFaviconUpdatedEvent) => void, useCapture?: boolean): void; - /** - * Fired when page enters fullscreen triggered by HTML API. - */ - addEventListener(type: 'enter-html-full-screen', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when page leaves fullscreen triggered by HTML API. - */ - addEventListener(type: 'leave-html-full-screen', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when the guest window logs a console message. - */ - addEventListener(type: 'console-message', listener: (event: WebViewElement.ConsoleMessageEvent) => void, useCapture?: boolean): void; - /** - * Fired when a result is available for webview.findInPage request. - */ - addEventListener(type: 'found-in-page', listener: (event: WebViewElement.FoundInPageEvent) => void, useCapture?: boolean): void; - /** - * Fired when the guest page attempts to open a new browser window. - */ - addEventListener(type: 'new-window', listener: (event: WebViewElement.NewWindowEvent) => void, useCapture?: boolean): void; - /** - * Emitted when a user or the page wants to start navigation. - * It can happen when the window.location object is changed or a user clicks a link in the page. - * - * This event will not emit when the navigation is started programmatically with APIs - * like .loadURL and .back. - * - * It is also not emitted during in-page navigation, such as clicking anchor links - * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. - * - * Calling event.preventDefault() does NOT have any effect. - */ - addEventListener(type: 'will-navigate', listener: (event: WebViewElement.WillNavigateEvent) => void, useCapture?: boolean): void; - /** - * Emitted when a navigation is done. - * - * This event is not emitted for in-page navigations, such as clicking anchor links - * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. - */ - addEventListener(type: 'did-navigate', listener: (event: WebViewElement.DidNavigateEvent) => void, useCapture?: boolean): void; - /** - * Emitted when an in-page navigation happened. - * - * When in-page navigation happens, the page URL changes but does not cause - * navigation outside of the page. Examples of this occurring are when anchor links - * are clicked or when the DOM hashchange event is triggered. - */ - addEventListener(type: 'did-navigate-in-page', listener: (event: WebViewElement.DidNavigateInPageEvent) => void, useCapture?: boolean): void; - /** - * Fired when the guest page attempts to close itself. - */ - addEventListener(type: 'close', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when the guest page has sent an asynchronous message to embedder page. - */ - addEventListener(type: 'ipc-message', listener: (event: WebViewElement.IpcMessageEvent) => void, useCapture?: boolean): void; - /** - * Fired when the renderer process is crashed. - */ - addEventListener(type: 'crashed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when the gpu process is crashed. - */ - addEventListener(type: 'gpu-crashed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when a plugin process is crashed. - */ - addEventListener(type: 'plugin-crashed', listener: (event: WebViewElement.PluginCrashedEvent) => void, useCapture?: boolean): void; - /** - * Fired when the WebContents is destroyed. - */ - addEventListener(type: 'destroyed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Emitted when media starts playing. - */ - addEventListener(type: 'media-started-playing', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Emitted when media is paused or done playing. - */ - addEventListener(type: 'media-paused', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Emitted when a page's theme color changes. This is usually due to encountering a meta tag: - * - */ - 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. - */ - addEventListener(type: 'devtools-opened', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Emitted when DevTools is closed. - */ - addEventListener(type: 'devtools-closed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Emitted when DevTools is focused / opened. - */ - addEventListener(type: 'devtools-focused', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - addEventListener(type: string, listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - } - - namespace WebViewElement { - type Event = ElectronPrivate.GlobalEvent; - - interface LoadCommitEvent extends Event { - url: string; - isMainFrame: boolean; - } - - interface DidFailLoadEvent extends Event { - errorCode: number; - errorDescription: string; - validatedURL: string; - isMainFrame: boolean; - } - - interface DidFrameFinishLoadEvent extends Event { - isMainFrame: boolean; - } - - interface DidGetResponseDetails extends Event { - status: boolean; - newURL: string; - originalURL: string; - httpResponseCode: number; - requestMethod: string; - referrer: string; - headers: Headers; - resourceType: string; - } - - interface DidGetRedirectRequestEvent extends Event { - oldURL: string; - newURL: string; - isMainFrame: boolean; - httpResponseCode: number; - requestMethod: string; - referrer: string; - headers: Headers; - } - - interface PageTitleUpdatedEvent extends Event { - title: string; - explicitSet: string; - } - - interface PageFaviconUpdatedEvent extends Event { - favicons: string[]; - } - - interface ConsoleMessageEvent extends Event { - level: number; - message: string; - line: number; - sourceId: string; - } - - interface FoundInPageEvent extends Event { - result: FoundInPageResult; - } - - interface NewWindowEvent extends Event { - url: string; - frameName: string; - disposition: NewWindowDisposition; - options: BrowserWindowOptions; - } - - interface WillNavigateEvent extends Event { - url: string; - } - - interface DidNavigateEvent extends Event { - url: string; - } - - interface DidNavigateInPageEvent extends Event { - url: string; - isMainFrame: boolean; - } - - interface IpcMessageEvent extends Event { - channel: string; - args: any[]; - } - - interface PluginCrashedEvent extends Event { - name: string; - version: string; - } - - interface DidChangeThemeColorEvent extends Event { - themeColor: string; - } - - interface UpdateTargetUrlEvent extends Event { - url: string; - } - } - - /** - * The BrowserWindowProxy object is returned from window.open and provides limited functionality with the child window. - */ - interface BrowserWindowProxy { - /** - * Removes focus from the child window. - */ - blur(): void; - /** - * Forcefully closes the child window without calling its unload event. - */ - close(): void; - /** - * Set to true after the child window gets closed. - */ - closed: boolean; - /** - * Evaluates the code in the child window. - */ - eval(code: string): void; - /** - * Focuses the child window (brings the window to front). - */ - focus(): void; - /** - * Sends a message to the child window with the specified origin or * for no origin preference. - * In addition to these methods, the child window implements window.opener object with no - * 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 - - interface CommonElectron { - clipboard: Electron.Clipboard; - crashReporter: Electron.CrashReporter; - nativeImage: typeof Electron.NativeImage; - shell: Electron.Shell; - - app: Electron.App; - autoUpdater: Electron.AutoUpdater; - BrowserWindow: typeof Electron.BrowserWindow; - contentTracing: Electron.ContentTracing; - dialog: Electron.Dialog; - ipcMain: Electron.IpcMain; - globalShortcut: Electron.GlobalShortcut; - Menu: typeof Electron.Menu; - MenuItem: typeof Electron.MenuItem; - net: Electron.Net; - powerMonitor: Electron.PowerMonitor; - powerSaveBlocker: Electron.PowerSaveBlocker; - protocol: Electron.Protocol; - screen: Electron.Screen; - session: typeof Electron.Session; - systemPreferences: Electron.SystemPreferences; - Tray: typeof Electron.Tray; - webContents: Electron.WebContentsStatic; - } - - interface ElectronMainAndRenderer extends CommonElectron { - desktopCapturer: Electron.DesktopCapturer; - ipcRenderer: Electron.IpcRenderer; - remote: Electron.Remote; - webFrame: Electron.WebFrame; - } -} - -declare namespace ElectronPrivate { - type GlobalEvent = Event; -} - -interface Document { - createElement(tagName: 'webview'): Electron.WebViewElement; -} - -// https://github.com/electron/electron/blob/master/docs/api/window-open.md - -interface Window { - /** - * Creates a new window. - */ - open(url: string, frameName?: string, features?: string): Electron.BrowserWindowProxy; -} - -// https://github.com/electron/electron/blob/master/docs/api/file-object.md - -interface File { - /** - * Exposes the real path of the filesystem. - */ - path: string; -} - -// 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 - */ - type: 'browser' | 'renderer'; - /** - * Path to JavaScript source code. - */ - resourcesPath: string; - /** - * For Mac App Store build, this value is true, for other builds it is undefined. - */ - mas?: boolean; - /** - * 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; - /** - * Causes the main thread of the current process crash; - */ - crash(): void; - /** - * Causes the main thread of the current process hang. - */ - hang(): void; - /** - * 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 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; - } -} - -declare module 'electron' { - var electron: Electron.ElectronMainAndRenderer; - export = electron; -} - -interface NodeRequireFunction { - (moduleName: 'electron'): Electron.ElectronMainAndRenderer; -} diff --git a/types/electron/test/index.ts b/types/electron/test/index.ts deleted file mode 100644 index 8ae462139a..0000000000 --- a/types/electron/test/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import electron = require('electron'); -import child_process = require('child_process'); - -// TODO -child_process.spawn(electron as any); diff --git a/types/electron/test/main.ts b/types/electron/test/main.ts deleted file mode 100644 index 0f3f17ca33..0000000000 --- a/types/electron/test/main.ts +++ /dev/null @@ -1,1138 +0,0 @@ - -import { - app, - autoUpdater, - BrowserWindow, - contentTracing, - dialog, - globalShortcut, - ipcMain, - Menu, - MenuItem, - net, - powerMonitor, - powerSaveBlocker, - protocol, - Tray, - clipboard, - crashReporter, - nativeImage, - screen, - shell, - session, - systemPreferences, - webContents -} from 'electron'; - -import * as path from 'path'; - -// Quick start -// https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md - -// Keep a global reference of the window object, if you don't, the window will -// be closed automatically when the javascript object is GCed. -var mainWindow: Electron.BrowserWindow = null; - -// Quit when all windows are closed. -app.on('window-all-closed', () => { - if (process.platform !== 'darwin') - app.quit(); -}); - -// Check single instance app -var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) { - // Someone tried to run a second instance, we should focus our window - if (mainWindow) { - if (mainWindow.isMinimized()) mainWindow.restore(); - mainWindow.focus(); - } -}); - -if (shouldQuit) { - app.quit(); - process.exit(0); -} - -// This method will be called when Electron has done everything -// initialization and ready for creating browser windows. -app.on('ready', () => { - // Create the browser window. - mainWindow = new BrowserWindow({ width: 800, height: 600 }); - - // and load the index.html of the app. - mainWindow.loadURL(`file://${__dirname}/index.html`); - mainWindow.loadURL('file://foo/bar', {userAgent: 'cool-agent', httpReferrer: 'greateRefferer'}); - mainWindow.webContents.loadURL('file://foo/bar', {userAgent: 'cool-agent', httpReferrer: 'greateRefferer'}); - mainWindow.webContents.loadURL('file://foo/bar', {userAgent: 'cool-agent', httpReferrer: 'greateRefferer', postData: [{type: 'blob', blobUUID: 'hogefuga'}]}); - - mainWindow.webContents.openDevTools(); - mainWindow.webContents.toggleDevTools(); - mainWindow.webContents.openDevTools({mode: 'detach'}); - mainWindow.webContents.closeDevTools(); - mainWindow.webContents.addWorkSpace('/path/to/workspace'); - mainWindow.webContents.removeWorkSpace('/path/to/workspace'); - var opened: boolean = mainWindow.webContents.isDevToolsOpened() - var focused = mainWindow.webContents.isDevToolsFocused(); - // Emitted when the window is closed. - mainWindow.on('closed', () => { - // Dereference the window object, usually you would store windows - // in an array if your app supports multi windows, this is the time - // when you should delete the corresponding element. - mainWindow = null; - }); - - mainWindow.webContents.setVisualZoomLevelLimits(50, 200); - mainWindow.webContents.setLayoutZoomLevelLimits(50, 200); - - mainWindow.webContents.print({silent: true, printBackground: false}); - mainWindow.webContents.print(); - - mainWindow.webContents.printToPDF({ - marginsType: 1, - pageSize: 'A3', - printBackground: true, - printSelectionOnly: true, - landscape: true, - }, (error: Error, data: Buffer) => {}); - - mainWindow.webContents.printToPDF({}, (err, data) => {}); - - mainWindow.webContents.executeJavaScript('return true;').then((v: boolean) => console.log(v)); - 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, - matchCase: false, - }); - mainWindow.webContents.stopFindInPage('clearSelection'); - mainWindow.webContents.stopFindInPage('keepSelection'); - mainWindow.webContents.stopFindInPage('activateSelection'); - - mainWindow.loadURL('https://github.com'); - - mainWindow.webContents.on('did-finish-load', function() { - mainWindow.webContents.savePage('/tmp/test.html', 'HTMLComplete', function(error) { - if (!error) - console.log("Save page successfully"); - }); - }); - - try { - mainWindow.webContents.debugger.attach("1.1"); - } catch(err) { - console.log("Debugger attach failed : ", err); - }; - - mainWindow.webContents.debugger.on('detach', function(event, reason) { - console.log("Debugger detached due to : ", reason); - }); - - mainWindow.webContents.debugger.on('message', function(event, method, params) { - if (method == "Network.requestWillBeSent") { - if (params.request.url == "https://www.github.com") { - win.webContents.debugger.detach(); - } - } - }); - - 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()); - }); - - mainWindow.setMenu(null); - mainWindow.setMenu(Menu.buildFromTemplate([])); -}); - -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 -app.getLocale(); - -// Desktop environment integration -// https://github.com/atom/electron/blob/master/docs/tutorial/desktop-environment-integration.md - -app.addRecentDocument('/Users/USERNAME/Desktop/work.type'); -app.clearRecentDocuments(); -var dockMenu = Menu.buildFromTemplate([ - { - label: 'New Window', - click: () => { - console.log('New Window'); - } - }, - { - label: 'New Window with Settings', - submenu: [ - { label: 'Basic' }, - { label: 'Pro' } - ] - }, - { label: 'New Command...' }, - { - label: 'Edit', - submenu: [ - { - label: 'Undo', - accelerator: 'CmdOrCtrl+Z', - role: 'undo' - }, - { - label: 'Redo', - accelerator: 'Shift+CmdOrCtrl+Z', - role: 'redo' - }, - { - type: 'separator' - }, - { - label: 'Cut', - accelerator: 'CmdOrCtrl+X', - role: 'cut' - }, - { - label: 'Copy', - accelerator: 'CmdOrCtrl+C', - role: 'copy' - }, - { - label: 'Paste', - accelerator: 'CmdOrCtrl+V', - role: 'paste' - }, - ] - }, -]); -app.dock.setMenu(dockMenu); -app.dock.setBadge('foo'); -var id = app.dock.bounce('informational'); -app.dock.cancelBounce(id); -app.dock.setIcon('/path/to/icon.png'); - -app.setBadgeCount(app.getBadgeCount() + 1); - -app.setUserTasks([ - { - program: process.execPath, - arguments: '--new-window', - iconPath: process.execPath, - iconIndex: 0, - title: 'New Window', - description: 'Create a new window' - } -]); -app.setUserTasks([]); - -app.setJumpList([ - { - type: 'custom', - name: 'Recent Projects', - items: [ - { type: 'file', path: 'C:\\Projects\\project1.proj' }, - { type: 'file', path: 'C:\\Projects\\project2.proj' } - ] - }, - { // has a name so type is assumed to be "custom" - name: 'Tools', - items: [ - { - type: 'task', - title: 'Tool A', - program: process.execPath, - args: '--run-tool-a', - iconPath: process.execPath, - iconIndex: 0, - description: 'Runs Tool A' - }, - { - type: 'task', - title: 'Tool B', - program: process.execPath, - args: '--run-tool-b', - iconPath: process.execPath, - iconIndex: 0, - description: 'Runs Tool B' - }] - }, - { - type: 'frequent' - }, - { // has no name and no type so type is assumed to be "tasks" - items: [ - { - type: 'task', - title: 'New Project', - program: process.execPath, - args: '--new-project', - description: 'Create a new project.' - }, - { - type: 'separator' - }, - { - type: 'task', - title: 'Recover Project', - program: process.execPath, - args: '--recover-project', - description: 'Recover Project' - }] - } -]); - -if (app.isUnityRunning()) { -} -if (app.isAccessibilitySupportEnabled()) { -} -app.setLoginItemSettings({openAtLogin: true, openAsHidden: false}); -console.log(app.getLoginItemSettings().wasOpenedAtLogin); -app.setAboutPanelOptions({ - applicationName: 'Test', - version: '1.2.3' -}); - -var window = new BrowserWindow(); -window.setProgressBar(0.5); -window.setRepresentedFilename('/etc/passwd'); -window.setDocumentEdited(true); -window.previewFile('/path/to/file'); -window.previewFile('/path/to/file', 'Displayed Name'); -window.setVibrancy('light'); -window.setVibrancy('titlebar'); - -// Online/Offline Event Detection -// https://github.com/atom/electron/blob/master/docs/tutorial/online-offline-events.md - -var onlineStatusWindow: Electron.BrowserWindow; - -app.on('ready', () => { - onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false, vibrancy: 'sidebar' }); - 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); -}); - -// Synopsis -// https://github.com/atom/electron/blob/master/docs/api/synopsis.md - -app.on('ready', () => { - window = new BrowserWindow({ - width: 800, - height: 600, - titleBarStyle: 'hidden-inset', - }); - window.loadURL('https://github.com'); -}); - -// Supported Chrome command line switches -// https://github.com/atom/electron/blob/master/docs/api/chrome-command-line-switches.md - -app.commandLine.appendSwitch('remote-debugging-port', '8315'); -app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1'); -app.commandLine.appendSwitch('vmodule', 'console=0'); - -// systemPreferences -// https://github.com/electron/electron/blob/master/docs/api/system-preferences.md - -var browserOptions = { - width: 1000, - height: 800, - transparent: false, - frame: true -}; - -// Make the window transparent only if the platform supports it. -if (process.platform !== 'win32' || systemPreferences.isAeroGlassEnabled()) { - browserOptions.transparent = true; - browserOptions.frame = false; -} - -if (process.platform === 'win32') { - systemPreferences.on('color-changed', () => { console.log('color changed'); }); - systemPreferences.on('inverted-color-scheme-changed', (_, inverted) => console.log(inverted ? 'inverted' : 'not inverted')); - console.log('Color for menu is', systemPreferences.getColor('menu')); -} - -// Create the window. -var win = new BrowserWindow(browserOptions); - -// Navigate. -if (browserOptions.transparent) { - win.loadURL('file://' + __dirname + '/index.html'); -} else { - // No transparency, so we load a fallback that uses basic styles. - win.loadURL('file://' + __dirname + '/fallback.html'); -} - -// 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") { - // Verification logic. - event.preventDefault(); - callback(true); - } else { - callback(false); - } -}); - -app.on('select-client-certificate', function(event, webContents, url, list, callback) { - event.preventDefault(); - callback(list[0]); -}); - -app.on('login', function(event, webContents, request, authInfo, callback) { - event.preventDefault(); - 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 - -autoUpdater.setFeedURL('http://mycompany.com/myapp/latest?version=' + app.getVersion()); -autoUpdater.checkForUpdates(); -autoUpdater.quitAndInstall(); - -autoUpdater.on('error', (error) => { - console.log('error', error); -}); - -autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName, releaseDate, updateURL) => { - console.log('update-downloaded', releaseNotes, releaseName, releaseDate, updateURL); -}); - -// browser-window -// https://github.com/atom/electron/blob/master/docs/api/browser-window.md - -var win = new BrowserWindow({ width: 800, height: 600, show: false }); -win.on('closed', () => { - win = null; -}); - -win.loadURL('https://github.com'); -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 - -const options = { - categoryFilter: '*', - traceOptions: 'record-until-full,enable-sampling' -} - -contentTracing.startRecording(options, function() { - console.log('Tracing started'); - setTimeout(function() { - contentTracing.stopRecording('', function(path) { - console.log('Tracing data recorded to ' + path); - }); - }, 5000); -}); - -// dialog -// https://github.com/atom/electron/blob/master/docs/api/dialog.md - -// variant without browserWindow -var openDialogResult: string[] = dialog.showOpenDialog({ - title: 'Testing showOpenDialog', - defaultPath: '/var/log/syslog', - filters: [{name: '', extensions: ['']}], - properties: ['openFile', 'openDirectory', 'multiSelections'] -}); - -// variant with browserWindow -openDialogResult = dialog.showOpenDialog(win, { - title: 'Testing showOpenDialog', - defaultPath: '/var/log/syslog', - filters: [{name: '', extensions: ['']}], - properties: ['openFile', 'openDirectory', 'multiSelections'] -}); - -// global-shortcut -// https://github.com/atom/electron/blob/master/docs/api/global-shortcut.md - -// Register a 'ctrl+x' shortcut listener. -var ret = globalShortcut.register('ctrl+x', () => { - console.log('ctrl+x is pressed'); -}); -if (!ret) - console.log('registerion fails'); - -// Check whether a shortcut is registered. -console.log(globalShortcut.isRegistered('ctrl+x')); - -// Unregister a shortcut. -globalShortcut.unregister('ctrl+x'); - -// Unregister all shortcuts. -globalShortcut.unregisterAll(); - -// ipcMain -// https://github.com/atom/electron/blob/master/docs/api/ipc-main-process.md - -ipcMain.on('asynchronous-message', (event: Electron.IpcMainEvent, arg: any) => { - console.log(arg); // prints "ping" - event.sender.send('asynchronous-reply', 'pong'); -}); - -ipcMain.on('synchronous-message', (event: Electron.IpcMainEvent, arg: any) => { - console.log(arg); // prints "ping" - 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 - -var menuItem = new MenuItem({ - click: (menuItem: Electron.MenuItem, browserWindow: Electron.BrowserWindow, event: Electron.Event) => { - console.log('click', menuItem, browserWindow, event); - } -}); - -const fakeEvent: Electron.Event = { - preventDefault: () => { }, - sender: winWindows.webContents, -} - -menuItem.label = 'Hello World!'; -menuItem.click(fakeEvent, winWindows, winWindows.webContents) - -// menu -// https://github.com/atom/electron/blob/master/docs/api/menu.md - -var menu = new Menu(); -menu.append(new MenuItem({ label: 'MenuItem1', click: () => { console.log('item 1 clicked'); } })); -menu.append(new MenuItem({ type: 'separator' })); -menu.append(new MenuItem({ label: 'MenuItem2', type: 'checkbox', checked: true })); -menu.insert(0, menuItem); - -console.log(menu.items); - -var pos = screen.getCursorScreenPoint(); -menu.popup(null, pos.x, pos.y); - -// main.js -var template = [ - { - label: 'Electron', - submenu: [ - { - label: 'About Electron', - role: 'about' - }, - { - type: 'separator' - }, - { - label: 'Services', - role: 'services', - submenu: [] - }, - { - type: 'separator' - }, - { - label: 'Hide Electron', - accelerator: 'Command+H', - role: 'hide' - }, - { - label: 'Hide Others', - accelerator: 'Command+Shift+H', - role: 'hideothers' - }, - { - label: 'Show All', - role: 'unhide' - }, - { - type: 'separator' - }, - { - label: 'Quit', - accelerator: 'Command+Q', - click: () => { app.quit(); } - } - ] - }, - { - label: 'Edit', - submenu: [ - { - label: 'Undo', - accelerator: 'Command+Z', - role: 'undo' - }, - { - label: 'Redo', - accelerator: 'Shift+Command+Z', - role: 'redo' - }, - { - type: 'separator' - }, - { - label: 'Cut', - accelerator: 'Command+X', - role: 'cut' - }, - { - label: 'Copy', - accelerator: 'Command+C', - role: 'copy' - }, - { - label: 'Paste', - accelerator: 'Command+V', - role: 'paste' - }, - { - label: 'Select All', - accelerator: 'Command+A', - role: 'selectall' - } - ] - }, - { - label: 'View', - submenu: [ - { - label: 'Reload', - accelerator: 'Command+R', - click: (item, focusedWindow) => { - if (focusedWindow) { - focusedWindow.webContents.reloadIgnoringCache(); - } - } - }, - { - label: 'Toggle DevTools', - accelerator: 'Alt+Command+I', - click: (item, focusedWindow) => { - if (focusedWindow) { - 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) - }); - } - } - } - ] - }, - { - label: 'Window', - submenu: [ - { - label: 'Minimize', - accelerator: 'Command+M', - role: 'minimize' - }, - { - label: 'Close', - accelerator: 'Command+W', - role: 'close' - }, - { - type: 'separator' - }, - { - label: 'Bring All to Front', - role: 'front' - } - ] - }, - { - label: 'Help', - submenu: [] - } -]; - -menu = Menu.buildFromTemplate(template); - -Menu.setApplicationMenu(menu); // Must be called within app.on('ready', function(){ ... }); -Menu.setApplicationMenu(null); - -Menu.buildFromTemplate([ - { label: '4', id: '4' }, - { label: '5', id: '5' }, - { label: '1', id: '1', position: 'before=4' }, - { label: '2', id: '2' }, - { label: '3', id: '3' } -]); - -Menu.buildFromTemplate([ - { label: 'a', position: 'endof=letters' }, - { label: '1', position: 'endof=numbers' }, - { label: 'b', position: 'endof=letters' }, - { label: '2', position: 'endof=numbers' }, - { label: 'c', position: 'endof=letters' }, - { label: '3', position: 'endof=numbers' } -]); - -// net -// https://github.com/electron/electron/blob/master/docs/api/net.md - -app.on('ready', () => { - const request = net.request('https://github.com') - request.setHeader('Some-Custom-Header-Name', 'Some-Custom-Header-Value'); - let header = request.getHeader('Some-Custom-Header-Name'); - request.removeHeader('Some-Custom-Header-Name'); - request.on('response', (response) => { - console.log(`Status code: ${response.statusCode}`); - console.log(`Status message: ${response.statusMessage}`); - console.log(`Headers: ${JSON.stringify(response.headers)}`); - console.log(`Http version: ${response.httpVersion}`); - console.log(`Major Http version: ${response.httpVersionMajor}`); - console.log(`Minor Http version: ${response.httpVersionMinor}`); - response.on('data', (chunk) => { - console.log(`BODY: ${chunk}`); - }) - response.on('end', () => { - console.log('No more data in response.'); - }) - response.on('error', () => { - console.log('"error" event emitted'); - }); - response.on('aborted', () => { - console.log('"aborted" event emitted'); - }); - }) - request.on('login', (authInfo, callback) => { - callback('username', 'password'); - }); - request.on('finish', () => { - console.log('"finish" event emitted'); - }); - request.on('abort', () => { - console.log('"abort" event emitted'); - }); - request.on('error', () => { - console.log('"error" event emitted'); - }); - request.write('Hello World!', 'utf-8', () => { }); - request.end('Hello World!', 'utf-8', () => { }); - request.abort(); -}) - -// power-monitor -// https://github.com/atom/electron/blob/master/docs/api/power-monitor.md - -app.on('ready', () => { - powerMonitor.on('suspend', () => { - console.log('The system is going to sleep'); - }); - powerMonitor.on('resume', () => { - console.log('The system has resumed from sleep'); - }); - powerMonitor.on('on-ac', () => { - console.log('The system changed to AC power') - }); - powerMonitor.on('on-battery', () => { - console.log('The system changed to battery power'); - }); -}); - -// power-save-blocker -// https://github.com/atom/electron/blob/master/docs/api/power-save-blocker.md - -var id = powerSaveBlocker.start('prevent-display-sleep'); -console.log(powerSaveBlocker.isStarted(id)); - -powerSaveBlocker.stop(id); - -// protocol -// https://github.com/atom/electron/blob/master/docs/api/protocol.md - -app.on('ready', () => { - protocol.registerStandardSchemes(['https']); - protocol.registerServiceWorkerSchemes(['https']); - - protocol.registerFileProtocol('atom', (request, callback) => { - callback(`${__dirname}/${request.url}`); - }); - - protocol.registerBufferProtocol('atom', (request, callback) => { - callback({mimeType: 'text/html', data: new Buffer('
Response
')}); - }); - - protocol.registerStringProtocol('atom', (request, callback) => { - callback('Hello World!'); - }); - - protocol.registerHttpProtocol('atom', (request, callback) => { - callback({url: request.url, method: request.method}); - }); - - protocol.unregisterProtocol('atom', (error) => { - console.log(error ? error.message : 'ok'); - }); - - protocol.isProtocolHandled('atom', (handled) => { - console.log(handled); - }); -}); - -// tray -// https://github.com/atom/electron/blob/master/docs/api/tray.md - -var appIcon: Electron.Tray = null; -app.on('ready', () => { - appIcon = new Tray('/path/to/my/icon'); - var contextMenu = Menu.buildFromTemplate([ - { label: 'Item1', type: 'radio' }, - { label: 'Item2', type: 'radio' }, - { label: 'Item3', type: 'radio', checked: true }, - { label: 'Item4', type: 'radio' }, - ]); - appIcon.setToolTip('This is my application.'); - appIcon.setContextMenu(contextMenu); - appIcon.setImage('/path/to/new/icon'); - appIcon.popUpContextMenu(contextMenu, {x: 100, y: 100}); - - appIcon.on('click', (event, bounds) => { - console.log('click', event, bounds); - }); - - appIcon.on('ballon-show', () => { - console.log('ballon-show'); - }); - - appIcon.displayBalloon({ - title: 'Hello World!' - }); -}); - -// clipboard -// https://github.com/atom/electron/blob/master/docs/api/clipboard.md - -{ - let str: string; - clipboard.writeText('Example String'); - clipboard.writeText('Example String', 'selection'); - clipboard.writeBookmark('foo', 'http://example.com'); - clipboard.writeBookmark('foo', 'http://example.com', 'selection'); - clipboard.writeFindText('foo'); - str = clipboard.readText('selection'); - str = clipboard.readFindText(); - console.log(clipboard.availableFormats()); - console.log(clipboard.readBookmark().title); - clipboard.clear(); - - clipboard.write({ - html: '', - text: 'Hello World!', - image: clipboard.readImage() - }); -} - -// crash-reporter -// https://github.com/atom/electron/blob/master/docs/api/crash-reporter.md - -crashReporter.start({ - productName: 'YourName', - companyName: 'YourCompany', - submitURL: 'https://your-domain.com/url-to-submit', - autoSubmit: true, - extra: { - someKey: "value" - } -}); - -console.log(crashReporter.getLastCrashReport()); -console.log(crashReporter.getUploadedReports()); - -// nativeImage -// https://github.com/atom/electron/blob/master/docs/api/native-image.md - -var appIcon2 = new Tray('/Users/somebody/images/icon.png'); -var window2 = new BrowserWindow({ icon: '/Users/somebody/images/window.png' }); -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); -console.log(process.windowsStore); -process.noAsar = true; -process.crash(); -process.hang(); -process.setFdLimit(8192); - -// screen -// https://github.com/atom/electron/blob/master/docs/api/screen.md - -app.on('ready', () => { - var size = screen.getPrimaryDisplay().workAreaSize; - mainWindow = new BrowserWindow({ width: size.width, height: size.height }); -}); - -app.on('ready', () => { - var displays = screen.getAllDisplays(); - var externalDisplay: any = null; - for (var i in displays) { - if (displays[i].bounds.x > 0 || displays[i].bounds.y > 0) { - externalDisplay = displays[i]; - break; - } - } - - if (externalDisplay) { - mainWindow = new BrowserWindow({ - x: externalDisplay.bounds.x + 50, - y: externalDisplay.bounds.y + 50, - }); - } - - screen.on('display-added', (event, display) => { - console.log('display-added', display); - }); - - screen.on('display-removed', (event, display) => { - console.log('display-removed', display); - }); - - screen.on('display-metrics-changed', (event, display, changes) => { - console.log('display-metrics-changed', display, changes); - }); -}); - -// shell -// https://github.com/atom/electron/blob/master/docs/api/shell.md - -shell.showItemInFolder('/home/user/Desktop/test.txt'); -shell.openItem('/home/user/Desktop/test.txt'); -shell.moveItemToTrash('/home/user/Desktop/test.txt'); - -shell.openExternal('https://github.com', { - activate: false -}); - -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 - -session.defaultSession.on('will-download', (event, item, webContents) => { - event.preventDefault(); - require('request')(item.getURL(), (data: any) => { - require('fs').writeFileSync('/somewhere', data); - }); -}); - -// Query all cookies. -session.defaultSession.cookies.get({}, (error, cookies) => { - console.log(cookies); -}); - -// Query all cookies associated with a specific url. -session.defaultSession.cookies.get({ url : "http://www.github.com" }, (error, cookies) => { - console.log(cookies); -}); - -// Set a cookie with the given cookie data; -// may overwrite equivalent cookies if they exist. -var cookie = { url : "http://www.github.com", name : "dummy_name", value : "dummy" }; -session.defaultSession.cookies.set(cookie, (error) => { - if (error) { - console.error(error); - } -}); - -// In the main process. -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', (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 failed: ${state}`) - } - }); -}); - -// To emulate a GPRS connection with 50kbps throughput and 500 ms latency. -session.defaultSession.enableNetworkEmulation({ - latency: 500, - downloadThroughput: 6400, - uploadThroughput: 6400 -}); - -// To emulate a network outage. -session.defaultSession.enableNetworkEmulation({ - offline: true -}); - -session.defaultSession.setCertificateVerifyProc((hostname, cert, callback) => { - callback((hostname === 'github.com') ? true : false); - console.log(cert.issuer.commonName); -}); - -session.defaultSession.setPermissionRequestHandler(function(webContents, permission, callback) { - if (webContents.getURL() === 'github.com') { - if (permission == "notifications") { - callback(false); - return; - } - } - - 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"] -}; - -session.defaultSession.webRequest.onBeforeSendHeaders(filter, function(details, callback) { - 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/types/electron/test/renderer.ts b/types/electron/test/renderer.ts deleted file mode 100644 index 9779765e6f..0000000000 --- a/types/electron/test/renderer.ts +++ /dev/null @@ -1,311 +0,0 @@ - -import { - ipcRenderer, - remote, - webFrame, - clipboard, - crashReporter, - nativeImage, - screen, - shell -} from 'electron'; - -import * as fs from 'fs'; - -// In renderer process (web page). -// https://github.com/atom/electron/blob/master/docs/api/ipc-renderer.md -console.log(ipcRenderer.sendSync('synchronous-message', 'ping')); // prints "pong" - -ipcRenderer.on('asynchronous-reply', (event: Electron.IpcRendererEvent, arg: any) => { - console.log(arg); // prints "pong" - event.sender.send('another-message', 'Hello World!'); -}); - -ipcRenderer.send('asynchronous-message', 'ping'); - -// remote -// https://github.com/atom/electron/blob/master/docs/api/remote.md - -var BrowserWindow = remote.BrowserWindow; -var win = new BrowserWindow({ width: 800, height: 600 }); -win.loadURL('https://github.com'); - -remote.getCurrentWindow().on('close', () => { - // blabla... -}); - -remote.getCurrentWindow().capturePage(buf => { - fs.writeFile('/tmp/screenshot.png', buf, err => { - console.log(err); - }); -}); - -remote.getCurrentWebContents().print(); - -remote.getCurrentWindow().capturePage(buf => { - remote.require('fs').writeFile('/tmp/screenshot.png', buf, (err: Error) => { - console.log(err); - }); -}); - -// web-frame -// https://github.com/atom/electron/blob/master/docs/api/web-frame.md - -webFrame.setZoomFactor(2); -console.log(webFrame.getZoomFactor()); - -webFrame.setZoomLevel(200); -console.log(webFrame.getZoomLevel()); - -webFrame.setVisualZoomLevelLimits(50, 200); -webFrame.setLayoutZoomLevelLimits(50, 200); - -webFrame.setSpellCheckProvider('en-US', true, { - spellCheck: text => { - return !(require('spellchecker').isMisspelled(text)); - } -}); - -webFrame.registerURLSchemeAsSecure('app'); -webFrame.registerURLSchemeAsBypassingCSP('app'); -webFrame.registerURLSchemeAsPrivileged('app'); -webFrame.registerURLSchemeAsPrivileged('app', { - secure: true, - supportFetchAPI: true, -}); - -webFrame.insertText('text'); - -webFrame.executeJavaScript('JSON.stringify({})', false, (result) => { - console.log(result); -}).then((result: string) => console.log('OK:' + result)); - -console.log(webFrame.getResourceUsage()); -webFrame.clearCache(); - -// clipboard -// https://github.com/atom/electron/blob/master/docs/api/clipboard.md - -clipboard.writeText('Example String'); -clipboard.writeText('Example String', 'selection'); -console.log(clipboard.readText('selection')); -console.log(clipboard.availableFormats()); -clipboard.clear(); - -clipboard.write({ - html: '', - text: 'Hello World!', - bookmark: "Bookmark name", - image: clipboard.readImage() -}); - -// crash-reporter -// https://github.com/atom/electron/blob/master/docs/api/crash-reporter.md - -crashReporter.start({ - productName: 'YourName', - companyName: 'YourCompany', - submitURL: 'https://your-domain.com/url-to-submit', - autoSubmit: true -}); - -// desktopCapturer -// https://github.com/atom/electron/blob/master/docs/api/desktop-capturer.md - -var desktopCapturer = require('electron').desktopCapturer; - -desktopCapturer.getSources({types: ['window', 'screen']}, function(error, sources) { - if (error) throw error; - for (var i = 0; i < sources.length; ++i) { - if (sources[i].name == "Electron") { - (navigator as any).webkitGetUserMedia({ - audio: false, - video: { - mandatory: { - chromeMediaSource: 'desktop', - chromeMediaSourceId: sources[i].id, - minWidth: 1280, - maxWidth: 1280, - minHeight: 720, - maxHeight: 720 - } - } - }, gotStream, getUserMediaError); - return; - } - } -}); - -function gotStream(stream: any) { - (document.querySelector('video') as HTMLVideoElement).src = URL.createObjectURL(stream); -} - -function getUserMediaError(error: Error) { - console.log('getUserMediaError', error); -} - -// File object -// https://github.com/atom/electron/blob/master/docs/api/file-object.md - -/* -
- Drag your file here -
-*/ - -var holder = document.getElementById('holder'); - -holder.ondragover = function () { - return false; -}; - -holder.ondragleave = holder.ondragend = function () { - return false; -}; - -holder.ondrop = function (e) { - e.preventDefault(); - var file = e.dataTransfer.files[0]; - console.log('File you dragged here is', file.path); - return false; -}; - -// nativeImage -// https://github.com/atom/electron/blob/master/docs/api/native-image.md - -var Tray = remote.Tray; -var appIcon2 = new Tray('/Users/somebody/images/icon.png'); -var window2 = new BrowserWindow({ icon: '/Users/somebody/images/window.png' }); -var image = clipboard.readImage(); -var appIcon3 = new Tray(image); -var appIcon4 = new Tray('/Users/somebody/images/icon.png'); - -// https://github.com/electron/electron/blob/master/docs/api/process.md - -// preload.js -var _setImmediate = setImmediate; -var _clearImmediate = clearImmediate; -process.once('loaded', function() { - global.setImmediate = _setImmediate; - global.clearImmediate = _clearImmediate; -}); - -// screen -// https://github.com/atom/electron/blob/master/docs/api/screen.md - -var app = remote.app; - -var mainWindow: Electron.BrowserWindow = null; - -app.on('ready', () => { - var size = screen.getPrimaryDisplay().workAreaSize; - mainWindow = new BrowserWindow({ width: size.width, height: size.height }); -}); - -app.on('ready', () => { - var displays = screen.getAllDisplays(); - var externalDisplay: any = null; - for (var i in displays) { - if (displays[i].bounds.x > 0 || displays[i].bounds.y > 0) { - externalDisplay = displays[i]; - break; - } - } - - if (externalDisplay) { - mainWindow = new BrowserWindow({ - x: externalDisplay.bounds.x + 50, - y: externalDisplay.bounds.y + 50, - }); - } -}); - -// shell -// https://github.com/atom/electron/blob/master/docs/api/shell.md - -shell.openExternal('https://github.com'); - -// -// https://github.com/atom/electron/blob/master/docs/api/web-view-tag.md - -var webview = document.createElement('webview'); -webview.loadURL('https://github.com'); - -webview.addEventListener('console-message', function(e) { - console.log('Guest page logged a message:', e.message); -}); - -webview.addEventListener('found-in-page', function(e) { - if (e.result.finalUpdate) { - webview.stopFindInPage("keepSelection"); - } -}); - -var requestId = webview.findInPage("test"); - -webview.addEventListener('new-window', function(e) { - require('electron').shell.openExternal(e.url); -}); - -webview.addEventListener('close', function() { - webview.src = 'about:blank'; -}); - -// In embedder page. -webview.addEventListener('ipc-message', function(event) { - console.log(event.channel); // Prints "pong" -}); -webview.send('ping'); -webview.capturePage((image) => { console.log(image); }); - -{ - const opened: boolean = webview.isDevToolsOpened(); - const focused: boolean = webview.isDevToolsFocused(); - const focused2: boolean = webview.getWebContents().isFocused(); -} - -// In guest page. -ipcRenderer.on('ping', function() { - ipcRenderer.sendToHost('pong'); -}); - - -// showOpenDialog -// https://electron.atom.io/docs/api/dialog/#dialogshowopendialogbrowserwindow-options-callback - -remote.dialog.showOpenDialog({ title: 'foo' }); -remote.dialog.showOpenDialog(win, {}, fileNames => fileNames); -remote.dialog.showOpenDialog(win, { - title: 'foo', - defaultPath: '/bar', - buttonLabel: 'foo bar', - filters: [ - {name: 'Images', extensions: ['jpg', 'png', 'gif']}, - {name: 'Movies', extensions: ['mkv', 'avi', 'mp4']}, - {name: 'Custom File Type', extensions: ['as']}, - {name: 'All Files', extensions: ['*']} - ], - properties: ['openFile', 'openDirectory', 'multiSelections', 'showHiddenFiles', 'createDirectory', 'promptToCreate', 'noResolveAliases'], - normalizeAccessKeys: true, - message: 'foo message', -}); - -// showSaveDialog -// https://electron.atom.io/docs/api/dialog/#dialogshowsavedialogbrowserwindow-options-callback - -remote.dialog.showSaveDialog({ title: 'foo' }); -remote.dialog.showSaveDialog(win, {}, fileNames => fileNames); -remote.dialog.showSaveDialog(win, { - title: 'foo', - defaultPath: '/bar', - buttonLabel: 'foo bar', - filters: [ - {name: 'Images', extensions: ['jpg', 'png', 'gif']}, - {name: 'Movies', extensions: ['mkv', 'avi', 'mp4']}, - {name: 'Custom File Type', extensions: ['as']}, - {name: 'All Files', extensions: ['*']} - ], - message: 'foo message', - nameFieldLabel: 'foo name', - showsTagField: true -}); diff --git a/types/electron/tsconfig.json b/types/electron/tsconfig.json deleted file mode 100644 index bf2299ea31..0000000000 --- a/types/electron/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "test/index.ts", - "test/main.ts", - "test/renderer.ts" - ] -} \ No newline at end of file From da04d8b684e79bcbcc31966fc2c4efdb0f2b64a1 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 10:39:49 -0400 Subject: [PATCH 215/761] Add PouchDB heterogeneous generic test --- types/pouchdb-core/pouchdb-core-tests.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/types/pouchdb-core/pouchdb-core-tests.ts b/types/pouchdb-core/pouchdb-core-tests.ts index ba06de7608..1e5d7ee75a 100644 --- a/types/pouchdb-core/pouchdb-core-tests.ts +++ b/types/pouchdb-core/pouchdb-core-tests.ts @@ -210,3 +210,26 @@ function testRemoteOptions() { skip_setup: true }); } + +interface Cat { + meow: string; +} + +interface Boot { + thud: boolean; +} + +async function heterogeneousGenericsDatabase(db: PouchDB.Database) { + const cats = await db.allDocs({ startkey: 'cat/', endkey: 'cat/\uffff', include_docs: true }); + for (let row of cats.rows) { + if (row.doc) { + row.doc.meow; // $ExpectType string + } + } + const boots = await db.allDocs({ startkey: 'boot/', endkey: 'boot/\uffff', include_docs: true }); + for (let row of boots.rows) { + if (row.doc) { + row.doc.thud; // $ExpectType boolean + } + } +} From 8225b6592b99db3597b1fbc5d32e7ba033fcc707 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 10:40:15 -0400 Subject: [PATCH 216/761] Add DT tslint to PouchDB core --- types/pouchdb-core/tslint.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 types/pouchdb-core/tslint.json diff --git a/types/pouchdb-core/tslint.json b/types/pouchdb-core/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-core/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b19ff51bd2910505ab06c778719015a8543f1ec1 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 10:43:02 -0400 Subject: [PATCH 217/761] Fix lint in PouchDB core tests --- types/pouchdb-core/pouchdb-core-tests.ts | 26 ++++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/types/pouchdb-core/pouchdb-core-tests.ts b/types/pouchdb-core/pouchdb-core-tests.ts index 1e5d7ee75a..a42947dd7d 100644 --- a/types/pouchdb-core/pouchdb-core-tests.ts +++ b/types/pouchdb-core/pouchdb-core-tests.ts @@ -17,7 +17,7 @@ function testAllDocs() { // check document property isNumber(doc!.foo); - }) + }); }); db.allDocs({ startkey: "a", endkey: "b" }); @@ -37,7 +37,9 @@ function testAllDocs() { function testBulkDocs() { const db = new PouchDB(); - type MyModel = { property: string }; + interface MyModel { + property: string; + } let model = { property: 'test' }; let model2 = { property: 'test' }; @@ -59,8 +61,8 @@ function testBulkGet() { } function testRevsDiff() { const db = new PouchDB<{}>(); - db.revsDiff({'a': ['1-a', '2-b']}).then((result) => {}); - db.revsDiff({'a': ['1-a', '2-b']}, (error, response) => {}); + db.revsDiff({a: ['1-a', '2-b']}).then((result) => {}); + db.revsDiff({a: ['1-a', '2-b']}, (error, response) => {}); } function testCompact() { @@ -84,7 +86,9 @@ function testDestroy() { } function testBasics() { - type MyModel = { property: string }; + interface MyModel { + property: string; + } let model = { property: 'test' }; const id = 'model'; @@ -114,7 +118,9 @@ function testBasics() { } function testRemove() { - type MyModel = { property: string }; + interface MyModel { + property: string; + } const id = 'model'; const rev = 'rev'; let model = { _id: id, _rev: rev, existingDocProperty: 'any' }; @@ -141,7 +147,9 @@ function testRemove() { } function testChanges() { - type MyModel = { foo: string }; + interface MyModel { + foo: string; + } const db = new PouchDB(); db.changes({ @@ -164,7 +172,7 @@ function testChanges() { let _id: string = change.id; let _seq: number = change.seq as number; let _seq_couch20: string = change.seq as string; - let _changes: { rev: string }[] = change.changes; + let _changes: Array<{ rev: string }> = change.changes; let _foo: string = change.doc!.foo; let _deleted: boolean | undefined = change.doc!._deleted; let _attachments: PouchDB.Core.Attachments | undefined = change.doc!._attachments; @@ -178,7 +186,7 @@ function testChanges() { let _id: string = change.id; let _seq: number = change.seq as number; let _seq_couch20: string = change.seq as string; - let _changes: { rev: string }[] = change.changes; + let _changes: Array<{ rev: string }> = change.changes; let _deleted: boolean | undefined = change.doc!._deleted; let _attachments: PouchDB.Core.Attachments | undefined = change.doc!._attachments; }); From 121e63d7077eaf9b0c46f0712678db5ad2f5ba16 Mon Sep 17 00:00:00 2001 From: Pascal Brokmeier Date: Thu, 8 Jun 2017 17:47:51 +0200 Subject: [PATCH 218/761] fix(alexa-sdk): added this.i interface for i18n > Once you are done defining and enabling language strings, you can access these > strings using the this.t() function. Strings will be rendered in the language > that matches the locale of the incoming request. Extract from [alexa skills kit sdk readme](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs) --- types/alexa-sdk/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/alexa-sdk/index.d.ts b/types/alexa-sdk/index.d.ts index c19892425d..7f3f022137 100644 --- a/types/alexa-sdk/index.d.ts +++ b/types/alexa-sdk/index.d.ts @@ -39,6 +39,7 @@ interface Handler { context: any; name: any; isOverriden: any; + t: (token: String) => void; } interface Context { From deba2cf9285e0a8b332000eacda53955e96b427c Mon Sep 17 00:00:00 2001 From: Pascal Brokmeier Date: Thu, 8 Jun 2017 17:58:59 +0200 Subject: [PATCH 219/761] fix String -> string obviously --- types/alexa-sdk/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/alexa-sdk/index.d.ts b/types/alexa-sdk/index.d.ts index 7f3f022137..a621634417 100644 --- a/types/alexa-sdk/index.d.ts +++ b/types/alexa-sdk/index.d.ts @@ -39,7 +39,7 @@ interface Handler { context: any; name: any; isOverriden: any; - t: (token: String) => void; + t: (token: string) => void; } interface Context { From dba4a0f69f771621ac0349bb37765b7b91c63003 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 09:10:20 -0700 Subject: [PATCH 220/761] material-ui: Fix error in typescript@next (#17054) --- types/material-ui/material-ui-tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/material-ui/material-ui-tests.tsx b/types/material-ui/material-ui-tests.tsx index 77a0445fb2..9a0eddd0b9 100644 --- a/types/material-ui/material-ui-tests.tsx +++ b/types/material-ui/material-ui-tests.tsx @@ -319,8 +319,8 @@ class DeepDownTheTree extends React.Component<{} & {muiTheme: MuiTheme}, {}> { } } - -const MuiThemeableFunction = muiThemeable()((props: {label: string, muiTheme?: MuiTheme}) => { +type Props = { label: string, muiTheme?: MuiTheme }; +const MuiThemeableFunction = muiThemeable(), Props>(props => { return ( Applied the Theme to functional component: {props.label}. From 248eba251a06d3a635ef46ae59253c306c3399b1 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 09:19:48 -0700 Subject: [PATCH 221/761] parse: Fix error in typescript@next (#17057) --- types/parse/parse-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index 79d583f3be..282913d17e 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -198,7 +198,7 @@ function test_file() { // The file either could n ot be read, or could not be saved to Parse. }); - Parse.Cloud.httpRequest({ url: file.url() }).then((response: Parse.Promise) => { + Parse.Cloud.httpRequest({ url: file.url() }).then((response: Parse.Cloud.HttpResponse) => { // result }); From dc79bd7509ec57e675e3f6c9e84826b1dd80ed2f Mon Sep 17 00:00:00 2001 From: Pascal Brokmeier Date: Thu, 8 Jun 2017 18:27:30 +0200 Subject: [PATCH 222/761] chore: activated tslint and cleaned results up --- types/alexa-sdk/alexa-sdk-tests.ts | 8 ++--- types/alexa-sdk/index.d.ts | 54 ++++++++++++++++-------------- types/alexa-sdk/tslint.json | 1 + 3 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 types/alexa-sdk/tslint.json diff --git a/types/alexa-sdk/alexa-sdk-tests.ts b/types/alexa-sdk/alexa-sdk-tests.ts index 8d309e9e81..c40efa7851 100644 --- a/types/alexa-sdk/alexa-sdk-tests.ts +++ b/types/alexa-sdk/alexa-sdk-tests.ts @@ -2,20 +2,20 @@ import * as Alexa from "alexa-sdk"; -exports.handler = function(event: Alexa.RequestBody, context: Alexa.Context, callback: Function) { +exports.handler = (event: Alexa.RequestBody, context: Alexa.Context, callback: () => void) => { let alexa = Alexa.handler(event, context); alexa.registerHandlers(handlers); alexa.execute(); }; let handlers: Alexa.Handlers = { - 'LaunchRequest': function () { + 'LaunchRequest': function() { this.emit('SayHello'); }, - 'HelloWorldIntent': function () { + 'HelloWorldIntent': function() { this.emit('SayHello'); }, - 'SayHello': function () { + 'SayHello': function() { this.emit(':tell', 'Hello World!'); } }; diff --git a/types/alexa-sdk/index.d.ts b/types/alexa-sdk/index.d.ts index a621634417..256d3fee9a 100644 --- a/types/alexa-sdk/index.d.ts +++ b/types/alexa-sdk/index.d.ts @@ -1,17 +1,19 @@ -// Type definitions for Alexa SDK for Node.js v1.1.0 +// Type definitions for Alexa SDK for Node.js 1.0 // Project: https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs -// Definitions by: Pete Beegle , Huw +// Definitions by: Pete Beegle +// Huw +// pascalwhoop // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -export function handler(event: RequestBody, context: Context, callback?: Function): AlexaObject; +export function handler(event: RequestBody, context: Context, callback?: (err: any, response: any) => void ): AlexaObject; export function CreateStateHandler(state: string, obj: any): any; -export var StateString: string; +export let StateString: string; -type ConfirmationStatuses = "NONE" | "DENIED" | "CONFIRMED"; -type DialogStates = "STARTED" | "IN_PROGRESS" | "COMPLETED"; +export type ConfirmationStatuses = "NONE" | "DENIED" | "CONFIRMED"; +export type DialogStates = "STARTED" | "IN_PROGRESS" | "COMPLETED"; -interface AlexaObject extends Handler { +export interface AlexaObject extends Handler { _event: any; _context: any; _callback: any; @@ -24,11 +26,11 @@ interface AlexaObject extends Handler { execute: () => void; } -interface Handlers { +export interface Handlers { [intent: string]: (this: Handler) => void; } -interface Handler { +export interface Handler { on: any; emit(event: string, ...args: any[]): boolean; emitWithState: any; @@ -42,7 +44,7 @@ interface Handler { t: (token: string) => void; } -interface Context { +export interface Context { callbackWaitsForEmptyEventLoop: boolean; logGroupName: string; logStreamName: string; @@ -53,13 +55,13 @@ interface Context { awsRequestId: string; } -interface RequestBody { +export interface RequestBody { version: string; session: Session; request: LaunchRequest | IntentRequest | SessionEndedRequest; } -interface Session { +export interface Session { new: boolean; sessionId: string; attributes: any; @@ -67,64 +69,64 @@ interface Session { user: SessionUser; } -interface SessionApplication { +export interface SessionApplication { applicationId: string; } -interface SessionUser { +export interface SessionUser { userId: string; accessToken: string; } -interface LaunchRequest extends IRequest { } +export interface LaunchRequest extends Request { } -interface IntentRequest extends IRequest { +export interface IntentRequest extends Request { dialogState: DialogStates; intent: Intent; } -interface SlotValue { +export interface SlotValue { confirmationStatus: ConfirmationStatuses; name: string; value?: any; } -interface Intent { +export interface Intent { confirmationStatus: ConfirmationStatuses; name: string; slots: Record; } -interface SessionEndedRequest extends IRequest { +export interface SessionEndedRequest extends Request { reason: string; } -interface IRequest { +export interface Request { type: "LaunchRequest" | "IntentRequest" | "SessionEndedRequest"; requestId: string; timeStamp: string; } -interface ResponseBody { +export interface ResponseBody { version: string; sessionAttributes?: any; response: Response; } -interface Response { +export interface Response { outputSpeech?: OutputSpeech; card?: Card; reprompt?: Reprompt; shouldEndSession: boolean; } -interface OutputSpeech { +export interface OutputSpeech { type: "PlainText" | "SSML"; text?: string; ssml?: string; } -interface Card { +export interface Card { type: "Simple" | "Standard" | "LinkAccount"; title?: string; content?: string; @@ -132,11 +134,11 @@ interface Card { image?: Image; } -interface Image { +export interface Image { smallImageUrl: string; largeImageUrl: string; } -interface Reprompt { +export interface Reprompt { outputSpeech: OutputSpeech; } diff --git a/types/alexa-sdk/tslint.json b/types/alexa-sdk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/alexa-sdk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 9cb1431127dad715d9e0a8330b936ace465db3ae Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 11:05:35 -0400 Subject: [PATCH 223/761] Add heterogeneous generics to PouchDB Core - Add a default to Database's generic parameter allowing easier "bare" usage (requires Typescript 2.3) - Add a new `` generic to allow narrowing all calls to specific models at call point. (Generic default not needed here because Typescript already defaults to `{}` or `any` depending on noImplicitAny for all of these sorts of calls.) - Expand bulkGet to include return type Resolves #17039 --- types/pouchdb-core/index.d.ts | 104 ++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 48 deletions(-) diff --git a/types/pouchdb-core/index.d.ts b/types/pouchdb-core/index.d.ts index 556fa71b5b..07c93cabe6 100644 --- a/types/pouchdb-core/index.d.ts +++ b/types/pouchdb-core/index.d.ts @@ -2,6 +2,7 @@ // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Jakub Navratil , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Typescript Version: 2.3 /// /// @@ -19,7 +20,7 @@ declare namespace PouchDB { type AttachmentId = string; type RevisionId = string; type Availability = 'available' | 'compacted' | 'not compacted' | 'missing'; - type Encodable = { [propertyName: string]: any }; + type Encodable = {}; type Attachment = string | Blob | Buffer; interface Options { @@ -48,7 +49,7 @@ declare namespace PouchDB { update_seq: number | string; } - interface Revision { + interface Revision { ok: Document & RevisionIdMeta; } interface RevisionInfo { @@ -217,12 +218,18 @@ declare namespace PouchDB { } interface BulkGetOptions extends Options { - docs: any, + docs: Array<{ id: string; rev: RevisionId }>, revs?: boolean, attachments?: boolean, binary?: boolean } + interface BulkGetResponse { + results: { + docs: Array<{ ok: Content & GetMeta } | { error: Error }>; + } + } + interface ChangesMeta { _conflicts?: RevisionId[]; _deleted?: boolean; @@ -458,7 +465,7 @@ declare namespace PouchDB { debug: debug.IDebug; - new(name?: string, + new(name?: string, options?: Configuration.DatabaseConfiguration): Database; /** @@ -466,28 +473,28 @@ declare namespace PouchDB { * except that whenever you invoke it (e.g. with new), the given options will be passed in by default. */ defaults(options: Configuration.DatabaseConfiguration): { - new(name?: string, + new(name?: string, options?: Configuration.DatabaseConfiguration): Database; } } - interface Database { + interface Database { /** Fetch all documents matching the given key. */ - allDocs(options: Core.AllDocsWithKeyOptions): - Promise>; + allDocs(options: Core.AllDocsWithKeyOptions): + Promise>; /** Fetch all documents matching any of the given keys. */ - allDocs(options: Core.AllDocsWithKeysOptions): - Promise>; + allDocs(options: Core.AllDocsWithKeysOptions): + Promise>; /** Fetch all documents matching the given key range. */ - allDocs(options: Core.AllDocsWithinRangeOptions): - Promise>; + allDocs(options: Core.AllDocsWithinRangeOptions): + Promise>; /** Fetch all documents. */ - allDocs(options?: Core.AllDocsOptions): - Promise>; + allDocs(options?: Core.AllDocsOptions): + Promise>; /** * Create, update or delete multiple documents. The docs argument is an array of documents. @@ -496,9 +503,9 @@ declare namespace PouchDB { * which should match the ID and revision of the document on which to base your updates. * Finally, to delete a document, include a _deleted parameter with the value true. */ - bulkDocs(docs: Core.PutDocument[], - options: Core.BulkDocsOptions | null, - callback: Core.Callback): void; + bulkDocs(docs: Core.PutDocument[], + options: Core.BulkDocsOptions | null, + callback: Core.Callback): void; /** * Create, update or delete multiple documents. The docs argument is an array of documents. @@ -507,8 +514,8 @@ declare namespace PouchDB { * which should match the ID and revision of the document on which to base your updates. * Finally, to delete a document, include a _deleted parameter with the value true. */ - bulkDocs(docs: Core.PutDocument[], - options?: Core.BulkDocsOptions): Promise; + bulkDocs(docs: Core.PutDocument[], + options?: Core.BulkDocsOptions): Promise; /** Compact the database */ compact(options?: Core.CompactOptions): Promise; @@ -525,27 +532,27 @@ declare namespace PouchDB { destroy(options?: Core.DestroyOptions | void): Promise; /** Fetch a document */ - get(docId: Core.DocumentId, - options: Core.GetOptions | null, - callback: Core.Callback & Core.GetMeta> - ): void; + get(docId: Core.DocumentId, + options: Core.GetOptions | null, + callback: Core.Callback & Core.GetMeta> + ): void; /** Fetch a document */ - get(docId: Core.DocumentId, - options: Core.GetOptions - ): Promise & Core.GetMeta>; + get(docId: Core.DocumentId, + options: Core.GetOptions + ): Promise & Core.GetMeta>; /** Fetch a document */ - get(docId: Core.DocumentId): Promise & Core.GetMeta>; + get(docId: Core.DocumentId): Promise & Core.GetMeta>; /** Fetch document open revs */ - get(docId: Core.DocumentId, - options: Core.GetOpenRevisions, - callback: Core.Callback[]>): void; + get(docId: Core.DocumentId, + options: Core.GetOpenRevisions, + callback: Core.Callback[]>): void; /** Fetch document open revs */ - get(docId: Core.DocumentId, - options: Core.GetOpenRevisions): Promise[]>; + get(docId: Core.DocumentId, + options: Core.GetOpenRevisions): Promise[]>; /** Create a new document without providing an id. * @@ -555,9 +562,9 @@ declare namespace PouchDB { * * @see {@link https://pouchdb.com/2014/06/17/12-pro-tips-for-better-code-with-pouchdb.html|PouchDB Pro Tips} */ - post(doc: Core.PostDocument, - options: Core.PostOptions | null, - callback: Core.Callback): void; + post(doc: Core.PostDocument, + options: Core.PostOptions | null, + callback: Core.Callback): void; /** Create a new document without providing an id. * @@ -567,8 +574,8 @@ declare namespace PouchDB { * * @see {@link https://pouchdb.com/2014/06/17/12-pro-tips-for-better-code-with-pouchdb.html|PouchDB Pro Tips} */ - post(doc: Core.PostDocument, - options?: Core.PostOptions): Promise; + post(doc: Core.PostDocument, + options?: Core.PostOptions): Promise; /** Create a new document or update an existing document. * @@ -578,9 +585,9 @@ declare namespace PouchDB { * If you try to store non-JSON data (for instance Date objects) you may * see inconsistent results. */ - put(doc: Core.PutDocument, - options: Core.PutOptions | null, - callback: Core.Callback): void; + put(doc: Core.PutDocument, + options: Core.PutOptions | null, + callback: Core.Callback): void; /** Create a new document or update an existing document. * @@ -590,8 +597,8 @@ declare namespace PouchDB { * If you try to store non-JSON data (for instance Date objects) you may * see inconsistent results. */ - put(doc: Core.PutDocument, - options?: Core.PutOptions): Promise; + put(doc: Core.PutDocument, + options?: Core.PutOptions): Promise; /** Remove a doc from the database */ remove(doc: Core.RemoveDocument, @@ -627,8 +634,8 @@ declare namespace PouchDB { * a 'complete' event when all the changes have been processed, and an 'error' event when an error occurs. * Calling cancel() will unsubscribe all event listeners automatically. */ - changes(options: Core.ChangesOptions | null, - callback: Core.Callback>): void; + changes(options: Core.ChangesOptions | null, + callback: Core.Callback>): void; /** * A list of changes made to documents in the database, in the order they were made. @@ -638,7 +645,7 @@ declare namespace PouchDB { * a 'complete' event when all the changes have been processed, and an 'error' event when an error occurs. * Calling cancel() will unsubscribe all event listeners automatically. */ - changes(options?: Core.ChangesOptions): Core.Changes; + changes(options?: Core.ChangesOptions): Core.Changes; /** Close the database */ close(callback: Core.AnyCallback): void; @@ -722,11 +729,11 @@ declare namespace PouchDB { rev: Core.RevisionId): Promise; /** Given a set of document/revision IDs, returns the document bodies (and, optionally, attachment data) for each ID/revision pair specified. */ - bulkGet(options: Core.BulkGetOptions, - callback: Core.Callback): void; + bulkGet(options: Core.BulkGetOptions, + callback: Core.Callback>): void; /** Given a set of document/revision IDs, returns the document bodies (and, optionally, attachment data) for each ID/revision pair specified. */ - bulkGet(options: Core.BulkGetOptions): Promise; + bulkGet(options: Core.BulkGetOptions): Promise>; /** Given a set of document/revision IDs, returns the subset of those that do not correspond to revisions stored in the database */ revsDiff(diff : Core.RevisionDiffOptions, @@ -737,6 +744,7 @@ declare namespace PouchDB { } } +// declare module 'pouchdb-core' { const PouchDb: PouchDB.Static; export = PouchDb; From 3aaf7db373afa972cebab532dc6443c657dec28f Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 09:43:41 -0700 Subject: [PATCH 224/761] verror: Fix lint (#17064) --- types/verror/verror-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/verror/verror-tests.ts b/types/verror/verror-tests.ts index c3b560bfb2..17f7fe1bd7 100644 --- a/types/verror/verror-tests.ts +++ b/types/verror/verror-tests.ts @@ -12,7 +12,7 @@ const verror3 = new VError({ name: "fooError", cause: error, info: { - "info0": "baz" + info0: "baz" } }, "bar"); From baafa81401f48879b199f96c7404a8470d020a28 Mon Sep 17 00:00:00 2001 From: odin3 Date: Thu, 8 Jun 2017 20:11:18 +0300 Subject: [PATCH 225/761] Add types for normalize-url --- types/normalize-url/index.d.ts | 20 ++++++++++++++++++++ types/normalize-url/tsconfig.json | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 types/normalize-url/index.d.ts create mode 100644 types/normalize-url/tsconfig.json diff --git a/types/normalize-url/index.d.ts b/types/normalize-url/index.d.ts new file mode 100644 index 0000000000..7433263923 --- /dev/null +++ b/types/normalize-url/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for normalize-url v1.9.1 +// Project: https://github.com/sindresorhus/normalize-url +// Definitions by: odin3 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module NormalizeUrl { + interface INormalizeUrlArgs { + normalizeProtocol: boolean; + normalizeHttps: boolean; + stripFragment: boolean; + stripWWW: boolean; + removeQueryParameters: string[]; + removeTrailingSlash: boolean; + removeDirectoryIndex: RegExp[]; + } + + function normalizeUrl(url: string, args?: INormalizeUrlArgs): string; +} + +export = NormalizeUrl.normalizeUrl; diff --git a/types/normalize-url/tsconfig.json b/types/normalize-url/tsconfig.json new file mode 100644 index 0000000000..27e01ecd7b --- /dev/null +++ b/types/normalize-url/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file From 73546dc95f1d772382cbffb1f9bdc3c8c3a4d08d Mon Sep 17 00:00:00 2001 From: odin3 Date: Thu, 8 Jun 2017 20:21:28 +0300 Subject: [PATCH 226/761] Fix code style --- types/normalize-url/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/normalize-url/index.d.ts b/types/normalize-url/index.d.ts index 7433263923..84cca245a5 100644 --- a/types/normalize-url/index.d.ts +++ b/types/normalize-url/index.d.ts @@ -13,7 +13,7 @@ declare module NormalizeUrl { removeTrailingSlash: boolean; removeDirectoryIndex: RegExp[]; } - + function normalizeUrl(url: string, args?: INormalizeUrlArgs): string; } From ef9cfd95370465097132d0a4aea11164f95c0274 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 13:24:28 -0400 Subject: [PATCH 227/761] Fix lint issues in pouchdb-core --- types/pouchdb-core/index.d.ts | 311 +++++++++++------------ types/pouchdb-core/pouchdb-core-tests.ts | 44 ++-- 2 files changed, 167 insertions(+), 188 deletions(-) diff --git a/types/pouchdb-core/index.d.ts b/types/pouchdb-core/index.d.ts index 07c93cabe6..71fdb011b6 100644 --- a/types/pouchdb-core/index.d.ts +++ b/types/pouchdb-core/index.d.ts @@ -1,26 +1,35 @@ -// Type definitions for pouchdb-core v6.1.2 +// Type definitions for pouchdb-core 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Jakub Navratil , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Typescript Version: 2.3 +// TypeScript Version: 2.3 /// /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { namespace Core { interface Error { + /** + * HTTP Status Code during HTTP or HTTP-like operations + */ + status?: number; + name?: string; + message?: string; + reason?: string; + error?: string | boolean; + id?: string; + rev?: RevisionId; } - interface Callback { - (error: E | void, result: R | void): void; - } - type AnyCallback = Callback; + type Callback = (error: Error | null, result: R | null) => void; type DocumentId = string; type DocumentKey = string; type AttachmentId = string; type RevisionId = string; type Availability = 'available' | 'compacted' | 'not compacted' | 'missing'; - type Encodable = {}; type Attachment = string | Blob | Buffer; interface Options { @@ -49,7 +58,7 @@ declare namespace PouchDB { update_seq: number | string; } - interface Revision { + interface Revision { ok: Document & RevisionIdMeta; } interface RevisionInfo { @@ -57,14 +66,14 @@ declare namespace PouchDB { status: Availability; } interface RevisionDiffOptions { - [DocumentId : string]: string[]; + [DocumentId: string]: string[]; } interface RevisionDiff { missing?: string[]; possible_ancestors?: string[]; } interface RevisionDiffResponse { - [DocumentId : string]: RevisionDiff + [DocumentId: string]: RevisionDiff; } interface IdMeta { @@ -86,7 +95,7 @@ declare namespace PouchDB { _revisions?: { ids: RevisionId[]; start: number; - } + }; /** Attachments where index is attachmentId */ _attachments?: Attachments; @@ -116,15 +125,15 @@ declare namespace PouchDB { [attachmentId: string]: AttachmentResponse; } - type NewDocument = Content; - type Document = Content & IdMeta; - type ExistingDocument = + type NewDocument = Content; + type Document = Content & IdMeta; + type ExistingDocument = Document & RevisionIdMeta; /** Existing doc or just object with `_id` and `_rev` */ - type RemoveDocument = Encodable & IdMeta & RevisionIdMeta; + type RemoveDocument = IdMeta & RevisionIdMeta; - type PostDocument = NewDocument & { + type PostDocument = NewDocument & { filters?: {[filterName: string]: string}; views?: {[viewName: string]: string}; @@ -134,7 +143,7 @@ declare namespace PouchDB { _attachments?: {[attachmentId: string]: PutAttachment}; }; - type PutDocument = PostDocument & ChangesMeta & { + type PutDocument = PostDocument & ChangesMeta & { _id?: DocumentId; }; @@ -155,11 +164,13 @@ declare namespace PouchDB { /** Return attachments as Buffers. * * Requires `include_docs` to be `true`. - * Requires `attachments` to be `true`. */ + * Requires `attachments` to be `true`. + */ binary?: boolean; /** Include conflict information for each document. * - * Requires `include_docs` to be `true`. */ + * Requires `include_docs` to be `true`. + */ conflicts?: boolean; /** Reverse ordering of results. */ descending?: boolean; @@ -169,7 +180,8 @@ declare namespace PouchDB { limit?: number; /** Number of documents to skip before returning. * - * Causes poor performance on IndexedDB and LevelDB. */ + * Causes poor performance on IndexedDB and LevelDB. + */ skip?: number; } interface AllDocsWithKeyOptions extends AllDocsOptions { @@ -187,21 +199,21 @@ declare namespace PouchDB { endkey: DocumentKey; /** Include any documents identified by `endkey`. * - * Defaults to `true`. */ + * Defaults to `true`. + */ inclusive_end?: boolean; } interface AllDocsMeta { - /** Only present if `conflicts` is `true` */ _conflicts?: RevisionId[]; _attachments?: Attachments; } - interface AllDocsResponse { + interface AllDocsResponse { /** The `skip` if provided, or in CouchDB the actual offset */ offset: number; total_rows: number; - rows: { + rows: Array<{ /** Only present if `include_docs` was `true`. */ doc?: Document; id: DocumentId; @@ -210,24 +222,24 @@ declare namespace PouchDB { rev: RevisionId; deleted?: boolean; } - }[]; + }>; } - interface BulkDocsOptions extends PutOptions { + interface BulkDocsOptions extends Options { new_edits?: boolean; } interface BulkGetOptions extends Options { - docs: Array<{ id: string; rev: RevisionId }>, - revs?: boolean, - attachments?: boolean, - binary?: boolean + docs: Array<{ id: string; rev: RevisionId }>; + revs?: boolean; + attachments?: boolean; + binary?: boolean; } - interface BulkGetResponse { + interface BulkGetResponse { results: { docs: Array<{ ok: Content & GetMeta } | { error: Error }>; - } + }; } interface ChangesMeta { @@ -283,7 +295,7 @@ declare namespace PouchDB { * To use a view function, pass '_view' here and provide a reference to the view function in options.view. * See filtered changes for details. */ - filter?: string | {(doc: any, params: any): any}; + filter?: string | ((doc: any, params: any) => any); /** Only show changes for docs with these ids (array of strings). */ doc_ids?: string[]; @@ -303,21 +315,22 @@ declare namespace PouchDB { view?: string; } - interface ChangesResponseChange { + interface ChangesResponseChange { id: string; seq: number | string; - changes: { rev: string }[]; + changes: Array<{ rev: string }>; deleted?: boolean; doc?: ExistingDocument; } - interface ChangesResponse { + interface ChangesResponse { status: string; last_seq: number | string; - results: ChangesResponseChange[]; + results: Array>; } - interface Changes extends EventEmitter, Promise> { + /** @todo: remove nodejs dep. */ + interface Changes extends NodeJS.EventEmitter, Promise> { on(event: 'change', listener: (value: ChangesResponseChange) => any): this; on(event: 'complete', listener: (value: ChangesResponse) => any): this; on(event: 'error', listener: (value: any) => any): this; @@ -325,9 +338,6 @@ declare namespace PouchDB { cancel(): void; } - interface DestroyOptions extends Options { - } - interface GetOptions extends Options { /** Include list of conflicting leaf revisions. */ conflicts?: boolean; @@ -336,7 +346,8 @@ declare namespace PouchDB { /** Include revision history of the document. */ revs?: boolean; /** Include a list of revisions of the document, and their - * availability. */ + * availability. + */ revs_info?: boolean; /** Include attachment data. */ @@ -352,18 +363,14 @@ declare namespace PouchDB { interface GetOpenRevisions extends Options { /** Fetch all leaf revisions if open_revs="all" or fetch all leaf * revisions specified in open_revs array. Leaves will be returned - * in the same order as specified in input array. */ + * in the same order as specified in input array. + */ open_revs: 'all' | Core.RevisionId[]; /** Include revision history of the document. */ revs?: boolean; } - interface PutOptions extends Options { - } - interface PostOptions extends PutOptions { - } - interface CompactOptions extends Core.Options { interval?: number; } @@ -376,7 +383,7 @@ declare namespace PouchDB { /** * Pass this to `PouchDB.plugin()`. */ - export type Plugin = 'This should be passed to PouchDB.plugin()'; + type Plugin = 'This should be passed to PouchDB.plugin()'; namespace Configuration { interface CommonDatabaseConfiguration { @@ -423,7 +430,7 @@ declare namespace PouchDB { */ headers?: { [name: string]: string; - } + }; /** * Enables transferring cookies and HTTP Authorization information. @@ -439,7 +446,7 @@ declare namespace PouchDB { auth?: { username?: string; password?: string; - } + }; /** * Disables automatic creation of databases. */ @@ -451,49 +458,31 @@ declare namespace PouchDB { } /** @todo: remove nodejs dep. */ - interface EventEmitter extends NodeJS.EventEmitter { - - } - - interface Static extends EventEmitter { + interface Static extends NodeJS.EventEmitter { plugin(plugin: Plugin): Static; version: string; - on(event: 'created', listener: (dbName: string) => any): this; - on(event: 'destroyed', listener: (dbName: string) => any): this; + on(event: 'created' | 'destroyed', listener: (dbName: string) => any): this; debug: debug.IDebug; - new(name?: string, - options?: Configuration.DatabaseConfiguration): Database; + new(name?: string, + options?: Configuration.DatabaseConfiguration): Database; /** * The returned object is a constructor function that works the same as PouchDB, * except that whenever you invoke it (e.g. with new), the given options will be passed in by default. */ defaults(options: Configuration.DatabaseConfiguration): { - new(name?: string, - options?: Configuration.DatabaseConfiguration): Database; - } + new(name?: string, + options?: Configuration.DatabaseConfiguration): Database; + }; } - interface Database { - - /** Fetch all documents matching the given key. */ - allDocs(options: Core.AllDocsWithKeyOptions): - Promise>; - - /** Fetch all documents matching any of the given keys. */ - allDocs(options: Core.AllDocsWithKeysOptions): - Promise>; - - /** Fetch all documents matching the given key range. */ - allDocs(options: Core.AllDocsWithinRangeOptions): - Promise>; - - /** Fetch all documents. */ - allDocs(options?: Core.AllDocsOptions): + interface Database { + /** Fetch all documents matching the given options. */ + allDocs(options?: Core.AllDocsWithKeyOptions | Core.AllDocsWithKeysOptions | Core.AllDocsWithinRangeOptions | Core.AllDocsOptions): Promise>; /** @@ -503,9 +492,9 @@ declare namespace PouchDB { * which should match the ID and revision of the document on which to base your updates. * Finally, to delete a document, include a _deleted parameter with the value true. */ - bulkDocs(docs: Core.PutDocument[], + bulkDocs(docs: Array>, options: Core.BulkDocsOptions | null, - callback: Core.Callback): void; + callback: Core.Callback): void; /** * Create, update or delete multiple documents. The docs argument is an array of documents. @@ -514,7 +503,7 @@ declare namespace PouchDB { * which should match the ID and revision of the document on which to base your updates. * Finally, to delete a document, include a _deleted parameter with the value true. */ - bulkDocs(docs: Core.PutDocument[], + bulkDocs(docs: Array>, options?: Core.BulkDocsOptions): Promise; /** Compact the database */ @@ -522,37 +511,37 @@ declare namespace PouchDB { /** Compact the database */ compact(options: Core.CompactOptions, - callback: Core.Callback): void; + callback: Core.Callback): void; /** Destroy the database */ - destroy(options: Core.DestroyOptions | void, - callback: Core.AnyCallback): void; + destroy(options: Core.Options | null, + callback: Core.Callback): void; /** Destroy the database */ - destroy(options?: Core.DestroyOptions | void): Promise; + destroy(options?: Core.Options | null): Promise; /** Fetch a document */ get(docId: Core.DocumentId, - options: Core.GetOptions | null, - callback: Core.Callback & Core.GetMeta> + options: Core.GetOptions | Core.GetOpenRevisions | null, + callback: Core.Callback & Core.GetMeta> ): void; /** Fetch a document */ get(docId: Core.DocumentId, - options: Core.GetOptions + options?: Core.GetOptions | Core.GetOpenRevisions ): Promise & Core.GetMeta>; - /** Fetch a document */ - get(docId: Core.DocumentId): Promise & Core.GetMeta>; - - /** Fetch document open revs */ - get(docId: Core.DocumentId, - options: Core.GetOpenRevisions, - callback: Core.Callback[]>): void; - - /** Fetch document open revs */ - get(docId: Core.DocumentId, - options: Core.GetOpenRevisions): Promise[]>; + /** Create a new document without providing an id. + * + * You should prefer put() to post(), because when you post(), you are + * missing an opportunity to use allDocs() to sort documents by _id + * (because your _ids are random). + * + * @see {@link https://pouchdb.com/2014/06/17/12-pro-tips-for-better-code-with-pouchdb.html|PouchDB Pro Tips} + */ + post(doc: Core.PostDocument, + options: Core.Options | null, + callback: Core.Callback): void; /** Create a new document without providing an id. * @@ -563,19 +552,7 @@ declare namespace PouchDB { * @see {@link https://pouchdb.com/2014/06/17/12-pro-tips-for-better-code-with-pouchdb.html|PouchDB Pro Tips} */ post(doc: Core.PostDocument, - options: Core.PostOptions | null, - callback: Core.Callback): void; - - /** Create a new document without providing an id. - * - * You should prefer put() to post(), because when you post(), you are - * missing an opportunity to use allDocs() to sort documents by _id - * (because your _ids are random). - * - * @see {@link https://pouchdb.com/2014/06/17/12-pro-tips-for-better-code-with-pouchdb.html|PouchDB Pro Tips} - */ - post(doc: Core.PostDocument, - options?: Core.PostOptions): Promise; + options?: Core.Options): Promise; /** Create a new document or update an existing document. * @@ -586,8 +563,8 @@ declare namespace PouchDB { * see inconsistent results. */ put(doc: Core.PutDocument, - options: Core.PutOptions | null, - callback: Core.Callback): void; + options: Core.Options | null, + callback: Core.Callback): void; /** Create a new document or update an existing document. * @@ -598,18 +575,18 @@ declare namespace PouchDB { * see inconsistent results. */ put(doc: Core.PutDocument, - options?: Core.PutOptions): Promise; + options?: Core.Options): Promise; /** Remove a doc from the database */ remove(doc: Core.RemoveDocument, options: Core.Options, - callback: Core.Callback): void; + callback: Core.Callback): void; /** Remove a doc from the database */ remove(docId: Core.DocumentId, revision: Core.RevisionId, options: Core.Options, - callback: Core.Callback): void; + callback: Core.Callback): void; /** Remove a doc from the database */ remove(doc: Core.RemoveDocument, @@ -621,7 +598,7 @@ declare namespace PouchDB { options?: Core.Options): Promise; /** Get database information */ - info(callback: Core.Callback): void; + info(callback: Core.Callback): void; /** Get database information */ info(): Promise; @@ -635,7 +612,7 @@ declare namespace PouchDB { * Calling cancel() will unsubscribe all event listeners automatically. */ changes(options: Core.ChangesOptions | null, - callback: Core.Callback>): void; + callback: Core.Callback>): void; /** * A list of changes made to documents in the database, in the order they were made. @@ -648,7 +625,7 @@ declare namespace PouchDB { changes(options?: Core.ChangesOptions): Core.Changes; /** Close the database */ - close(callback: Core.AnyCallback): void; + close(callback: Core.Callback): void; /** Close the database */ close(): Promise; @@ -659,88 +636,84 @@ declare namespace PouchDB { * If the document doesn’t already exist, then this method will create an empty document containing the attachment. */ putAttachment(docId: Core.DocumentId, - attachmentId: Core.AttachmentId, - rev: Core.RevisionId, - attachment: Core.Attachment, - type: string, - callback: Core.Callback): void; + attachmentId: Core.AttachmentId, + rev: Core.RevisionId, + attachment: Core.Attachment, + type: string, + callback: Core.Callback): void; /** - * Attaches a binary object to a document. - * This method will update an existing document to add the attachment, so it requires a rev if the document already exists. - * If the document doesn’t already exist, then this method will create an empty document containing the attachment. - */ + * Attaches a binary object to a document. + * This method will update an existing document to add the attachment, so it requires a rev if the document already exists. + * If the document doesn’t already exist, then this method will create an empty document containing the attachment. + */ putAttachment(docId: Core.DocumentId, - attachmentId: Core.AttachmentId, - rev: Core.RevisionId, - attachment: Core.Attachment, - type: string): Promise; + attachmentId: Core.AttachmentId, + rev: Core.RevisionId, + attachment: Core.Attachment, + type: string): Promise; /** - * Attaches a binary object to a document. - * This method will update an existing document to add the attachment, so it requires a rev if the document already exists. - * If the document doesn’t already exist, then this method will create an empty document containing the attachment. - */ + * Attaches a binary object to a document. + * This method will update an existing document to add the attachment, so it requires a rev if the document already exists. + * If the document doesn’t already exist, then this method will create an empty document containing the attachment. + */ putAttachment(docId: Core.DocumentId, - attachmentId: Core.AttachmentId, - attachment: Core.Attachment, - type: string, - callback: Core.Callback): void; + attachmentId: Core.AttachmentId, + attachment: Core.Attachment, + type: string, + callback: Core.Callback): void; /** - * Attaches a binary object to a document. - * This method will update an existing document to add the attachment, so it requires a rev if the document already exists. - * If the document doesn’t already exist, then this method will create an empty document containing the attachment. - */ + * Attaches a binary object to a document. + * This method will update an existing document to add the attachment, so it requires a rev if the document already exists. + * If the document doesn’t already exist, then this method will create an empty document containing the attachment. + */ putAttachment(docId: Core.DocumentId, - attachmentId: Core.AttachmentId, - attachment: Core.Attachment, - type: string): Promise; + attachmentId: Core.AttachmentId, + attachment: Core.Attachment, + type: string): Promise; /** Get attachment data */ getAttachment(docId: Core.DocumentId, - attachmentId: Core.AttachmentId, - options: { rev?: Core.RevisionId}, - callback: Core.Callback): void; + attachmentId: Core.AttachmentId, + options: { rev?: Core.RevisionId}, + callback: Core.Callback): void; /** Get attachment data */ getAttachment(docId: Core.DocumentId, - attachmentId: Core.AttachmentId, - options: { rev?: Core.RevisionId}): Promise; + attachmentId: Core.AttachmentId, + options?: { rev?: Core.RevisionId}): Promise; /** Get attachment data */ getAttachment(docId: Core.DocumentId, - attachmentId: Core.AttachmentId, - callback: Core.Callback): void; - - /** Get attachment data */ - getAttachment(docId: Core.DocumentId, - attachmentId: Core.AttachmentId): Promise; + attachmentId: Core.AttachmentId, + callback: Core.Callback): void; /** Delete an attachment from a doc. You must supply the rev of the existing doc. */ removeAttachment(docId: Core.DocumentId, - attachmentId: Core.AttachmentId, - rev: Core.RevisionId, - callback: Core.Callback): void; + attachmentId: Core.AttachmentId, + rev: Core.RevisionId, + callback: Core.Callback): void; /** Delete an attachment from a doc. You must supply the rev of the existing doc. */ removeAttachment(docId: Core.DocumentId, - attachmentId: Core.AttachmentId, - rev: Core.RevisionId): Promise; + attachmentId: Core.AttachmentId, + rev: Core.RevisionId): Promise; /** Given a set of document/revision IDs, returns the document bodies (and, optionally, attachment data) for each ID/revision pair specified. */ bulkGet(options: Core.BulkGetOptions, - callback: Core.Callback>): void; + callback: Core.Callback>): void; /** Given a set of document/revision IDs, returns the document bodies (and, optionally, attachment data) for each ID/revision pair specified. */ bulkGet(options: Core.BulkGetOptions): Promise>; /** Given a set of document/revision IDs, returns the subset of those that do not correspond to revisions stored in the database */ - revsDiff(diff : Core.RevisionDiffOptions, - callback: Core.Callback): void; + revsDiff(diff: Core.RevisionDiffOptions, + callback: Core.Callback): void; /** Given a set of document/revision IDs, returns the subset of those that do not correspond to revisions stored in the database */ - revsDiff(diff : Core.RevisionDiffOptions): Promise; + revsDiff(diff: Core.RevisionDiffOptions): Promise; } } diff --git a/types/pouchdb-core/pouchdb-core-tests.ts b/types/pouchdb-core/pouchdb-core-tests.ts index a42947dd7d..3b2e8d3542 100644 --- a/types/pouchdb-core/pouchdb-core-tests.ts +++ b/types/pouchdb-core/pouchdb-core-tests.ts @@ -1,3 +1,5 @@ +import * as PouchDB from 'pouchdb-core'; + function isString(someString: string) { } function isNumber(someNumber: number) { @@ -219,25 +221,29 @@ function testRemoteOptions() { }); } -interface Cat { - meow: string; -} - -interface Boot { - thud: boolean; -} - -async function heterogeneousGenericsDatabase(db: PouchDB.Database) { - const cats = await db.allDocs({ startkey: 'cat/', endkey: 'cat/\uffff', include_docs: true }); - for (let row of cats.rows) { - if (row.doc) { - row.doc.meow; // $ExpectType string - } +function heterogeneousGenericsDatabase(db: PouchDB.Database) { + interface Cat { + meow: string; } - const boots = await db.allDocs({ startkey: 'boot/', endkey: 'boot/\uffff', include_docs: true }); - for (let row of boots.rows) { - if (row.doc) { - row.doc.thud; // $ExpectType boolean - } + + interface Boot { + thud: boolean; } + + db.allDocs({ startkey: 'cat/', endkey: 'cat/\uffff', include_docs: true }) + .then(cats => { + for (let row of cats.rows) { + if (row.doc) { + row.doc.meow; // $ExpectType string + } + } + }); + db.allDocs({ startkey: 'boot/', endkey: 'boot/\uffff', include_docs: true }) + .then(boots => { + for (let row of boots.rows) { + if (row.doc) { + row.doc.thud; // $ExpectType boolean + } + } + }); } From 63905996fa11e6711c7145c21c4df4428c9fdd49 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 13:37:02 -0400 Subject: [PATCH 228/761] Update and lint pouchdb-find --- types/pouchdb-find/index.d.ts | 45 ++++++++++++------------ types/pouchdb-find/pouchdb-find-tests.ts | 4 +-- types/pouchdb-find/tslint.json | 1 + 3 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 types/pouchdb-find/tslint.json diff --git a/types/pouchdb-find/index.d.ts b/types/pouchdb-find/index.d.ts index a125d42ee4..f598b5311d 100644 --- a/types/pouchdb-find/index.d.ts +++ b/types/pouchdb-find/index.d.ts @@ -1,14 +1,16 @@ -// Type definitions for pouchdb-find v0.10.0 +// Type definitions for pouchdb-find 0.10 // Project: https://pouchdb.com/ // Definitions by: Jakub Navratil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { - namespace Find { - interface ConditionOperators { /** Match fields "less than" this one. */ $lt?: any; @@ -47,7 +49,7 @@ declare namespace PouchDB { * Non-integer values result in a 404 status. * Matches documents where (field % Divisor == Remainder) is true, and only when the document field is an integer. * [divisor, remainder] - * */ + */ $mod?: [number, number]; /** A regular expression pattern to match against the document field. Only matches when the field is a string value and matches the supplied regular expression. */ @@ -79,7 +81,7 @@ declare namespace PouchDB { _id?: ConditionOperators; } - interface FindRequest { + interface FindRequest { /** Defines a selector to filter the results. Required */ selector: Selector; @@ -96,8 +98,8 @@ declare namespace PouchDB { skip?: number; } - interface FindResponse { - docs: Core.Document[]; + interface FindResponse { + docs: Array>; } interface CreateIndexOptions { @@ -113,10 +115,10 @@ declare namespace PouchDB { /** Only supports 'json', and it's also the default */ type?: string; - } + }; } - interface CreateIndexResponse { + interface CreateIndexResponse { result: string; } @@ -131,14 +133,14 @@ declare namespace PouchDB { type: string; def: { - fields: { + fields: Array<{ [fieldName: string]: string - }[] - } + }>; + }; } - interface GetIndexesResponse { - indexes: Index[] + interface GetIndexesResponse { + indexes: Index[]; } interface DeleteIndexOptions { @@ -152,33 +154,30 @@ declare namespace PouchDB { type?: string; } - interface DeleteIndexResponse { + interface DeleteIndexResponse { [propertyName: string]: any; } - } - interface Database { - + interface Database { /** Query the API to find some documents. */ find(request: Find.FindRequest, - callback: Core.Callback>): void; + callback: Core.Callback>): void; find(request?: Find.FindRequest): Promise>; /** Create an index if it doesn't exist, or do nothing if it already exists. */ createIndex(index: Find.CreateIndexOptions, - callback: Core.Callback>): void; + callback: Core.Callback>): void; createIndex(index?: Find.CreateIndexOptions): Promise>; /** Get a list of all the indexes you've created. Also tells you about the special _all_docs index, i.e. the default index on the _id field. */ - getIndexes(callback: Core.Callback>): void; + getIndexes(callback: Core.Callback>): void; getIndexes(): Promise>; /** Delete an index and clean up any leftover data on the disk. */ deleteIndex(index: Find.DeleteIndexOptions, - callback: Core.Callback>): void; + callback: Core.Callback>): void; deleteIndex(index?: Find.DeleteIndexOptions): Promise>; - } } diff --git a/types/pouchdb-find/pouchdb-find-tests.ts b/types/pouchdb-find/pouchdb-find-tests.ts index d9fe07536f..411b6c1b00 100644 --- a/types/pouchdb-find/pouchdb-find-tests.ts +++ b/types/pouchdb-find/pouchdb-find-tests.ts @@ -7,11 +7,11 @@ function testFind() { sort: ['fieldName'], limit: 1, skip: 1 - }) + }); db.find({ selector: {}, - sort: [{'fieldName': 'asc'}] + sort: [{fieldName: 'asc'}] }); // test combinations of selectors diff --git a/types/pouchdb-find/tslint.json b/types/pouchdb-find/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-find/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 0cdc4d77f19201e4d7f042afc0fd11764b1a1526 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 14:18:36 -0400 Subject: [PATCH 229/761] Update and lint PouchDB adapters --- types/pouchdb-adapter-fruitdown/index.d.ts | 12 ++++++++---- .../pouchdb-adapter-fruitdown-tests.ts | 4 +++- types/pouchdb-adapter-fruitdown/tslint.json | 1 + types/pouchdb-adapter-http/index.d.ts | 12 ++++++++---- types/pouchdb-adapter-http/tslint.json | 1 + types/pouchdb-adapter-idb/index.d.ts | 12 ++++++++---- types/pouchdb-adapter-idb/tslint.json | 1 + types/pouchdb-adapter-leveldb/index.d.ts | 12 ++++++++---- .../pouchdb-adapter-leveldb-tests.ts | 5 +++-- types/pouchdb-adapter-leveldb/tslint.json | 1 + types/pouchdb-adapter-localstorage/index.d.ts | 12 ++++++++---- .../pouchdb-adapter-localstorage-tests.ts | 4 +++- types/pouchdb-adapter-localstorage/tslint.json | 1 + types/pouchdb-adapter-memory/index.d.ts | 12 ++++++++---- .../pouchdb-adapter-memory-tests.ts | 4 +++- types/pouchdb-adapter-memory/tslint.json | 1 + types/pouchdb-adapter-node-websql/index.d.ts | 6 +++++- .../pouchdb-adapter-node-websql-tests.ts | 4 +++- types/pouchdb-adapter-node-websql/tslint.json | 1 + types/pouchdb-adapter-websql/index.d.ts | 10 +++++++--- .../pouchdb-adapter-websql-tests.ts | 2 -- types/pouchdb-adapter-websql/tslint.json | 1 + 22 files changed, 83 insertions(+), 36 deletions(-) create mode 100644 types/pouchdb-adapter-fruitdown/tslint.json create mode 100644 types/pouchdb-adapter-http/tslint.json create mode 100644 types/pouchdb-adapter-idb/tslint.json create mode 100644 types/pouchdb-adapter-leveldb/tslint.json create mode 100644 types/pouchdb-adapter-localstorage/tslint.json create mode 100644 types/pouchdb-adapter-memory/tslint.json create mode 100644 types/pouchdb-adapter-node-websql/tslint.json create mode 100644 types/pouchdb-adapter-websql/tslint.json diff --git a/types/pouchdb-adapter-fruitdown/index.d.ts b/types/pouchdb-adapter-fruitdown/index.d.ts index 89fcd9d95b..63484904ac 100644 --- a/types/pouchdb-adapter-fruitdown/index.d.ts +++ b/types/pouchdb-adapter-fruitdown/index.d.ts @@ -1,10 +1,14 @@ -// Type definitions for pouchdb-adapter-fruitdown v6.1.2 +// Type definitions for pouchdb-adapter-fruitdown 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { namespace FruitDOWNAdapter { interface FruitDOWNAdapterConfiguration @@ -14,9 +18,9 @@ declare namespace PouchDB { } interface Static { - new(name: string | void, - options: FruitDOWNAdapter.FruitDOWNAdapterConfiguration - ): Database; + new(name: string | null, + options: FruitDOWNAdapter.FruitDOWNAdapterConfiguration + ): Database; } } diff --git a/types/pouchdb-adapter-fruitdown/pouchdb-adapter-fruitdown-tests.ts b/types/pouchdb-adapter-fruitdown/pouchdb-adapter-fruitdown-tests.ts index 645ec0b448..437d759d21 100644 --- a/types/pouchdb-adapter-fruitdown/pouchdb-adapter-fruitdown-tests.ts +++ b/types/pouchdb-adapter-fruitdown/pouchdb-adapter-fruitdown-tests.ts @@ -1,5 +1,7 @@ function testConstructor() { - type MyModel = { numericProperty: number }; + interface MyModel { + numericProperty: number; + } let model: PouchDB.Core.Document; let db = new PouchDB(null, { diff --git a/types/pouchdb-adapter-fruitdown/tslint.json b/types/pouchdb-adapter-fruitdown/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-adapter-fruitdown/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb-adapter-http/index.d.ts b/types/pouchdb-adapter-http/index.d.ts index f0125baf7c..07eb5bbbfb 100644 --- a/types/pouchdb-adapter-http/index.d.ts +++ b/types/pouchdb-adapter-http/index.d.ts @@ -1,10 +1,14 @@ -// Type definitions for pouchdb-http v6.1.2 +// Type definitions for pouchdb-http 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { namespace HttpAdapter { interface HttpAdapterConfiguration @@ -14,9 +18,9 @@ declare namespace PouchDB { } interface Static { - new(name: string | void, - options: HttpAdapter.HttpAdapterConfiguration - ): Database; + new(name: string | null, + options: HttpAdapter.HttpAdapterConfiguration + ): Database; } } diff --git a/types/pouchdb-adapter-http/tslint.json b/types/pouchdb-adapter-http/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-adapter-http/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb-adapter-idb/index.d.ts b/types/pouchdb-adapter-idb/index.d.ts index a62cef3654..e8ad990b45 100644 --- a/types/pouchdb-adapter-idb/index.d.ts +++ b/types/pouchdb-adapter-idb/index.d.ts @@ -1,10 +1,14 @@ -// Type definitions for pouchdb-adapter-idb v6.1.2 +// Type definitions for pouchdb-adapter-idb 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { namespace Core { interface DatabaseInfo { @@ -26,9 +30,9 @@ declare namespace PouchDB { } interface Static { - new(name: string | void, - options: IdbAdapter.IdbAdapterConfiguration - ): Database; + new(name: string | null, + options: IdbAdapter.IdbAdapterConfiguration + ): Database; } } diff --git a/types/pouchdb-adapter-idb/tslint.json b/types/pouchdb-adapter-idb/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-adapter-idb/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb-adapter-leveldb/index.d.ts b/types/pouchdb-adapter-leveldb/index.d.ts index 6c89d0161e..a3dd9ad6d7 100644 --- a/types/pouchdb-adapter-leveldb/index.d.ts +++ b/types/pouchdb-adapter-leveldb/index.d.ts @@ -1,10 +1,14 @@ -// Type definitions for pouchdb-adapter-leveldb v6.1.2 +// Type definitions for pouchdb-adapter-leveldb 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { namespace LevelDbAdapter { interface LevelDbAdapterConfiguration extends Configuration.LocalDatabaseConfiguration { @@ -13,9 +17,9 @@ declare namespace PouchDB { } interface Static { - new(name: string | void, - options: LevelDbAdapter.LevelDbAdapterConfiguration - ): Database; + new(name: string | null, + options: LevelDbAdapter.LevelDbAdapterConfiguration + ): Database; } } diff --git a/types/pouchdb-adapter-leveldb/pouchdb-adapter-leveldb-tests.ts b/types/pouchdb-adapter-leveldb/pouchdb-adapter-leveldb-tests.ts index 49c4a84088..f7223616ac 100644 --- a/types/pouchdb-adapter-leveldb/pouchdb-adapter-leveldb-tests.ts +++ b/types/pouchdb-adapter-leveldb/pouchdb-adapter-leveldb-tests.ts @@ -1,5 +1,7 @@ function testConstructor() { - type MyModel = { numericProperty: number }; + interface MyModel { + numericProperty: number; + } let db = new PouchDB(null, { adapter: 'leveldb', @@ -8,4 +10,3 @@ function testConstructor() { adapter: 'leveldb', }); } - diff --git a/types/pouchdb-adapter-leveldb/tslint.json b/types/pouchdb-adapter-leveldb/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-adapter-leveldb/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb-adapter-localstorage/index.d.ts b/types/pouchdb-adapter-localstorage/index.d.ts index 9e71c05a77..04823352de 100644 --- a/types/pouchdb-adapter-localstorage/index.d.ts +++ b/types/pouchdb-adapter-localstorage/index.d.ts @@ -1,10 +1,14 @@ -// Type definitions for pouchdb-adapter-localstorage v6.1.2 +// Type definitions for pouchdb-adapter-localstorage 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { namespace LocalStorageAdapter { interface LocalStorageAdapterConfiguration @@ -14,9 +18,9 @@ declare namespace PouchDB { } interface Static { - new(name: string | void, - options: LocalStorageAdapter.LocalStorageAdapterConfiguration - ): Database; + new(name: string | null, + options: LocalStorageAdapter.LocalStorageAdapterConfiguration + ): Database; } } diff --git a/types/pouchdb-adapter-localstorage/pouchdb-adapter-localstorage-tests.ts b/types/pouchdb-adapter-localstorage/pouchdb-adapter-localstorage-tests.ts index 71a60e987f..77f3701e57 100644 --- a/types/pouchdb-adapter-localstorage/pouchdb-adapter-localstorage-tests.ts +++ b/types/pouchdb-adapter-localstorage/pouchdb-adapter-localstorage-tests.ts @@ -1,5 +1,7 @@ function testConstructor() { - type MyModel = { numericProperty: number }; + interface MyModel { + numericProperty: number; + } let db = new PouchDB(null, { adapter: 'localstorage', diff --git a/types/pouchdb-adapter-localstorage/tslint.json b/types/pouchdb-adapter-localstorage/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-adapter-localstorage/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb-adapter-memory/index.d.ts b/types/pouchdb-adapter-memory/index.d.ts index 647ce5b434..3cbc0c664e 100644 --- a/types/pouchdb-adapter-memory/index.d.ts +++ b/types/pouchdb-adapter-memory/index.d.ts @@ -1,10 +1,14 @@ -// Type definitions for pouchdb-adapter-memory v6.1.2 +// Type definitions for pouchdb-adapter-memory 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { namespace MemoryAdapter { interface MemoryAdapterConfiguration @@ -14,9 +18,9 @@ declare namespace PouchDB { } interface Static { - new(name: string | void, - options: MemoryAdapter.MemoryAdapterConfiguration - ): Database; + new(name: string | null, + options: MemoryAdapter.MemoryAdapterConfiguration + ): Database; } } diff --git a/types/pouchdb-adapter-memory/pouchdb-adapter-memory-tests.ts b/types/pouchdb-adapter-memory/pouchdb-adapter-memory-tests.ts index a920375bb8..82e1d0b5a1 100644 --- a/types/pouchdb-adapter-memory/pouchdb-adapter-memory-tests.ts +++ b/types/pouchdb-adapter-memory/pouchdb-adapter-memory-tests.ts @@ -1,5 +1,7 @@ function testConstructor() { - type MyModel = { numericProperty: number }; + interface MyModel { + numericProperty: number; + } let db = new PouchDB(null, { adapter: 'memory', diff --git a/types/pouchdb-adapter-memory/tslint.json b/types/pouchdb-adapter-memory/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-adapter-memory/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb-adapter-node-websql/index.d.ts b/types/pouchdb-adapter-node-websql/index.d.ts index bec01a6d8b..25dcc7d8cf 100644 --- a/types/pouchdb-adapter-node-websql/index.d.ts +++ b/types/pouchdb-adapter-node-websql/index.d.ts @@ -1,11 +1,15 @@ -// Type definitions for pouchdb-adapter-node-websql v6.1.2 +// Type definitions for pouchdb-adapter-node-websql 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare module 'pouchdb-adapter-node-websql' { const plugin: PouchDB.Plugin; export = plugin; diff --git a/types/pouchdb-adapter-node-websql/pouchdb-adapter-node-websql-tests.ts b/types/pouchdb-adapter-node-websql/pouchdb-adapter-node-websql-tests.ts index b65fabca1b..94cb7b0c0c 100644 --- a/types/pouchdb-adapter-node-websql/pouchdb-adapter-node-websql-tests.ts +++ b/types/pouchdb-adapter-node-websql/pouchdb-adapter-node-websql-tests.ts @@ -6,7 +6,9 @@ function isString(someString: string) { } function testConstructor() { - type MyModel = { numericProperty: number }; + interface MyModel { + numericProperty: number; + } let db = new PouchDB(null, { adapter: 'websql', diff --git a/types/pouchdb-adapter-node-websql/tslint.json b/types/pouchdb-adapter-node-websql/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-adapter-node-websql/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb-adapter-websql/index.d.ts b/types/pouchdb-adapter-websql/index.d.ts index 7148d65ea2..b7cc5af65b 100644 --- a/types/pouchdb-adapter-websql/index.d.ts +++ b/types/pouchdb-adapter-websql/index.d.ts @@ -1,10 +1,14 @@ -// Type definitions for pouchdb-adapter-websql v6.1.2 +// Type definitions for pouchdb-adapter-websql 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { namespace Core { interface DatabaseInfo { @@ -25,8 +29,8 @@ declare namespace PouchDB { } interface Static { - new(name: string | void, - options: AdapterWebSql.Configuration): Database; + new(name: string | null, + options: AdapterWebSql.Configuration): Database; } } diff --git a/types/pouchdb-adapter-websql/pouchdb-adapter-websql-tests.ts b/types/pouchdb-adapter-websql/pouchdb-adapter-websql-tests.ts index 4fcd195669..577b7c7e83 100644 --- a/types/pouchdb-adapter-websql/pouchdb-adapter-websql-tests.ts +++ b/types/pouchdb-adapter-websql/pouchdb-adapter-websql-tests.ts @@ -6,8 +6,6 @@ function isString(someString: string) { } function testConstructor() { - type MyModel = { numericProperty: number }; - let db = new PouchDB('basic'); db = new PouchDB(null, { adapter: 'websql' diff --git a/types/pouchdb-adapter-websql/tslint.json b/types/pouchdb-adapter-websql/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-adapter-websql/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a9e346334202ce611ffe087b45f786dbe5234ad3 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 14:29:46 -0400 Subject: [PATCH 230/761] Update and lint pouchdb-mapreduce --- types/pouchdb-mapreduce/index.d.ts | 27 ++++++++++--------- .../pouchdb-mapreduce-tests.ts | 15 ++++++----- types/pouchdb-mapreduce/tslint.json | 1 + 3 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 types/pouchdb-mapreduce/tslint.json diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index 401f70afb0..7b398d730b 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -1,15 +1,18 @@ -// Type definitions for pouchdb-mapreduce v6.1.2 +// Type definitions for pouchdb-mapreduce 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// -declare namespace PouchDB { +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ +declare namespace PouchDB { interface Filter { - map: (doc: any) => void; - reduce?: (key: string, value: any) => any; + map(doc: any): void; + reduce?(key: string, value: any): any; } namespace Query { @@ -55,19 +58,19 @@ declare namespace PouchDB { stale?: 'ok' | 'update_after'; } - interface Response { + interface Response { total_rows: number; offset: number; - rows: { + rows: Array<{ id: any; key: any; value: any; doc?: Core.ExistingDocument; - }[] + }>; } } - export interface Database { + interface Database { /** * Cleans up any stale map/reduce indexes. * @@ -76,7 +79,7 @@ declare namespace PouchDB { * to take up space on disk. viewCleanup() removes these unnecessary * index files. */ - viewCleanup(callback: PouchDB.Core.Callback): void; + viewCleanup(callback: PouchDB.Core.Callback): void; /** * Cleans up any stale map/reduce indexes. * @@ -91,17 +94,17 @@ declare namespace PouchDB { * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Filter | Function, opts: Query.Options, callback: (err: Core.Error, res: Query.Response) => void): void; + query(fun: string | Filter | ((doc: any) => void), opts: Query.Options, callback: (err: Core.Error, res: Query.Response) => void): void; /** * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Filter | Function, callback: (err: Core.Error, res: Query.Response) => void): void; + query(fun: string | Filter | ((doc: any) => void), callback: (err: Core.Error, res: Query.Response) => void): void; /** * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Filter | Function, opts?: Query.Options): Promise>; + query(fun: string | Filter | ((doc: any) => void), opts?: Query.Options): Promise>; } } diff --git a/types/pouchdb-mapreduce/pouchdb-mapreduce-tests.ts b/types/pouchdb-mapreduce/pouchdb-mapreduce-tests.ts index 6f6d941e83..6c028a5d93 100644 --- a/types/pouchdb-mapreduce/pouchdb-mapreduce-tests.ts +++ b/types/pouchdb-mapreduce/pouchdb-mapreduce-tests.ts @@ -1,5 +1,7 @@ function testConstructor() { - type MyModel = { numericProperty: number }; + interface MyModel { + numericProperty: number; + } let model: PouchDB.Core.Document; let db = new PouchDB('mydb'); @@ -8,14 +10,14 @@ function testConstructor() { } function testQuery() { - let pouch = new PouchDB<{}>('mydb'); + let pouch = new PouchDB('mydb'); // find pokemon with name === 'Pika pi!' pouch.query('my_index/by_name', { key : 'Pika pi!', include_docs : true - }).then(function (result) { + }).then((result) => { // handle result - }).catch(function (err) { + }).catch((err) => { // handle errors }); @@ -25,10 +27,9 @@ function testQuery() { endkey : 'P\uffff', limit : 5, include_docs : true - }).then(function (result) { + }).then((result) => { // handle result - }).catch(function (err) { + }).catch((err) => { // handle errors }); - } diff --git a/types/pouchdb-mapreduce/tslint.json b/types/pouchdb-mapreduce/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-mapreduce/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 12ffcffba5610faed3252cee42093099d498d531 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 14:40:01 -0400 Subject: [PATCH 231/761] Update and lint pouchdb-replication --- types/pouchdb-replication/index.d.ts | 57 ++++++++----------- .../pouchdb-replication-tests.ts | 6 +- types/pouchdb-replication/tslint.json | 1 + 3 files changed, 29 insertions(+), 35 deletions(-) create mode 100644 types/pouchdb-replication/tslint.json diff --git a/types/pouchdb-replication/index.d.ts b/types/pouchdb-replication/index.d.ts index c88ebd4e23..ff9d0051ec 100644 --- a/types/pouchdb-replication/index.d.ts +++ b/types/pouchdb-replication/index.d.ts @@ -1,14 +1,16 @@ -// Type definitions for pouchdb-replication v6.1.2 +// Type definitions for pouchdb-replication 6.1 // Project: https://pouchdb.com/ // Definitions by: Jakub Navratil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { - namespace Replication { - interface ReplicateOptions { /** If true, starts subscribing to future changes in the source database and continue replicating them. */ live?: boolean; @@ -25,7 +27,7 @@ declare namespace PouchDB { * To use a view function, pass '_view' here and provide a reference to the view function in options.view. * See filtered changes for details. */ - filter?: string | {(doc: any, params: any): any}; + filter?: string | ((doc: any, params: any) => any); /** Only show changes for docs with these ids (array of strings). */ doc_ids?: string[]; @@ -76,38 +78,35 @@ declare namespace PouchDB { * Defaults to a function that chooses a random backoff between 0 and 2 seconds and doubles every time it fails to connect. * The default delay will never exceed 10 minutes. */ - back_off_function?: (delay: number) => number; + back_off_function?(delay: number): number; } - interface ReplicationEventEmitter extends EventEmitter { + interface ReplicationEventEmitter extends NodeJS.EventEmitter { on(event: 'change', listener: (info: C) => any): this; - on(event: 'paused', listener: (err: {}) => any): this; + on(event: 'paused' | 'denied' | 'error', listener: (err: {}) => any): this; on(event: 'active', listener: () => any): this; - on(event: 'denied', listener: (err: {}) => any): this; on(event: 'complete', listener: (info: F) => any): this; - on(event: 'error', listener: (err: {}) => any): this; cancel(): void; } - interface Replication + interface Replication extends ReplicationEventEmitter, ReplicationResultComplete>, Promise> { - } - interface ReplicationResult { + interface ReplicationResult { doc_write_failures: number; docs_read: number; docs_written: number; - last_seq: number, - start_time: Date, - ok: boolean, + last_seq: number; + start_time: Date; + ok: boolean; errors: any[]; - docs: Core.ExistingDocument[]; + docs: Array>; } - interface ReplicationResultComplete extends ReplicationResult { + interface ReplicationResultComplete extends ReplicationResult { end_time: Date; status: string; } @@ -117,26 +116,23 @@ declare namespace PouchDB { pull?: ReplicateOptions; } - interface Sync + interface Sync extends ReplicationEventEmitter, SyncResultComplete>, Promise> { - } - interface SyncResult { + interface SyncResult { direction: 'push' | 'pull'; change: ReplicationResult; } - interface SyncResultComplete { + interface SyncResultComplete { push?: ReplicationResultComplete; pull?: ReplicationResultComplete; } - } interface Static { - /** * Replicate data from source to target. Both the source and target can be a PouchDB instance or a string * representing a CouchDB database URL or the name of a local PouchDB database. If options.live is true, @@ -147,7 +143,7 @@ declare namespace PouchDB { source: string | Database, target: string | Database, options?: Replication.ReplicateOptions, - callback?: Core.Callback> + callback?: Core.Callback> ): Replication.Replication; /** @@ -163,13 +159,11 @@ declare namespace PouchDB { source: string | Database, target: string | Database, options?: Replication.SyncOptions, - callback?: Core.Callback> + callback?: Core.Callback> ): Replication.Sync; - } - interface Database { - + interface Database { replicate: { /** * Replicate data to `target`. Both the source and target can be a PouchDB instance @@ -180,7 +174,7 @@ declare namespace PouchDB { to( target: string | Database, options?: Replication.ReplicateOptions, - callback?: Core.Callback> + callback?: Core.Callback> ): Replication.Replication; /** @@ -192,7 +186,7 @@ declare namespace PouchDB { from( source: string | Database, options?: Replication.ReplicateOptions, - callback?: Core.Callback> + callback?: Core.Callback> ): Replication.Replication; }; @@ -208,9 +202,8 @@ declare namespace PouchDB { sync( remote: string | Database, options?: Replication.SyncOptions, - callback?: Core.Callback> + callback?: Core.Callback> ): Replication.Sync; - } } diff --git a/types/pouchdb-replication/pouchdb-replication-tests.ts b/types/pouchdb-replication/pouchdb-replication-tests.ts index 9cf352bed6..3eb4a0d86e 100644 --- a/types/pouchdb-replication/pouchdb-replication-tests.ts +++ b/types/pouchdb-replication/pouchdb-replication-tests.ts @@ -1,13 +1,13 @@ /** @todo make some real tests */ function testReplication() { - type Model = { foo: number }; + interface Model { + foo: number; + } const db = new PouchDB(); db.replicate.to('').then((res: PouchDB.Replication.ReplicationResultComplete) => { - }); db.replicate.from('').then((res: PouchDB.Replication.ReplicationResultComplete) => { - }); } diff --git a/types/pouchdb-replication/tslint.json b/types/pouchdb-replication/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-replication/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 1493b8762b9b55237e28e011737fde28e4369f15 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 14:48:02 -0400 Subject: [PATCH 232/761] Update and lint pouchdb-upsert --- types/pouchdb-upsert/index.d.ts | 25 ++++++++++---------- types/pouchdb-upsert/pouchdb-upsert-tests.ts | 11 +++++---- types/pouchdb-upsert/tslint.json | 1 + 3 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 types/pouchdb-upsert/tslint.json diff --git a/types/pouchdb-upsert/index.d.ts b/types/pouchdb-upsert/index.d.ts index 03f415ea90..e893a052aa 100644 --- a/types/pouchdb-upsert/index.d.ts +++ b/types/pouchdb-upsert/index.d.ts @@ -1,13 +1,16 @@ -// Type definitions for pouchdb-upsert v2.0.1 +// Type definitions for pouchdb-upsert 2.0 // Project: https://github.com/pouchdb/upsert // Definitions by: Keith D. Moore , Andrew Mitchell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// -declare namespace PouchDB { +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ - interface Database { +declare namespace PouchDB { + interface Database { /** * Perform an upsert (update or insert) operation. Returns a Promise. * @@ -17,7 +20,7 @@ declare namespace PouchDB { * If the document does not already exist, then {} will be the input to diffFunc. * */ - upsert(docId: Core.DocumentId, diffFun: UpsertDiffCallback): Promise; + upsert(docId: Core.DocumentId, diffFun: UpsertDiffCallback): Promise; /** * Perform an upsert (update or insert) operation. If a callback is not provided, the Promise based version @@ -29,8 +32,8 @@ declare namespace PouchDB { * If the document does not already exist, then {} will be the input to diffFunc. * @param callback - called with the results after operation is completed. */ - upsert(docId: Core.DocumentId, diffFun: UpsertDiffCallback, - callback: Core.Callback): void; + upsert(docId: Core.DocumentId, diffFun: UpsertDiffCallback, + callback: Core.Callback): void; /** * Put a new document with the given docId, if it doesn't already exist. Returns a Promise. @@ -38,7 +41,7 @@ declare namespace PouchDB { * @param doc - the document to insert. Should contain an _id if docId is not specified * If the document already exists, then the Promise will just resolve immediately. */ - putIfNotExists(doc: Core.Document): Promise; + putIfNotExists(doc: Core.Document): Promise; // /** @@ -51,13 +54,11 @@ declare namespace PouchDB { * If you don't specify a callback, then the Promise version of this function will be invoked and it * will return a Promise. */ - putIfNotExists(doc: Core.Document, - callback: Core.Callback): void; + putIfNotExists(doc: Core.Document, + callback: Core.Callback): void; } - interface UpsertDiffCallback { - (doc: Core.Document): Core.Document|boolean; - } + type UpsertDiffCallback = (doc: Core.Document) => Core.Document | boolean; } declare module 'pouchdb-upsert' { diff --git a/types/pouchdb-upsert/pouchdb-upsert-tests.ts b/types/pouchdb-upsert/pouchdb-upsert-tests.ts index 7da1c46267..52efc75099 100644 --- a/types/pouchdb-upsert/pouchdb-upsert-tests.ts +++ b/types/pouchdb-upsert/pouchdb-upsert-tests.ts @@ -1,7 +1,10 @@ import * as pouchdbUpsert from 'pouchdb-upsert'; PouchDB.plugin(pouchdbUpsert); -type UpsertDocModel = { _id: 'test-doc1', name: 'test' }; +interface UpsertDocModel { + _id: 'test-doc1'; + name: 'test'; +} let docToUpsert: PouchDB.Core.Document; const db = new PouchDB(); @@ -14,7 +17,7 @@ function testUpsert_WithPromise_AndReturnDoc() { } function testUpsert_WithPromise_AndReturnBoolean() { - db.upsert(docToUpsert._id, (doc: PouchDB.Core.Document) => { + db.upsert(docToUpsert._id, (doc: PouchDB.Core.Document) => { // Make some updates.... return false; }).then((res: PouchDB.Core.Response) => { @@ -22,7 +25,7 @@ function testUpsert_WithPromise_AndReturnBoolean() { } function testUpsert_WithCallback_AndReturnDoc() { - db.upsert(docToUpsert._id, (doc: PouchDB.Core.Document) => { + db.upsert(docToUpsert._id, (doc: PouchDB.Core.Document) => { // Make some updates.... return doc; }, (res: PouchDB.Core.Response) => {}); @@ -30,7 +33,7 @@ function testUpsert_WithCallback_AndReturnDoc() { function testUpsert_WithCallback_AndReturnBoolean() { // callback return boolean - db.upsert(docToUpsert._id, (doc: PouchDB.Core.Document) => { + db.upsert(docToUpsert._id, (doc: PouchDB.Core.Document) => { // Make some updates.... return false; }, (res: PouchDB.Core.Response) => {}); diff --git a/types/pouchdb-upsert/tslint.json b/types/pouchdb-upsert/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-upsert/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From fe564f6dcfc7efb6a858e3ba0cd90d9fddf66dd3 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 14:55:10 -0400 Subject: [PATCH 233/761] Update and lint PouchDB metapackages --- types/pouchdb-browser/index.d.ts | 6 +++++- types/pouchdb-browser/pouchdb-browser-tests.ts | 4 +++- types/pouchdb-browser/tslint.json | 1 + types/pouchdb-http/index.d.ts | 6 +++++- types/pouchdb-http/pouchdb-http-tests.ts | 4 +++- types/pouchdb-http/tslint.json | 1 + types/pouchdb-node/index.d.ts | 6 +++++- types/pouchdb-node/pouchdb-node-tests.ts | 4 +++- types/pouchdb-node/tslint.json | 1 + types/pouchdb/index.d.ts | 6 +++++- types/pouchdb/pouchdb-tests.ts | 6 ++++-- types/pouchdb/tslint.json | 1 + 12 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 types/pouchdb-browser/tslint.json create mode 100644 types/pouchdb-http/tslint.json create mode 100644 types/pouchdb-node/tslint.json create mode 100644 types/pouchdb/tslint.json diff --git a/types/pouchdb-browser/index.d.ts b/types/pouchdb-browser/index.d.ts index 94f942302c..3872feef98 100644 --- a/types/pouchdb-browser/index.d.ts +++ b/types/pouchdb-browser/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for pouchdb-browser v6.1.2 +// Type definitions for pouchdb-browser 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// @@ -10,6 +11,9 @@ /// /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare module 'pouchdb-browser' { const PouchDb: PouchDB.Static; export = PouchDb; diff --git a/types/pouchdb-browser/pouchdb-browser-tests.ts b/types/pouchdb-browser/pouchdb-browser-tests.ts index faaa5b5d21..29b8d55b5a 100644 --- a/types/pouchdb-browser/pouchdb-browser-tests.ts +++ b/types/pouchdb-browser/pouchdb-browser-tests.ts @@ -1,5 +1,7 @@ function testConstructor() { - type MyModel = { numericProperty: number }; + interface MyModel { + numericProperty: number; + } let model: PouchDB.Core.Document; let db = new PouchDB(null, { diff --git a/types/pouchdb-browser/tslint.json b/types/pouchdb-browser/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-browser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb-http/index.d.ts b/types/pouchdb-http/index.d.ts index 8dde8993e9..8c5dfd3104 100644 --- a/types/pouchdb-http/index.d.ts +++ b/types/pouchdb-http/index.d.ts @@ -1,11 +1,15 @@ -// Type definitions for pouchdb-http v6.1.2 +// Type definitions for pouchdb-http 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare module 'pouchdb-http' { const PouchDb: PouchDB.Static; export = PouchDb; diff --git a/types/pouchdb-http/pouchdb-http-tests.ts b/types/pouchdb-http/pouchdb-http-tests.ts index 05a0f1667d..ebf0b04bed 100644 --- a/types/pouchdb-http/pouchdb-http-tests.ts +++ b/types/pouchdb-http/pouchdb-http-tests.ts @@ -1,5 +1,7 @@ function testConstructor() { - type MyModel = { numericProperty: number }; + interface MyModel { + numericProperty: number; + } let model: PouchDB.Core.Document; let db = new PouchDB('myDb', { diff --git a/types/pouchdb-http/tslint.json b/types/pouchdb-http/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-http/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb-node/index.d.ts b/types/pouchdb-node/index.d.ts index aed20c7192..c0f48adb23 100644 --- a/types/pouchdb-node/index.d.ts +++ b/types/pouchdb-node/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for pouchdb-node v6.1.2 +// Type definitions for pouchdb-node 6.1 // Project: https://pouchdb.com/ // Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// @@ -9,6 +10,9 @@ /// /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare namespace PouchDB { namespace Core { interface DatabaseInfo { diff --git a/types/pouchdb-node/pouchdb-node-tests.ts b/types/pouchdb-node/pouchdb-node-tests.ts index 107dcf00e8..21b42558f0 100644 --- a/types/pouchdb-node/pouchdb-node-tests.ts +++ b/types/pouchdb-node/pouchdb-node-tests.ts @@ -1,5 +1,7 @@ function testConstructor() { - type MyModel = { numericProperty: number }; + interface MyModel { + numericProperty: number; + } let model: PouchDB.Core.Document; let db = new PouchDB('myDb', { diff --git a/types/pouchdb-node/tslint.json b/types/pouchdb-node/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb-node/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb/index.d.ts b/types/pouchdb/index.d.ts index e14e4c421f..48bc6279ff 100644 --- a/types/pouchdb/index.d.ts +++ b/types/pouchdb/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for pouchdb v6.1.2 +// Type definitions for pouchdb 6.1 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// @@ -18,6 +19,9 @@ /// /// +// TODO: Fixing this lint error will require a large refactor +/* tslint:disable:no-single-declare-module */ + declare module 'pouchdb' { const plugin: PouchDB.Static; export = plugin; diff --git a/types/pouchdb/pouchdb-tests.ts b/types/pouchdb/pouchdb-tests.ts index ef7da0fd83..25e3861b99 100644 --- a/types/pouchdb/pouchdb-tests.ts +++ b/types/pouchdb/pouchdb-tests.ts @@ -19,7 +19,7 @@ function testAllDocs() { // check document property isNumber(doc.foo); - }) + }); }); db.allDocs({ startkey: "a", endkey: "b" }); @@ -48,7 +48,9 @@ function testDestroy() { } function testBasics() { - type MyModel = { property: 'someProperty '}; + interface MyModel { + property: 'someProperty '; + } let model: PouchDB.Core.Document; const id = 'model'; diff --git a/types/pouchdb/tslint.json b/types/pouchdb/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouchdb/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 3c705e898c7b45cc17386d0ebab0288f8a50cb43 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 15:13:04 -0400 Subject: [PATCH 234/761] Update and lint pouch-redux-middleware --- types/pouch-redux-middleware/index.d.ts | 41 +++++++++---------- .../pouch-redux-middleware-tests.ts | 18 ++++---- types/pouch-redux-middleware/tslint.json | 1 + 3 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 types/pouch-redux-middleware/tslint.json diff --git a/types/pouch-redux-middleware/index.d.ts b/types/pouch-redux-middleware/index.d.ts index 2e940e819d..e0e3691de6 100644 --- a/types/pouch-redux-middleware/index.d.ts +++ b/types/pouch-redux-middleware/index.d.ts @@ -1,34 +1,33 @@ -// Type definitions for pouch-redux-middleware 0.5.0 +// Type definitions for pouch-redux-middleware 0.5 // Project: https://github.com/pgte/pouch-redux-middleware // Definitions by: Adam Charron // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -import { Dispatch, Action, Middleware } from 'redux' -import * as PouchDB from 'pouchdb' +import { Dispatch, Action, Middleware } from 'redux'; +import * as PouchDB from 'pouchdb'; export interface Document { _id: any; - [field: string]: any + [field: string]: any; } export interface Path { - path: string - db: PouchDB.Database - scheduleRemove?: (doc: Document) => void - scheduleInset?: (doc: Document) => void - propagateDelete?: (doc: Document, dispatch: Dispatch) => void - propagateInsert?: (doc: Document, dispatch: Dispatch) => void - propagateUpdate?: (doc: Document, dispatch: Dispatch) => void - handleResponse?: (err: Error, data: any, errorCallback: (err: Error) => void) => void - queue?: Function - docs?: any + path: string; + db: PouchDB.Database; + scheduleRemove?(doc: Document): void; + scheduleInset?(doc: Document): void; + propagateDelete?(doc: Document, dispatch: Dispatch): void; + propagateInsert?(doc: Document, dispatch: Dispatch): void; + propagateUpdate?(doc: Document, dispatch: Dispatch): void; + handleResponse?(err: Error, data: any, errorCallback: (err: Error) => void): void; + queue?(...args: any[]): any; + docs?: any; actions: { - remove: (doc: Document) => Action - update: (doc: Document) => Action - insert: (doc: Document) => Action - } + remove(doc: Document): Action; + update(doc: Document): Action; + insert(doc: Document): Action; + }; } -export default function PouchMiddlewareFactory(paths?: Path[] | Path): Middleware - - +export default function PouchMiddlewareFactory(paths?: Path[] | Path): Middleware; diff --git a/types/pouch-redux-middleware/pouch-redux-middleware-tests.ts b/types/pouch-redux-middleware/pouch-redux-middleware-tests.ts index 1ae6493175..bacd6c4b7a 100644 --- a/types/pouch-redux-middleware/pouch-redux-middleware-tests.ts +++ b/types/pouch-redux-middleware/pouch-redux-middleware-tests.ts @@ -1,22 +1,22 @@ -import * as redux from 'redux' -import makePouchMiddleware, { Document, Path } from 'pouch-redux-middleware' +import * as redux from 'redux'; +import makePouchMiddleware, { Document, Path } from 'pouch-redux-middleware'; import * as PouchDB from 'pouchdb'; const types = { DELETE_TODO: 'delete-todo', INSERT_TODO: 'insert-todo', UPDATE_TODO: 'update-todo' -} +}; const path: Path = { path: "/test", db: new PouchDB('test'), actions: { - remove: doc => { return { type: types.DELETE_TODO, id: doc._id } }, - insert: doc => { return { type: types.INSERT_TODO, todo: doc } }, - update: doc => { return { type: types.UPDATE_TODO, todo: doc } }, + remove: doc => ({ type: types.DELETE_TODO, id: doc._id }), + insert: doc => ({ type: types.INSERT_TODO, todo: doc }), + update: doc => ({ type: types.UPDATE_TODO, todo: doc }), } -} +}; -const middleware: redux.Middleware = makePouchMiddleware(path) -const otherMiddleware: redux.Middleware = makePouchMiddleware([path, path, path]) +const middleware: redux.Middleware = makePouchMiddleware(path); +const otherMiddleware: redux.Middleware = makePouchMiddleware([path, path, path]); diff --git a/types/pouch-redux-middleware/tslint.json b/types/pouch-redux-middleware/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pouch-redux-middleware/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From dc27c3788c00d279ae5ff61e8e2dfd568aae5e8e Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 12:27:20 -0700 Subject: [PATCH 235/761] d3-zoom: Add needed type arguments (#17053) --- types/d3-zoom/d3-zoom-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/d3-zoom/d3-zoom-tests.ts b/types/d3-zoom/d3-zoom-tests.ts index de213d5149..185b9fd45a 100644 --- a/types/d3-zoom/d3-zoom-tests.ts +++ b/types/d3-zoom/d3-zoom-tests.ts @@ -104,7 +104,7 @@ function zoomedCanvas(this: HTMLCanvasElement, d: CanvasDatum) { let canvasZoom: d3Zoom.ZoomBehavior; -canvasZoom = d3Zoom.zoom() +canvasZoom = d3Zoom.zoom() .scaleExtent([1 / 2, 4]) .on('zoom', zoomedCanvas); From f342368cd4daf837e26571b2f2b9049c1859fe9c Mon Sep 17 00:00:00 2001 From: Jeremi Stadler Date: Thu, 8 Jun 2017 22:24:16 +0200 Subject: [PATCH 236/761] [React-Native] Add dark-content as statusbar option https://facebook.github.io/react-native/docs/statusbar.html#statusbarstyle --- types/react-native/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 22930ea00c..01942e2267 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -7273,9 +7273,9 @@ export interface SettingsStatic { /** - * @enum('default', 'light-content') + * @enum('default', 'light-content', 'dark-content') */ -export type StatusBarStyle = "default" | "light-content" +export type StatusBarStyle = "default" | "light-content" | "dark-content" /** * @enum('fade', 'slide') From 270ade8beec568fbe5fbdb0913e8d8a24b9544c8 Mon Sep 17 00:00:00 2001 From: Matthew Tebbs Date: Thu, 8 Jun 2017 13:42:12 -0700 Subject: [PATCH 237/761] three: Fixed declaration for class PolyhedronGeometry in three-core.d.ts to use number arrays and not Vector3/Face3 arrays. --- types/three/three-core.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 5679c4e8c7..4321f11501 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -6488,11 +6488,11 @@ export class PlaneGeometry extends Geometry { } export class PolyhedronGeometry extends Geometry { - constructor(vertices: Vector3[], faces: Face3[], radius?: number, detail?: number); + constructor(vertices: number[], indices: number[], radius?: number, detail?: number); parameters: { - vertices: Vector3[]; - faces: Face3[]; + vertices: number[]; + indices: number[]; radius: number; detail: number; }; From 2a8dcade032af2a718d013185b7e55f9e232f157 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 17:19:16 -0400 Subject: [PATCH 238/761] Replace pouchdb-core get open revision overloads --- types/pouchdb-core/index.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/types/pouchdb-core/index.d.ts b/types/pouchdb-core/index.d.ts index 71fdb011b6..933dfbf6a5 100644 --- a/types/pouchdb-core/index.d.ts +++ b/types/pouchdb-core/index.d.ts @@ -522,15 +522,26 @@ declare namespace PouchDB { /** Fetch a document */ get(docId: Core.DocumentId, - options: Core.GetOptions | Core.GetOpenRevisions | null, + options: Core.GetOptions | null, callback: Core.Callback & Core.GetMeta> ): void; + /** Fetch a document */ + get(docId: Core.DocumentId, + options: Core.GetOpenRevisions, + callback: Core.Callback>> + ): void; + /** Fetch a document */ get(docId: Core.DocumentId, options?: Core.GetOptions | Core.GetOpenRevisions ): Promise & Core.GetMeta>; + /** Fetch a document */ + get(docId: Core.DocumentId, + options: Core.GetOpenRevisions + ): Promise>>; + /** Create a new document without providing an id. * * You should prefer put() to post(), because when you post(), you are From 9e9bee141249c1b0430f94d5d1e79cbbf0dc4273 Mon Sep 17 00:00:00 2001 From: Eli Young Date: Thu, 8 Jun 2017 14:33:19 -0700 Subject: [PATCH 239/761] [convict] Fix header (#17046) The DefinitelyTyped header needs to have the name of the library as it is published on npm and must not have a patch number in the version. --- types/convict/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/convict/index.d.ts b/types/convict/index.d.ts index 395d540875..82b22ba2db 100644 --- a/types/convict/index.d.ts +++ b/types/convict/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-convict v3.0.0 +// Type definitions for convict 3.0 // Project: https://github.com/mozilla/node-convict // Definitions by: Wim Looman , Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 0c42afa21ab4549367f07f18d8d0c0c22a7498df Mon Sep 17 00:00:00 2001 From: StefanSchoof Date: Thu, 8 Jun 2017 23:35:02 +0200 Subject: [PATCH 240/761] [SharePoint] Add _spFriendlyUrlPageContextInfo (#17052) --- types/sharepoint/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/sharepoint/index.d.ts b/types/sharepoint/index.d.ts index 3520e12f06..b4e4e4cb9d 100644 --- a/types/sharepoint/index.d.ts +++ b/types/sharepoint/index.d.ts @@ -179,6 +179,13 @@ declare class _spPageContextInfo { static webUIVersion: number; // 15 } +declare class _spFriendlyUrlPageContextInfo { + static termId: string; + static termSetId: string; + static termStoreId: string; + static title: string; +} + declare function STSHtmlEncode(value: string): string; declare function STSHtmlDecode(value: string): string; From 47e7bba277f09ce790de00c4db44f24e74b01376 Mon Sep 17 00:00:00 2001 From: Simon Pfeifer Date: Thu, 8 Jun 2017 23:46:23 +0200 Subject: [PATCH 241/761] Chartist: added candle stick chart support (#16745) * Chartist: added candle stick chart support to. This PR is depending on: https://github.com/gionkunz/chartist-js/pull/956 * Increased type definition version for Chartist from v0.9.5 to v0.9.6 --- types/chartist/chartist-tests.ts | 26 +++++++ types/chartist/index.d.ts | 127 ++++++++++++++++++++++++++++++- 2 files changed, 151 insertions(+), 2 deletions(-) diff --git a/types/chartist/chartist-tests.ts b/types/chartist/chartist-tests.ts index 2a4a362e7e..13a7c7dd1c 100644 --- a/types/chartist/chartist-tests.ts +++ b/types/chartist/chartist-tests.ts @@ -401,3 +401,29 @@ var overlappingBarsResponsiveOptions: Array +// Definitions by: Matt Gibbs , Simon Pfeifer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Chartist { @@ -20,6 +20,7 @@ declare namespace Chartist { Pie: IChartistPieChart; Bar: IChartistBarChart; Line: IChartistLineChart; + Candle: IChartistCandleChart; FixedScaleAxis: IFixedScaleAxisStatic; AutoScaleAxis: IAutoScaleAxisStatic; @@ -138,6 +139,10 @@ declare namespace Chartist { new (target: any, data: IChartistData, options?: IBarChartOptions, responsiveOptions?: Array>): IChartistBarChart; } + interface IChartistCandleChart extends IChartistBase { + new (target: any, data: IChartistData, options?: ICandleChartOptions, responsiveOptions?: Array>): IChartistCandleChart; + } + interface IChartOptions { /** * If true the whole data is reversed including labels, the series order as well as the whole series data arrays. @@ -352,6 +357,124 @@ declare namespace Chartist { end?: string; } + interface ICandleChartOptions extends IChartOptions { + + /** + * Options for X-Axis + */ + axisX?: ICandleChartAxis; + + /** + * Options for Y-Axis + */ + axisY?: ICandleChartAxis; + + /** + * Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + */ + width?: number | string; + + /** + * Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + */ + height?: number | string; + + /** + * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value + */ + hight?: number | string; + + /** + * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value + */ + low?: number | string; + + /** + * Width of candle body in pixel (IMO is 2 px best minimum value) + */ + candleWidth?: number | string; + + /** + * Width of candle wick in pixel (IMO is 1 px best minimum value) + */ + candleWickWidth?: number | string; + + /** + * Use calculated x-axis step length, depending on the number of quotes to display, as candle width. Otherwise the candleWidth is being used. + */ + useStepLengthAsCandleWidth?: boolean | string; + + /** + * Use 1/3 of candle body width as width for the candle wick, otherwise the candleWickWidth is being used. + */ + useOneThirdAsCandleWickWidth?: boolean | string; + + /** + * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + */ + chartPadding?: IChartPadding | number; + + /** + * When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler. + */ + fullWidth?: boolean | string; + + /** + * Override the class names that get used to generate the SVG structure of the chart + */ + classNames?: ICandleChartClasses; + } + + interface ICandleChartAxis { + /** + * The offset of the chart drawing area to the border of the container + */ + offset?: number; + /** + * Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + */ + position?: string; + /** + * Allows you to correct label positioning on this axis by positive or negative x and y offset. + */ + labelOffset?: { + x?: number; + y?: number; + }; + /** + * If labels should be shown or not + */ + showLabel?: boolean; + /** + * If the axis grid should be drawn or not + */ + showGrid?: boolean; + /** + * Interpolation function that allows you to intercept the value from the axis label + */ + labelInterpolationFnc?: Function; + /** + * Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. + */ + type?: any; + } + + interface ICandleChartClasses { + chart?: string; + label?: string; + labelGroup?: string; + series?: string; + candlePositive?: string; + candleNegative?: string, + grid?: string, + gridGroup?: string, + gridBackground?: string, + vertical?: string, + horizontal?: string, + start?: string, + end?: string, + } + interface ChartistSvgStatic { new (name: HTMLElement | string, attributes: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg; From 5a7ad344d10e8fdc8fa9dcb7ef2c873e3e966e20 Mon Sep 17 00:00:00 2001 From: Anton Cholakov Date: Fri, 9 Jun 2017 00:50:41 +0300 Subject: [PATCH 242/761] Add confirm property in PNotifyOptions (#17043) Use PNotifyconfirm interface as a type for confirm property in the PNotifyOptions --- types/jquery.pnotify/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/jquery.pnotify/index.d.ts b/types/jquery.pnotify/index.d.ts index 1d222efb26..3355f889ce 100644 --- a/types/jquery.pnotify/index.d.ts +++ b/types/jquery.pnotify/index.d.ts @@ -133,6 +133,10 @@ interface PNotifyOptions { * Whether to escape the content of the text. (Not allow HTML.) */ text_escape?: boolean; + /** + * Support for PNotifyconfirm options + */ + confirm?: PNotifyconfirm /** * What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", "fontawesome" or a custom style object) */ From 380c910b7470dc2fa0db17693cf18b94620f18c5 Mon Sep 17 00:00:00 2001 From: Eli Young Date: Thu, 8 Jun 2017 15:08:09 -0700 Subject: [PATCH 243/761] [bunyan] Fix automatic publishing (#17045) The DefinitelyTyped header needs to have the name of the library as it is published on npm. --- types/bunyan/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts index d46396023f..bc1dca298d 100644 --- a/types/bunyan/index.d.ts +++ b/types/bunyan/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-bunyan 1.8 +// Type definitions for bunyan 1.8 // Project: https://github.com/trentm/node-bunyan // Definitions by: Alex Mikhalev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 96d2d239f83f962da5144de776ec527352ba41ea Mon Sep 17 00:00:00 2001 From: Mads Madsen Date: Fri, 9 Jun 2017 00:08:28 +0200 Subject: [PATCH 244/761] Updated jwt-decode definitions to v2.2.0 (#17049) --- types/jwt-decode/index.d.ts | 6 +++--- types/jwt-decode/jwt-decode-tests.ts | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/types/jwt-decode/index.d.ts b/types/jwt-decode/index.d.ts index 5cf3772b68..d27cdf91e9 100644 --- a/types/jwt-decode/index.d.ts +++ b/types/jwt-decode/index.d.ts @@ -1,12 +1,12 @@ -// Type definitions for jwt-decode v1.4.0 +// Type definitions for jwt-decode v2.2.0 // Project: https://github.com/auth0/jwt-decode -// Definitions by: Giedrius Grabauskas +// Definitions by: Giedrius Grabauskas , Mads Madsen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace JwtDecode { interface JwtDecodeStatic { - (token: string): any; + (token: string, options?: { header: boolean }): any; } } diff --git a/types/jwt-decode/jwt-decode-tests.ts b/types/jwt-decode/jwt-decode-tests.ts index 4ec792fde1..7e65c2a5a4 100644 --- a/types/jwt-decode/jwt-decode-tests.ts +++ b/types/jwt-decode/jwt-decode-tests.ts @@ -9,4 +9,10 @@ interface TokenDto { iat: number; } -let decodedToken = jwtDecode(token) as TokenDto; +interface TokenHeaderDto { + typ: string; + alg: string; +} + +let decodedTokenPayload = jwtDecode(token) as TokenDto; +let decodedTokenHeader = jwtDecode(token, { header: true }) as TokenHeaderDto; \ No newline at end of file From b3dc832da43f1ea3362edfe2b78bf058c995dc89 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 15:10:18 -0700 Subject: [PATCH 245/761] multiplexjs: Fix error in typescript@next (#17055) --- types/multiplexjs/index.d.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/types/multiplexjs/index.d.ts b/types/multiplexjs/index.d.ts index eddd801609..0cc38c8c06 100644 --- a/types/multiplexjs/index.d.ts +++ b/types/multiplexjs/index.d.ts @@ -448,9 +448,9 @@ declare namespace multiplex { /** * Performs the specified action on each element of the List. - * @param action The action function to perform on each element of the List. + * @param action The action function to perform on each element of an List; the second parameter of the function represents the index of the source element. */ - forEach(action: (item: T) => void): void + forEach(action: (item: T, index: number) => void): void /** @@ -1741,14 +1741,6 @@ declare namespace multiplex { */ firstOrDefault(predicate: (item: T) => boolean, defaultValue: T): T - - /** - * Performs the specified action on each element of an Enumerable. - * @param action The action function to perform on each element of an Enumerable. - */ - forEach(action: (item: T) => void): void - - /** * Performs the specified action on each element of an Enumerable. * @param action The action function to perform on each element of an Enumerable; the second parameter of the function represents the index of the source element. From 261cdecc96aea45d6eba9d0c5d42f317ee1d5d6e Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 15:10:37 -0700 Subject: [PATCH 246/761] observe-js: Fix type of ArrayObserver_instance (#17056) --- types/observe-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/observe-js/index.d.ts b/types/observe-js/index.d.ts index 4b668bec16..d3321c9a8c 100644 --- a/types/observe-js/index.d.ts +++ b/types/observe-js/index.d.ts @@ -102,7 +102,7 @@ declare namespace observejs { } interface ArrayObserver_instance extends Observable { - open(onChange:(splices:Array)=>any):void + open(onChange: (splices: Array, oldSplices: Array) => any): void } /** From 2baab8780cd73ec5f57dcb8ac53d07be439154d2 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 15:10:57 -0700 Subject: [PATCH 247/761] passport-local-mongoose: Fix error in typescript@next (#17058) --- .../passport-local-mongoose/passport-local-mongoose-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/passport-local-mongoose/passport-local-mongoose-tests.ts b/types/passport-local-mongoose/passport-local-mongoose-tests.ts index 7b428561fe..63c82a9913 100644 --- a/types/passport-local-mongoose/passport-local-mongoose-tests.ts +++ b/types/passport-local-mongoose/passport-local-mongoose-tests.ts @@ -31,13 +31,13 @@ interface User extends PassportLocalDocument { last: Date; } -const UserSchema: PassportLocalSchema = new Schema({ +const UserSchema = new Schema({ username: String, hash: String, salt: String, attempts: Number, last: Date -}); +}) as PassportLocalSchema; let options: PassportLocalOptions = {}; options.iterations = 25000; From e8aac973ef3e774c3fd9c0c425525e58848a61fa Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 15:13:10 -0700 Subject: [PATCH 248/761] quill: Fix error in typescript@next (#17060) --- types/quill/quill-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/quill/quill-tests.ts b/types/quill/quill-tests.ts index b16c90b384..eba77f8b68 100644 --- a/types/quill/quill-tests.ts +++ b/types/quill/quill-tests.ts @@ -170,7 +170,7 @@ function test_addContainer() function test_on_EventType1(){ var quillEditor = new Quill('#editor'); - quillEditor.on('text-change', (newDelta, oldDelta, source)=>{ + quillEditor.on('text-change', (newDelta: T, oldDelta: T, source: string)=>{ // happened }); From 90ccae007e185274f5dae2e6863005ace1dc99af Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 15:13:41 -0700 Subject: [PATCH 249/761] restify: Fix error in typescript@next (#17061) --- types/restify/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index 5f7e0ccb21..a7781f933c 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -483,13 +483,14 @@ export interface Client { basicAuth(username: string, password: string): any; } -export interface HttpClient extends Client { +export interface HttpClient { get(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; head(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; post(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; put(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; patch(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; del(opts?: string | { path?: string; [name: string]: any }, callback?: (err: any, req: Request) => void): any; + basicAuth(username: string, password: string): any; } export interface ThrottleOptions { From cc464d95a45feb58f45fa683d4b9633b06f73e71 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 15:14:00 -0700 Subject: [PATCH 250/761] rx-*: Fix lint (#17062) --- types/rx-core-binding/index.d.ts | 2 +- types/rx-lite-aggregates/index.d.ts | 2 +- types/rx-lite-async/index.d.ts | 2 +- types/rx-lite-backpressure/index.d.ts | 2 +- types/rx-lite-coincidence/index.d.ts | 2 +- types/rx-lite-time/index.d.ts | 2 +- types/rx-lite-virtualtime/index.d.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/types/rx-core-binding/index.d.ts b/types/rx-core-binding/index.d.ts index e8ba93bd3a..3b7cf59369 100644 --- a/types/rx-core-binding/index.d.ts +++ b/types/rx-core-binding/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface ISubject extends Observable, Observer, IDisposable { diff --git a/types/rx-lite-aggregates/index.d.ts b/types/rx-lite-aggregates/index.d.ts index 72c2ae402f..2b2ce8d6b7 100644 --- a/types/rx-lite-aggregates/index.d.ts +++ b/types/rx-lite-aggregates/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface Observable { diff --git a/types/rx-lite-async/index.d.ts b/types/rx-lite-async/index.d.ts index 94117a1562..8979b9dd36 100644 --- a/types/rx-lite-async/index.d.ts +++ b/types/rx-lite-async/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: zoetrope , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface ObservableStatic { diff --git a/types/rx-lite-backpressure/index.d.ts b/types/rx-lite-backpressure/index.d.ts index fa997f03c6..73e9f2e8d1 100644 --- a/types/rx-lite-backpressure/index.d.ts +++ b/types/rx-lite-backpressure/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface Observable { diff --git a/types/rx-lite-coincidence/index.d.ts b/types/rx-lite-coincidence/index.d.ts index 3682126071..7649b234be 100644 --- a/types/rx-lite-coincidence/index.d.ts +++ b/types/rx-lite-coincidence/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface Observable { diff --git a/types/rx-lite-time/index.d.ts b/types/rx-lite-time/index.d.ts index e5abaf3832..e1cf93dc07 100644 --- a/types/rx-lite-time/index.d.ts +++ b/types/rx-lite-time/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface Observable { diff --git a/types/rx-lite-virtualtime/index.d.ts b/types/rx-lite-virtualtime/index.d.ts index 7413ec2604..1ff855f532 100644 --- a/types/rx-lite-virtualtime/index.d.ts +++ b/types/rx-lite-virtualtime/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: gsino , Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace Rx { interface VirtualTimeScheduler extends Scheduler { From a994ca3b6016a1a1212380b866412a21140f00df Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 15:14:24 -0700 Subject: [PATCH 251/761] stale-lru-cache: Fix error in typescript@next (#17063) --- types/stale-lru-cache/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/stale-lru-cache/index.d.ts b/types/stale-lru-cache/index.d.ts index f5ab3733b3..80be52905d 100644 --- a/types/stale-lru-cache/index.d.ts +++ b/types/stale-lru-cache/index.d.ts @@ -22,7 +22,7 @@ declare class Cache { } declare namespace Cache { - type OptionsCallback = (error: any, value: V, options?: string | SetOptions) => void; + type OptionsCallback = (error: any, value?: V, options?: string | SetOptions) => void; type RevalidationCallback = (key: K, callback: OptionsCallback) => void; interface CacheOptions { From b3212da01e75bd1604a1612e80320414d6bb4575 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 15:15:14 -0700 Subject: [PATCH 252/761] vinyl: Fix error in typescript@next (#17065) --- types/vinyl/v0/vinyl-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/vinyl/v0/vinyl-tests.ts b/types/vinyl/v0/vinyl-tests.ts index 910b5b7bc7..e9017f7235 100644 --- a/types/vinyl/v0/vinyl-tests.ts +++ b/types/vinyl/v0/vinyl-tests.ts @@ -72,9 +72,9 @@ describe('File', () => { }); it('should set stat to given value', done => { - var val = {}; - var file = new File({stat: val}); - file.stat.should.equal(val); + var stat = {} as fs.Stats; + var file = new File({ stat }); + file.stat.should.equal(stat); done(); }); From be319089e5efbe5b2ddd526fe16cbf9558d85d38 Mon Sep 17 00:00:00 2001 From: Jean-Michel DECORET Date: Thu, 8 Jun 2017 22:18:37 +0000 Subject: [PATCH 253/761] Fix Materialize-css ScrollFireOptions (#17044) * Fix Materialize-css ScrollFireOptions The callback is either a strng, or a real typescript callback. * Add parens --- types/materialize-css/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/materialize-css/index.d.ts b/types/materialize-css/index.d.ts index 12dbeb5aa0..2c43daf285 100644 --- a/types/materialize-css/index.d.ts +++ b/types/materialize-css/index.d.ts @@ -316,8 +316,9 @@ declare namespace Materialize { * The string function call that you want to make when the user scrolls to the threshold. * It will only be called once. * Example: 'console.log("hello, world!")'; + * or callback: () => { console.log('hello world'); } */ - callback?: string; + callback?: string | (() => void); } interface TabOptions { From 26ae3e5aae99621e16007809465ede468b1aa566 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Fri, 9 Jun 2017 00:19:57 +0200 Subject: [PATCH 254/761] add jest-matchers (#17040) --- types/jest-matchers/index.d.ts | 7 +++++++ types/jest-matchers/jest-matchers-tests.ts | 3 +++ types/jest-matchers/tsconfig.json | 22 ++++++++++++++++++++++ types/jest-matchers/tslint.json | 1 + 4 files changed, 33 insertions(+) create mode 100644 types/jest-matchers/index.d.ts create mode 100644 types/jest-matchers/jest-matchers-tests.ts create mode 100644 types/jest-matchers/tsconfig.json create mode 100644 types/jest-matchers/tslint.json diff --git a/types/jest-matchers/index.d.ts b/types/jest-matchers/index.d.ts new file mode 100644 index 0000000000..27e6a5b9f0 --- /dev/null +++ b/types/jest-matchers/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for jest-matchers 20.0 +// Project: https://github.com/facebook/jest#readme +// Definitions by: Joscha Feth +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +export = expect; diff --git a/types/jest-matchers/jest-matchers-tests.ts b/types/jest-matchers/jest-matchers-tests.ts new file mode 100644 index 0000000000..7484dd5ed8 --- /dev/null +++ b/types/jest-matchers/jest-matchers-tests.ts @@ -0,0 +1,3 @@ +import * as expect from 'jest-matchers'; + +expect('x').toEqual('x'); diff --git a/types/jest-matchers/tsconfig.json b/types/jest-matchers/tsconfig.json new file mode 100644 index 0000000000..37a7e86d8d --- /dev/null +++ b/types/jest-matchers/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jest-matchers-tests.ts" + ] +} diff --git a/types/jest-matchers/tslint.json b/types/jest-matchers/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-matchers/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f91d29adad47ead7491da5c071d1635a3b5f670e Mon Sep 17 00:00:00 2001 From: Nick Schultz Date: Thu, 8 Jun 2017 18:27:57 -0400 Subject: [PATCH 255/761] sequelize: update BelongsToManyAssociationMixin to accept join table attributes (#17071) * update BelongsToManyAssociationMixin to accept join table attributes correctly * dont make a bunch of automatic editor changes --- types/sequelize/index.d.ts | 8 ++++---- types/sequelize/sequelize-tests.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 68c68a854f..70c637e25a 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -811,7 +811,7 @@ declare namespace sequelize { */ ( newAssociations?: Array, - options?: BelongsToManySetAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | TJoinTableAttributes + options?: BelongsToManySetAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | { through: TJoinTableAttributes } ): Promise; } @@ -860,7 +860,7 @@ declare namespace sequelize { */ ( newAssociations?: Array, - options?: BelongsToManyAddAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | TJoinTableAttributes + options?: BelongsToManyAddAssociationsMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | { through: TJoinTableAttributes } ): Promise; } @@ -909,7 +909,7 @@ declare namespace sequelize { */ ( newAssociation?: TInstance | TInstancePrimaryKey, - options?: BelongsToManyAddAssociationMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | TJoinTableAttributes + options?: BelongsToManyAddAssociationMixinOptions | FindOptions | BulkCreateOptions | InstanceUpdateOptions | InstanceDestroyOptions | { through: TJoinTableAttributes } ): Promise; } @@ -952,7 +952,7 @@ declare namespace sequelize { */ ( values?: TAttributes, - options?: BelongsToManyCreateAssociationMixinOptions | CreateOptions | TJoinTableAttributes + options?: BelongsToManyCreateAssociationMixinOptions | CreateOptions | { through: TJoinTableAttributes } ): Promise; } diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index c5c494a454..d786dfc4a2 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -270,19 +270,19 @@ warehouse.getBranches({ where: {} }).then((branches) => branches[0].rank); warehouse.setBranches(); warehouse.setBranches([branch]); -warehouse.setBranches([branch, 2], { validate: true, distance: 1 }).then(() => { }); +warehouse.setBranches([branch, 2], { validate: true, through: { distance: 1 } }).then(() => { }); warehouse.addBranches(); warehouse.addBranches([branch]); -warehouse.addBranches([branch, 2], { validate: false, distance: 1 }).then(() => { }); +warehouse.addBranches([branch, 2], { validate: false, through: { distance: 1 } }).then(() => { }); warehouse.addBranch(); warehouse.addBranch(branch); -warehouse.addBranch(2, { validate: true, distance: 1 }).then(() => { }); +warehouse.addBranch(2, { validate: true, through: { distance: 1 } }).then(() => { }); warehouse.createBranch(); warehouse.createBranch({ id: 1, address: 'baz' }); -warehouse.createBranch({ id: 1 }, { silent: true, distance: 1 }).then((branch) => { }); +warehouse.createBranch({ id: 1 }, { silent: true, through: { distance: 1 } }).then((branch) => { }); warehouse.removeBranches(); warehouse.removeBranches([branch]); From ad756d05b3537420eac2e66baaec58fae27a0e31 Mon Sep 17 00:00:00 2001 From: Mike Woodward Date: Thu, 8 Jun 2017 17:30:24 -0500 Subject: [PATCH 256/761] className type support for Uncontrolled Dropdown (#17075) --- types/reactstrap/lib/Dropdown.d.ts | 2 +- types/reactstrap/reactstrap-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/reactstrap/lib/Dropdown.d.ts b/types/reactstrap/lib/Dropdown.d.ts index 57e4532a31..c89150fd83 100644 --- a/types/reactstrap/lib/Dropdown.d.ts +++ b/types/reactstrap/lib/Dropdown.d.ts @@ -3,6 +3,7 @@ export interface UncontrolledProps { isOpen?: boolean; toggle?: () => void; + className?: string; } export interface Props extends UncontrolledProps { @@ -12,7 +13,6 @@ export interface Props extends UncontrolledProps { size?: string; tag?: React.ReactType; tether?: boolean | Tether.ITetherOptions; - className?: string; } declare var Dropdown: React.StatelessComponent; diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index ba5f5e38e1..b69023e6c0 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -1051,7 +1051,7 @@ class Example43 extends React.Component { function Example44() { return ( - + Dropdown From 2305d1e38df2c75362d842fd58a3d7267d980a30 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 18:38:05 -0400 Subject: [PATCH 257/761] Remove union type in pouchdb-core The union is covered by the overload. --- types/pouchdb-core/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/pouchdb-core/index.d.ts b/types/pouchdb-core/index.d.ts index 933dfbf6a5..59d60be2e0 100644 --- a/types/pouchdb-core/index.d.ts +++ b/types/pouchdb-core/index.d.ts @@ -534,7 +534,7 @@ declare namespace PouchDB { /** Fetch a document */ get(docId: Core.DocumentId, - options?: Core.GetOptions | Core.GetOpenRevisions + options?: Core.GetOptions ): Promise & Core.GetMeta>; /** Fetch a document */ From 7019f85ea5b3d6d30cbeb3bf05babf612695790d Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 8 Jun 2017 15:46:15 -0700 Subject: [PATCH 258/761] webpack: Remove test that fails in typescript@next (#17066) --- types/webpack/webpack-tests.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index 066bdfb740..6c7095483d 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -585,14 +585,6 @@ class TestResolvePlugin implements webpack.ResolvePlugin { } } -const resolve: webpack.Resolve = { - plugins: [ - new TestResolvePlugin() - ], - symlinks: false, - cachePredicate: 'boo' // why does this test _not_ fail!? -}; - const performance: webpack.Options.Performance = { hints: 'error', maxEntrypointSize: 400000, From eef8a774f54b920cf17216c72dd142d8db7bd7cd Mon Sep 17 00:00:00 2001 From: Yui Date: Thu, 8 Jun 2017 15:50:41 -0700 Subject: [PATCH 259/761] manually port fix from 16286 and address PR (#17003) --- types/reactstrap/lib/Row.d.ts | 4 ++-- types/reactstrap/reactstrap-tests.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/reactstrap/lib/Row.d.ts b/types/reactstrap/lib/Row.d.ts index b318b6e6f5..61529c4a48 100644 --- a/types/reactstrap/lib/Row.d.ts +++ b/types/reactstrap/lib/Row.d.ts @@ -1,8 +1,8 @@ -interface Props { +interface Props extends React.HTMLProps< HTMLElement> { className?: string; tag?: React.ReactType; noGutters?: boolean; } -declare var Row: React.StatelessComponent>; +declare var Row: React.StatelessComponent; export default Row; \ No newline at end of file diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index b69023e6c0..331436760e 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -549,7 +549,7 @@ const Example26 = (props: any) => { const Example27 = (props: any) => { return ( - + Special Title Treatment From e8568770879dd7f8442331b969ae4892cb73c77d Mon Sep 17 00:00:00 2001 From: Kamil Szostak Date: Thu, 8 Jun 2017 15:51:32 -0700 Subject: [PATCH 260/761] Update application insights JS SDK types (#17076) --- .../applicationinsights-js-tests.ts | 13 ++++++++++++- types/applicationinsights-js/index.d.ts | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/types/applicationinsights-js/applicationinsights-js-tests.ts b/types/applicationinsights-js/applicationinsights-js-tests.ts index 8967356426..ecefb6d41a 100644 --- a/types/applicationinsights-js/applicationinsights-js-tests.ts +++ b/types/applicationinsights-js/applicationinsights-js-tests.ts @@ -118,7 +118,18 @@ const envelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(dat context.track(envelope); -context.addTelemetryInitializer(telemetryEnvelope => false); +context.addTelemetryInitializer(envelope => false); +context.addTelemetryInitializer(envelope => { }); + +// a sample from: https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md#example +context.addTelemetryInitializer(envelope => { + let telemetryItem = envelope.data.baseData; + if (envelope.name === Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType) { + telemetryItem.url = "URL CENSORED"; + } + telemetryItem.properties = telemetryItem.properties || {}; + telemetryItem.properties["globalProperty"] = "boo"; +}); // track event const eventObj = new Microsoft.ApplicationInsights.Telemetry.Event("test", null, null); diff --git a/types/applicationinsights-js/index.d.ts b/types/applicationinsights-js/index.d.ts index 0a01d726a4..17137d67dd 100644 --- a/types/applicationinsights-js/index.d.ts +++ b/types/applicationinsights-js/index.d.ts @@ -572,6 +572,7 @@ declare module Microsoft.ApplicationInsights { isPerfAnalyzerEnabled?: boolean; url?: string; isStorageUseDisabled?: boolean; + isBeaconApiDisabled?: boolean; } /** @@ -611,6 +612,7 @@ declare module Microsoft.ApplicationInsights { tags: { [name: string]: any; }; + data: any; } interface ITelemetryContext { @@ -650,7 +652,7 @@ declare module Microsoft.ApplicationInsights { * 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; + addTelemetryInitializer(telemetryInitializer: (envelope: Microsoft.ApplicationInsights.IEnvelope) => boolean | void): any; /** * Tracks telemetry object. */ From 37e857614e2b3c7f622bb305be9ad8f075ff62bf Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 18:59:03 -0400 Subject: [PATCH 261/761] Generic map/reduce parameters for pouchdb-mapreduce --- types/pouchdb-mapreduce/index.d.ts | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index 7b398d730b..b9a05ff7d6 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -10,9 +10,9 @@ /* tslint:disable:no-single-declare-module */ declare namespace PouchDB { - interface Filter { - map(doc: any): void; - reduce?(key: string, value: any): any; + interface Filter { + map(doc: Content): void; + reduce?(key: string, value: Content): Reduction; } namespace Query { @@ -94,17 +94,32 @@ declare namespace PouchDB { * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Filter | ((doc: any) => void), opts: Query.Options, callback: (err: Core.Error, res: Query.Response) => void): void; + query(fun: string | ((doc: Content & Model) => void), opts: Query.Options, callback: (err: Core.Error, res: Query.Response) => void): void; /** * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Filter | ((doc: any) => void), callback: (err: Core.Error, res: Query.Response) => void): void; + query(fun: Filter, opts: Query.Options, callback: (err: Core.Error, res: Query.Response) => void): void; /** * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Filter | ((doc: any) => void), opts?: Query.Options): Promise>; + query(fun: string | ((doc: Content & Model) => void), callback: (err: Core.Error, res: Query.Response) => void): void; + /** + * Invoke a map/reduce function, which allows you to perform more complex queries + * on PouchDB than what you get with allDocs(). + */ + query(fun: Filter, callback: (err: Core.Error, res: Query.Response) => void): void; + /** + * Invoke a map/reduce function, which allows you to perform more complex queries + * on PouchDB than what you get with allDocs(). + */ + query(fun: string | ((doc: Content & Model) => void), opts?: Query.Options): Promise>; + /** + * Invoke a map/reduce function, which allows you to perform more complex queries + * on PouchDB than what you get with allDocs(). + */ + query(fun: Filter, opts?: Query.Options): Promise>; } } From b47f2db564c54f8145a791fe197d7092c9b677c0 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:07:26 +0100 Subject: [PATCH 262/761] Added documentation --- types/nodegit/cert.d.ts | 6 + types/nodegit/clone-options.d.ts | 48 +++ types/nodegit/clone.d.ts | 21 ++ types/nodegit/commit.d.ts | 326 ++++++++++++++++++++- types/nodegit/config.d.ts | 69 +++++ types/nodegit/convenient-patch.d.ts | 119 ++++++++ types/nodegit/cred-user-pass-payload.d.ts | 12 + types/nodegit/cred-username.d.ts | 12 + types/nodegit/cred.d.ts | 78 ++++- types/nodegit/cvar-map.d.ts | 18 ++ types/nodegit/describe-format-options.d.ts | 24 ++ types/nodegit/describe-options.d.ts | 36 +++ types/nodegit/diff-binary-file.d.ts | 24 ++ types/nodegit/diff-binary.d.ts | 19 ++ types/nodegit/diff-file.d.ts | 35 +++ types/nodegit/diff-hunk.d.ts | 36 +++ types/nodegit/diff-line.d.ts | 51 ++++ types/nodegit/diff-options.d.ts | 103 ++++++- types/nodegit/diff-perf-data.d.ts | 18 ++ types/nodegit/diff.d.ts | 212 +++++++++++++- types/nodegit/error.d.ts | 12 + types/nodegit/fetch-options.d.ts | 45 +++ types/nodegit/fetch.d.ts | 10 + types/nodegit/filter.d.ts | 108 +++++++ types/nodegit/git-err.d.ts | 34 ++- types/nodegit/graph.d.ts | 22 ++ types/nodegit/ignore.d.ts | 29 ++ 27 files changed, 1500 insertions(+), 27 deletions(-) diff --git a/types/nodegit/cert.d.ts b/types/nodegit/cert.d.ts index fde86569b9..c368f83bb6 100644 --- a/types/nodegit/cert.d.ts +++ b/types/nodegit/cert.d.ts @@ -13,5 +13,11 @@ export namespace Cert { } export class Cert { + /** + * + * + * @type {Cert.TYPE} + * @memberof Cert + */ certType: Cert.TYPE; } diff --git a/types/nodegit/clone-options.d.ts b/types/nodegit/clone-options.d.ts index 8535b28c81..424a289cbe 100644 --- a/types/nodegit/clone-options.d.ts +++ b/types/nodegit/clone-options.d.ts @@ -2,12 +2,60 @@ import { CheckoutOptions } from './checkout-options'; import { FetchOptions } from './fetch-options'; export class CloneOptions { + /** + * + * + * @type {number} + * @memberof CloneOptions + */ version?: number; + /** + * + * + * @type {CheckoutOptions} + * @memberof CloneOptions + */ checkoutOpts?: CheckoutOptions; + /** + * + * + * @type {FetchOptions} + * @memberof CloneOptions + */ fetchOpts?: FetchOptions; + /** + * + * + * @type {number} + * @memberof CloneOptions + */ bare?: number; + /** + * + * + * @type {number} + * @memberof CloneOptions + */ local?: number; + /** + * + * + * @type {string} + * @memberof CloneOptions + */ checkoutBranch?: string; + /** + * + * + * @type {*} + * @memberof CloneOptions + */ repositoryCbPayload?: any; + /** + * + * + * @type {*} + * @memberof CloneOptions + */ remoteCbPayload?: any; } diff --git a/types/nodegit/clone.d.ts b/types/nodegit/clone.d.ts index c038a8e26a..61f8cfe2cf 100644 --- a/types/nodegit/clone.d.ts +++ b/types/nodegit/clone.d.ts @@ -11,6 +11,27 @@ export namespace Clone { } export class Clone { + /** + * Patch repository cloning to automatically coerce objects. + * + * @static + * @param {string} url + * @param {string} local_path + * @param {CloneOptions} [options] + * @returns {Promise} + * + * @memberof Clone + */ static clone(url: string, local_path: string, options?: CloneOptions): Promise; + /** + * + * + * @static + * @param {CloneOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Clone + */ static initOptions(opts: CloneOptions, version: number): number; } diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts index 24ee08cc48..247fdb102d 100644 --- a/types/nodegit/commit.d.ts +++ b/types/nodegit/commit.d.ts @@ -10,40 +10,360 @@ import { TreeEntry } from './tree-entry'; import { Diff } from './diff'; export class Commit { - static create(repo: Repository, update_ref: string, author: Signature, committer: Signature, message_encoding: string, message: string, tree: Tree, parent_count: number, parents: any[]): Oid; - static createV(id: Oid, repo: Repository, update_ref: string, author: Signature, committer: Signature, message_encoding: string, message: string, tree: Tree, parent_count: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {string} messageEncoding + * @param {string} message + * @param {Tree} tree + * @param {number} parentCount + * @param {any[]} parents + * @returns {Oid} + * + * @memberof Commit + */ + static create(repo: Repository, updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree, parentCount: number, parents: any[]): Oid; + /** + * + * + * @static + * @param {Oid} id + * @param {Repository} repo + * @param {string} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {string} messageEncoding + * @param {string} message + * @param {Tree} tree + * @param {number} parentCount + * @returns {number} + * + * @memberof Commit + */ + static createV(id: Oid, repo: Repository, updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree, parentCount: number): number; + /** + * Retrieves the commit pointed to by the oid + * + * @static + * @param {Repository} repo + * @param {(string | Oid | Commit)} id + * @returns {Promise} + * + * @memberof Commit + */ static lookup(repo: Repository, id: string | Oid | Commit): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} len + * @returns {Promise} + * + * @memberof Commit + */ static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} commitContent + * @param {string} signature + * @param {string} signatureField + * @returns {Promise} + * + * @memberof Commit + */ + static createWithSignature(repo: Repository, commitContent: string, signature: string, signatureField: string): Promise; - amend(update_ref: string, author: Signature, committer: Signature, message_encoding: string, message: string, tree: Tree): Oid; + /** + * + * + * @param {string} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {string} messageEncoding + * @param {string} message + * @param {Tree} tree + * @returns {Oid} + * + * @memberof Commit + */ + amend(updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree): Oid; + /** + * + * + * @returns {Signature} + * + * @memberof Commit + */ author(): Signature; + /** + * + * + * @returns {Signature} + * + * @memberof Commit + */ committer(): Signature; + /** + * + * + * + * @memberof Commit + */ free(): void; + /** + * + * + * @param {string} field + * @returns {Promise} + * + * @memberof Commit + */ headerField(field: string): Promise; + /** + * + * + * @returns {Oid} + * + * @memberof Commit + */ id(): Oid; + /** + * + * + * @returns {string} + * + * @memberof Commit + */ message(): string; + /** + * + * + * @returns {string} + * + * @memberof Commit + */ messageEncoding(): string; + /** + * + * + * @returns {string} + * + * @memberof Commit + */ messageRaw(): string; + /** + * + * + * @param {number} n + * @returns {Promise} + * + * @memberof Commit + */ nthGenAncestor(n: number): Promise; + /** + * + * + * @returns {Repository} + * + * @memberof Commit + */ owner(): Repository; + /** + * + * + * @param {number} n + * @returns {Promise} + * + * @memberof Commit + */ parent(n: number): Promise; + /** + * + * + * @param {number} n + * @returns {Oid} + * + * @memberof Commit + */ parentId(n: number): Oid; + /** + * + * + * @returns {number} + * + * @memberof Commit + */ parentcount(): number; + /** + * + * + * @returns {string} + * + * @memberof Commit + */ rawHeader(): string; + /** + * + * + * @returns {string} + * + * @memberof Commit + */ summary(): string; + /** + * + * + * @returns {number} + * + * @memberof Commit + */ time(): number; + /** + * + * + * @returns {number} + * + * @memberof Commit + */ timeOffset(): number; + /** + * + * + * @param {Tree} tree_out + * @returns {number} + * + * @memberof Commit + */ tree(tree_out: Tree): number; + /** + * + * + * @returns {Oid} + * + * @memberof Commit + */ treeId(): Oid; + /** + * Retrieve the SHA. + * + * @returns {string} + * + * @memberof Commit + */ sha(): string; + /** + * Retrieve the commit time as a unix timestamp. + * + * @returns {number} + * + * @memberof Commit + */ timeMs(): number; + /** + * Retrieve the commit time as a Date object. + * + * @returns {Date} + * + * @memberof Commit + */ date(): Date; + /** + * Get the tree associated with this commit. + * + * @returns {Promise} + * + * @memberof Commit + */ getTree(): Promise; + /** + * Retrieve the entry represented by path for this commit. Path must be relative to repository root. + * + * @param {string} path + * @returns {Promise} + * + * @memberof Commit + */ getEntry(path: string): Promise; + /** + * Walk the history from this commit backwards. + * An EventEmitter is returned that will emit a "commit" event for each commit in the history, and one "end" + * event when the walk is completed. Don't forget to call start() on the returned event. + * + * @returns {EventEmitter} + * + * @memberof Commit + */ history(): EventEmitter; + /** + * Retrieve the commit's parents as commit objects. + * + * @param {number} limit + * @param {Function} callback + * @returns {Promise} + * + * @memberof Commit + */ getParents(limit: number, callback: Function): Promise; + /** + * Retrieve the commit's parent shas. + * + * @param {Function} callback + * @returns {Oid[]} + * + * @memberof Commit + */ parents(callback: Function): Oid[]; + /** + * Generate an array of diff trees showing changes between this commit and its parent(s). + * + * @param {Function} callback + * @returns {Promise} + * + * @memberof Commit + */ getDiff(callback: Function): Promise; + /** + * Generate an array of diff trees showing changes between this commit and its parent(s). + * + * @param {Object} options + * @param {Function} callback + * @returns {Promise} + * + * @memberof Commit + */ getDiffWithOptions(options: Object, callback: Function): Promise; + /** + * The sha of this commit + * + * @returns {string} + * + * @memberof Commit + */ toString(): string; + /** + * + * + * @returns {Promise} + * + * @memberof Commit + */ + dup(): Promise; + /** + * consists of a summary + * + * @returns {string} + * + * @memberof Commit + */ + body(): string; } diff --git a/types/nodegit/config.d.ts b/types/nodegit/config.d.ts index ea61c52d3c..eea13c6c70 100644 --- a/types/nodegit/config.d.ts +++ b/types/nodegit/config.d.ts @@ -12,11 +12,80 @@ export namespace Config { } export class Config { + /** + * + * + * @static + * @returns {Promise} + * + * @memberof Config + */ static openDefault(): Promise; + /** + * + * + * @static + * @returns {Promise} + * + * @memberof Config + */ + static findProgramdata(): Promise; + /** + * + * + * @param {string} name + * @returns {Promise} + * + * @memberof Config + */ getStringBuf(name: string): Promise; + /** + * + * + * @param {string} name + * @param {number} value + * @returns {number} + * + * @memberof Config + */ setInt64(name: string, value: number): number; + /** + * + * + * @param {string} name + * @param {string} regexp + * @param {string} value + * @returns {number} + * + * @memberof Config + */ setMultivar(name: string, regexp: string, value: string): number; + /** + * + * + * @param {string} name + * @param {string} value + * @returns {Promise} + * + * @memberof Config + */ setString(name: string, value: string): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Config + */ snapshot(): Promise; + /** + * + * + * @param {*} transaction + * @returns {number} + * + * @memberof Config + */ + lock(transaction: any): number; } diff --git a/types/nodegit/convenient-patch.d.ts b/types/nodegit/convenient-patch.d.ts index 8dee260aa0..b03bb2ff54 100644 --- a/types/nodegit/convenient-patch.d.ts +++ b/types/nodegit/convenient-patch.d.ts @@ -1,21 +1,140 @@ import { DiffFile } from './diff-file'; export class ConvenientPatch { + /** + * Old attributes of the file + * + * @returns {DiffFile} + * + * @memberof ConvenientPatch + */ oldFile(): DiffFile; + /** + * New attributes of the file + * + * @returns {DiffFile} + * + * @memberof ConvenientPatch + */ newFile(): DiffFile; + /** + * The number of hunks in this patch + * + * @returns {number} + * + * @memberof ConvenientPatch + */ size(): number; + /** + * The hunks in this patch + * + * @returns {Promise} + * + * @memberof ConvenientPatch + */ hunks(): Promise; + /** + * The status of this patch (unmodified, added, deleted) + * + * @returns {number} + * + * @memberof ConvenientPatch + */ status(): number; + /** + * The line statistics of this patch (#contexts, #added, #deleted) + * + * @returns {*} + * + * @memberof ConvenientPatch + */ lineStats(): any; + /** + * Is this an unmodified patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isUnmodified(): Boolean; + /** + * Is this an added patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isAdded(): Boolean; + /** + * Is this a deleted patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isDeleted(): Boolean; + /** + * Is this an modified patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isModified(): Boolean; + /** + * Is this a renamed patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isRenamed(): Boolean; + /** + * Is this a copied patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isCopied(): Boolean; + /** + * Is this an ignored patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isIgnored(): Boolean; + /** + * Is this an untracked patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isUntracked(): Boolean; + /** + * Is this a type change? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isTypeChange(): Boolean; + /** + * Is this an undreadable patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isUnreadable(): Boolean; + /** + * Is this a conflicted patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isConflicted(): Boolean; } diff --git a/types/nodegit/cred-user-pass-payload.d.ts b/types/nodegit/cred-user-pass-payload.d.ts index 95beeb9f3a..fdf65b9342 100644 --- a/types/nodegit/cred-user-pass-payload.d.ts +++ b/types/nodegit/cred-user-pass-payload.d.ts @@ -1,4 +1,16 @@ export class CredUserpassPayload { + /** + * + * + * @type {string} + * @memberof CredUserpassPayload + */ username: string; + /** + * + * + * @type {string} + * @memberof CredUserpassPayload + */ password: string; } diff --git a/types/nodegit/cred-username.d.ts b/types/nodegit/cred-username.d.ts index d7b619eb5d..2522b3968a 100644 --- a/types/nodegit/cred-username.d.ts +++ b/types/nodegit/cred-username.d.ts @@ -1,6 +1,18 @@ import { Cred } from './cred'; export class CredUsername { + /** + * + * + * @type {Cred} + * @memberof CredUsername + */ parent: Cred; + /** + * + * + * @type {string} + * @memberof CredUsername + */ username: string; } diff --git a/types/nodegit/cred.d.ts b/types/nodegit/cred.d.ts index 9de014311b..d7b96c9fd8 100644 --- a/types/nodegit/cred.d.ts +++ b/types/nodegit/cred.d.ts @@ -11,12 +11,86 @@ export namespace Cred { } export class Cred { + /** + * + * + * @static + * @returns {Cred} + * + * @memberof Cred + */ static defaultNew(): Cred; + /** + * + * + * @static + * @param {string} username + * @returns {Cred} + * + * @memberof Cred + */ static sshKeyFromAgent(username: string): Cred; - static sshKeyMemoryNew(username: string, publickey: string, privatekey: string, passphrase: string): Promise; - static sshKeyNew(username: string, publickey: string, privatekey: string, passphrase: string): Cred; + /** + * + * + * @static + * @param {string} username + * @param {string} publicKey + * @param {string} privateKey + * @param {string} passphrase + * @returns {Promise} + * + * @memberof Cred + */ + static sshKeyMemoryNew(username: string, publicKey: string, privateKey: string, passphrase: string): Promise; + /** + * + * + * @static + * @param {string} username + * @param {string} publicKey + * @param {string} privateKey + * @param {string} passphrase + * @returns {Cred} + * + * @memberof Cred + */ + static sshKeyNew(username: string, publicKey: string, privateKey: string, passphrase: string): Cred; + /** + * + * + * @static + * @param {string} username + * @returns {Promise} + * + * @memberof Cred + */ static usernameNew(username: string): Promise; + /** + * + * + * @static + * @param {string} username + * @param {string} password + * @returns {Cred} + * + * @memberof Cred + */ static userpassPlaintextNew(username: string, password: string): Cred; + /** + * + * + * @returns {number} + * + * @memberof Cred + */ hasUsername(): number; + /** + * + * + * + * @memberof Cred + */ + free(): void; } diff --git a/types/nodegit/cvar-map.d.ts b/types/nodegit/cvar-map.d.ts index f7c4b227d0..2a5665dc6b 100644 --- a/types/nodegit/cvar-map.d.ts +++ b/types/nodegit/cvar-map.d.ts @@ -1,5 +1,23 @@ export class CvarMap { + /** + * + * + * @type {number} + * @memberof CvarMap + */ cvarType: number; + /** + * + * + * @type {string} + * @memberof CvarMap + */ strMatch: string; + /** + * + * + * @type {number} + * @memberof CvarMap + */ mapValue: number; } diff --git a/types/nodegit/describe-format-options.d.ts b/types/nodegit/describe-format-options.d.ts index ecb7f4d762..4a67cd9082 100644 --- a/types/nodegit/describe-format-options.d.ts +++ b/types/nodegit/describe-format-options.d.ts @@ -1,6 +1,30 @@ export class DescribeFormatOptions { + /** + * + * + * @type {number} + * @memberof DescribeFormatOptions + */ version: number; + /** + * + * + * @type {number} + * @memberof DescribeFormatOptions + */ abbreviatedSize: number; + /** + * + * + * @type {number} + * @memberof DescribeFormatOptions + */ alwaysUseLongFormat: number; + /** + * + * + * @type {string} + * @memberof DescribeFormatOptions + */ dirtySuffix: string; } diff --git a/types/nodegit/describe-options.d.ts b/types/nodegit/describe-options.d.ts index 939750eb11..f860bb88e9 100644 --- a/types/nodegit/describe-options.d.ts +++ b/types/nodegit/describe-options.d.ts @@ -1,8 +1,44 @@ export class DescribeOptions { + /** + * + * + * @type {number} + * @memberof DescribeOptions + */ version: number; + /** + * + * + * @type {number} + * @memberof DescribeOptions + */ maxCandidatesTags: number; + /** + * + * + * @type {number} + * @memberof DescribeOptions + */ describeStrategy: number; + /** + * + * + * @type {string} + * @memberof DescribeOptions + */ pattern: string; + /** + * + * + * @type {number} + * @memberof DescribeOptions + */ onlyFollowFirstParent: number; + /** + * + * + * @type {number} + * @memberof DescribeOptions + */ showCommitOidAsFallback: number; } diff --git a/types/nodegit/diff-binary-file.d.ts b/types/nodegit/diff-binary-file.d.ts index 46b67f406e..9774b99b87 100644 --- a/types/nodegit/diff-binary-file.d.ts +++ b/types/nodegit/diff-binary-file.d.ts @@ -1,6 +1,30 @@ export class DiffBinaryFile { + /** + * + * + * @type {number} + * @memberof DiffBinaryFile + */ type: number; + /** + * + * + * @type {string} + * @memberof DiffBinaryFile + */ data: string; + /** + * + * + * @type {number} + * @memberof DiffBinaryFile + */ datalen: number; + /** + * + * + * @type {number} + * @memberof DiffBinaryFile + */ inflatedlen: number; } diff --git a/types/nodegit/diff-binary.d.ts b/types/nodegit/diff-binary.d.ts index d01181c92a..f447510165 100644 --- a/types/nodegit/diff-binary.d.ts +++ b/types/nodegit/diff-binary.d.ts @@ -9,6 +9,25 @@ export namespace DiffBinary { } export class DiffBinary { + /** + * + * + * @type {DiffBinaryFile} + * @memberof DiffBinary + */ oldFile: DiffBinaryFile; + /** + * + * + * @type {DiffBinaryFile} + * @memberof DiffBinary + */ newFile: DiffBinaryFile; + /** + * + * + * @type {DiffBinary.DIFF_BINARY} + * @memberof DiffBinary + */ + containsData: DiffBinary.DIFF_BINARY; } diff --git a/types/nodegit/diff-file.d.ts b/types/nodegit/diff-file.d.ts index 99646ec08b..7602f0dba9 100644 --- a/types/nodegit/diff-file.d.ts +++ b/types/nodegit/diff-file.d.ts @@ -1,9 +1,44 @@ import { Oid } from './oid'; export class DiffFile { + /** + * Returns the file's flags + * + * @returns {number} + * + * @memberof DiffFile + */ flags(): number; + /** + * Returns the file's Oid + * + * @returns {Oid} + * + * @memberof DiffFile + */ id(): Oid; + /** + * Returns the file's mode + * + * @returns {number} + * + * @memberof DiffFile + */ mode(): number; + /** + * Returns the file's path + * + * @returns {string} + * + * @memberof DiffFile + */ path(): string; + /** + * Returns the file's size + * + * @returns {number} + * + * @memberof DiffFile + */ size(): number; } diff --git a/types/nodegit/diff-hunk.d.ts b/types/nodegit/diff-hunk.d.ts index 14a1a9a304..1a522ae8c6 100644 --- a/types/nodegit/diff-hunk.d.ts +++ b/types/nodegit/diff-hunk.d.ts @@ -1,8 +1,44 @@ export class DiffHunk { + /** + * + * + * @type {number} + * @memberof DiffHunk + */ oldStart: number; + /** + * + * + * @type {number} + * @memberof DiffHunk + */ oldLines: number; + /** + * + * + * @type {number} + * @memberof DiffHunk + */ newStart: number; + /** + * + * + * @type {number} + * @memberof DiffHunk + */ newLines: number; + /** + * + * + * @type {number} + * @memberof DiffHunk + */ headerLen: number; + /** + * + * + * @type {string} + * @memberof DiffHunk + */ header: string; } diff --git a/types/nodegit/diff-line.d.ts b/types/nodegit/diff-line.d.ts index 587653b09f..612041a92d 100644 --- a/types/nodegit/diff-line.d.ts +++ b/types/nodegit/diff-line.d.ts @@ -1,9 +1,60 @@ export class DiffLine { + /** + * The relevant line + * + * @returns {string} + * + * @memberof DiffLine + */ content(): string; + /** + * The non utf8 translated text + * + * @returns {string} + * + * @memberof DiffLine + */ + rawContent(): string; + /** + * + * + * @type {number} + * @memberof DiffLine + */ origin: number; + /** + * + * + * @type {number} + * @memberof DiffLine + */ oldLineno: number; + /** + * + * + * @type {number} + * @memberof DiffLine + */ newLineno: number; + /** + * + * + * @type {number} + * @memberof DiffLine + */ numLines: number; + /** + * + * + * @type {number} + * @memberof DiffLine + */ contentLen: number; + /** + * + * + * @type {number} + * @memberof DiffLine + */ contentOffset: number; } diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts index 32dec9943f..c4f28f984f 100644 --- a/types/nodegit/diff-options.d.ts +++ b/types/nodegit/diff-options.d.ts @@ -1,16 +1,95 @@ import { Strarray } from './str-array'; export interface DiffOptions { - version: number; - flags: number; - ignoreSubmodules: number; - pathspec: Strarray; - notifyCb: Function; - notifyPayload: any; - contextLines: number; - interhunkLines: number; - idAbbrev: number; - maxSize: number; - oldPrefix: string; - newPrefix: string; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + version?: number; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + flags?: number; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + ignoreSubmodules?: number; + /** + * + * + * @type {Strarray} + * @memberof DiffOptions + */ + pathspec?: Strarray; + /** + * + * + * @type {Function} + * @memberof DiffOptions + */ + notifyCb?: Function; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + contextLines?: number; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + interhunkLines?: number; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + idAbbrev?: number; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + maxSize?: number; + /** + * + * + * @type {string} + * @memberof DiffOptions + */ + oldPrefix?: string; + /** + * + * + * @type {string} + * @memberof DiffOptions + */ + newPrefix?: string; + /** + * + * + * @type {*} + * @memberof DiffOptions + */ + payload?: any; + /** + * + * + * @type {*} + * @memberof DiffOptions + */ + progressCb?: any; } diff --git a/types/nodegit/diff-perf-data.d.ts b/types/nodegit/diff-perf-data.d.ts index 5dfca09670..30bae1d2c9 100644 --- a/types/nodegit/diff-perf-data.d.ts +++ b/types/nodegit/diff-perf-data.d.ts @@ -1,5 +1,23 @@ export class DiffPerfdata { + /** + * + * + * @type {number} + * @memberof DiffPerfdata + */ version: number; + /** + * + * + * @type {number} + * @memberof DiffPerfdata + */ statCalls: number; + /** + * + * + * @type {number} + * @memberof DiffPerfdata + */ oidCalculations: number; } diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 6926527124..23d3ddf5fc 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -6,15 +6,58 @@ import { Index } from './index_'; import { DiffDelta } from './diff-delta'; import { DiffPerfdata } from './diff-perf-data'; import { DiffOptions } from './diff-options'; +import { Buf } from './buf'; export interface DiffFindOptions { - version: number; - flags: number; - renameThreshold: number; - renameFromRewriteThreshold: number; - copyThreshold: number; - breakRewriteThreshold: number; - renameLimit: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + version?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + flags?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + renameThreshold?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + renameFromRewriteThreshold?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + copyThreshold?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + breakRewriteThreshold?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + renameLimit?: number; } export namespace Diff { @@ -125,17 +168,170 @@ export namespace Diff { } export class Diff { + /** + * Directly run a diff between a blob and a buffer. + * + * @static + * @param {Blob} old_blob + * @param {string} oldAsPath + * @param {string} buffer + * @param {string} bufferAsPath + * @param {DiffOptions} opts + * @param {Function} fileCb + * @param {Function} binaryCb + * @param {Function} hunkCb + * @param {Function} lineCb + * @returns {Promise} + * + * @memberof Diff + */ static blobToBuffer(old_blob: Blob, oldAsPath: string, - buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; + buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; + /** + * + * + * @static + * @param {string} content + * @param {number} contentLen + * @returns {Promise} + * + * @memberof Diff + */ + static fromBuffer(content: string, contentLen: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Index} index + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ static indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Index} oldIndex + * @param {Index} newIndex + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ + static indexToIndex(repo: Repository, oldIndex: Index, newIndex: Index, opts: DiffOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} old_tree + * @param {Index} index + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} old_tree + * @param {Tree} new_tree + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} old_tree + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ static treeToWorkdir(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} old_tree + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ static treeToWorkdirWithIndex(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + /** + * + * + * @param {DiffFindOptions} options + * @returns {Promise} + * + * @memberof Diff + */ findSimilar(options: DiffFindOptions): Promise; + /** + * + * + * @param {number} idx + * @returns {DiffDelta} + * + * @memberof Diff + */ getDelta(idx: number): DiffDelta; + /** + * + * + * @returns {Promise} + * + * @memberof Diff + */ getPerfdata(): Promise; + /** + * + * + * @returns {number} + * + * @memberof Diff + */ numDeltas(): number; + /** + * Retrieve patches in this difflist + * + * @returns {Promise} + * + * @memberof Diff + */ patches(): Promise; + /** + * + * + * @param {Diff} from + * @returns {Promise} + * + * @memberof Diff + */ + merge(from: Diff): Promise; + /** + * + * + * @param {Diff.FORMAT} format + * @returns {Promise} + * + * @memberof Diff + */ + toBuf(format: Diff.FORMAT): Promise; } diff --git a/types/nodegit/error.d.ts b/types/nodegit/error.d.ts index c259749e8b..9acf4cc2cd 100644 --- a/types/nodegit/error.d.ts +++ b/types/nodegit/error.d.ts @@ -63,6 +63,18 @@ export namespace Error { } export class Error { + /** + * + * + * @type {string} + * @memberof Error + */ message: string; + /** + * + * + * @type {number} + * @memberof Error + */ klass: number; } diff --git a/types/nodegit/fetch-options.d.ts b/types/nodegit/fetch-options.d.ts index 1aa26fd974..3b3a1b26c1 100644 --- a/types/nodegit/fetch-options.d.ts +++ b/types/nodegit/fetch-options.d.ts @@ -1,9 +1,54 @@ import { RemoteCallbacks } from './remote-callbacks'; +import { Strarray} from './str-array'; export interface FetchOptions { + /** + * + * + * @type {number} + * @memberof FetchOptions + */ version?: number; + /** + * + * + * @type {RemoteCallbacks} + * @memberof FetchOptions + */ callbacks?: RemoteCallbacks; + /** + * + * + * @type {number} + * @memberof FetchOptions + */ prune?: number; + /** + * + * + * @type {number} + * @memberof FetchOptions + */ updateFetchhead?: number; + /** + * + * + * @type {number} + * @memberof FetchOptions + */ downloadTags?: number; + /** + * + * + * @type {Strarray} + * @memberof FetchOptions + */ + customHeaders?: Strarray; + /** + * + * + * @type {*} + * @memberof FetchOptions + */ + proxyOpts?: any; } diff --git a/types/nodegit/fetch.d.ts b/types/nodegit/fetch.d.ts index db0980586f..b777066629 100644 --- a/types/nodegit/fetch.d.ts +++ b/types/nodegit/fetch.d.ts @@ -9,5 +9,15 @@ export namespace Fetch { } export class Fetch { + /** + * + * + * @static + * @param {FetchOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Fetch + */ static initOptions(opts: FetchOptions, version: number): number; } diff --git a/types/nodegit/filter.d.ts b/types/nodegit/filter.d.ts index 066a51183e..7b73196ed0 100644 --- a/types/nodegit/filter.d.ts +++ b/types/nodegit/filter.d.ts @@ -19,17 +19,125 @@ export namespace Filter { } export class Filter { + /** + * + * + * @static + * @param {*} filters + * @param {string} name + * @returns {number} + * + * @memberof Filter + */ static listContains(filters: any, name: string): number; + /** + * + * + * @static + * @param {*} fl + * @returns {number} + * + * @memberof Filter + */ static listLength(fl: any): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {number} mode + * @param {number} options + * @returns {Promise} + * + * @memberof Filter + */ static listNew(repo: Repository, mode: number, options: number): Promise; + /** + * + * + * @static + * @param {*} filters + * @param {Blob} blob + * @param {WriteStream} target + * @returns {number} + * + * @memberof Filter + */ static listStreamBlob(filters: any, blob: Blob, target: WriteStream): number; + /** + * + * + * @static + * @param {*} filters + * @param {Buf} data + * @param {WriteStream} target + * @returns {number} + * + * @memberof Filter + */ static listStreamData(filters: any, data: Buf, target: WriteStream): number; + /** + * + * + * @static + * @param {*} filters + * @param {Repository} repo + * @param {string} path + * @param {WriteStream} target + * @returns {number} + * + * @memberof Filter + */ static listStreamFile(filters: any, repo: Repository, path: string, target: WriteStream): number; + /** + * + * + * @static + * @param {string} name + * @returns {number} + * + * @memberof Filter + */ static unregister(name: string): number; + /** + * + * + * @param {string} name + * @returns {Filter} + * + * @memberof Filter + */ lookup(name: string): Filter; + /** + * + * + * @param {string} name + * @param {number} priority + * @returns {number} + * + * @memberof Filter + */ register(name: string, priority: number): number; + /** + * + * + * @type {number} + * @memberof Filter + */ version: number; + /** + * + * + * @type {string} + * @memberof Filter + */ attributes: string; + /** + * + * + * @type {Function} + * @memberof Filter + */ stream: Function; } diff --git a/types/nodegit/git-err.d.ts b/types/nodegit/git-err.d.ts index 6a9da24bb3..541a191e30 100644 --- a/types/nodegit/git-err.d.ts +++ b/types/nodegit/git-err.d.ts @@ -1,9 +1,39 @@ import { Error } from './error'; export class Giterr { + /** + * + * + * @static + * + * @memberof Giterr + */ static errClear(): void; - static errDetach(cpy: Error): number; + /** + * + * + * @static + * @returns {Error} + * + * @memberof Giterr + */ static errLast(): Error; + /** + * + * + * @static + * + * @memberof Giterr + */ static errSetOom(): void; - static errSetString(error_class: number, string: string): void; + /** + * + * + * @static + * @param {number} errorClass + * @param {string} string + * + * @memberof Giterr + */ + static errSetString(errorClass: number, string: string): void; } diff --git a/types/nodegit/graph.d.ts b/types/nodegit/graph.d.ts index d16d7b5dee..90639a5075 100644 --- a/types/nodegit/graph.d.ts +++ b/types/nodegit/graph.d.ts @@ -2,6 +2,28 @@ import { Repository } from './repository'; import { Oid } from './oid'; export class Graph { + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} local + * @param {Oid} upstream + * @returns {Promise} + * + * @memberof Graph + */ static aheadBehind(repo: Repository, local: Oid, upstream: Oid): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} commit + * @param {Oid} ancestor + * @returns {Promise} + * + * @memberof Graph + */ static descendantOf(repo: Repository, commit: Oid, ancestor: Oid): Promise; } diff --git a/types/nodegit/ignore.d.ts b/types/nodegit/ignore.d.ts index c38d84d1f3..017637c8d2 100644 --- a/types/nodegit/ignore.d.ts +++ b/types/nodegit/ignore.d.ts @@ -1,7 +1,36 @@ import { Repository } from './repository'; export class Ignore { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} rules + * @returns {number} + * + * @memberof Ignore + */ static addRule(repo: Repository, rules: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @returns {number} + * + * @memberof Ignore + */ static clearInternalRules(repo: Repository): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} path + * @returns {Promise} + * + * @memberof Ignore + */ static pathIsIgnored(repo: Repository, path: string): Promise; } From edf46bc72563e170c35fdfddd44e1b73536da873 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:07:35 +0100 Subject: [PATCH 263/761] Added ProxyOptions --- types/nodegit/index.d.ts | 1 + types/nodegit/proxy-options.d.ts | 8 ++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 10 insertions(+) create mode 100644 types/nodegit/proxy-options.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 32b86ba19f..4efd864946 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -65,6 +65,7 @@ export { Oid } from './oid'; export { Openssl } from './open-ssl'; export { Packbuilder } from './pack-builder'; export { Pathspec } from './path-spec'; +export { ProxyOptions } from './proxy-options'; export { PushOptions } from './push-options'; export { PushUpdate } from './push-update'; export { Push } from './push'; diff --git a/types/nodegit/proxy-options.d.ts b/types/nodegit/proxy-options.d.ts new file mode 100644 index 0000000000..7a4c8f4dd4 --- /dev/null +++ b/types/nodegit/proxy-options.d.ts @@ -0,0 +1,8 @@ +export class ProxyOptions { + certificateCheck?: Function + credentials?: Function + payload?: any + type?: number + url?: string + version?: number +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 31f9ee0497..635c40ac91 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -79,6 +79,7 @@ "open-ssl.d.ts", "pack-builder.d.ts", "path-spec.d.ts", + "proxy-options.d.ts", "push-options.d.ts", "push-update.d.ts", "push.d.ts", From 462dfb5b3a3d15632ffe508e2bce997a6658aedc Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 9 Jun 2017 05:40:32 +0530 Subject: [PATCH 264/761] Typing files updated (#17014) * typings updated * Lint errors with v15.2.0.43 have been resolved. --- types/ej.web.all/index.d.ts | 1747 +++++++++++++++++++++++++++++++++-- 1 file changed, 1673 insertions(+), 74 deletions(-) diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index e304a73863..61698887b8 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -7,7 +7,7 @@ /*! * filename: ej.web.all.d.ts -* version : 15.2.0.40 +* version : 15.2.0.43 * Copyright Syncfusion Inc. 2001 - 2017. 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 @@ -239,6 +239,7 @@ declare namespace ej { convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; processResponse(data: any, ds: any, query: ej.Query, xhr: JQueryXHR, request?: any, changes?: Changes): any; onGroup(e: any): void; + onAggregates(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: any, tableName: string): { url: string; data: any }; @@ -246,14 +247,12 @@ declare namespace ej { update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; getFiltersFrom(data: any, query: ej.Query): ej.Predicate; } - class WebMethodAdaptor extends ej.UrlAdaptor { constructor(); processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: any): { type: string; url: string; ejPvtData: any; contentType?: string; data?: any; }; } - class CacheAdaptor extends ej.UrlAdaptor { constructor(); init(adaptor: any, timeStamp: number, pageSize: number): void; @@ -266,7 +265,6 @@ declare namespace ej { batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: any; contentType: string }; } - class ODataAdaptor extends ej.UrlAdaptor { constructor(); options: UrlAdaptorOptions; @@ -280,6 +278,7 @@ declare namespace ej { onSortBy(e: any): string; onGroup(e: any): string; onSelect(e: any): string; + onAggregates(e: any): string; onCount(e: any): string; beforeSend(dm: ej.DataManager, request: any, settings?: any): void; processResponse(data: any, ds: any, query: ej.Query, xhr: any, request: any, changes: Changes): { @@ -313,6 +312,7 @@ declare namespace ej { changeSetContent?: string; batchChangeSetContentType?: string; } + class WebApiAdaptor extends ej.ODataAdaptor { constructor(); insert(dm: ej.DataManager, data: any, tableName?: string): { url: string; type: string; data: any; }; @@ -322,6 +322,7 @@ declare namespace ej { result: any; count: number }; } + class ODataV4Adaptor extends ej.ODataAdaptor { constructor(); options: ODataAdaptorOptions; @@ -329,9 +330,13 @@ declare namespace ej { onEachSearch(e: any): void; onSearch(e: any): string; beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processQuery(ds: any, query: ej.Query): { + type: string; url: string; ejPvtData: any; contentType?: string; data?: any; + }; processResponse(data: any, ds: any, query: ej.Query, xhr: any, request: any, changes: Changes): { result: any; count: number }; + } interface ODataAdaptorOptions { requestType?: string; @@ -359,6 +364,7 @@ declare namespace ej { processQuery(ds: any, query: ej.Query): string; batchRequest(dm: ej.DataManager, changes: Changes, e: any): Changes; onWhere(ds: any, e: any): any; + onAggregates(ds: any, e: any): any; onSearch(ds: any, e: any): any; onSortBy(ds: any, e: any, query: ej.Query): any; onGroup(ds: any, e: any, query: ej.Query): any; @@ -367,10 +373,16 @@ declare namespace ej { onTake(ds: any, e: any): any; onSkip(ds: any, e: any): any; onSelect(ds: any, e: any): any; - insert(dm: ej.DataManager, data: any): any; + insert(dm: ej.DataManager, data: any, tableName?: string): any; remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; update(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; } + class ForeignKeyAdaptor extends ej.JsonAdaptor { + constructor(); + processQuery(ds: any, query: ej.Query): any; + insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any }; + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: any }; + } class remoteSaveAdaptor extends ej.UrlAdaptor { constructor(); batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; @@ -740,7 +752,7 @@ declare namespace ej { /** returns the element which accepts the droppable element. */ - targetElement?: any; + target?: any; } export interface OutEventArgs { @@ -759,7 +771,7 @@ declare namespace ej { /** returns the mouse out over the element */ - targetElement?: any; + target?: any; } export interface OverEventArgs { @@ -778,7 +790,7 @@ declare namespace ej { /** returns the mouse over the element */ - targetElement?: any; + target?: any; } } @@ -3267,7 +3279,10 @@ declare namespace ej { * @Default {false} */ showRoundedCorner?: boolean; - + /** Set to sort ListBox items either by Ascending or Descending order. By default sortOrder is set as enum type of "None".You can use only below mentioned type for sorting purpose. + * @Default {ej.SortOrder.None} + */ + sortOrder?: ej.ListBox.SortOrder | string; /** The template to display the ListBox widget with customized appearance. * @Default {null} */ @@ -3864,6 +3879,14 @@ declare namespace ej { */ value?: string; } + enum SortOrder { + /// The items are not sorted. + None, + /// To sort items in Ascending order. + Ascending, + /// To sort items in Descending order. + Descending + } } class Calculate { @@ -6868,8 +6891,8 @@ declare namespace ej { export interface TimeDrillDown { - /** This is the field to show/hide the timeDrillDown in DateTimePicker. - */ + /** This is the field to show/hide the timeDrillDown in DateTimePicker. + */ enabled?: boolean; /** Sets the interval time of minutes on selected date. @@ -7342,6 +7365,10 @@ declare namespace ej { */ animation?: any; + /** To Enable or disable the scrolling for background element of the modal dialog. This will work only with modal dialog. + */ + backgroundScroll?: boolean; + /** Closes the dialog widget on pressing the ESC key when it is set to true. */ closeOnEscape?: boolean; @@ -9002,6 +9029,10 @@ declare namespace ej { */ target?: string; + /** defines Tooltip size and gap between tooltip against the target element. + */ + tip?: Tip; + /** The title text to be displayed in the Tooltip header. * @Default {null} */ @@ -9936,6 +9967,26 @@ declare namespace ej { */ width?: string | number; + /** Specifies the number of items to be fetched on each scroll. Note: This property works only with Virtual scrolling. + * @Default {5} + */ + itemRequestCount?: number; + + /** Specifies the maximum number of items to be fetched. Note: This will work only with Virtual scrolling + * @Default {null} + */ + totalItemsCount?: number; + + /** 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; + + /** Specifies the virtual scroll mode to load the list data on demand via scrolling behavior. There are two types of mode. + * @Default {ej.VirtualScrollMode.Normal} + */ + virtualScrollMode?: ej.VirtualScrollMode | string; + /** Event triggers before the AJAX request happens. */ ajaxBeforeLoad?(e: AjaxBeforeLoadEventArgs): void; @@ -10712,6 +10763,11 @@ declare namespace ej { */ contextMenuTarget?: string; + /** Specifies the container element selectors for submenu’s collision. The submenu gets displayed based on spacing available with respect to container element. + * @Default {null} + */ + container?: string; + /** Specify the CSS class to achieve custom theme. */ cssClass?: string; @@ -11990,8 +12046,8 @@ declare namespace ej { export interface MouseoverEventArgs { - /** returns the current value. - */ + /** returns the current value. + */ value?: number; /** if the event should be canceled; otherwise, false. @@ -13609,6 +13665,9 @@ declare namespace ej { /** Triggered initial load. */ load?(e: LoadEventArgs): void; + /** Triggers before swim lane expand or collapse icon is clicked. */ + swimlaneClick?(e: SwimlaneClickEventArgs): void; + /** Triggered every time a single card rendered request is made to access particular card information. */ queryCellInfo?(e: QueryCellInfoEventArgs): void; @@ -14304,6 +14363,37 @@ declare namespace ej { type?: string; } + export interface SwimlaneClickEventArgs { + + /** Current Action name while swim lane clicked. Actions are "expand" or "collapse" + */ + action?: string; + + /** Returns the kanban model. + */ + model?: any; + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the name of the event. + */ + type?: string; + + /** Returns the swim lane group data's. + */ + data?: any; + + /** Returns current swim lane row index. + */ + rowIndex?: number; + + /** Returns current target element. + */ + target?: any; + } + export interface QueryCellInfoEventArgs { /** Returns Kanban card. @@ -14330,8 +14420,8 @@ declare namespace ej { */ model?: any; - /** Returns the name of the event. - */ + /** Returns the name of the event. + */ type?: string; } @@ -15447,6 +15537,11 @@ declare namespace ej { */ autoHeight?: boolean; + /** This API holds configuration setting for paste clenaup behavior. + * @Default {{ listConversion: false, cleanCSS: false, removeStyles: false, cleanElements: false }} + */ + pasteCleanupSettings?: PasteCleanupSettings; + /** 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]} @@ -15695,6 +15790,11 @@ declare namespace ej { */ toolsList?: any[]; + /** Specifies the overflow mode for RTE responsive toolbar + * @Default {Popup} + */ + toolbarOverflowMode?: ej.RTE.ToolbarOverflowMode | string; + /** Display the hints for the tools in the Toolbar. * @Default {{ associate: mouseenter, showShadow: true, position: { stem: { horizontal: left, vertical: top } }, tip: { size: { width: 5, height: 5 }, isBalloon: false }} */ @@ -15897,6 +15997,29 @@ declare namespace ej { event?: any; } + export interface PasteCleanupSettings { + + /** This API is used to convert the list elements pasted from word document to editor. + * @Default {false} + */ + listConversion?: boolean; + + /** This API is used to clean the unwanted css in the elements pasted from word document to editor. + * @Default {false} + */ + cleanCSS?: boolean; + + /** This API is used to remove all styles in the elements pasted from word document to editor. + * @Default {false} + */ + removeStyles?: boolean; + + /** This API is used to clean the unwanted elements pasted from word document to editor. + * @Default {false} + */ + cleanElements?: boolean; + } + export interface ExportToPdfSettings { /** This API is used to receive the server-side handler for export related operations. @@ -16096,6 +16219,16 @@ declare namespace ej { */ customUnorderedList?: ToolsCustomUnorderedList[]; } + + enum ToolbarOverflowMode { + + ///To display the RTE toolbar overflow items as popup + Popup, + + ///To display the RTE toolbar overflow items as inline toolbar + Inline + } + } class Slider extends ej.Widget { @@ -16125,6 +16258,7 @@ declare namespace ej { */ setValue(): void; } + export namespace Slider { export interface Model { @@ -16418,6 +16552,7 @@ declare namespace ej { cancel?: boolean; } } + namespace slider { enum sliderType { //Shows default slider @@ -17233,8 +17368,8 @@ declare namespace ej { */ activeIndex?: number; - /** returns, is it triggered by interaction or not. - */ + /** returns, is it triggered by interaction or not. + */ isInteraction?: boolean; } @@ -21193,6 +21328,12 @@ declare namespace ej { */ addIgnoreOnExport(propertyNames: any[]): void; + /** Adds a grid model property which is to be ignored upon OnServerToolbarClick. + * @param {Array} Pass the array of parameters which need to be ignored on OnServerToolbarClick + * @returns {void} + */ + addIgnoreOnToolbarServerClick(propertyNames: any[]): void; + /** Add a new record in grid control when allowAdding is set as true. * @returns {void} */ @@ -23581,6 +23722,21 @@ declare namespace ej { type?: string; } + export interface MergeHeaderCellInfoEventArgs { + + /** Method to merge the header cells. + */ + headerCellMerge?: any; + + /** Returns the column headers. + */ + columnHeaders?: any; + + /** Returns the grid model. + */ + model?: any; + } + export interface MergeCellInfoEventArgs { /** Returns grid cell. @@ -23593,7 +23749,7 @@ declare namespace ej { /** Returns current row record object (JSON). */ - data?: any; + rowData?: any; /** Returns the text value in the cell. */ @@ -23636,7 +23792,7 @@ declare namespace ej { /** Returns current row record object (JSON). */ - data?: any; + rowData?: any; /** Returns the text value in the cell. */ @@ -24068,7 +24224,7 @@ declare namespace ej { /** Returns the current row data. */ - data?: any; + rowData?: any; /** Returns the grid model. */ @@ -24630,6 +24786,10 @@ declare namespace ej { * @Default {null} */ dropMapper?: string; + /** Gets or sets a value that indicates whether to define the behavior for drag. + * @Default {ej.Grid.DragBehavior.Move} + */ + dragBehavior?: ej.Grid.DragBehavior | string; } export interface SearchSettings { @@ -24872,6 +25032,17 @@ declare namespace ej { wrapMode?: ej.Grid.WrapMode | string; } + export interface ToolbarSettingsCustomToolbarItem { + + /** Gets or sets a value that indicates whether to add custom toolbar item as a template element. + */ + templateID?: string; + + /** Gets or sets a value that indicates whether to add custom toolbar item with a custom tooltip. + */ + tooltip?: 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 @@ -25058,6 +25229,16 @@ declare namespace ej { } + enum DragBehavior { + + ///Moves a dragged row from one grid to another + Move, + + ///Copies a dragged row from one grid to another + Copy + } + + enum SelectionType { ///Specifies the selection type as single. @@ -25225,6 +25406,11 @@ declare namespace ej { */ rangeBandSettings?: RangeBandSettings; + /** Name of the culture based on which sparkline should be localized. + * @Default {en-US} + */ + locale?: string; + /** Name of a field in data source, where the fill color for all the data points is generated. */ palette?: string; @@ -25239,6 +25425,11 @@ declare namespace ej { */ enableCanvasRendering?: boolean; + /** Specify to convert the date object to string, using locale settings. + * @Default {false} + */ + enableGroupSeparator?: boolean; + /** Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. * @Default {null} */ @@ -25377,8 +25568,8 @@ declare namespace ej { */ cancel?: boolean; - /** Instance of the sparkline model object - */ + /** Instance of the sparkline model object + */ model?: any; /** Name of the event @@ -27022,6 +27213,16 @@ declare namespace ej { */ frozenHeaderSettings?: FrozenHeaderSettings; + /** Allows user to display header name in PivotGrid control. + * @Default {{}} + */ + headerSettings?: HeaderSettings; + + /** Allows user to show appropriate unique name on Pivot button. + * @Default {false} + */ + showUniqueNameOnPivotButton?: boolean; + /** Object utilized to pass additional information between client-end and service-end on operating the control in server mode. * @Default {null} */ @@ -27865,6 +28066,24 @@ declare namespace ej { * @Default {false} */ enableFrozenHeaders?: boolean; + + /** Allows user to set the size of the scrollbar (horizontal and vertical) visible in PivotGrid. + * @Default {18} + */ + scrollerSize?: number; + } + + export interface HeaderSettings { + + /** Allows user to enable/disable row header names in PivotGrid control. + * @Default {false} + */ + showRowItems?: boolean; + + /** Allows user to enable/disable column header names in PivotGrid control. + * @Default {false} + */ + showColumnItems?: boolean; } export interface HyperlinkSettings { @@ -28441,6 +28660,11 @@ declare namespace ej { */ enableRTL?: boolean; + /** Allows user to render complete PivotChart on drill operation, that is, when expanding and collapsing members which are shown in multi-level labels. + * @Default {false} + */ + enableMultiLevelLabels?: boolean; + /** Allows the user to enable PivotChart’s responsiveness in the browser layout. * @Default {false} */ @@ -29005,6 +29229,16 @@ declare namespace ej { */ displaySettings?: DisplaySettings; + /** Allows user to set visibility of icons in toolbar panel. + * @Default {{}} + */ + toolbarIconSettings?: ToolbarIconSettings; + + /** Allows user to show unique name on pivotbutton. + * @Default {false} + */ + showUniqueNameOnPivotButton?: boolean; + /** Enables the splitter option for resizing the elements inside the control. * @Default {false} */ @@ -29626,6 +29860,89 @@ declare namespace ej { mode?: ej.PivotClient.DisplayMode | string; } + export interface ToolbarIconSettings { + + /** Allows user to set the visibility of Add Report icon in toolbar panel. + * @Default {true} + */ + enableAddReport?: boolean; + + /** Allows user to set the visibility of New Report icon in toolbar panel. + * @Default {true} + */ + enableNewReport?: boolean; + + /** Allows user to set the visibility of Rename Report icon in toolbar panel. + * @Default {true} + */ + enableRenameReport?: boolean; + + /** Allows user to set the visibility of DB Manipulation icon in toolbar panel. + * @Default {true} + */ + enableDBManipulation?: boolean; + + /** Allows user to set the visibility of Word Export icon in toolbar panel. + * @Default {true} + */ + enableWordExport?: boolean; + + /** Allows user to set the visibility of Excel Export icon in toolbar panel. + * @Default {true} + */ + enableExcelExport?: boolean; + + /** Allows user to set the visibility of PDF Export icon in toolbar panel. + * @Default {true} + */ + enablePdfExport?: boolean; + + /** Allows user to set the visibility of MDX Query icon in toolbar panel. + * @Default {true} + */ + enableMDXQuery?: boolean; + + /** Allows user to set the visibility of Defer Update icon in toolbar panel. + * @Default {false} + */ + enableDeferUpdate?: boolean; + + /** Allows user to set the visibility of Full Screen icon in toolbar panel. + * @Default {false} + */ + enableFullScreen?: boolean; + + /** Allows user to set the visibility of Sort/Filter Column icon in toolbar panel. + * @Default {true} + */ + enableSortOrFilterColumn?: boolean; + + /** Allows user to set the visibility of Sort/Filter Row icon in toolbar panel. + * @Default {true} + */ + enableSortOrFilterRow?: boolean; + + /** Allows user to set the visibility of Toggle Axis icon in toolbar panel. + * @Default {true} + */ + enableToggleAxis?: boolean; + + /** Allows user to set the visibility of Chart Types icon in toolbar panel. + * @Default {true} + */ + enableChartTypes?: boolean; + + /** Allows user to set the visibility of Remove Report icon in toolbar panel. + * @Default {true} + */ + enableRemoveReport?: boolean; + + /** Allows user to set the visibility of Calculated Member icon in toolbar panel. + * @Default {false} + */ + enableCalculatedMember?: boolean; + } + export interface ServiceMethodSettings { /** Allows the user to set the custom name for the service method responsible for updating the entire report and widget, while changing the Cube. @@ -29887,9 +30204,9 @@ declare namespace ej { */ showHeaderLabel?: boolean; - /** Connects the service using the specified URL for any server updates on server mode operation. - * @Default {“”} - */ + /** Connects the service using the specified URL for any server updates on server mode operation. + * @Default {“”} + */ url?: string; /** Sets the mode for the PivotGauge widget for binding either OLAP or Relational data source. @@ -30843,6 +31160,11 @@ declare namespace ej { */ showAllDayRow?: boolean; + /** When set to false, hides the weekend days on all the Scheduler views. + * @Default {true} + */ + showWeekend?: boolean; + /** When set to true, displays the current time indicator on the Schedule. * @Default {true} */ @@ -32455,6 +32777,13 @@ declare namespace ej { */ setSplitterIndex(index: number): void; + /** To sort the column in required direction + * @param {string} Defines the column's mapping name in which sorting have to be performed + * @param {string} Defines the sort direction whether the column has to sorted in ascending/descending order. By default it is sorting in an ascending order + * @returns {void} + */ + sortColumn(mappingName: string, columnSortDirection: string): void; + /** To cancel the edited state of an item in Gantt * @returns {void} */ @@ -32486,6 +32815,14 @@ declare namespace ej { */ expandCollapseRecord(taskId: number): void; + /** Export the Gantt content to excel 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 + * @returns {void} + */ + export(action: string, serverEvent?: string, multipleExport?: boolean): void; + /** To hide the column by using header text * @param {string} you can pass a header text of a column to hide * @returns {void} @@ -32594,6 +32931,14 @@ declare namespace ej { */ baselineColor?: string; + /** Specifies the mapping property path for the work field of a task in the data source. When it is mapped the end date and duration for a task will be calculated automatically. + */ + workMapping?: string; + + /** Specifies the mapping property path for the expand status of a record in data source. + */ + expandStateMapping?: string; + /** Specifies the mapping property path for baseline end date in datasource */ baselineEndDateMapping?: string; @@ -32643,6 +32988,11 @@ declare namespace ej { */ dateFormat?: string; + /** Specifies the customized working time for tasks in Gantt + * @Default {[{ from: 08:00 AM, to: 12:00 PM }, { from: 01:00 PM, to: 05:00 PM }]} + */ + dayWorkingTime?: any[]; + /** Specifies the mapping property path for duration of a task in datasource */ durationMapping?: string; @@ -32978,6 +33328,11 @@ declare namespace ej { */ taskbarEditingTooltipTemplateId?: string; + /** Specifies the height of taskBar in Gantt. + * @Default {20} + */ + taskbarHeight?: number; + /** Specifies the template for tooltip on mouse action on taskbars */ taskbarTooltipTemplate?: string; @@ -33790,6 +34145,17 @@ declare namespace ej { type?: string; } + export interface AddDialogField { + + /** Specifies mapping name to include required fields in Gantt + */ + field?: string; + + /** Specifies editType of fields to be included in the add dialog in Gantt + */ + editType?: string; + } + export interface DragTooltip { /** Specifies option to enable/disable tooltip while drag and drop a row. @@ -33808,6 +34174,17 @@ declare namespace ej { tooltipTemplate?: string; } + export interface EditDialogField { + + /** Specifies mapping name to include required fields in Gantt + */ + field?: string; + + /** Specifies editType of fields to be included in the edit dialog in Gantt + */ + editType?: string; + } + export interface SplitterSettings { /** Specifies position of the splitter in Gantt , splitter can be placed either based on percentage values or pixel values. @@ -33862,6 +34239,21 @@ declare namespace ej { rowPosition?: ej.Gantt.RowPosition | string; } + export interface Holiday { + + /** Specifies holiday date to be displayed in Gantt + */ + day?: string; + + /** Specifies the background color for holiday date in Gantt Schedule + */ + background?: string; + + /** Specifies the label to be displayed for rendered holiday in Gantt + */ + label?: string; + } + export interface ScheduleHeaderSettings { /** Specified the format for day view in schedule header @@ -33899,9 +34291,9 @@ declare namespace ej { */ weekendBackground?: string; - /** Specified the format for week view in schedule header - * @Default {ddd} - */ + /** Specified the format for week view in schedule header + * @Default {MMM dd , yyyy} + */ weekHeaderFormat?: string; /** Specified the format for year view in schedule header @@ -33945,12 +34337,61 @@ declare namespace ej { cellIndex?: number; } + export interface SortSettingsSortedColumn { + + /** Specifies the field to be sorted in Gantt + */ + field?: string; + + /** Specifies the sort direction in Gantt + */ + direction?: string; + } + export interface SortSettings { /** Specifies the sorted columns for Gantt * @Default {[]} */ - sortedColumns?: any[]; + sortedColumns?: SortSettingsSortedColumn[]; + } + + export interface StripLine { + + /** Specifies date to render striplines in Gantt + */ + day?: string; + + /** Specifies label to be displayed for striplines in Gantt + */ + label?: string; + + /** Specifies line style for rendered striplines in Gantt + */ + lineStyle?: string; + + /** Specifies the line color for rendered striplines in Gantt + */ + lineColor?: string; + + /** Specifies the width of the stripline in Gantt + */ + lineWidth?: string; + } + + export interface ToolbarSettingsCustomToolbarItem { + + /** Allows the user to insert the custom icons in toolbar using CSS class name selector. + */ + text?: string; + + /** Allows the user to insert the custom icons in toolbar using script templates. Using this property we can bind HTML elements and other EJ controls to Gantt toolbar. + */ + templateID?: string; + + /** Allows the user to display custom tooltip text for Gantt custom toolbar items. + */ + tooltipText?: string; } export interface ToolbarSettings { @@ -33964,6 +34405,10 @@ declare namespace ej { * @Default {[]} */ toolbarItems?: any[]; + + /** Allows the user to insert custom toolbar items. + */ + customToolbarItems?: ToolbarSettingsCustomToolbarItem[]; } enum DurationUnit { @@ -34856,12 +35301,6 @@ declare namespace ej { */ 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} @@ -34873,7 +35312,7 @@ declare namespace ej { * @param {string} you can pass a sort direction to sort the column. * @returns {void} */ - sortColumn(columnName: string, columnSortDirection: string): void; + sortColumn(fieldName: string, columnSortDirection: string): void; /** To reorder the column with field name and target index values * @param {string} you can pass a name of column to reorder. @@ -34936,6 +35375,10 @@ declare namespace ej { */ altRowTemplateID?: string; + /** Specifies the mapping property path for the expand status of a record in data source. + */ + expandStateMapping?: string; + /** Specifies the mapping property path for sub tasks in datasource */ childMapping?: string; @@ -34963,9 +35406,9 @@ declare namespace ej { dataSource?: any[]; /** Specifies whether to wrap the header text when it is overflown i.e., when it exceeds the header width. - * @Default {none} + * @Default {ej.TreeGrid.HeaderTextOverflow.None} */ - headerTextOverflow?: string; + headerTextOverflow?: ej.TreeGrid.HeaderTextOverflow | string; /** Options for displaying and customizing the tooltip. This tooltip will show the preview of the row that is being dragged. */ @@ -34999,6 +35442,11 @@ declare namespace ej { */ columnResizeSettings?: ColumnResizeSettings; + /** Defines the common width for all the columns in TreeGrid + * @Default {150} + */ + commonWidth?: number; + /** Options for filtering and customizing filter actions. */ filterSettings?: FilterSettings; @@ -35054,6 +35502,10 @@ declare namespace ej { */ selectedRowIndex?: number; + /** Specifies the selected cell information on rendering TreeGrid. + */ + selectedCellIndexes?: SelectedCellIndex[]; + /** Specifies the settings for row and cell selection. */ selectionSettings?: SelectionSettings; @@ -35172,6 +35624,15 @@ declare namespace ej { /** Triggered when TreeGrid is rendered completely */ create?(e: CreateEventArgs): void; + /** Triggered while rendering details template in TreeGrid */ + detailsDataBound?(e: DetailsDataBoundEventArgs): void; + + /** Triggered when details template pop-up is shown. */ + detailsShown?(e: DetailsShownEventArgs): void; + + /** Triggered when details template pop-up is hidden. */ + detailsHidden?(e: DetailsHiddenEventArgs): void; + /** Triggered after saved the modified cellValue in TreeGrid */ endEdit?(e: EndEditEventArgs): void; @@ -35621,6 +36082,79 @@ declare namespace ej { type?: string; } + export interface DetailsDataBoundEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the data collection of selected row. + */ + data?: any; + + /** Returns the details element of selected row. + */ + detailsElement?: any; + + /** Returns the rowIndex of selected row. + */ + rowIndex?: number; + + /** Returns the TreeGrid model + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + } + + export interface DetailsShownEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the data collection of selected row. + */ + data?: any; + + /** Returns the details element of selected row. + */ + detailsElement?: any; + + /** Returns the rowIndex of selected row. + */ + rowIndex?: number; + + /** Returns the TreeGrid model + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + } + + export interface DetailsHiddenEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the TreeGrid model + */ + model?: any; + + /** Returns the data collection of hidden details Template + */ + rowData?: any; + + /** Returns the name of the event. + */ + type?: string; + } + export interface EndEditEventArgs { /** Returns the cancel option value. @@ -36018,6 +36552,11 @@ declare namespace ej { */ allowFiltering?: boolean; + /** Enables the blanks option in ejDropDownList mapped in TreeGrid column + * @Default {true} + */ + allowFilteringBlankContent?: boolean; + /** Enables or disables the ability to sort the rows based on this column/field. * @Default {false} */ @@ -36028,15 +36567,35 @@ declare namespace ej { */ allowCellSelection?: boolean; + /** To customize the ej controls defined in TreeGrid column with their native property. + */ + editParams?: any; + /** Specifies the edit type of the column. * @Default {ej.TreeGrid.EditingType.String} */ editType?: ej.TreeGrid.EditingType | string; + /** To bind the dropdown data for TreeGrid column mapped with ejDropDownList + */ + dropdownData?: string; + /** Specifies the name of the field from the dataSource to bind with this column. */ field?: string; + /** Specifies the template string of the script element to enable column template for a column. + */ + template?: string; + + /** Specifies the template ID of the script element to enable column template for a column. + */ + templateID?: string; + + /** Specifies the template ID or the template string of the AngularJS script element to enable column template for a column. + */ + angularTemplate?: string; + /** Specifies the type of the editor control to be used to filter the rows. * @Default {ej.TreeGrid.EditingType.String} */ @@ -36050,6 +36609,11 @@ declare namespace ej { /** Enables or disables the checkbox visibility in a column to make it as a checkbox column * @Default {false} */ + displayAsCheckbox?: boolean; + + /** Enables or disables the checkbox visibility in a column for checkbox selection. + * @Default {false} + */ showCheckbox?: boolean; /** Controls the visibility of the column. @@ -36090,15 +36654,35 @@ declare namespace ej { */ textAlign?: ej.TextAlign | string; - /** Specifies the template for the TreeGrid column - */ - templateID?: string; - /** Enables or disables the ability to edit a row or cell. * @Default {false} */ allowEditing?: boolean; + /** We can include or exclude particular column from column visibility list in column menu. + * @Default {true} + */ + showInColumnChooser?: boolean; + + /** Sets the clip mode for TreeGrid cell as ellipsis or clipped content(both header and content) + * @Default {ej.TreeGrid.ClipMode.Clip} + */ + clipMode?: ej.TreeGrid.ClipMode | string; + + /** Sets the tooltip template for the specific column. + * @Default {null} + */ + tooltip?: string; + + /** Sets the tooltip template for the column header + * @Default {null} + */ + headerTooltip?: string; + + /** specifies the conditions for saving data to the database while adding or editing the fields. + */ + validationRules?: any; + /** Enables or disables the ability to freeze/unfreeze the columns * @Default {false} */ @@ -36167,14 +36751,37 @@ declare namespace ej { * @Default {top} */ rowPosition?: ej.TreeGrid.RowPosition | string; + /** Specifies the template ID for the custom dialog. + * @Default {null} + */ + dialogEditorTemplateID?: string; } export interface ColumnResizeSettings { /** Specifies the mode for column resizing - * @Default {normal} + * @Default {ej.TreeGrid.ColumnResizeMode.Normal} */ - columnResizeMode?: string; + columnResizeMode?: ej.TreeGrid.ColumnResizeMode | string; + } + + export interface FilterSettingsFilteredColumn { + + /** Specifies the value to be filtered in TreeGrid. + */ + value?: string; + + /** Specifies the field where filtering has to be performed. + */ + field?: string; + + /** Specifies the predicate(and/or) value to perform filtering. + */ + predicate?: string; + + /** Specifies the filter condition to filtered column. See operator + */ + operator?: string; } export interface FilterSettings { @@ -36185,9 +36792,9 @@ declare namespace ej { filterBarMode?: string; /** Specifies the type of column filtering. - * @Default {filterbar} + * @Default {ej.TreeGrid.FilterType.FilterBar} */ - filterType?: string; + filterType?: ej.TreeGrid.FilterType | string; /** Specifies the column collection for filtering the TreeGrid content on initial load * @Default {[]} @@ -36228,6 +36835,18 @@ declare namespace ej { template?: string; } + export interface SelectedCellIndex { + + /** Specifies the row index of the cell to be selected in TreeGrid control + */ + rowIndex?: number; + + /** Specifies the cell index to be selected in the row. + * @Default { } + */ + cellIndex?: number; + } + export interface SelectionSettings { /** Specifies the type of selection whether to select row or cell. @@ -36251,6 +36870,44 @@ declare namespace ej { enableSelectAll?: boolean; } + export interface SummaryRowsSummaryColumn { + + /** Specifies the summary type to perform calculations in a corresponding summary column. See summaryType. + */ + summaryType?: ej.TreeGrid.SummaryType | string; + + /** Specifies summary column used to perform the summary calculation. + */ + dataMember?: string; + + /** Specifies the required column to display the summary. + */ + displayColumn?: string; + + /** Specifies the text to be displayed before the summary column value. + */ + prefix?: string; + + /** Specifies the text to be displayed after the summary column value. + */ + suffix?: string; + + /** Specifies the format to be applied on the summary column value. + */ + format?: string; + } + + export interface SummaryRow { + + /** Specifies the title for summary row collection in TreeGrid + */ + title?: string; + + /** Specifies the summary columns in the summary rows. + */ + summaryColumns?: SummaryRowsSummaryColumn[]; + } + export interface SizeSettings { /** Height of the TreeGrid. @@ -36264,12 +36921,38 @@ declare namespace ej { width?: string; } + export interface SortSettingsSortedColumn { + + /** Specifies the field to be sorted in TreeGrid + */ + field?: string; + + /** Specifies the sort direction in TreeGrid + */ + direction?: string; + } + export interface SortSettings { /** Option to add columns based on which the rows have to be sorted recursively. * @Default {[]} */ - sortedColumns?: any[]; + sortedColumns?: SortSettingsSortedColumn[]; + } + + export interface ToolbarSettingsCustomToolbarItem { + + /** Allows the user to insert the custom icons in toolbar using CSS class name selector. + */ + text?: string; + + /** Allows the user to insert the custom icons in toolbar using script templates. Using this property we can bind HTML elements and other EJ controls to TreeGrid toolbar. + */ + templateID?: string; + + /** Allows the user to display custom tooltip text for TreeGrid custom toolbar items. + */ + tooltipText?: string; } export interface ToolbarSettings { @@ -36283,6 +36966,10 @@ declare namespace ej { * @Default {[]} */ toolbarItems?: any[]; + + /** Allows the user to insert custom toolbar items. + */ + customToolbarItems?: ToolbarSettingsCustomToolbarItem[]; } enum EditingType { @@ -36310,6 +36997,26 @@ declare namespace ej { } + enum ClipMode { + + ///Shows ellipsis for the overflown cell. + Ellipsis, + + ///Truncate the text in the cell. + Clip + } + + + enum HeaderTextOverflow { + + ///You can disable the word wrap + None, + + ///You can wrap the header content + Wrap + } + + enum BeginEditAction { ///you can begin the editing at double click @@ -36349,6 +37056,29 @@ declare namespace ej { } + enum ColumnResizeMode { + + ///At load time column are rendered with given width value, while resizing the column only current column width is changed + FixedColumns, + + ///At load time columns are stretched with control width,while resizing the column, current column width updated based on next column + Normal, + + ///In this mode columns are stretched with control width in load time and on resizing action. + NextColumn + } + + + enum FilterType { + + ///Enables the filterbar filtering + FilterBar, + + ///Enables the menu filtering + Menu + } + + enum PageSizeMode { ///To count all the parent and child records. @@ -36381,6 +37111,37 @@ declare namespace ej { Checkbox } + + enum SummaryType { + + ///Displays the sum of summary column + Sum, + + ///Displays the average of summary column + Average, + + ///Displays the maximum value of summary column + Maximum, + + ///Displays the minimum value of summary column + Minimum, + + ///Displays the total count of summary column + Count, + + ///Displays the minimum date value in summary column + MinimumDate, + + ///Displays the maximum date value in summary column + MaximumDate, + + ///Displays the true count value for boolean summary columns + TrueCount, + + ///Displays the false count value for boolean summary columns + FalseCount + } + } class GroupButton extends ej.Widget { @@ -38233,6 +38994,11 @@ declare namespace ej { */ gotoPage(sheetIdx: number, newSheet: boolean): void; + /** This method is used to hide the pivot table activationPanel in the Spreadsheet. + * @returns {void} + */ + hideActivationPanel(): 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} Optional. Index of the end column. @@ -38952,6 +39718,12 @@ declare namespace ej { export interface XLFormat { + /** This method is used to add the font to the Ribbon font family dropdown. + * @param {string} Font name which needs to add into the font family option. + * @returns {void} + */ + addFontFamily(fontName: string): void; + /** This method is used to convert table range to normal range. * @param {any} Pass the sheet index and table id. * @returns {void} @@ -38972,6 +39744,12 @@ declare namespace ej { */ format(formatObj: any, range: string): void; + /** This method is used to remove the font from the Ribbon font family dropdown. + * @param {string} Font name which needs to remove from the font family drop down. + * @returns {void} + */ + removeFontFamily(fontName: string): void; + /** This method is used to remove the style in the specified range. * @param {Array|string} Pass the cell range . * @param {any} Optional. Pass the options for which the style gets removed. @@ -38986,7 +39764,7 @@ declare namespace ej { 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 decimal places type in IncreaseDecimal/DecreaseDecimal. * @param {string|Array} Pass the range. * @returns {void} */ @@ -39475,9 +40253,9 @@ declare namespace ej { */ 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 {false} + /** Gets or sets a value that indicates whether to enable or disable freeze pane support in Spreadsheet. By enabling this feature, you can use freeze top row, + * freeze first column and freeze panes options. + * @Default {true} */ allowFreezing?: boolean; @@ -39620,6 +40398,10 @@ declare namespace ej { */ locale?: string; + /** Gets or sets a value that indicates name manager in Spreadsheet. + */ + nameManager?: NameManager[]; + /** Gets or sets an object that indicates to customize the picture behavior in the Spreadsheet. */ pictureSettings?: PictureSettings; @@ -41012,6 +41794,17 @@ declare namespace ej { password?: string; } + export interface NameManager { + + /** Specifies the name for the cell or a range. + */ + name?: string; + + /** Specifies the address for the cell or a range. + */ + refersto?: 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. @@ -42238,6 +43031,11 @@ declare namespace ej { */ isResponsive?: boolean; + /** Gets or sets a value that indicates whether to enable the spellcheck operation on Enter/Space key-press. + * @Default {false} + */ + enableValidateOnType?: boolean; + /** It allows to spell check the multiple target HTML element's texts and correct its error words. * @Default {null} */ @@ -42802,6 +43600,7 @@ declare namespace ej { } } + declare namespace ej.datavisualization { class SymbolPalette extends ej.Widget { @@ -43401,6 +44200,16 @@ declare namespace ej.datavisualization { */ isResponsive?: boolean; + /** Used to Convert the date object to string while using the locale settings + * @Default {false} + */ + enableGroupSeparator?: boolean; + + /** Responsiveness of the linear gauge is controlled + * @Default {false} + */ + enableResize?: boolean; + /** Specify frame of linear gauge * @Default {null} */ @@ -43415,6 +44224,10 @@ declare namespace ej.datavisualization { * @Default {null} */ labelColor?: string; + /** Set the localization culture for the Linear gauge + * @Default {en-US} + */ + locale?: string; /** Specifies the maximum value of Linear gauge. * @Default {100} @@ -45412,6 +46225,16 @@ declare namespace ej.datavisualization { */ enableAnimation?: boolean; + /** Specify to convert the date object to string, using locale settings. + * @Default {false} + */ + enableGroupSeparator?: boolean; + + /** Controls whether circular gauge has to be responsive while resizing. + * @Default {false} + */ + enableResize?: boolean; + /** Specify the frame of circular gauge * @Default {Object} */ @@ -45442,6 +46265,11 @@ declare namespace ej.datavisualization { */ isResponsive?: boolean; + /** Name of the culture based on which circular gauge should be localized. + * @Default {en-US} + */ + locale?: string; + /** Specifies the maximum value of circular gauge. * @Default {100} */ @@ -45477,6 +46305,10 @@ declare namespace ej.datavisualization { */ theme?: string; + /** Options to customize the legend. + */ + legend?: Legend; + /** Specify tooltip option of circular gauge * @Default {object} */ @@ -45492,6 +46324,15 @@ declare namespace ej.datavisualization { */ width?: number; + /** Fires before rendering the legend item. This event is fired for each legend item in CircularGauge. You can use this event to customize legend item shape or add custom text to legend item. */ + legendItemRender?(e: LegendItemRenderEventArgs): void; + + /** Fires on clicking the legend item. */ + legendItemClick?(e: LegendItemClickEventArgs): void; + + /** Fires when mouse moving on ranges. */ + rangeMouseMove?(e: RangeMouseMoveEventArgs): void; + /** Triggers while the custom labels are being drawn on the gauge. */ drawCustomLabel?(e: DrawCustomLabelEventArgs): void; @@ -45529,6 +46370,63 @@ declare namespace ej.datavisualization { renderComplete?(e: RenderCompleteEventArgs): void; } + export interface LegendItemRenderEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the circulargauge model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + + /** Instance of the legend item object that is about to be rendered + */ + data?: any; + } + + export interface LegendItemClickEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the circulargauge model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + + /** Instance of the legend item object that is about to be rendered + */ + data?: any; + } + + export interface RangeMouseMoveEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the circulargauge model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + + /** Region of ranges + */ + data?: any; + } + export interface DrawCustomLabelEventArgs { /** returns the object of the gauge. @@ -46171,10 +47069,20 @@ declare namespace ej.datavisualization { */ position?: ScalesCustomLabelsPosition; + /** Specify angle for the rotation of the custom labels in degrees. + * @Default {0} + */ + textAngle?: number; + /** Specify font for custom labels * @Default {Object} */ font?: ScalesCustomLabelsFont; + + /** Specifies the position of the custom labels. See CustomLabelPositionType + * @Default {inner} + */ + positionType?: ej.datavisualization.CircularGauge.CustomLabelPositionType | string; } export interface ScalesIndicatorsPosition { @@ -46540,6 +47448,11 @@ declare namespace ej.datavisualization { */ backgroundColor?: string; + /** Specify text for the ranges of circular gauge + * @Default {null} + */ + legendText?: string; + /** Specify border for ranges of circular gauge * @Default {Object} */ @@ -46798,6 +47711,144 @@ declare namespace ej.datavisualization { ticks?: ScalesTick[]; } + export interface LegendBorder { + + /** Border color of the legend. + * @Default {transparent} + */ + color?: string; + + /** Border width of the legend. + * @Default {1} + */ + width?: number; + } + + 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; + + /** Specifies the height of the legend item shapes. + * @Default {10} + */ + height?: number; + + /** Specifies the width of the legend item shapes. + * @Default {10} + */ + width?: number; + } + + export interface LegendSize { + + /** Specify the height of the legend. Height can be specified in pixel. + * @Default {null} + */ + height?: string; + + /** Specify the width of the legend. Width can be specified in pixel. + * @Default {null} + */ + width?: string; + } + + export interface LegendFont { + + /** Font family for legend item text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style for legend item text. + * @Default {Normal} + */ + fontStyle?: string; + + /** Font weight for legend item text. + * @Default {Regular} + */ + fontWeight?: string; + + /** Font size for legend item text. + * @Default {12px} + */ + size?: string; + + /** Font color of the text for legend items. + * @Default {null} + */ + color?: string; + } + + export interface Legend { + + /** Toggles the visibility of the legend. + * @Default {false} + */ + visible?: boolean; + + /** Specifies the alignment of the legend. + * @Default {Center. See Alignment} + */ + alignment?: ej.datavisualization.CircularGauge.LegendAlignment | string; + + /** Options for customizing the legend border. + */ + border?: LegendBorder; + + /** Fill color for the legend items. By using this property, it displays all legend item shapes in same color.Legend items representing invisible ranges is displayed in gray color. + * @Default {null} + */ + fill?: string; + + /** Gap or padding between the legend items. + * @Default {20} + */ + itemPadding?: number; + + /** Options to customize the style of legend items. + */ + itemStyle?: LegendItemStyle; + + /** 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 circular gauge. + * @Default {Bottom. See Position} + */ + position?: ej.datavisualization.CircularGauge.LegendPosition | string; + + /** Shape of the legend items. + * @Default {Circle. See Shape} + */ + shape?: ej.datavisualization.CircularGauge.LegendShape | string; + + /** Options to customize the size of the legend. + */ + size?: LegendSize; + + /** Options to customize the font used for legend item text. + */ + font?: LegendFont; + } + export interface Tooltip { /** enable showCustomLabelTooltip of circular gauge @@ -46955,6 +48006,53 @@ declare namespace ej.datavisualization { } } + namespace CircularGauge { + enum LegendAlignment { + //string + Center, + //string + Near, + //string + Far, + } + } + + namespace CircularGauge { + enum LegendPosition { + //string + Left, + //string + Right, + //string + Top, + //string + Bottom, + } + } + + namespace CircularGauge { + enum LegendShape { + //string + Rectangle, + //string + Circle, + //string + Triangle, + //string + Ellipse, + //string + Diamond, + //string + Pentagon, + //string + Slider, + //string + Trapezoid, + //string + Line, + } + } + class DigitalGauge extends ej.Widget { static fn: DigitalGauge; constructor(element: JQuery | Element, options?: DigitalGauge.Model); @@ -47024,6 +48122,11 @@ declare namespace ej.datavisualization { */ isResponsive?: boolean; + /** Specifies the responsiveness of the Digital gauge + * @Default {false} + */ + enableResize?: boolean; + /** Specifies the items for the DigitalGauge. * @Default {null} */ @@ -47384,6 +48487,11 @@ declare namespace ej.datavisualization { */ animate(options: any): void; + /** Prints the rendered chart. + * @returns {void} + */ + print(): 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, @@ -47599,6 +48707,9 @@ declare namespace ej.datavisualization { /** Fires before loading the chart. */ load?(e: LoadEventArgs): void; + /** Fires while performing rectangle zooming in chart. */ + zoomed?(e: ZoomedEventArgs): void; + /** Fires after selected the data in chart. */ rangeSelected?(e: RangeSelectedEventArgs): void; @@ -47694,15 +48805,15 @@ declare namespace ej.datavisualization { /** Instance of the corresponding axis. */ - Axis?: any; + axis?: any; /** Formatted text of the respective label. You can also add custom text to the label. */ - LabelText?: string; + Text?: string; /** Actual value of the label. */ - LabelValue?: string; + Value?: string; /** Set this option to true to cancel the event. */ @@ -48056,6 +49167,42 @@ declare namespace ej.datavisualization { */ type?: string; } + export interface ZoomedEventArgs { + + /** 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; + + /** Selected data collection of object + */ + data?: any; + } + export interface RangeSelectedEventArgs { + + /** 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; + + /** Selected data collection of object + */ + data?: any; + } export interface RangeSelectedEventArgs { @@ -49765,6 +50912,11 @@ declare namespace ej.datavisualization { */ labelPosition?: ej.datavisualization.Chart.LabelPosition | string; + /** Specifies the mode for splitting the data points in pieOfPie series. + * @Default {value. See SplitMode} + */ + splitMode?: ej.datavisualization.Chart.SplitMode | string; + /** Quartile calculation has been performed in three different formulas to render the box and whisker series. * @Default {exclusive} */ @@ -49802,6 +50954,21 @@ declare namespace ej.datavisualization { */ pieCoefficient?: number; + /** Controls the size of the second pie in pieOfPie series. Value ranges from 0 to 1. + * @Default {0.6} + */ + pieOfPieCoefficient?: number; + + /** Split Value of pieofpie series. + * @Default {null} + */ + splitValue?: string; + + /** Distance between the two pie's in pieOfPie series. + * @Default {50} + */ + gapWidth?: number; + /** Name of the property in the datasource that contains fill color for the series. * @Default {null} */ @@ -51141,6 +52308,11 @@ declare namespace ej.datavisualization { */ multiLevelLabels?: PrimaryXAxisMultiLevelLabel[]; + /** Specifies whether the axis elements need to be placed nearby the axis line, while crossing. + * @Default {true} + */ + showNextToAxisLine?: boolean; + /** Options for customizing the strip lines. * @Default {[ ]} */ @@ -51818,6 +52990,11 @@ declare namespace ej.datavisualization { */ multiLevelLabels?: AxesMultiLevelLabel[]; + /** Specifies whether the axis elements need to be placed nearby the axis line, while crossing. + * @Default {true} + */ + showNextToAxisLine?: boolean; + /** Options for customizing the strip lines. * @Default {[ ]} */ @@ -52491,6 +53668,11 @@ declare namespace ej.datavisualization { */ multiLevelLabels?: PrimaryYAxisMultiLevelLabel[]; + /** Specifies whether the axis elements need to be placed nearby the axis line, while crossing. + * @Default {true} + */ + showNextToAxisLine?: boolean; + /** Options for customizing the strip lines. * @Default {[ ]} */ @@ -53719,6 +54901,11 @@ declare namespace ej.datavisualization { */ labelPosition?: ej.datavisualization.Chart.LabelPosition | string; + /** Specifies the mode for splitting the data points in pieOfPie series. + * @Default {value. See SplitMode} + */ + splitMode?: ej.datavisualization.Chart.SplitMode | string; + /** Quartile calculation has been performed in three different formulas to render the boxplot series . * @Default {exclusive} */ @@ -53761,6 +54948,21 @@ declare namespace ej.datavisualization { */ pieCoefficient?: number; + /** Controls the size of the second pie in pieOfPie series. Value ranges from 0 to 1. + * @Default {0.6} + */ + pieOfPieCoefficient?: number; + + /** Split Value of pieofpie series. + * @Default {null} + */ + splitValue?: string; + + /** Distance between the two pie's in pieOfPie series. + * @Default {50} + */ + gapWidth?: number; + /** Options for customizing the empty point in the series. */ emptyPointSettings?: SeriesEmptyPointSettings; @@ -54223,6 +55425,19 @@ declare namespace ej.datavisualization { OutsideExtended, } } + + namespace Chart { + enum SplitMode { + //string + Position, + //string + Value, + //string + Percentage, + //string + Indexes, + } + } namespace Chart { enum boxPlotMode { //string @@ -54719,6 +55934,11 @@ declare namespace ej.datavisualization { */ enableScrollbar?: boolean; + /** Enable the resize option in the rangenavigator. + * @Default {false} + */ + enableAutoResizing?: boolean; + /** Toggles the direction of rendering the range navigator control. * @Default {false} */ @@ -54813,6 +56033,12 @@ declare namespace ej.datavisualization { /** Fires on when starting to change the scrollbar position of range navigator. */ scrollStart?(e: ScrollStartEventArgs): void; + /** Fires on when starting to change the slider position of range navigator. */ + selectedRangeStart?(e: SelectedRangeStartEventArgs): void; + + /** Fires when the selection ends in the range navigator */ + selectedRangeEnd?(e: SelectedRangeEndEventArgs): void; + /** Fires on changes ending the scrollbar position of range navigator. */ scrollEnd?(e: ScrollEndEventArgs): void; } @@ -54928,6 +56154,19 @@ declare namespace ej.datavisualization { type?: string; } + export interface SelectedRangeStartEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + } + + export interface SelectedRangeEndEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + } export interface ScrollEndEventArgs { /** parameters from RangeNavigator @@ -55644,6 +56883,24 @@ declare namespace ej.datavisualization { width?: number; } + export interface ValueAxisSettingsRange { + + /** Default Value + * @Default {null} + */ + min?: number; + + /** Default Value + * @Default {null} + */ + max?: number; + + /** Default Value + * @Default {null} + */ + interval?: number; + } + export interface ValueAxisSettings { /** Options for customizing the axis line. @@ -55662,6 +56919,10 @@ declare namespace ej.datavisualization { */ majorTickLines?: ValueAxisSettingsMajorTickLines; + /** You can customize the range of the axis by setting minimum , maximum and interval. + */ + range?: ValueAxisSettingsRange; + /** If the range is not given explicitly, range will be calculated automatically. You can customize the automatic range calculation using rangePadding. * @Default {none} */ @@ -55827,6 +57088,11 @@ declare namespace ej.datavisualization { */ enableAnimation?: boolean; + /** Controls whether bullet graph has to be responsive while resizing. + * @Default {true} + */ + enableResizing?: boolean; + /** Specifies the direction of flow in bullet graph. Neither it may be backward nor forward. * @Default {forward} */ @@ -55842,6 +57108,16 @@ declare namespace ej.datavisualization { */ isResponsive?: boolean; + /** Specifies to convert the date object to string, using locale settings. + * @Default {false} + */ + enableGroupSeparator?: boolean; + + /** Name of the culture based on which bulletgraph should be localized. + * @Default {en-US} + */ + locale?: string; + /** Bullet graph will render in the specified orientation. * @Default {horizontal} */ @@ -55902,6 +57178,9 @@ declare namespace ej.datavisualization { /** Fires on rendering the labels. */ drawLabels?(e: DrawLabelsEventArgs): void; + /** Fires on rendering the ticks. */ + drawTicks?(e: DrawTicksEventArgs): void; + /** Fires on rendering the qualitative ranges. */ drawQualitativeRanges?(e: DrawQualitativeRangesEventArgs): void; @@ -56023,6 +57302,11 @@ declare namespace ej.datavisualization { labelType?: string; } + export interface DrawTicksEventArgs { + /** Returns the cancel option value. + */ + cancel?: boolean; + } export interface DrawQualitativeRangesEventArgs { /** returns the object of the bullet graph. @@ -57952,6 +59236,15 @@ declare namespace ej.datavisualization { /** Triggers on treemap item selected. */ treeMapItemSelected?(e: TreeMapItemSelectedEventArgs): void; + + /** Triggers when drilldown is started */ + drillStarted?(e: DrillStartedEventArgs): void; + + /** Triggers on treemap drilldown item selected. */ + drillDownItemSelected?(e: DrillDownItemSelectedEventArgs): void; + + /** Triggers after refreshing the treemap items. */ + refreshed?(e: RefreshedEventArgs): void; } export interface TreeMapItemSelectedEventArgs { @@ -57961,6 +59254,27 @@ declare namespace ej.datavisualization { originalEvent?: any; } + export interface DrillStartedEventArgs { + + /** Returns selected drilled treeMap object. + */ + originalEvent?: any; + } + + export interface DrillDownItemSelectedEventArgs { + + /** Returns selected drilldown treeMap object. + */ + originalEvent?: any; + } + + export interface RefreshedEventArgs { + + /** Refresh and load the treemap. + */ + originalEvent?: any; + } + export interface UniColorMapping { /** Specifies the uniform color mapping of the treemap @@ -58085,6 +59399,11 @@ declare namespace ej.datavisualization { */ borderThickness?: number; + /** Specifies the space between the leaf items. + * @Default {0} + */ + gap?: number; + /** Specifies the label template of the leaf item. * @Default {null} */ @@ -58392,13 +59711,13 @@ declare namespace ej.datavisualization { */ findNode(name: string): any; - /** Fit the diagram content into diagram viewport - * @param {string} to set the mode of fit to command. See [Fit Mode](/api/js/global#fitmode) - * @param {string} to set whether the region to be fit will be based on diagram elements or page settings [Region](/api/js/global#region) - * @param {any} to set the required margin - * @returns {void} - */ - fitToPage(mode?: string, region?: string, margin?: any): void; + /** Fit the diagram content into diagram viewport + * @param {ej.datavisualization.Diagram.FitMode} to set the mode of fit to command. + * @param {ej.datavisualization.Diagram.Region} to set whether the region to be fit will be based on diagram elements or page settings. + * @param {any} to set the required margin + * @returns {void} + */ + fitToPage(mode?: ej.datavisualization.Diagram.FitMode, region?: ej.datavisualization.Diagram.Region, margin?: any): void; /** Group the selected nodes and connectors * @returns {void} @@ -58617,17 +59936,17 @@ declare namespace ej.datavisualization { */ fileName?: string; - /** format of the exported file/data. See [File Formats](/api/js/global#fileformats). + /** format of the exported file/data. */ - format?: string; + format?: ej.datavisualization.Diagram.FileFormats; - /** to set whether to export diagram as a file or as raw data. See [Export Modes](/api/js/global#exportmodes). + /** to set whether to export diagram as a file or as raw data. */ - mode?: string; + mode?: ej.datavisualization.Diagram.ExportModes; - /** to set the region of the diagram to be exported. See [Region](/api/js/global#region). + /** to set the region of the diagram to be exported. */ - region?: string; + region?: ej.datavisualization.Diagram.Region; /** to export any custom region of diagram. */ @@ -58637,9 +59956,9 @@ declare namespace ej.datavisualization { */ margin?: any; - /** to set stretch to the exported data. + /** to resize the diagram content to fill its allocated space. */ - stretch?: string; + stretch?: ej.datavisualization.Diagram.Stretch; } export interface Zoom { @@ -58925,6 +60244,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter to specify whether or not to cancel the event + */ + cancel?: boolean; } export interface ConnectionChangeEventArgs { @@ -59052,6 +60375,17 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; + + /** parameter returns the actual click event arguments that explains which button is clicked + */ + model?: any; + + /** parameter returns the type of the event triggered + */ + type?: string; } export interface ContextMenuClickEventArgs { @@ -59083,6 +60417,22 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter to specify whether or not to cancel the event + */ + cancel?: boolean; + + /** parameter returns the elementof the object that was clicked + */ + element?: any; + + /** parameter returns the object that is selected + */ + selectedItem?: any; + + /** parameter returns the model of the diagram + */ + events?: any; } export interface DoubleClickEventArgs { @@ -59098,6 +60448,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter to specify whether or not to cancel the event + */ + cancel?: boolean; } export interface DragEventArgs { @@ -59125,6 +60479,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter returns the offset of the selecteditems + */ + offset?: any; } export interface DragEnterEventArgs { @@ -59148,6 +60506,10 @@ declare namespace ej.datavisualization { */ element?: any; + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; + /** parameter returns the id of the diagram */ diagramId?: string; @@ -59204,7 +60566,7 @@ declare namespace ej.datavisualization { /** parameter returns the enum which defines the type of the source */ - sourceType?: string; + objectType?: string; /** parameter returns the id of the diagram */ @@ -59212,7 +60574,7 @@ declare namespace ej.datavisualization { } export interface EditorFocusChangeEventArgs { - /** Returns the cancel option value. + /** parameter to specify whether or not to cancel the event */ cancel?: boolean; } @@ -59253,6 +60615,14 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter to specify whether or not to cancel the event + */ + cancel?: boolean; + + /** parameter returns the model of the diagram + */ + cause?: boolean; } export interface ItemClickEventArgs { @@ -59269,7 +60639,7 @@ declare namespace ej.datavisualization { */ cancel?: boolean; - /** parameter returns the actual click event arguments that explains which button is clicked + /** parameter returns the model of the diagram */ event?: any; @@ -59295,6 +60665,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; } export interface MouseLeaveEventArgs { @@ -59311,6 +60685,10 @@ declare namespace ej.datavisualization { */ target?: any; + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; + /** parameter returns the id of the diagram */ diagramId?: string; @@ -59330,6 +60708,10 @@ declare namespace ej.datavisualization { */ target?: any; + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; + /** parameter returns the id of the diagram */ diagramId?: string; @@ -59383,6 +60765,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter defines whether to cancel the property change or not + */ + cancel?: boolean; } export interface RotationChangeEventArgs { @@ -59406,6 +60792,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter returns the actual click event arguments that explains which button is clicked + */ + cause?: string; } export interface ScrollChangeEventArgs { @@ -59418,9 +60808,17 @@ declare namespace ej.datavisualization { */ oldValues?: any; + /** parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; + /** parameter returns the id of the diagram */ diagramId?: string; + + /** Parameter returns the new zoom value, horizontal and vertical scroll offsets. + */ + cause?: string; } export interface SegmentChangeEventArgs { @@ -59472,14 +60870,18 @@ declare namespace ej.datavisualization { */ cancel?: boolean; - /** triggers before and after adding the selection to the object in the diagram which can be differentiated through `state` argument. - * We can cancel the event only before the selection of the object. + /** triggers before and after adding the selection to the object in the diagram which can be differentiated through `state` argument. We can cancel the event only + * before the selection of the object. */ state?: string; /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter returns the actual cause of the event + */ + cause?: string; } export interface SizeChangeEventArgs { @@ -59511,6 +60913,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter returns the direction of the node is resized + */ + direction?: string; } export interface TextChangeEventArgs { @@ -59530,6 +60936,10 @@ declare namespace ej.datavisualization { /** parameter returns the id of the diagram */ diagramId?: string; + + /** parameter to specify whether or not to cancel the event + */ + cancel?: boolean; } export interface CreateEventArgs { @@ -60173,6 +61583,105 @@ declare namespace ej.datavisualization { showCustomMenuItemsOnly?: boolean; } + export interface DataSourceSettingsCrudAction { + + /** Specifies the create method which is used to get the nodes to be added from client side to the server side + * @Default {null} + */ + create?: string; + + /** Specifies the update method which is used to get the updated data from client side to the server side + * @Default {null} + */ + update?: string; + + /** Specifies the destroy method which is used to get the deleted items data from client side to the server side + * @Default {null} + */ + destroy?: string; + + /** Specifies the read method to get the created nodes from client side to the server side + * @Default {null} + */ + read?: string; + } + + export interface DataSourceSettingsConnectionDataSourceCrudAction { + + /** Specifies the create method which is used to get the connectors to be added from client side to the server side + * @Default {null} + */ + create?: string; + + /** Specifies the update method which is used to get the updated connectors from client side to the server side + * @Default {null} + */ + update?: string; + + /** Specifies the destroy method which is used to get the deleted items data from client side to the server side + * @Default {null} + */ + destroy?: string; + + /** Specifies the read method which is used to get the data from client side to the server side + * @Default {null} + */ + read?: string; + } + + export interface DataSourceSettingsConnectionDataSource { + + /** Sets the datasource for the connection datasource settings items. + * @Default {null} + */ + dataSource?: string; + + /** Sets the unique id of the connection data source item + * @Default {null} + */ + id?: string; + + /** Sets the sourcenode of the connection data source item + * @Default {null} + */ + sourceNode?: string; + + /** Sets the targetnode of the connection data source item + * @Default {null} + */ + targetNode?: string; + + /** Sets the sourcepoint-x value of the connection data source item + * @Default {null} + */ + sourcePointX?: string; + + /** Sets the sourcePoint-y value of the connection data source item + * @Default {null} + */ + sourcePointY?: string; + + /** Sets the targetPoint-x value of the connection data source item + * @Default {null} + */ + targetPointX?: string; + + /** Sets the targetPoint-y value of the connection data source item + * @Default {null} + */ + targetPointY?: string; + + /** Specifies the method name which is used to get updated connectors from client side to the server side + * @Default {null} + */ + crudAction?: DataSourceSettingsConnectionDataSourceCrudAction; + + /** Specifies the customfields to get the updated data from client side to the server side + * @Default {[]} + */ + customFields?: any[]; + } + export interface DataSourceSettings { /** Defines the data source either as a collection of objects or as an instance of ej.DataManager @@ -60202,6 +61711,21 @@ declare namespace ej.datavisualization { * @Default {null} */ tableName?: string; + + /** Specifies the method name which is used to get the updated data from client side to the server side + * @Default {null} + */ + crudAction?: DataSourceSettingsCrudAction; + + /** Specifies the customfields to get the updated data from client side to the server side + * @Default {[]} + */ + customFields?: any[]; + + /** Defines the data source either as a collection of objects or as an instance of ej.DataManager + * @Default {null} + */ + connectionDataSource?: DataSourceSettingsConnectionDataSource; } export interface DefaultSettings { @@ -60285,6 +61809,11 @@ declare namespace ej.datavisualization { */ getLayoutInfo?: any; + /** Defines a method to customize the segments based on source and target nodes. + * @Default {null} + */ + getConnectorSegments?: any; + /** Sets the space to be horizontally left between nodes * @Default {30} */ @@ -61534,6 +63063,10 @@ declare namespace ej.datavisualization { export interface SelectedItemsUserHandle { + /** Defines the name of the user handle + */ + name?: string; + /** Defines the background color of the user handle * @Default {#2382c3} */ @@ -62691,6 +64224,57 @@ declare namespace ej.datavisualization { Mouse, } } + namespace Diagram { + enum FileFormats { + //Used to export the diagram into JPG format. + JPG, + //Used to export the diagram into PNG format. + PNG, + //Used to export the diagram into BMP format. + BMP, + //Used to export the diagram into SVG format. + SVG, + } + } + namespace Diagram { + enum ExportModes { + //Used to export the diagram as a file. + Download, + //Used to export the diagram as raw data. + Data, + } + } + namespace Diagram { + enum Region { + //Used to export the content of the diagram only. + Content, + //Used to export the page region of the diagram. + PageSettings, + } + } + namespace Diagram { + enum Stretch { + //The diagram content preserves its original size. + None, + //The diagram content is resized to fill the destination dimensions. The aspect ratio is not preserved. + Fill, + //The diagram content is resized to fit in the destination dimensions while it preserves its native aspect ratio. + Uniform, + //The diagram content is resized to fill the destination dimensions while it preserves its native aspect ratio. If the aspect ratio of the destination rectangle differs from the source, + //the source content is clipped to fit in the destination dimensions. + UniformToFill, + } + } + namespace Diagram { + enum FitMode { + //Used to fit the diagram content based on page size. + Page, + //Used to fit the diagram content based on diagram width. + Width, + //Used to fit the diagram content based on diagram height. + Height, + } + } namespace Diagram { enum ZoomCommand { //Used to zoom in the Diagram @@ -63378,6 +64962,11 @@ declare namespace ej.datavisualization { */ rangeBandSettings?: RangeBandSettings; + /** Name of the culture based on which sparkline should be localized. + * @Default {en-US} + */ + locale?: string; + /** Name of a field in data source, where the fill color for all the data points is generated. */ palette?: string; @@ -63392,6 +64981,11 @@ declare namespace ej.datavisualization { */ enableCanvasRendering?: boolean; + /** Specify to convert the date object to string, using locale settings. + * @Default {false} + */ + enableGroupSeparator?: boolean; + /** Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. * @Default {null} */ @@ -65079,6 +66673,7 @@ declare namespace ej.datavisualization { } + interface JQueryXHR { /** * Returns the cancel option value. @@ -65243,6 +66838,9 @@ interface JQuery { ejPivotTreeMap(options?: ej.PivotTreeMap.Model): JQuery; ejPivotTreeMap(memberName: any, value?: any, param?: any): any; + ejPrint(options?: ej.Print.Model): JQuery; + ejPrint(memberName: any, value?: any, param?: any): any; + ejProgressBar(options?: ej.ProgressBar.Model): JQuery; ejProgressBar(memberName: any, value?: any, param?: any): any; @@ -65401,6 +66999,7 @@ interface JQuery { data(key: "ejPivotPager"): ej.PivotPager; data(key: "ejPivotSchemaDesigner"): ej.PivotSchemaDesigner; data(key: "ejPivotTreeMap"): ej.PivotTreeMap; + data(key: "ejPrint"): ej.Print; data(key: "ejProgressBar"): ej.ProgressBar; data(key: "ejRadialMenu"): ej.RadialMenu; data(key: "ejRadialSlider"): ej.RadialSlider; From 8f92ae45d43ed9074df3531909eb92f5a4eabe16 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 20:12:24 -0400 Subject: [PATCH 265/761] Further model reduction in pouchdb-mapreduce Reduce should be a CouchDB-style reduction function (keys, values, rereduce). For query, the Model is the Reduction or the currently hidden from types emit(key, value) value. --- types/pouchdb-mapreduce/index.d.ts | 33 ++++++++++-------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index b9a05ff7d6..4ecf21d370 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -10,15 +10,19 @@ /* tslint:disable:no-single-declare-module */ declare namespace PouchDB { + type Map = (doc: Content) => void; + // The any below would be the value type from emit(key, value), currently hidden from type information in the Map + type Reducer = (keys: Array<[string, any]> | null, values: Content[] | Reduction[], rereduce: boolean) => Reduction[] | Reduction; + interface Filter { - map(doc: Content): void; - reduce?(key: string, value: Content): Reduction; + map: Map; + reduce?: Reducer | '_sum' | '_count' | '_stats' | string; } namespace Query { - interface Options { + interface Options { /** Reduce function, or the string name of a built-in function: '_sum', '_count', or '_stats'. */ - reduce?: ((...args: any[]) => void) | '_sum' | '_count' | '_stats' | boolean; + reduce?: Reducer | '_sum' | '_count' | '_stats' | boolean; /** Include the document in each row in the doc field. */ include_docs?: boolean; /** Include conflicts in the _conflicts field of a doc. */ @@ -94,32 +98,17 @@ declare namespace PouchDB { * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | ((doc: Content & Model) => void), opts: Query.Options, callback: (err: Core.Error, res: Query.Response) => void): void; + query(fun: string | Map | Filter, opts: Query.Options, callback: Core.Callback>): void; /** * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: Filter, opts: Query.Options, callback: (err: Core.Error, res: Query.Response) => void): void; + query(fun: string | Map | Filter, callback: Core.Callback>): void; /** * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | ((doc: Content & Model) => void), callback: (err: Core.Error, res: Query.Response) => void): void; - /** - * Invoke a map/reduce function, which allows you to perform more complex queries - * on PouchDB than what you get with allDocs(). - */ - query(fun: Filter, callback: (err: Core.Error, res: Query.Response) => void): void; - /** - * Invoke a map/reduce function, which allows you to perform more complex queries - * on PouchDB than what you get with allDocs(). - */ - query(fun: string | ((doc: Content & Model) => void), opts?: Query.Options): Promise>; - /** - * Invoke a map/reduce function, which allows you to perform more complex queries - * on PouchDB than what you get with allDocs(). - */ - query(fun: Filter, opts?: Query.Options): Promise>; + query(fun: string | Map | Filter, opts?: Query.Options): Promise>; } } From 307c01282bfc9ff985c63096ac25eb07130eb5f3 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 20:23:23 -0400 Subject: [PATCH 266/761] Reallow heterogeneous query in pouchdb-mapreduce --- types/pouchdb-mapreduce/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index 4ecf21d370..4c3d2e8ebf 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -98,17 +98,17 @@ declare namespace PouchDB { * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Map | Filter, opts: Query.Options, callback: Core.Callback>): void; + query(fun: string | Map | Filter, opts: Query.Options, callback: Core.Callback>): void; /** * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Map | Filter, callback: Core.Callback>): void; + query(fun: string | Map | Filter, callback: Core.Callback>): void; /** * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Map | Filter, opts?: Query.Options): Promise>; + query(fun: string | Map | Filter, opts?: Query.Options): Promise>; } } From 21a5f52f750a3034f1a6ff00d98c7979d61fc4f0 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:33:54 +0100 Subject: [PATCH 267/761] Added documentation --- types/nodegit/diff-delta.d.ts | 36 ++++ types/nodegit/hash-sig.d.ts | 35 ++++ types/nodegit/index-entry.d.ts | 84 ++++++++ types/nodegit/index_.d.ts | 279 ++++++++++++++++++++++++++ types/nodegit/indexer.d.ts | 21 ++ types/nodegit/lib-git2.d.ts | 43 ++++ types/nodegit/merge-file-input.d.ts | 30 +++ types/nodegit/merge-file-options.d.ts | 48 ++++- types/nodegit/merge-file-result.d.ts | 30 +++ types/nodegit/merge-options.d.ts | 64 +++++- types/nodegit/merge.d.ts | 79 ++++++++ types/nodegit/note.d.ts | 106 ++++++++++ types/nodegit/object.d.ts | 117 +++++++++++ types/nodegit/odb-object.d.ts | 41 ++++ types/nodegit/odb.d.ts | 3 +- types/nodegit/proxy-options.d.ts | 36 ++++ 16 files changed, 1038 insertions(+), 14 deletions(-) diff --git a/types/nodegit/diff-delta.d.ts b/types/nodegit/diff-delta.d.ts index c21d98f430..b09226c064 100644 --- a/types/nodegit/diff-delta.d.ts +++ b/types/nodegit/diff-delta.d.ts @@ -1,10 +1,46 @@ import { DiffFile } from './diff-file'; export class DiffDelta { + /** + * + * + * @type {number} + * @memberof DiffDelta + */ status: number; + /** + * + * + * @type {number} + * @memberof DiffDelta + */ flags: number; + /** + * + * + * @type {number} + * @memberof DiffDelta + */ similarity: number; + /** + * + * + * @type {number} + * @memberof DiffDelta + */ nfiles: number; + /** + * + * + * @type {DiffFile} + * @memberof DiffDelta + */ oldFile: DiffFile; + /** + * + * + * @type {DiffFile} + * @memberof DiffDelta + */ newFile: DiffFile; } diff --git a/types/nodegit/hash-sig.d.ts b/types/nodegit/hash-sig.d.ts index 5e9897450f..86bfe5d64f 100644 --- a/types/nodegit/hash-sig.d.ts +++ b/types/nodegit/hash-sig.d.ts @@ -8,9 +8,44 @@ export namespace Hashsig { } export class Hashsig { + /** + * + * + * @static + * @param {string} buf + * @param {number} buflen + * @param {number} opts + * @returns {Promise} + * + * @memberof Hashsig + */ static create(buf: string, buflen: number, opts: number): Promise; + /** + * + * + * @static + * @param {string} path + * @param {number} opts + * @returns {Promise} + * + * @memberof Hashsig + */ static createFromFile(path: string, opts: number): Promise; + /** + * + * + * @param {Hashsig} b + * @returns {number} + * + * @memberof Hashsig + */ compare(b: Hashsig): number; + /** + * + * + * + * @memberof Hashsig + */ free(): void; } diff --git a/types/nodegit/index-entry.d.ts b/types/nodegit/index-entry.d.ts index b121b7a826..df42f9cbce 100644 --- a/types/nodegit/index-entry.d.ts +++ b/types/nodegit/index-entry.d.ts @@ -1,21 +1,105 @@ import { Oid } from './oid'; export interface IndexTime { + /** + * + * + * @type {number} + * @memberof IndexTime + */ seconds: number; + /** + * + * + * @type {number} + * @memberof IndexTime + */ nanoseconds: number; } export class IndexEntry { + /** + * + * + * @type {IndexTime} + * @memberof IndexEntry + */ ctime: IndexTime; + /** + * + * + * @type {IndexTime} + * @memberof IndexEntry + */ mtime: IndexTime; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ dev: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ ino: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ mode: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ uid: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ gid: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ fileSize: number; + /** + * + * + * @type {Oid} + * @memberof IndexEntry + */ id: Oid; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ flags: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ flagsExtended: number; + /** + * + * + * @type {string} + * @memberof IndexEntry + */ path: string; } diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index 6fd80f5047..a805a19c97 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -21,36 +21,315 @@ export namespace Index { } export class Index { + /** + * + * + * @static + * @param {IndexEntry} entry + * @returns {number} + * + * @memberof Index + */ static entryIsConflict(entry: IndexEntry): number; + /** + * + * + * @static + * @param {IndexEntry} entry + * @returns {number} + * + * @memberof Index + */ static entryStage(entry: IndexEntry): number; + /** + * + * + * @static + * @param {string} index_path + * @returns {Promise} + * + * @memberof Index + */ static open(index_path: string): Promise; + /** + * + * + * @param {IndexEntry} source_entry + * @returns {number} + * + * @memberof Index + */ add(source_entry: IndexEntry): number; + /** + * + * + * @param {Strarray} pathspec + * @param {number} flags + * @param {Function} callback + * @param {void} payload + * @returns {Promise} + * + * @memberof Index + */ addAll(pathspec: Strarray, flags: number, callback: Function, payload: void): Promise; + /** + * + * + * @param {string} path + * @returns {number} + * + * @memberof Index + */ addByPath(path: string): number; + /** + * + * + * @returns {number} + * + * @memberof Index + */ caps(): number; + /** + * + * + * @returns {Oid} + * + * @memberof Index + */ checksum(): Oid; + /** + * + * + * @returns {number} + * + * @memberof Index + */ clear(): number; + /** + * + * + * @param {IndexEntry} ancestor_entry + * @param {IndexEntry} our_entry + * @param {IndexEntry} their_entry + * @returns {number} + * + * @memberof Index + */ conflictAdd(ancestor_entry: IndexEntry, our_entry: IndexEntry, their_entry: IndexEntry): number; + /** + * + * + * @returns {number} + * + * @memberof Index + */ conflictCleanup(): number; + /** + * + * + * @param {string} path + * @returns {Promise} + * + * @memberof Index + */ conflictGet(path: string): Promise; + /** + * + * + * @param {string} path + * @returns {number} + * + * @memberof Index + */ conflictRemove(path: string): number; + /** + * + * + * @returns {number} + * + * @memberof Index + */ entryCount(): number; + /** + * + * + * @param {number} n + * @returns {IndexEntry} + * + * @memberof Index + */ getByIndex(n: number): IndexEntry; + /** + * + * + * @param {string} path + * @param {number} stage + * @returns {IndexEntry} + * + * @memberof Index + */ getByPath(path: string, stage: number): IndexEntry; + /** + * + * + * @returns {number} + * + * @memberof Index + */ hasConflicts(): number; + /** + * + * + * @returns {Repository} + * + * @memberof Index + */ owner(): Repository; + /** + * + * + * @returns {string} + * + * @memberof Index + */ path(): string; + /** + * + * + * @param {number} force + * @returns {number} + * + * @memberof Index + */ read(force: number): number; + /** + * + * + * @param {Tree} tree + * @returns {number} + * + * @memberof Index + */ readTree(tree: Tree): number; + /** + * + * + * @param {string} path + * @param {number} stage + * @returns {number} + * + * @memberof Index + */ remove(path: string, stage: number): number; + /** + * + * + * @param {Strarray} pathspec + * @param {Function} callback + * @param {void} payload + * @returns {Promise} + * + * @memberof Index + */ removeAll(pathspec: Strarray, callback: Function, payload: void): Promise; + /** + * + * + * @param {string} path + * @returns {number} + * + * @memberof Index + */ removeByPath(path: string): number; + /** + * + * + * @param {string} dir + * @param {number} stage + * @returns {number} + * + * @memberof Index + */ removeDirectory(dir: string, stage: number): number; + /** + * + * + * @param {number} caps + * @returns {number} + * + * @memberof Index + */ setCaps(caps: number): number; + /** + * + * + * @param {Strarray} pathspec + * @param {Function} callback + * @param {void} payload + * @returns {Promise} + * + * @memberof Index + */ updateAll(pathspec: Strarray, callback: Function, payload: void): Promise; + /** + * + * + * @returns {number} + * + * @memberof Index + */ write(): number; + /** + * + * + * @returns {Promise} + * + * @memberof Index + */ writeTree(): Promise; + /** + * + * + * @param {Repository} repo + * @returns {Promise} + * + * @memberof Index + */ writeTreeTo(repo: Repository): Promise; + /** + * + * + * @returns {IndexEntry[]} + * + * @memberof Index + */ entries(): IndexEntry[]; + /** + * + * + * @param {number} at_pos + * @param {string} prefix + * @returns {number} + * + * @memberof Index + */ + findPrefix(at_pos: number, prefix: string): number; + /** + * + * + * @param {number} version + * @returns {number} + * + * @memberof Index + */ + setVersion(version: number): number; + /** + * + * + * @returns {number} + * + * @memberof Index + */ + version(): number; } diff --git a/types/nodegit/indexer.d.ts b/types/nodegit/indexer.d.ts index ee3ba9bc69..e776c0f508 100644 --- a/types/nodegit/indexer.d.ts +++ b/types/nodegit/indexer.d.ts @@ -2,7 +2,28 @@ import { TransferProgress } from './transfer-progress'; import { Oid } from './oid'; export class Indexer { + /** + * + * + * @param {TransferProgress} stats + * @returns {number} + * + * @memberof Indexer + */ commit(stats: TransferProgress): number; + /** + * + * + * + * @memberof Indexer + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Indexer + */ hash(): Oid; } diff --git a/types/nodegit/lib-git2.d.ts b/types/nodegit/lib-git2.d.ts index be5a5d1856..10ad4f864a 100644 --- a/types/nodegit/lib-git2.d.ts +++ b/types/nodegit/lib-git2.d.ts @@ -17,9 +17,52 @@ export namespace Libgit2 { } export class Libgit2 { + /** + * + * + * @static + * @returns {number} + * + * @memberof Libgit2 + */ static features(): number; + /** + * + * + * @static + * @returns {number} + * + * @memberof Libgit2 + */ static init(): number; + /** + * + * + * @static + * @param {number} option + * @returns {number} + * + * @memberof Libgit2 + */ static opts(option: number): number; + /** + * + * + * @static + * @returns {number} + * + * @memberof Libgit2 + */ static shutdown(): number; + /** + * + * + * @static + * @param {number} major + * @param {number} minor + * @param {number} rev + * + * @memberof Libgit2 + */ static version(major: number, minor: number, rev: number): void; } diff --git a/types/nodegit/merge-file-input.d.ts b/types/nodegit/merge-file-input.d.ts index f49bd446ca..9401f8fd1d 100644 --- a/types/nodegit/merge-file-input.d.ts +++ b/types/nodegit/merge-file-input.d.ts @@ -1,7 +1,37 @@ export interface MergeFileInput { + /** + * + * + * @type {number} + * @memberof MergeFileInput + */ version: number; + /** + * + * + * @type {string} + * @memberof MergeFileInput + */ ptr: string; + /** + * + * + * @type {number} + * @memberof MergeFileInput + */ size: number; + /** + * + * + * @type {string} + * @memberof MergeFileInput + */ path: string; + /** + * + * + * @type {number} + * @memberof MergeFileInput + */ mode: number; } diff --git a/types/nodegit/merge-file-options.d.ts b/types/nodegit/merge-file-options.d.ts index 5d8233bcd6..6212c6275e 100644 --- a/types/nodegit/merge-file-options.d.ts +++ b/types/nodegit/merge-file-options.d.ts @@ -1,8 +1,44 @@ export interface MergeFileOptions { - version: number; - ancestorLabel: string; - ourLabel: string; - theirLabel: string; - favor: number; - flags: number; + /** + * + * + * @type {number} + * @memberof MergeFileOptions + */ + version?: number; + /** + * + * + * @type {string} + * @memberof MergeFileOptions + */ + ancestorLabel?: string; + /** + * + * + * @type {string} + * @memberof MergeFileOptions + */ + ourLabel?: string; + /** + * + * + * @type {string} + * @memberof MergeFileOptions + */ + theirLabel?: string; + /** + * + * + * @type {number} + * @memberof MergeFileOptions + */ + favor?: number; + /** + * + * + * @type {number} + * @memberof MergeFileOptions + */ + flags?: number; } diff --git a/types/nodegit/merge-file-result.d.ts b/types/nodegit/merge-file-result.d.ts index e6f2efcc3b..da2410da01 100644 --- a/types/nodegit/merge-file-result.d.ts +++ b/types/nodegit/merge-file-result.d.ts @@ -1,7 +1,37 @@ export class MergeFileResult { + /** + * + * + * @type {number} + * @memberof MergeFileResult + */ automergeable: number; + /** + * + * + * @type {string} + * @memberof MergeFileResult + */ path: string; + /** + * + * + * @type {number} + * @memberof MergeFileResult + */ mode: number; + /** + * + * + * @type {string} + * @memberof MergeFileResult + */ ptr: string; + /** + * + * + * @type {number} + * @memberof MergeFileResult + */ len: number; } diff --git a/types/nodegit/merge-options.d.ts b/types/nodegit/merge-options.d.ts index a4108c767d..31445857dd 100644 --- a/types/nodegit/merge-options.d.ts +++ b/types/nodegit/merge-options.d.ts @@ -1,8 +1,58 @@ -export interface MergeOptions { - version: number; - treeFlags: number; - renameThreshold: number; - targetLimit: number; - fileFavor: number; - fileFlags: number; +export class MergeOptions { + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + version?: number; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + renameThreshold?: number; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + targetLimit?: number; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + fileFavor?: number; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + fileFlags?: number; + /** + * + * + * @type {string} + * @memberof MergeOptions + */ + defaultDriver?: string; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + flags?: number; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + recursionLimit?: number; } diff --git a/types/nodegit/merge.d.ts b/types/nodegit/merge.d.ts index 737d3c5a04..5603d2b66e 100644 --- a/types/nodegit/merge.d.ts +++ b/types/nodegit/merge.d.ts @@ -49,11 +49,90 @@ export namespace Merge { } export class Merge { + /** + * + * + * @static + * @param {Repository} repo + * @param {AnnotatedCommit} theirHead + * @param {MergeOptions} [mergeOpts] + * @param {CheckoutOptions} [checkoutOpts] + * @returns {*} + * + * @memberof Merge + */ static merge(repo: Repository, theirHead: AnnotatedCommit, mergeOpts?: MergeOptions, checkoutOpts?: CheckoutOptions): any; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} one + * @param {Oid} two + * @returns {Promise} + * + * @memberof Merge + */ static base(repo: Repository, one: Oid, two: Oid): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} one + * @param {Oid} two + * @returns {Promise} + * + * @memberof Merge + */ static bases(repo: Repository, one: Oid, two: Oid): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Commit} ourCommit + * @param {Commit} theirCommit + * @param {MergeOptions} [options] + * @returns {*} + * + * @memberof Merge + */ static commits(repo: Repository, ourCommit: Commit, theirCommit: Commit, options?: MergeOptions): any; + /** + * + * + * @static + * @param {MergeFileInput} opts + * @param {number} version + * @returns {number} + * + * @memberof Merge + */ static fileInitInput(opts: MergeFileInput, version: number): number; + /** + * + * + * @static + * @param {MergeOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Merge + */ static initOptions(opts: MergeOptions, version: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} ancestor_tree + * @param {Tree} our_tree + * @param {Tree} their_tree + * @param {MergeOptions} opts + * @returns {Promise} + * + * @memberof Merge + */ static trees(repo: Repository, ancestor_tree: Tree, our_tree: Tree, their_tree: Tree, opts: MergeOptions): Promise; } diff --git a/types/nodegit/note.d.ts b/types/nodegit/note.d.ts index c5c9152bb2..1e9382b712 100644 --- a/types/nodegit/note.d.ts +++ b/types/nodegit/note.d.ts @@ -3,16 +3,122 @@ import {Signature} from './signature'; import {Oid} from './oid'; export class Note { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} notes_ref + * @param {Signature} author + * @param {Signature} committer + * @param {Oid} oid + * @param {string} note + * @param {number} force + * @returns {Promise} + * + * @memberof Note + */ static create(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid, note: string, force: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} notes_ref + * @param {Function} note_cb + * @param {*} payload + * @returns {Promise} + * + * @memberof Note + */ static foreach(repo: Repository, notes_ref: string, note_cb: Function, payload: any): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} notes_ref + * @returns {Promise} + * + * @memberof Note + */ static iteratorNew(repo: Repository, notes_ref: string): Promise; + /** + * + * + * @static + * @param {Oid} note_id + * @param {Oid} annotated_id + * @param {*} it + * @returns {number} + * + * @memberof Note + */ static next(note_id: Oid, annotated_id: Oid, it: any): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} notes_ref + * @param {Oid} oid + * @returns {Promise} + * + * @memberof Note + */ static read(repo: Repository, notes_ref: string, oid: Oid): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} notes_ref + * @param {Signature} author + * @param {Signature} committer + * @param {Oid} oid + * @returns {Promise} + * + * @memberof Note + */ static remove(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid): Promise; + /** + * + * + * @returns {Signature} + * + * @memberof Note + */ author(): Signature; + /** + * + * + * @returns {Signature} + * + * @memberof Note + */ committer(): Signature; + /** + * + * + * + * @memberof Note + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Note + */ id(): Oid; + /** + * + * + * @returns {string} + * + * @memberof Note + */ message(): string; } diff --git a/types/nodegit/object.d.ts b/types/nodegit/object.d.ts index 8fabe5fdd2..8030943e0d 100644 --- a/types/nodegit/object.d.ts +++ b/types/nodegit/object.d.ts @@ -3,19 +3,136 @@ import { Repository } from './repository'; import { Buf } from './buf'; export class Object { + /** + * + * + * @static + * @param {number} type + * @returns {number} + * + * @memberof Object + */ static size(type: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} type + * @returns {Promise} + * + * @memberof Object + */ static lookup(repo: Repository, id: Oid, type: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} len + * @param {number} type + * @returns {Promise} + * + * @memberof Object + */ static lookupPrefix(repo: Repository, id: Oid, len: number, type: number): Promise; + /** + * + * + * @static + * @param {string} str + * @returns {number} + * + * @memberof Object + */ static string2type(str: string): number; + /** + * + * + * @static + * @param {number} type + * @returns {string} + * + * @memberof Object + */ static type2string(type: number): string; + /** + * + * + * @static + * @param {number} type + * @returns {number} + * + * @memberof Object + */ static typeisloose(type: number): number; + /** + * + * + * @returns {Promise} + * + * @memberof Object + */ dup(): Promise; + /** + * + * + * + * @memberof Object + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Object + */ id(): Oid; + /** + * + * + * @param {string} path + * @param {number} type + * @returns {Promise} + * + * @memberof Object + */ lookupByPath(path: string, type: number): Promise; + /** + * + * + * @returns {Repository} + * + * @memberof Object + */ owner(): Repository; + /** + * + * + * @param {number} target_type + * @returns {Promise} + * + * @memberof Object + */ peel(target_type: number): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Object + */ shortId(): Promise; + /** + * + * + * @returns {number} + * + * @memberof Object + */ type(): number; } diff --git a/types/nodegit/odb-object.d.ts b/types/nodegit/odb-object.d.ts index 361e8c0718..8b76274b00 100644 --- a/types/nodegit/odb-object.d.ts +++ b/types/nodegit/odb-object.d.ts @@ -1,10 +1,51 @@ import { Oid } from './oid'; export class OdbObject { + /** + * + * + * @returns {Buffer} + * + * @memberof OdbObject + */ data(): Buffer; + /** + * + * + * @returns {Promise} + * + * @memberof OdbObject + */ dup(): Promise; + /** + * + * + * + * @memberof OdbObject + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof OdbObject + */ id(): Oid; + /** + * + * + * @returns {number} + * + * @memberof OdbObject + */ size(): number; + /** + * + * + * @returns {number} + * + * @memberof OdbObject + */ type(): number; } diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index c0cbfd8725..ebaca11b5d 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -10,10 +10,11 @@ export namespace Odb { } export class Odb { - static open(objects_dir: string): Promise; + static open(objectsDir: string): Promise; addDiskAlternate(path: string): number; free(): void; read(id: Oid): Promise; write(data: Buffer, len: number, type: number): Promise; + expandIds(ids, count: number): number; } diff --git a/types/nodegit/proxy-options.d.ts b/types/nodegit/proxy-options.d.ts index 7a4c8f4dd4..512d70c99a 100644 --- a/types/nodegit/proxy-options.d.ts +++ b/types/nodegit/proxy-options.d.ts @@ -1,8 +1,44 @@ export class ProxyOptions { + /** + * + * + * @type {Function} + * @memberof ProxyOptions + */ certificateCheck?: Function + /** + * + * + * @type {Function} + * @memberof ProxyOptions + */ credentials?: Function + /** + * + * + * @type {*} + * @memberof ProxyOptions + */ payload?: any + /** + * + * + * @type {number} + * @memberof ProxyOptions + */ type?: number + /** + * + * + * @type {string} + * @memberof ProxyOptions + */ url?: string + /** + * + * + * @type {number} + * @memberof ProxyOptions + */ version?: number } From 41256279f00c2eeae19da14eadfcf0192b72d1f5 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:37:03 +0100 Subject: [PATCH 268/761] Added OdbExpandId --- types/nodegit/index.d.ts | 1 + types/nodegit/odb-expand-id.d.ts | 7 +++++++ types/nodegit/odb.d.ts | 3 ++- types/nodegit/tsconfig.json | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 types/nodegit/odb-expand-id.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 4efd864946..6551907ea4 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -58,6 +58,7 @@ export { MergeOptions } from './merge-options'; export { Merge } from './merge'; export { Note } from './note'; export { Object } from './object'; +export { OdbExpandId } from './odb-expand-id'; export { OdbObject } from './odb-object'; export { Odb } from './odb'; export { Oidarray } from './oid-array'; diff --git a/types/nodegit/odb-expand-id.d.ts b/types/nodegit/odb-expand-id.d.ts new file mode 100644 index 0000000000..842c65774e --- /dev/null +++ b/types/nodegit/odb-expand-id.d.ts @@ -0,0 +1,7 @@ +import { Oid } from './oid'; + +export class OdbExpandId { + id: Oid + length: number + type: number +} diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index ebaca11b5d..efc4fcbe13 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -1,5 +1,6 @@ import { Oid } from './oid'; import { OdbObject } from './odb-object'; +import { OdbExpandId } from './odb-expand-id'; export namespace Odb { const enum STREAM { @@ -16,5 +17,5 @@ export class Odb { free(): void; read(id: Oid): Promise; write(data: Buffer, len: number, type: number): Promise; - expandIds(ids, count: number): number; + expandIds(ids: OdbExpandId, count: number): number; } diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 635c40ac91..829e49aedd 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -72,6 +72,7 @@ "nodegit-tests.ts", "note.d.ts", "object.d.ts", + "odb-expand-id.d.ts", "odb-object.d.ts", "odb.d.ts", "oid-array.d.ts", From 93a3dc1f476028e223920a32917c5a820e3feeae Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:41:43 +0100 Subject: [PATCH 269/761] Documentation and made Option values optional --- types/nodegit/blame-options.d.ts | 14 ++--- types/nodegit/cherry-pick-options.d.ts | 8 +-- types/nodegit/describe-format-options.d.ts | 8 +-- types/nodegit/describe-options.d.ts | 12 ++-- types/nodegit/odb.d.ts | 50 +++++++++++++++++ types/nodegit/oid-array.d.ts | 18 ++++++ types/nodegit/oid.d.ts | 62 +++++++++++++++++++++ types/nodegit/open-ssl.d.ts | 8 +++ types/nodegit/push-options.d.ts | 6 +- types/nodegit/status-options.d.ts | 8 +-- types/nodegit/submodule-update-options.d.ts | 8 +-- 11 files changed, 170 insertions(+), 32 deletions(-) diff --git a/types/nodegit/blame-options.d.ts b/types/nodegit/blame-options.d.ts index eac4c2f4f0..fdebbeff67 100644 --- a/types/nodegit/blame-options.d.ts +++ b/types/nodegit/blame-options.d.ts @@ -7,47 +7,47 @@ export class BlameOptions { * @type {number} * @memberof BlameOptions */ - version: number; + version?: number; /** * * * @type {number} * @memberof BlameOptions */ - flags: number; + flags?: number; /** * * * @type {number} * @memberof BlameOptions */ - minMatchCharacters: number; + minMatchCharacters?: number; /** * * * @type {Oid} * @memberof BlameOptions */ - newestCommit: Oid; + newestCommit?: Oid; /** * * * @type {Oid} * @memberof BlameOptions */ - oldestCommit: Oid; + oldestCommit?: Oid; /** * * * @type {number} * @memberof BlameOptions */ - minLine: number; + minLine?: number; /** * * * @type {number} * @memberof BlameOptions */ - maxLine: number; + maxLine?: number; } diff --git a/types/nodegit/cherry-pick-options.d.ts b/types/nodegit/cherry-pick-options.d.ts index 8743217b47..5e91da0c55 100644 --- a/types/nodegit/cherry-pick-options.d.ts +++ b/types/nodegit/cherry-pick-options.d.ts @@ -8,26 +8,26 @@ export interface CherrypickOptions { * @type {number} * @memberof CherrypickOptions */ - version: number; + version?: number; /** * * * @type {number} * @memberof CherrypickOptions */ - mainline: number; + mainline?: number; /** * * * @type {MergeOptions} * @memberof CherrypickOptions */ - mergeOpts: MergeOptions; + mergeOpts?: MergeOptions; /** * * * @type {CheckoutOptions} * @memberof CherrypickOptions */ - checkoutOpts: CheckoutOptions; + checkoutOpts?: CheckoutOptions; } diff --git a/types/nodegit/describe-format-options.d.ts b/types/nodegit/describe-format-options.d.ts index 4a67cd9082..3f1989f0dd 100644 --- a/types/nodegit/describe-format-options.d.ts +++ b/types/nodegit/describe-format-options.d.ts @@ -5,26 +5,26 @@ export class DescribeFormatOptions { * @type {number} * @memberof DescribeFormatOptions */ - version: number; + version?: number; /** * * * @type {number} * @memberof DescribeFormatOptions */ - abbreviatedSize: number; + abbreviatedSize?: number; /** * * * @type {number} * @memberof DescribeFormatOptions */ - alwaysUseLongFormat: number; + alwaysUseLongFormat?: number; /** * * * @type {string} * @memberof DescribeFormatOptions */ - dirtySuffix: string; + dirtySuffix?: string; } diff --git a/types/nodegit/describe-options.d.ts b/types/nodegit/describe-options.d.ts index f860bb88e9..1a7518cd76 100644 --- a/types/nodegit/describe-options.d.ts +++ b/types/nodegit/describe-options.d.ts @@ -5,40 +5,40 @@ export class DescribeOptions { * @type {number} * @memberof DescribeOptions */ - version: number; + version?: number; /** * * * @type {number} * @memberof DescribeOptions */ - maxCandidatesTags: number; + maxCandidatesTags?: number; /** * * * @type {number} * @memberof DescribeOptions */ - describeStrategy: number; + describeStrategy?: number; /** * * * @type {string} * @memberof DescribeOptions */ - pattern: string; + pattern?: string; /** * * * @type {number} * @memberof DescribeOptions */ - onlyFollowFirstParent: number; + onlyFollowFirstParent?: number; /** * * * @type {number} * @memberof DescribeOptions */ - showCommitOidAsFallback: number; + showCommitOidAsFallback?: number; } diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index efc4fcbe13..549bba872e 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -11,11 +11,61 @@ export namespace Odb { } export class Odb { + /** + * + * + * @static + * @param {string} objectsDir + * @returns {Promise} + * + * @memberof Odb + */ static open(objectsDir: string): Promise; + /** + * + * + * @param {string} path + * @returns {number} + * + * @memberof Odb + */ addDiskAlternate(path: string): number; + /** + * + * + * + * @memberof Odb + */ free(): void; + /** + * + * + * @param {Oid} id + * @returns {Promise} + * + * @memberof Odb + */ read(id: Oid): Promise; + /** + * + * + * @param {Buffer} data + * @param {number} len + * @param {number} type + * @returns {Promise} + * + * @memberof Odb + */ write(data: Buffer, len: number, type: number): Promise; + /** + * + * + * @param {OdbExpandId} ids + * @param {number} count + * @returns {number} + * + * @memberof Odb + */ expandIds(ids: OdbExpandId, count: number): number; } diff --git a/types/nodegit/oid-array.d.ts b/types/nodegit/oid-array.d.ts index 7a96f24a7a..0b95d31a5d 100644 --- a/types/nodegit/oid-array.d.ts +++ b/types/nodegit/oid-array.d.ts @@ -1,7 +1,25 @@ import { Oid } from './oid'; export class Oidarray { + /** + * + * + * + * @memberof Oidarray + */ free(): void; + /** + * + * + * @type {Oid} + * @memberof Oidarray + */ ids: Oid; + /** + * + * + * @type {number} + * @memberof Oidarray + */ count: number; } diff --git a/types/nodegit/oid.d.ts b/types/nodegit/oid.d.ts index 2aa65905f6..412a931f00 100644 --- a/types/nodegit/oid.d.ts +++ b/types/nodegit/oid.d.ts @@ -1,11 +1,73 @@ export class Oid { static fromString(str: string): Oid; + /** + * + * + * @param {Oid} b + * @returns {number} + * + * @memberof Oid + */ cmp(b: Oid): number; + /** + * + * + * @returns {Oid} + * + * @memberof Oid + */ cpy(): Oid; + /** + * + * + * @param {Oid} b + * @returns {number} + * + * @memberof Oid + */ equal(b: Oid): number; + /** + * + * + * @returns {number} + * + * @memberof Oid + */ iszero(): number; + /** + * + * + * @param {Oid} b + * @param {number} len + * @returns {number} + * + * @memberof Oid + */ ncmp(b: Oid, len: number): number; + /** + * + * + * @param {string} str + * @returns {number} + * + * @memberof Oid + */ strcmp(str: string): number; + /** + * + * + * @param {string} str + * @returns {number} + * + * @memberof Oid + */ streq(str: string): number; + /** + * + * + * @returns {string} + * + * @memberof Oid + */ tostrS(): string; } diff --git a/types/nodegit/open-ssl.d.ts b/types/nodegit/open-ssl.d.ts index f8370260d5..4b604a6f43 100644 --- a/types/nodegit/open-ssl.d.ts +++ b/types/nodegit/open-ssl.d.ts @@ -1,3 +1,11 @@ export class Openssl { + /** + * + * + * @static + * @returns {number} + * + * @memberof Openssl + */ static setLocking(): number; } diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index 5187548b8f..693a310ed0 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -1,7 +1,7 @@ import { RemoteCallbacks } from './remote-callbacks'; export interface PushOptions { - version: number; - pbParallelism: number; - callbacks: RemoteCallbacks; + version?: number; + pbParallelism?: number; + callbacks?: RemoteCallbacks; } diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts index c4296a5b92..9f75bbe96d 100644 --- a/types/nodegit/status-options.d.ts +++ b/types/nodegit/status-options.d.ts @@ -1,8 +1,8 @@ import { Strarray } from './str-array'; export interface StatusOptions { - version: number; - show: number; - flags: number; - pathspec: Strarray; + version?: number; + show?: number; + flags?: number; + pathspec?: Strarray; } diff --git a/types/nodegit/submodule-update-options.d.ts b/types/nodegit/submodule-update-options.d.ts index 35bbd6b3f8..d96320204b 100644 --- a/types/nodegit/submodule-update-options.d.ts +++ b/types/nodegit/submodule-update-options.d.ts @@ -2,8 +2,8 @@ import { CheckoutOptions } from './checkout-options'; import { FetchOptions } from './fetch-options'; export interface SubmoduleUpdateOptions { - version: number; - checkoutOpts: CheckoutOptions; - fetchOpts: FetchOptions; - cloneCheckoutStrategy: number; + version?: number; + checkoutOpts?: CheckoutOptions; + fetchOpts?: FetchOptions; + cloneCheckoutStrategy?: number; } From 3fe8ca1a01fedceb616e8e2a29678eb6b1cec913 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 02:11:48 +0100 Subject: [PATCH 270/761] Added more documentation --- types/nodegit/pack-builder.d.ts | 86 ++++ types/nodegit/path-spec.d.ts | 108 +++++ types/nodegit/push-options.d.ts | 34 ++ types/nodegit/push-update.d.ts | 24 ++ types/nodegit/push.d.ts | 10 + types/nodegit/rebase-operation.d.ts | 18 + types/nodegit/rebase.d.ts | 98 +++++ types/nodegit/ref-db.d.ts | 22 + types/nodegit/ref-log.d.ts | 110 ++++- types/nodegit/ref-spec.d.ts | 44 ++ types/nodegit/reference.d.ts | 330 +++++++++++++- types/nodegit/remote-callbacks.d.ts | 36 ++ types/nodegit/remote.d.ts | 325 ++++++++++++++ types/nodegit/repository.d.ts | 647 +++++++++++++++++++++++++++- 14 files changed, 1873 insertions(+), 19 deletions(-) diff --git a/types/nodegit/pack-builder.d.ts b/types/nodegit/pack-builder.d.ts index ed0fa0a2cc..e528ccbf38 100644 --- a/types/nodegit/pack-builder.d.ts +++ b/types/nodegit/pack-builder.d.ts @@ -10,16 +10,102 @@ export namespace Packbuilder { } export class Packbuilder { + /** + * + * + * @static + * @param {Repository} repo + * @returns {Packbuilder} + * + * @memberof Packbuilder + */ static create(repo: Repository): Packbuilder; + /** + * + * + * + * @memberof Packbuilder + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Packbuilder + */ hash(): Oid; + /** + * + * + * @param {Oid} id + * @param {string} name + * @returns {number} + * + * @memberof Packbuilder + */ insert(id: Oid, name: string): number; + /** + * + * + * @param {Oid} id + * @returns {number} + * + * @memberof Packbuilder + */ insertCommit(id: Oid): number; + /** + * + * + * @param {Oid} id + * @param {string} name + * @returns {number} + * + * @memberof Packbuilder + */ insertRecur(id: Oid, name: string): number; + /** + * + * + * @param {Oid} id + * @returns {number} + * + * @memberof Packbuilder + */ insertTree(id: Oid): number; + /** + * + * + * @param {Revwalk} walk + * @returns {number} + * + * @memberof Packbuilder + */ insertWalk(walk: Revwalk): number; + /** + * + * + * @returns {number} + * + * @memberof Packbuilder + */ objectCount(): number; + /** + * + * + * @param {number} n + * @returns {number} + * + * @memberof Packbuilder + */ setThreads(n: number): number; + /** + * + * + * @returns {number} + * + * @memberof Packbuilder + */ written(): number; } diff --git a/types/nodegit/path-spec.d.ts b/types/nodegit/path-spec.d.ts index 99435d5e0d..0581523300 100644 --- a/types/nodegit/path-spec.d.ts +++ b/types/nodegit/path-spec.d.ts @@ -18,17 +18,125 @@ export namespace Pathspec { } export class Pathspec { + /** + * + * + * @static + * @param {*} m + * @param {number} pos + * @returns {DiffDelta} + * + * @memberof Pathspec + */ static matchListDiffEntry(m: any, pos: number): DiffDelta; + /** + * + * + * @static + * @param {*} m + * @param {number} pos + * @returns {string} + * + * @memberof Pathspec + */ static matchListEntry(m: any, pos: number): string; + /** + * + * + * @static + * @param {*} m + * @returns {number} + * + * @memberof Pathspec + */ static matchListEntrycount(m: any): number; + /** + * + * + * @static + * @param {*} m + * @param {number} pos + * @returns {string} + * + * @memberof Pathspec + */ static matchListFailedEntry(m: any, pos: number): string; + /** + * + * + * @static + * @param {*} m + * @returns {number} + * + * @memberof Pathspec + */ static matchListFailedEntrycount(m: any): number; + /** + * + * + * @static + * @param {Strarray} pathspec + * @returns {Pathspec} + * + * @memberof Pathspec + */ static create(pathspec: Strarray): Pathspec; + /** + * + * + * + * @memberof Pathspec + */ free(): void; + /** + * + * + * @param {Diff} diff + * @param {number} flags + * @returns {Promise} + * + * @memberof Pathspec + */ matchDiff(diff: Diff, flags: number): Promise; + /** + * + * + * @param {Index} index + * @param {number} flags + * @returns {Promise} + * + * @memberof Pathspec + */ matchIndex(index: Index, flags: number): Promise; + /** + * + * + * @param {Tree} tree + * @param {number} flags + * @returns {Promise} + * + * @memberof Pathspec + */ matchTree(tree: Tree, flags: number): Promise; + /** + * + * + * @param {Repository} repo + * @param {number} flags + * @returns {Promise} + * + * @memberof Pathspec + */ matchWorkdir(repo: Repository, flags: number): Promise; + /** + * + * + * @param {number} flags + * @param {string} path + * @returns {number} + * + * @memberof Pathspec + */ matchesPath(flags: number, path: string): number; } diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index 693a310ed0..6cf501c84a 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -1,7 +1,41 @@ import { RemoteCallbacks } from './remote-callbacks'; +import { Strarray } from './str-array'; +import { ProxyOptions } from './proxy-options'; export interface PushOptions { + /** + * + * + * @type {number} + * @memberof PushOptions + */ version?: number; + /** + * + * + * @type {number} + * @memberof PushOptions + */ pbParallelism?: number; + /** + * + * + * @type {RemoteCallbacks} + * @memberof PushOptions + */ callbacks?: RemoteCallbacks; + /** + * + * + * @type {Strarray} + * @memberof PushOptions + */ + customHeaders: Strarray + /** + * + * + * @type {ProxyOptions} + * @memberof PushOptions + */ + proxyOpts: ProxyOptions } diff --git a/types/nodegit/push-update.d.ts b/types/nodegit/push-update.d.ts index 50f46726d5..cdd393d9ba 100644 --- a/types/nodegit/push-update.d.ts +++ b/types/nodegit/push-update.d.ts @@ -1,8 +1,32 @@ import { Oid } from './oid'; export class PushUpdate { + /** + * + * + * @type {string} + * @memberof PushUpdate + */ srcRefname: string; + /** + * + * + * @type {string} + * @memberof PushUpdate + */ dstRefname: string; + /** + * + * + * @type {Oid} + * @memberof PushUpdate + */ src: Oid; + /** + * + * + * @type {Oid} + * @memberof PushUpdate + */ dst: Oid; } diff --git a/types/nodegit/push.d.ts b/types/nodegit/push.d.ts index 26d8f07b60..4a4ce53dac 100644 --- a/types/nodegit/push.d.ts +++ b/types/nodegit/push.d.ts @@ -2,5 +2,15 @@ import { RemoteCallbacks } from './remote-callbacks'; import { PushOptions } from './push-options'; export class Push { + /** + * + * + * @static + * @param {PushOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Push + */ static initOptions(opts: PushOptions, version: number): number; } diff --git a/types/nodegit/rebase-operation.d.ts b/types/nodegit/rebase-operation.d.ts index 7144ebe6a9..e52542fb54 100644 --- a/types/nodegit/rebase-operation.d.ts +++ b/types/nodegit/rebase-operation.d.ts @@ -12,7 +12,25 @@ export namespace RebaseOperation { } export class RebaseOperation { + /** + * + * + * @type {number} + * @memberof RebaseOperation + */ type: number; + /** + * + * + * @type {Oid} + * @memberof RebaseOperation + */ id: Oid; + /** + * + * + * @type {string} + * @memberof RebaseOperation + */ exec: string; } diff --git a/types/nodegit/rebase.d.ts b/types/nodegit/rebase.d.ts index 15862ff17d..6e254545bc 100644 --- a/types/nodegit/rebase.d.ts +++ b/types/nodegit/rebase.d.ts @@ -4,6 +4,7 @@ import { Repository } from './repository'; import { Signature } from './signature'; import { Oid } from './oid'; import { RebaseOperation } from './rebase-operation'; +import { Index } from './index'; export interface RebaseOptions { version: number; @@ -13,15 +14,112 @@ export interface RebaseOptions { } export class Rebase { + /** + * + * + * @static + * @param {Repository} repo + * @param {AnnotatedCommit} branch + * @param {AnnotatedCommit} upstream + * @param {AnnotatedCommit} onto + * @param {RebaseOptions} opts + * @returns {Promise} + * + * @memberof Rebase + */ static init(repo: Repository, branch: AnnotatedCommit, upstream: AnnotatedCommit, onto: AnnotatedCommit, opts: RebaseOptions): Promise; + /** + * + * + * @static + * @param {RebaseOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Rebase + */ static initOptions(opts: RebaseOptions, version: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {RebaseOptions} opts + * @returns {Promise} + * + * @memberof Rebase + */ static open(repo: Repository, opts: RebaseOptions): Promise; + /** + * + * + * @returns {number} + * + * @memberof Rebase + */ abort(): number; + /** + * + * + * @param {Signature} author + * @param {Signature} committer + * @param {string} message_encoding + * @param {string} message + * @returns {Oid} + * + * @memberof Rebase + */ commit(author: Signature, committer: Signature, message_encoding: string, message: string): Oid; + /** + * + * + * @param {Signature} signature + * @returns {number} + * + * @memberof Rebase + */ finish(signature: Signature): number; + /** + * + * + * @param {Index} index + * @returns {number} + * + * @memberof Rebase + */ + inmemoryIndex(index: Index): number; + /** + * + * + * @returns {Promise} + * + * @memberof Rebase + */ next(): Promise; + /** + * + * + * @param {number} idx + * @returns {RebaseOperation} + * + * @memberof Rebase + */ operationByIndex(idx: number): RebaseOperation; + /** + * + * + * @returns {number} + * + * @memberof Rebase + */ operationCurrent(): number; + /** + * + * + * @returns {number} + * + * @memberof Rebase + */ operationEntrycount(): number; } diff --git a/types/nodegit/ref-db.d.ts b/types/nodegit/ref-db.d.ts index 8c9046d48d..de927eec58 100644 --- a/types/nodegit/ref-db.d.ts +++ b/types/nodegit/ref-db.d.ts @@ -1,8 +1,30 @@ import { Repository } from './repository'; export class Refdb { + /** + * + * + * @static + * @param {Repository} repo + * @returns {Promise} + * + * @memberof Refdb + */ static open(repo: Repository): Promise; + /** + * + * + * @returns {number} + * + * @memberof Refdb + */ compress(): number; + /** + * + * + * + * @memberof Refdb + */ free(): void; } diff --git a/types/nodegit/ref-log.d.ts b/types/nodegit/ref-log.d.ts index 8557d02a39..dec49731eb 100644 --- a/types/nodegit/ref-log.d.ts +++ b/types/nodegit/ref-log.d.ts @@ -3,25 +3,127 @@ import { Oid } from './oid'; import { Signature } from './signature'; export class Reflog { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {number} + * + * @memberof Reflog + */ static delete(repo: Repository, name: string): number; - static entryCommitter(entry: ReflogEntry): Signature; - static entryIdNew(entry: ReflogEntry): Oid; - static entryIdOld(entry: ReflogEntry): Oid; - static entryMessage(entry: ReflogEntry): string; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {Promise} + * + * @memberof Reflog + */ static read(repo: Repository, name: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} old_name + * @param {string} name + * @returns {number} + * + * @memberof Reflog + */ static rename(repo: Repository, old_name: string, name: string): number; + /** + * + * + * @param {Oid} id + * @param {Signature} committer + * @param {string} msg + * @returns {number} + * + * @memberof Reflog + */ append(id: Oid, committer: Signature, msg: string): number; + /** + * + * + * @param {number} idx + * @param {number} rewrite_previous_entry + * @returns {number} + * + * @memberof Reflog + */ drop(idx: number, rewrite_previous_entry: number): number; + /** + * + * + * @param {number} idx + * @returns {ReflogEntry} + * + * @memberof Reflog + */ entryByIndex(idx: number): ReflogEntry; + /** + * + * + * @returns {number} + * + * @memberof Reflog + */ entrycount(): number; + /** + * + * + * + * @memberof Reflog + */ free(): void; + /** + * + * + * @returns {number} + * + * @memberof Reflog + */ write(): number; } export class ReflogEntry { + /** + * + * + * @returns {Signature} + * + * @memberof ReflogEntry + */ committer(): Signature; + /** + * + * + * @returns {Oid} + * + * @memberof ReflogEntry + */ idNew(): Oid; + /** + * + * + * @returns {Oid} + * + * @memberof ReflogEntry + */ idOld(): Oid; + /** + * + * + * @returns {string} + * + * @memberof ReflogEntry + */ message(): string; } diff --git a/types/nodegit/ref-spec.d.ts b/types/nodegit/ref-spec.d.ts index bf40f21ac2..e48c8cd2ac 100644 --- a/types/nodegit/ref-spec.d.ts +++ b/types/nodegit/ref-spec.d.ts @@ -1,8 +1,52 @@ export class Refspec { + /** + * + * + * @returns {number} + * + * @memberof Refspec + */ direction(): number; + /** + * + * + * @returns {string} + * + * @memberof Refspec + */ dst(): string; + /** + * + * + * @param {string} refname + * @returns {number} + * + * @memberof Refspec + */ dstMatches(refname: string): number; + /** + * + * + * @returns {number} + * + * @memberof Refspec + */ force(): number; + /** + * + * + * @returns {string} + * + * @memberof Refspec + */ src(): string; + /** + * + * + * @param {string} refname + * @returns {number} + * + * @memberof Refspec + */ srcMatches(refname: string): number; } diff --git a/types/nodegit/reference.d.ts b/types/nodegit/reference.d.ts index 4edd34d2da..cb449ee225 100644 --- a/types/nodegit/reference.d.ts +++ b/types/nodegit/reference.d.ts @@ -19,41 +19,365 @@ export namespace Reference { } export class Reference { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {Oid} id + * @param {number} force + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ static create(repo: Repository, name: string, id: Oid, force: number, logMessage: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {Oid} id + * @param {number} force + * @param {Oid} currentId + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ static createMatching(repo: Repository, name: string, id: Oid, force: number, currentId: Oid, logMessage: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {(string | Reference)} id + * @param {Function} callback + * @returns {Promise} + * + * @memberof Reference + */ static dwim(repo: Repository, id: string | Reference, callback: Function): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} refname + * @returns {number} + * + * @memberof Reference + */ static ensureLog(repo: Repository, refname: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} refname + * @returns {number} + * + * @memberof Reference + */ static hasLog(repo: Repository, refname: string): number; + /** + * + * + * @static + * @param {string} refname + * @returns {number} + * + * @memberof Reference + */ static isValidName(refname: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @returns {Promise} + * + * @memberof Reference + */ static list(repo: Repository): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {(string | Reference)} id + * @param {Function} callback + * @returns {Promise} + * + * @memberof Reference + */ static lookup(repo: Repository, id: string | Reference, callback: Function): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {Promise} + * + * @memberof Reference + */ static nameToId(repo: Repository, name: string): Promise; + /** + * + * + * @static + * @param {string} bufferOut + * @param {number} bufferSize + * @param {string} name + * @param {number} flags + * @returns {number} + * + * @memberof Reference + */ static normalizeName(bufferOut: string, bufferSize: number, name: string, flags: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {number} + * + * @memberof Reference + */ static remove(repo: Repository, name: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} target + * @param {number} force + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ static symbolicCreate(repo: Repository, name: string, target: string, force: number, logMessage: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} target + * @param {number} force + * @param {string} currentValue + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ static symbolicCreateMatching(repo: Repository, name: string, target: string, force: number, currentValue: string, logMessage: string): Promise; + /** + * + * + * @param {Reference} ref2 + * @returns {number} + * + * @memberof Reference + */ cmp(ref2: Reference): number; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ delete(): number; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ isBranch(): number; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ isNote(): number; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ isRemote(): number; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ isTag(): number; + /** + * + * + * @returns {string} + * + * @memberof Reference + */ name(): string; + /** + * + * + * @returns {Repository} + * + * @memberof Reference + */ owner(): Repository; + /** + * + * + * @param {number} type + * @returns {Promise} + * + * @memberof Reference + */ peel(type: number): Promise; + /** + * + * + * @param {string} newName + * @param {number} force + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ rename(newName: string, force: number, logMessage: string): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Reference + */ resolve(): Promise; + /** + * + * + * @param {Oid} id + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ setTarget(id: Oid, logMessage: string): Promise; + /** + * + * + * @returns {string} + * + * @memberof Reference + */ shorthand(): string; + /** + * + * + * @param {string} target + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ symbolicSetTarget(target: string, logMessage: string): Promise; + /** + * + * + * @returns {string} + * + * @memberof Reference + */ symbolicTarget(): string; + /** + * + * + * @returns {Oid} + * + * @memberof Reference + */ target(): Oid; + /** + * + * + * @returns {Oid} + * + * @memberof Reference + */ targetPeel(): Oid; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ type(): number; - isValid(): Boolean; - isConcrete(): Boolean; - isSymbolic(): Boolean; + /** + * + * + * @returns {boolean} + * + * @memberof Reference + */ + isValid(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof Reference + */ + isConcrete(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof Reference + */ + isSymbolic(): boolean; + /** + * + * + * @returns {string} + * + * @memberof Reference + */ toString(): string; + /** + * + * + * @returns {boolean} + * + * @memberof Reference + */ isHead(): boolean; + /** + * + * + * @returns {Promise} + * + * @memberof Reference + */ + dup(): Promise; } diff --git a/types/nodegit/remote-callbacks.d.ts b/types/nodegit/remote-callbacks.d.ts index ca244e5c5e..b3cf3d9054 100644 --- a/types/nodegit/remote-callbacks.d.ts +++ b/types/nodegit/remote-callbacks.d.ts @@ -1,8 +1,44 @@ export class RemoteCallbacks { + /** + * + * + * @type {number} + * @memberof RemoteCallbacks + */ version?: number; + /** + * + * + * @type {Function} + * @memberof RemoteCallbacks + */ credentials?: Function; + /** + * + * + * @type {Function} + * @memberof RemoteCallbacks + */ certificateCheck?: Function; + /** + * + * + * @type {Function} + * @memberof RemoteCallbacks + */ transferProgress?: Function; + /** + * + * + * @type {Function} + * @memberof RemoteCallbacks + */ transport?: Function; + /** + * + * + * @type {undefined} + * @memberof RemoteCallbacks + */ payload?: undefined; } diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index bba1f640fb..165df83036 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -24,42 +24,367 @@ export namespace Remote { } export class Remote { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} remote + * @param {string} refspec + * @returns {number} + * + * @memberof Remote + */ static addFetch(repo: Repository, remote: string, refspec: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} remote + * @param {string} refspec + * @returns {number} + * + * @memberof Remote + */ static addPush(repo: Repository, remote: string, refspec: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} url + * @returns {Remote} + * + * @memberof Remote + */ static create(repo: Repository, name: string, url: string): Remote; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} url + * @returns {Promise} + * + * @memberof Remote + */ static createAnonymous(repo: Repository, url: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} url + * @param {string} fetch + * @returns {Promise} + * + * @memberof Remote + */ static createWithFetchspec(repo: Repository, name: string, url: string, fetch: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {Promise} + * + * @memberof Remote + */ static delete(repo: Repository, name: string): Promise; + /** + * + * + * @static + * @param {RemoteCallbacks} opts + * @param {number} version + * @returns {number} + * + * @memberof Remote + */ static initCallbacks(opts: RemoteCallbacks, version: number): number; + /** + * + * + * @static + * @param {string} remote_name + * @returns {number} + * + * @memberof Remote + */ static isValidName(remote_name: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @returns {Promise} + * + * @memberof Remote + */ static list(repo: Repository): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {(string | Remote)} name + * @param {Function} callback + * @returns {Promise} + * + * @memberof Remote + */ static lookup(repo: Repository, name: string | Remote, callback: Function): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} remote + * @param {number} value + * @returns {number} + * + * @memberof Remote + */ static setAutotag(repo: Repository, remote: string, value: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} remote + * @param {string} url + * @returns {number} + * + * @memberof Remote + */ static setPushurl(repo: Repository, remote: string, url: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} remote + * @param {string} url + * @returns {number} + * + * @memberof Remote + */ static setUrl(repo: Repository, remote: string, url: string): number; + /** + * + * + * @returns {number} + * + * @memberof Remote + */ autotag(): number; + /** + * + * + * @param {Enums.DIRECTION} direction + * @param {RemoteCallbacks} callbacks + * @param {Function} callback + * @returns {Promise} + * + * @memberof Remote + */ connect(direction: Enums.DIRECTION, callbacks: RemoteCallbacks, callback: Function): Promise; + /** + * + * + * @returns {number} + * + * @memberof Remote + */ connected(): number; + /** + * + * + * @returns {Promise} + * + * @memberof Remote + */ defaultBranch(): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Remote + */ disconnect(): Promise; + /** + * + * + * @param {any[]} refSpecs + * @param {FetchOptions} opts + * @param {Function} callback + * @returns {Promise} + * + * @memberof Remote + */ download(refSpecs: any[], opts: FetchOptions, callback: Function): Promise; dup(): Promise; + /** + * + * + * @param {any[]} refSpecs + * @param {FetchOptions} opts + * @param {string} message + * @param {Function} callback + * @returns {Promise} + * + * @memberof Remote + */ fetch(refSpecs: any[], opts: FetchOptions, message: string, callback: Function): Promise; + /** + * + * + * + * @memberof Remote + */ free(): void; + /** + * + * + * @returns {Promise} + * + * @memberof Remote + */ getFetchRefspecs(): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Remote + */ getPushRefspecs(): Promise; + /** + * + * + * @param {number} n + * @returns {Refspec} + * + * @memberof Remote + */ getRefspec(n: number): Refspec; + /** + * + * + * @returns {string} + * + * @memberof Remote + */ name(): string; + /** + * + * + * @returns {Repository} + * + * @memberof Remote + */ owner(): Repository; + /** + * + * + * @param {RemoteCallbacks} callbacks + * @returns {number} + * + * @memberof Remote + */ prune(callbacks: RemoteCallbacks): number; + /** + * + * + * @returns {number} + * + * @memberof Remote + */ pruneRefs(): number; + /** + * + * + * @param {any[]} refSpecs + * @param {PushOptions} options + * @param {Function} callback + * @returns {Promise} + * + * @memberof Remote + */ push(refSpecs: any[], options: PushOptions, callback: Function): Promise; + /** + * + * + * @returns {string} + * + * @memberof Remote + */ pushurl(): string; + /** + * + * + * @returns {number} + * + * @memberof Remote + */ refspecCount(): number; + /** + * + * + * @returns {TransferProgress} + * + * @memberof Remote + */ stats(): TransferProgress; + /** + * + * + * + * @memberof Remote + */ stop(): void; + /** + * + * + * @param {RemoteCallbacks} callbacks + * @param {number} update_fetchhead + * @param {number} download_tags + * @param {string} reflog_message + * @returns {number} + * + * @memberof Remote + */ updateTips(callbacks: RemoteCallbacks, update_fetchhead: number, download_tags: number, reflog_message: string): number; + /** + * + * + * @param {Strarray} refspecs + * @param {PushOptions} opts + * @returns {number} + * + * @memberof Remote + */ upload(refspecs: Strarray, opts: PushOptions): number; + /** + * + * + * @returns {string} + * + * @memberof Remote + */ url(): string; + /** + * Lists advertised references from a remote. You must connect to the remote before using referenceList. + * + * @returns {Promise} + * + * @memberof Remote + */ + referenceList(): Promise; } diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index acf5f5b83a..bf598d5a9f 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -17,6 +17,7 @@ import { Config } from './config'; import { Merge } from './merge'; import { MergeOptions } from './merge-options'; import { Refdb } from './ref-db'; +import {Revwalk} from './rev-walk'; export interface RepositoryInitOptions { description: string; @@ -84,80 +85,702 @@ export class Repository { * @memberof Repository */ static openBare(barePath: string): Promise; + /** + * + * + * @static + * @param {string} path + * @param {number} [flags] + * @param {string} [ceilingDirs] + * @returns {Promise} + * + * @memberof Repository + */ static openExt(path: string, flags?: number, ceilingDirs?: string): Promise; + /** + * + * + * @static + * @param {Odb} odb + * @returns {Promise} + * + * @memberof Repository + */ static wrapOdb(odb: Odb): Promise; + /** + * + * + * + * @memberof Repository + */ cleanup(): void; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ config(): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ configSnapshot(): Promise; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ detachHead(): number; + /** + * + * + * @param {Function} callback + * @returns {Promise} + * + * @memberof Repository + */ fetchheadForeach(callback: Function): Promise; + /** + * + * + * + * @memberof Repository + */ free(): void; + /** + * + * + * @returns {string} + * + * @memberof Repository + */ getNamespace(): string; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ head(): Promise; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ headDetached(): number; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ headUnborn(): number; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ index(): Promise; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ isBare(): number; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ isEmpty(): number; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ isShallow(): number; + /** + * + * + * @param {Function} callback + * @returns {Promise} + * + * @memberof Repository + */ mergeheadForeach(callback: Function): Promise; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ messageRemove(): number; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ odb(): Promise; + /** + * + * + * @returns {string} + * + * @memberof Repository + */ path(): string; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ refdb(): Promise; + /** + * + * + * @param {string} refname + * @returns {Promise} + * + * @memberof Repository + */ setHead(refname: string): Promise; + /** + * + * + * @param {Oid} commitish + * @returns {number} + * + * @memberof Repository + */ setHeadDetached(commitish: Oid): number; + /** + * + * + * @param {AnnotatedCommit} commitish + * @returns {number} + * + * @memberof Repository + */ setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): number; + /** + * + * + * @param {string} name + * @param {string} email + * @returns {number} + * + * @memberof Repository + */ setIdent(name: string, email: string): number; + /** + * + * + * @param {string} nmspace + * @returns {number} + * + * @memberof Repository + */ setNamespace(nmspace: string): number; + /** + * + * + * @param {string} workdir + * @param {number} update_gitlink + * @returns {number} + * + * @memberof Repository + */ setWorkdir(workdir: string, update_gitlink: number): number; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ state(): number; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ stateCleanup(): number; + /** + * + * + * @returns {string} + * + * @memberof Repository + */ workdir(): string; + /** + * Creates a branch with the passed in name pointing to the commit + * + * @param {string} name + * @param {(Commit | string | Oid)} commit + * @param {boolean} force + * @param {Signature} signature + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Repository + */ createBranch(name: string, commit: Commit | string | Oid, force: boolean, signature: Signature, logMessage: string): Promise; + /** + * Look up a refs's commit. + * + * @param {(string | Reference)} name + * @returns {Promise} + * + * @memberof Repository + */ getReferenceCommit(name: string | Reference): Promise; + /** + * Look up a branch. Alias for getReference + * + * @param {(string | Reference)} name + * @returns {Promise} + * + * @memberof Repository + */ getBranch(name: string | Reference): Promise; + /** + * Look up a branch's most recent commit. Alias to getReferenceCommit + * + * @param {(string | Reference)} name + * @returns {Promise} + * + * @memberof Repository + */ getBranchCommit(name: string | Reference): Promise; + /** + * Gets the branch that HEAD currently points to Is an alias to head() + * + * @returns {Promise} + * + * @memberof Repository + */ getCurrentBranch(): Promise; + /** + * Lookup the reference with the given name. + * + * @param {(string | Reference)} name + * @returns {Promise} + * + * @memberof Repository + */ getReference(name: string | Reference): Promise; + /** + * Lookup references for a repository. + * + * @param {Reference.TYPE} type + * @returns {Promise} + * + * @memberof Repository + */ getReferences(type: Reference.TYPE): Promise; + /** + * Lookup reference names for a repository. + * + * @param {Reference.TYPE} type + * @returns {Promise} + * + * @memberof Repository + */ getReferenceNames(type: Reference.TYPE): Promise; + /** + * + * + * @param {(string | Oid)} string + * @returns {Promise} + * + * @memberof Repository + */ getCommit(string: string | Oid): Promise; + /** + * Retrieve the blob represented by the oid. + * + * @param {(string | Oid)} string + * @returns {Promise} + * + * @memberof Repository + */ getBlob(string: string | Oid): Promise; + /** + * Retrieve the tree represented by the oid. + * + * @param {(string | Oid)} string + * @returns {Promise} + * + * @memberof Repository + */ getTree(string: string | Oid): Promise; + /** + * + * + * @param {(string | Oid)} string + * @param {string} name + * @param {string} message + * @returns {Promise} + * + * @memberof Repository + */ createTag(string: string | Oid, name: string, message: string): Promise; + /** + * Creates a new lightweight tag + * + * @param {(string | Oid)} string + * @param {string} name + * @returns {Promise} + * + * @memberof Repository + */ createLightweightTag(string: string | Oid, name: string): Promise; + /** + * Retrieve the tag represented by the oid. + * + * @param {(string | Oid)} string + * @returns {Promise} + * + * @memberof Repository + */ getTag(string: string | Oid): Promise; + /** + * Retrieve the tag represented by the tag name. + * + * @param {string} Short + * @returns {Promise} + * + * @memberof Repository + */ getTagByName(Short: string): Promise; + /** + * Deletes a tag from a repository by the tag name. + * + * @param {string} Short + * @returns {Promise} + * + * @memberof Repository + */ deleteTagByName(Short: string): Promise; - createRevWalk(string: string | Oid): any; + /** + * Instantiate a new revision walker for browsing the Repository"s history. See also Commit.prototype.history() + * + * @param {(string | Oid)} string + * @returns {Revwalk} + * + * @memberof Repository + */ + createRevWalk(string: string | Oid): Revwalk; + /** + * Retrieve the master branch commit. + * + * @returns {Promise} + * + * @memberof Repository + */ getMasterCommit(): Promise; + /** + * Retrieve the commit that HEAD is currently pointing to + * + * @returns {Promise} + * + * @memberof Repository + */ getHeadCommit(): Promise; + /** + * + * + * @param {string} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {string} message + * @param {(Tree | Oid | string)} Tree + * @param {any[]} parents + * @returns {Promise} + * + * @memberof Repository + */ createCommit(updateRef: string, author: Signature, committer: Signature, message: string, Tree: Tree | Oid | string, parents: any[]): Promise; + /** + * Creates a new commit on HEAD from the list of passed in files + * + * @param {any[]} filesToAdd + * @param {Signature} author + * @param {Signature} committer + * @param {string} message + * @returns {Promise} + * + * @memberof Repository + */ createCommitOnHead(filesToAdd: any[], author: Signature, committer: Signature, message: string): Promise; + /** + * Create a blob from a buffer + * + * @param {Buffer} buffer + * @returns {Oid} + * + * @memberof Repository + */ createBlobFromBuffer(buffer: Buffer): Oid; + /** + * + * + * @param {Tree} tree + * @returns {*} + * + * @memberof Repository + */ treeBuilder(tree: Tree): any; + /** + * Gets the default signature for the default user and now timestamp + * + * @returns {Signature} + * + * @memberof Repository + */ defaultSignature(): Signature; + /** + * Lists out the remotes in the given repository. + * + * @param {Function} Optional + * @returns {Promise} + * + * @memberof Repository + */ getRemotes(Optional: Function): Promise; + /** + * Gets a remote from the repo + * + * @param {(string | Remote)} remote + * @param {Function} callback + * @returns {Promise} + * + * @memberof Repository + */ getRemote(remote: string | Remote, callback: Function): Promise; - fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; - fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; + /** + * Fetches from a remote + * + * @param {(string | Remote)} remote + * @param {(Object | FetchOptions)} fetchOptions + * @returns {Promise} + * + * @memberof Repository + */ + fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; + /** + * Fetches from all remotes. This is done in series due to deadlocking issues with fetching from many remotes that can happen. + * + * @param {(Object | FetchOptions)} fetchOptions + * @param {Function} callback + * @returns {Promise} + * + * @memberof Repository + */ + fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; + /** + * + * + * @param {(string | Reference)} to + * @param {(string | Reference)} from + * @param {Signature} signature + * @param {Merge.PREFERENCE} mergePreference + * @param {MergeOptions} mergeOptions + * @returns {Promise} + * + * @memberof Repository + */ mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: Merge.PREFERENCE, mergeOptions: MergeOptions): Promise; + /** + * Rebases a branch onto another branch + * + * @param {string} branch + * @param {string} upstream + * @param {string} onto + * @param {Signature} signature + * @param {Function} beforeNextFn + * @returns {Promise} + * + * @memberof Repository + */ rebaseBranches(branch: string, upstream: string, onto: string, signature: Signature, beforeNextFn: Function): Promise; + /** + * + * + * @param {Signature} signature + * @param {Function} beforeNextFn + * @returns {Promise} + * + * @memberof Repository + */ continueRebase(signature: Signature, beforeNextFn: Function): Promise; + /** + * Get the status of a repo to it's working directory + * + * @param {*} opts + * @returns {Promise} + * + * @memberof Repository + */ getStatus(opts: any): Promise; + /** + * Get extended statuses of a repo to it's working directory. Status entries have status, headToIndex delta, and indexToWorkdir deltas + * + * @param {*} opts + * @returns {Promise} + * + * @memberof Repository + */ getStatusExt(opts: any): Promise; + /** + * Get the names of the submodules in the repository. + * + * @returns {Promise} + * + * @memberof Repository + */ getSubmoduleNames(): Promise; + /** + * This will set the HEAD to point to the reference and then attempt to update the index and working tree to match the content of the latest commit on that reference + * + * @param {Reference} reference + * @param {(Object | CheckoutOptions)} opts + * @returns {Promise} + * + * @memberof Repository + */ checkoutRef(reference: Reference, opts: Object | CheckoutOptions): Promise; + /** + * This will set the HEAD to point to the local branch and then attempt to update the index and working tree to match the content of the latest commit on that branch + * + * @param {(string | Reference)} branch + * @param {(Object | CheckoutOptions)} opts + * @returns {Promise} + * + * @memberof Repository + */ checkoutBranch(branch: string | Reference, opts: Object | CheckoutOptions): Promise; - stageFilemode(filePath: string | any[], stageNew: Boolean): Promise; - stageLines(filePath: string, newLines: any[], isStaged: Boolean): Promise; - isDefaultState(): Boolean; - isApplyingMailbox(): Boolean; - isBisecting(): Boolean; - isCherrypicking(): Boolean; - isMerging(): Boolean; - isRebasing(): Boolean; - isReverting(): Boolean; + /** + * Stages or unstages line selection of a specified file + * + * @param {(string | any[])} filePath + * @param {boolean} stageNew + * @returns {Promise} + * + * @memberof Repository + */ + stageFilemode(filePath: string | any[], stageNew: boolean): Promise; + /** + * Stages or unstages line selection of a specified file + * + * @param {string} filePath + * @param {any[]} newLines + * @param {boolean} isStaged + * @returns {Promise} + * + * @memberof Repository + */ + stageLines(filePath: string, newLines: any[], isStaged: boolean): Promise; + /** + * Returns true if the repository is in the default NONE state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isDefaultState(): boolean; + /** + * Returns true if the repository is in the APPLY_MAILBOX or APPLY_MAILBOX_OR_REBASE state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isApplyingMailbox(): boolean; + /** + * Returns true if the repository is in the BISECT state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isBisecting(): boolean; + /** + * Returns true if the repository is in the CHERRYPICK state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isCherrypicking(): boolean; + /** + * Returns true if the repository is in the MERGE state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isMerging(): boolean; + /** + * Returns true if the repository is in the REBASE, REBASE_INTERACTIVE, or REBASE_MERGE state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isRebasing(): boolean; + /** + * Returns true if the repository is in the REVERT state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isReverting(): boolean; + /** + * Discard line selection of a specified file. Assumes selected lines are unstaged. + * + * @param {string} filePath + * @param {any[]} selectedLines + * @returns {Promise} + * + * @memberof Repository + */ + discardLines(filePath: string, selectedLines: any[]): Promise; + /** + * Grabs a fresh copy of the index from the repository. Invalidates all previously grabbed indexes + * + * @returns {Promise} + * + * @memberof Repository + */ + refreshIndex(): Promise; } From 21c17befd38a6b37d8dd93a06f5a2887c81b087a Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 02:11:59 +0100 Subject: [PATCH 271/761] Changed Boolean to boolean --- types/nodegit/convenient-patch.d.ts | 44 ++++++++++++++--------------- types/nodegit/tree-entry.d.ts | 8 +++--- types/nodegit/tree.d.ts | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/types/nodegit/convenient-patch.d.ts b/types/nodegit/convenient-patch.d.ts index b03bb2ff54..5d3a9fd03f 100644 --- a/types/nodegit/convenient-patch.d.ts +++ b/types/nodegit/convenient-patch.d.ts @@ -52,89 +52,89 @@ export class ConvenientPatch { /** * Is this an unmodified patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isUnmodified(): Boolean; + isUnmodified(): boolean; /** * Is this an added patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isAdded(): Boolean; + isAdded(): boolean; /** * Is this a deleted patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isDeleted(): Boolean; + isDeleted(): boolean; /** * Is this an modified patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isModified(): Boolean; + isModified(): boolean; /** * Is this a renamed patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isRenamed(): Boolean; + isRenamed(): boolean; /** * Is this a copied patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isCopied(): Boolean; + isCopied(): boolean; /** * Is this an ignored patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isIgnored(): Boolean; + isIgnored(): boolean; /** * Is this an untracked patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isUntracked(): Boolean; + isUntracked(): boolean; /** * Is this a type change? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isTypeChange(): Boolean; + isTypeChange(): boolean; /** * Is this an undreadable patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isUnreadable(): Boolean; + isUnreadable(): boolean; /** * Is this a conflicted patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isConflicted(): Boolean; + isConflicted(): boolean; } diff --git a/types/nodegit/tree-entry.d.ts b/types/nodegit/tree-entry.d.ts index 844f5da90c..a56a658ce1 100644 --- a/types/nodegit/tree-entry.d.ts +++ b/types/nodegit/tree-entry.d.ts @@ -14,10 +14,10 @@ export namespace TreeEntry { } export class TreeEntry { - isFile(): Boolean; - isTree(): Boolean; - isDirectory(): Boolean; - isBlob(): Boolean; + isFile(): boolean; + isTree(): boolean; + isDirectory(): boolean; + isBlob(): boolean; sha(): string; getTree(): Promise; getBlob(): Promise; diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index c20037cb0a..a4101217d3 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -38,7 +38,7 @@ export class Tree { entryByIndex(i: number): TreeEntry; getEntry(filePath: string): TreeEntry; entries(): TreeEntry[]; - walk(blobsOnly?: Boolean): NodeJS.EventEmitter; + walk(blobsOnly?: boolean): NodeJS.EventEmitter; path(): string; builder(): Treebuilder; } From a2415a9ba3f08ec1bb81d2c1d8895f82152485b7 Mon Sep 17 00:00:00 2001 From: Walter Rumsby Date: Fri, 9 Jun 2017 13:16:04 +1200 Subject: [PATCH 272/761] [react-select] Update types for loadOptions to support Async options with Promises (#16664) * Update types for loadOptions to support Async options with Promises As per https://github.com/JedWatson/react-select#async-options-with-promises * Add test * Updates based on PR comments --- types/react-select/index.d.ts | 4 +- types/react-select/react-select-tests.tsx | 46 +++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/types/react-select/index.d.ts b/types/react-select/index.d.ts index 361dcfecc2..a3c2cf7881 100644 --- a/types/react-select/index.d.ts +++ b/types/react-select/index.d.ts @@ -434,7 +434,9 @@ declare namespace ReactSelectClass { /** * function to call to load options asynchronously */ - loadOptions: (input: string, callback: (err: any, result: AutocompleteResult) => any) => any; + loadOptions: + | ((input: string) => Promise) + | ((input: string, callback: (err: any, result: AutocompleteResult) => void) => void); /** * replaces the placeholder while options are loading diff --git a/types/react-select/react-select-tests.tsx b/types/react-select/react-select-tests.tsx index 972a1dacdc..5d603c9259 100644 --- a/types/react-select/react-select-tests.tsx +++ b/types/react-select/react-select-tests.tsx @@ -209,6 +209,52 @@ class SelectAsyncTest extends React.Component, {}> { } +class SelectAsyncPromiseTest extends React.Component, {}> { + + render() { + const getOptions = (input: string): Promise => { + return new Promise(resolve => { + setTimeout(function() { + return resolve({ + options: options, + complete: true + }); + }, 500); + }); + }; + const options: Option[] = [{ label: "Foo", value: "bar" }]; + const onChange = (value: any) => console.log(value); + + const asyncSelectProps: ReactAsyncSelectProps = { + name: "test-select-async-promise", + className: "test-select", + key: "1", + matchPos: "any", + matchProp: "any", + multi: true, + onValueClick: onChange, + valueKey: "github", + labelKey: "name", + onChange: onChange, + simpleValue: undefined, + value: options, + loadOptions: getOptions, + cache: {}, + ignoreAccents: false, + ignoreCase: true, + isLoading: false, + minimumInput: 5, + searchPromptText: "search...", + searchingText: "searching...", + }; + + return
+ +
; + } + +} + class SelectCreatableTest extends React.Component, {}> { render() { From 424873bdfaa0bb226d5525538ff6482d4bebb139 Mon Sep 17 00:00:00 2001 From: beary Date: Fri, 9 Jun 2017 09:37:32 +0800 Subject: [PATCH 273/761] Add default generic to FindAndModify... interface --- types/mongodb/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index a7c73e0799..ebe427a427 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -741,7 +741,7 @@ export interface DeleteWriteOpResultObject { } //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#~findAndModifyWriteOpResult -export interface FindAndModifyWriteOpResultObject { +export interface FindAndModifyWriteOpResultObject { //Document returned from findAndModify command. value?: TSchema; //The raw lastErrorObject returned from the command. From f904d66dab540a5d5fd2d0ca7a8e9feb2f0e1ce9 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 21:47:13 -0400 Subject: [PATCH 274/761] Correct Reducer in pouchdb-mapreduce Confused between too much different documentation descriptions and not enough code examples. --- types/pouchdb-mapreduce/index.d.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index 4c3d2e8ebf..92ea09e172 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -11,11 +11,17 @@ declare namespace PouchDB { type Map = (doc: Content) => void; - // The any below would be the value type from emit(key, value), currently hidden from type information in the Map - type Reducer = (keys: Array<[string, any]> | null, values: Content[] | Reduction[], rereduce: boolean) => Reduction[] | Reduction; + /** + * CouchDB-style Reduction function + * + * @param keys From CouchDB documentation: Array of pairs of docid-key for related map function results; + * PouchDB may pass a simple array and also supports complex keys. + */ + type Reducer = (keys: any | null, values: Content[] | Reduction[], rereduce: boolean) => Reduction[] | Reduction; interface Filter { map: Map; + // Assume that Content[] | Reduction[] is enough leverage in most cases to handle intermediate map emits reduce?: Reducer | '_sum' | '_count' | '_stats' | string; } From 851aeea04ae2c6e83abea3b64fdbf68680c5fdb4 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 02:57:41 +0100 Subject: [PATCH 275/761] Added documentation --- types/nodegit/reset.d.ts | 37 +++++ types/nodegit/rev-parse.d.ts | 22 +++ types/nodegit/rev-walk.d.ts | 157 +++++++++++++++++++- types/nodegit/revert.d.ts | 28 +++- types/nodegit/signature.d.ts | 79 ++++++++++ types/nodegit/stash.d.ts | 105 ++++++++++++- types/nodegit/status-entry.d.ts | 18 +++ types/nodegit/status-list.d.ts | 30 ++++ types/nodegit/status-options.d.ts | 24 +++ types/nodegit/status.d.ts | 54 +++++++ types/nodegit/str-array.d.ts | 26 ++++ types/nodegit/submodule-update-options.d.ts | 24 +++ 12 files changed, 596 insertions(+), 8 deletions(-) diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 25ff5ae563..1335eb8365 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -13,7 +13,44 @@ export namespace Reset { } export class Reset { + /** + * Look up a refs's commit. + * + * @static + * @param {Repository} repo + * @param {Object} target + * @param {number} reset_type + * @param {CheckoutOptions} checkout_opts + * @returns {Promise} + * + * @memberof Reset + */ static reset(repo: Repository, target: Object, reset_type: number, checkout_opts: CheckoutOptions): Promise; + /** + * Look up a refs's commit. + * + * @static + * @param {Repository} repo + * @param {Object} target + * @param {Strarray} pathspecs + * @returns {Promise} + * + * @memberof Reset + */ static default(repo: Repository, target: Object, pathspecs: Strarray): Promise; + /** + * Sets the current head to the specified commit oid and optionally resets the index and working tree to match. + * This behaves like reset but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages. + * See the documentation for reset. + * + * @static + * @param {Repository} repo + * @param {AnnotatedCommit} commit + * @param {number} reset_type + * @param {CheckoutOptions} checkout_opts + * @returns {number} + * + * @memberof Reset + */ static fromAnnotated(repo: Repository, commit: AnnotatedCommit, reset_type: number, checkout_opts: CheckoutOptions): number; } diff --git a/types/nodegit/rev-parse.d.ts b/types/nodegit/rev-parse.d.ts index 7bdbc80676..b4ef63f2f2 100644 --- a/types/nodegit/rev-parse.d.ts +++ b/types/nodegit/rev-parse.d.ts @@ -11,6 +11,28 @@ export namespace Revparse { } export class Revparse { + /** + * + * + * @static + * @param {Object} object_out + * @param {Reference} reference_out + * @param {Repository} repo + * @param {string} spec + * @returns {number} + * + * @memberof Revparse + */ static ext(object_out: Object, reference_out: Reference, repo: Repository, spec: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} spec + * @returns {Promise} + * + * @memberof Revparse + */ static single(repo: Repository, spec: string): Promise; } diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts index 643220b492..8ba18bf83a 100644 --- a/types/nodegit/rev-walk.d.ts +++ b/types/nodegit/rev-walk.d.ts @@ -12,25 +12,180 @@ export namespace Revwalk { } export class Revwalk { + /** + * + * + * @static + * @param {Repository} repo + * @returns {Revwalk} + * + * @memberof Revwalk + */ static create(repo: Repository): Revwalk; + /** + * + * + * @param {Oid} commit_id + * @returns {number} + * + * @memberof Revwalk + */ hide(commit_id: Oid): number; + /** + * + * + * @param {string} glob + * @returns {number} + * + * @memberof Revwalk + */ hideGlob(glob: string): number; + /** + * + * + * @returns {number} + * + * @memberof Revwalk + */ hideHead(): number; + /** + * + * + * @param {string} refname + * @returns {number} + * + * @memberof Revwalk + */ hideRef(refname: string): number; + /** + * + * + * @returns {Promise} + * + * @memberof Revwalk + */ next(): Promise; + /** + * + * + * @param {Oid} id + * @returns {number} + * + * @memberof Revwalk + */ push(id: Oid): number; + /** + * + * + * @param {string} glob + * @returns {number} + * + * @memberof Revwalk + */ pushGlob(glob: string): number; + /** + * + * + * @returns {number} + * + * @memberof Revwalk + */ pushHead(): number; + /** + * + * + * @param {string} range + * @returns {number} + * + * @memberof Revwalk + */ pushRange(range: string): number; + /** + * + * + * @param {string} refname + * @returns {number} + * + * @memberof Revwalk + */ pushRef(refname: string): number; + /** + * + * + * @returns {Repository} + * + * @memberof Revwalk + */ repository(): Repository; + /** + * + * + * + * @memberof Revwalk + */ reset(): void; + /** + * + * + * + * @memberof Revwalk + */ simplifyFirstParent(): void; - sorting(sort: number): any; + /** + * Set the sort order for the revwalk. This function takes variable arguments like revwalk.sorting(NodeGit.RevWalk.Topological, NodeGit.RevWalk.Reverse). + * + * @param {number} sort + * + * @memberof Revwalk + */ + sorting(sort: number): void; + /** + * + * + * @param {number} max_count + * @returns {Promise} + * + * @memberof Revwalk + */ fastWalk(max_count: number): Promise; + /** + * + * + * @param {string} filePath + * @param {number} max_count + * @returns {Promise} + * + * @memberof Revwalk + */ fileHistoryWalk(filePath: string, max_count: number): Promise; + /** + * Walk the history from the given oid. The callback is invoked for each commit; When the walk is over, the callback is invoked with (null, null). + * + * @param {Oid} oid + * @param {Function} callback + * @returns {Commit} + * + * @memberof Revwalk + */ walk(oid: Oid, callback: Function): Commit; + /** + * Walk the history grabbing commits until the checkFn called with the current commit returns false. + * + * @param {Function} checkFn + * @returns {Promise} + * + * @memberof Revwalk + */ getCommitsUntil(checkFn: Function): Promise; + /** + * + * + * @param {number} count + * @returns {Promise} + * + * @memberof Revwalk + */ getCommits(count: number): Promise; + } diff --git a/types/nodegit/revert.d.ts b/types/nodegit/revert.d.ts index a1210182eb..ac0cbf531a 100644 --- a/types/nodegit/revert.d.ts +++ b/types/nodegit/revert.d.ts @@ -12,6 +12,30 @@ export interface RevertOptions { } export class Revert { - static revert(repo: Repository, commit: Commit, given_opts: RevertOptions): Promise; - static commit(repo: Repository, revert_commit: Commit, our_commit: Commit, mainline: number, merge_options: MergeOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Commit} commit + * @param {RevertOptions} givenOpts + * @returns {Promise} + * + * @memberof Revert + */ + static revert(repo: Repository, commit: Commit, givenOpts: RevertOptions): Promise; + /** + * Reverts the given commit against the given "our" commit, producing an index that reflects the result of the revert. + * + * @static + * @param {Repository} repo + * @param {Commit} revert_commit + * @param {Commit} ourCommit + * @param {number} mainline + * @param {MergeOptions} mergeOptions + * @returns {Promise} + * + * @memberof Revert + */ + static commit(repo: Repository, revert_commit: Commit, ourCommit: Commit, mainline: number, mergeOptions: MergeOptions): Promise; } diff --git a/types/nodegit/signature.d.ts b/types/nodegit/signature.d.ts index c18ccb45ff..6854760004 100644 --- a/types/nodegit/signature.d.ts +++ b/types/nodegit/signature.d.ts @@ -2,14 +2,93 @@ import { Repository } from './repository'; import { Time } from './time'; export class Signature { + /** + * + * + * @static + * @param {Repository} repo + * @returns {Signature} + * + * @memberof Signature + */ static default(repo: Repository): Signature; + /** + * + * + * @static + * @param {string} name + * @param {string} email + * @param {number} time + * @param {number} offset + * @returns {Signature} + * + * @memberof Signature + */ static create(name: string, email: string, time: number, offset: number): Signature; + /** + * + * + * @static + * @param {string} name + * @param {string} email + * @returns {Signature} + * + * @memberof Signature + */ static now(name: string, email: string): Signature; + /** + * + * + * @static + * @param {string} buf + * @returns {Promise} + * + * @memberof Signature + */ + static fromBuffer(buf: string): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Signature + */ dup(): Promise; + /** + * + * + * + * @memberof Signature + */ free(): void; + /** + * + * + * @returns {string} + * + * @memberof Signature + */ toString(): string; + /** + * + * + * @type {string} + * @memberof Signature + */ name: string; + /** + * + * + * @type {string} + * @memberof Signature + */ email: string; + /** + * + * + * @type {Time} + * @memberof Signature + */ when: Time; } diff --git a/types/nodegit/stash.d.ts b/types/nodegit/stash.d.ts index c81e94b7b6..1aae88bd85 100644 --- a/types/nodegit/stash.d.ts +++ b/types/nodegit/stash.d.ts @@ -29,18 +29,113 @@ export namespace Stash { } export interface StashApplyOptions { - version: number; - flags: number; - checkoutOptions: CheckoutOptions; - progressCb: Function; - progressPayload: any; + /** + * + * + * @type {number} + * @memberof StashApplyOptions + */ + version?: number; + /** + * + * + * @type {number} + * @memberof StashApplyOptions + */ + flags?: number; + /** + * + * + * @type {CheckoutOptions} + * @memberof StashApplyOptions + */ + checkoutOptions?: CheckoutOptions; + /** + * + * + * @type {Function} + * @memberof StashApplyOptions + */ + progressCb?: Function; + /** + * + * + * @type {*} + * @memberof StashApplyOptions + */ + progressPayload?: any; } export class Stash { + /** + * + * + * @static + * @param {Repository} repo + * @param {number} index + * @param {StashApplyOptions} options + * @returns {Promise} + * + * @memberof Stash + */ static apply(repo: Repository, index: number, options: StashApplyOptions): Promise; + /** + * + * + * @static + * @param {StashApplyOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Stash + */ static applyInitOptions(opts: StashApplyOptions, version: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {number} index + * @returns {Promise} + * + * @memberof Stash + */ static drop(repo: Repository, index: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Function} callback + * @param {*} payload + * @returns {Promise} + * + * @memberof Stash + */ static foreach(repo: Repository, callback: Function, payload: any): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {number} index + * @param {StashApplyOptions} options + * @returns {Promise} + * + * @memberof Stash + */ static pop(repo: Repository, index: number, options: StashApplyOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Signature} stasher + * @param {string} message + * @param {number} flags + * @returns {Promise} + * + * @memberof Stash + */ static save(repo: Repository, stasher: Signature, message: string, flags: number): Promise; } diff --git a/types/nodegit/status-entry.d.ts b/types/nodegit/status-entry.d.ts index bc2ab62a12..70435d5de1 100644 --- a/types/nodegit/status-entry.d.ts +++ b/types/nodegit/status-entry.d.ts @@ -1,7 +1,25 @@ import { DiffDelta } from './diff-delta'; export class StatusEntry { + /** + * + * + * @type {number} + * @memberof StatusEntry + */ status: number; + /** + * + * + * @type {DiffDelta} + * @memberof StatusEntry + */ headToIndex: DiffDelta; + /** + * + * + * @type {DiffDelta} + * @memberof StatusEntry + */ indexToWorkdir: DiffDelta; } diff --git a/types/nodegit/status-list.d.ts b/types/nodegit/status-list.d.ts index 6d83044801..7847da4d1d 100644 --- a/types/nodegit/status-list.d.ts +++ b/types/nodegit/status-list.d.ts @@ -3,9 +3,39 @@ import { DiffPerfdata } from './diff-perf-data'; import { StatusOptions } from './status-options'; export class StatusList { + /** + * + * + * @static + * @param {Repository} repo + * @param {StatusOptions} opts + * @returns {Promise} + * + * @memberof StatusList + */ static create(repo: Repository, opts: StatusOptions): Promise; + /** + * + * + * @returns {number} + * + * @memberof StatusList + */ entrycount(): number; + /** + * + * + * + * @memberof StatusList + */ free(): void; + /** + * + * + * @returns {Promise} + * + * @memberof StatusList + */ getPerfdata(): Promise; } diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts index 9f75bbe96d..fe2f728737 100644 --- a/types/nodegit/status-options.d.ts +++ b/types/nodegit/status-options.d.ts @@ -1,8 +1,32 @@ import { Strarray } from './str-array'; export interface StatusOptions { + /** + * + * + * @type {number} + * @memberof StatusOptions + */ version?: number; + /** + * + * + * @type {number} + * @memberof StatusOptions + */ show?: number; + /** + * + * + * @type {number} + * @memberof StatusOptions + */ flags?: number; + /** + * + * + * @type {Strarray} + * @memberof StatusOptions + */ pathspec?: Strarray; } diff --git a/types/nodegit/status.d.ts b/types/nodegit/status.d.ts index 1059dd6bff..892b1f1c36 100644 --- a/types/nodegit/status.d.ts +++ b/types/nodegit/status.d.ts @@ -48,9 +48,63 @@ export namespace Status { } export class Status { + /** + * + * + * @static + * @param {StatusList} statuslist + * @param {number} idx + * @returns {StatusEntry} + * + * @memberof Status + */ static byIndex(statuslist: StatusList, idx: number): StatusEntry; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} path + * @returns {number} + * + * @memberof Status + */ static file(repo: Repository, path: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {Function} callback + * @param {*} payload + * @returns {Promise} + * + * @memberof Status + */ static foreach(repo: Repository, callback: Function, payload: any): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {StatusOptions} opts + * @param {Function} callback + * @param {*} payload + * @returns {Promise} + * + * @memberof Status + */ static foreachExt(repo: Repository, opts: StatusOptions, callback: Function, payload: any): Promise; + /** + * + * + * @static + * @param {number} ignored + * @param {Repository} repo + * @param {string} path + * @returns {number} + * + * @memberof Status + */ static shouldIgnore(ignored: number, repo: Repository, path: string): number; } diff --git a/types/nodegit/str-array.d.ts b/types/nodegit/str-array.d.ts index 525667fbcb..603889f756 100644 --- a/types/nodegit/str-array.d.ts +++ b/types/nodegit/str-array.d.ts @@ -1,6 +1,32 @@ export class Strarray { + /** + * + * + * @param {Strarray} src + * @returns {number} + * + * @memberof Strarray + */ copy(src: Strarray): number; + /** + * + * + * + * @memberof Strarray + */ free(): void; + /** + * + * + * @type {string[]} + * @memberof Strarray + */ strings: string[]; + /** + * + * + * @type {number} + * @memberof Strarray + */ count: number; } diff --git a/types/nodegit/submodule-update-options.d.ts b/types/nodegit/submodule-update-options.d.ts index d96320204b..3b07383090 100644 --- a/types/nodegit/submodule-update-options.d.ts +++ b/types/nodegit/submodule-update-options.d.ts @@ -2,8 +2,32 @@ import { CheckoutOptions } from './checkout-options'; import { FetchOptions } from './fetch-options'; export interface SubmoduleUpdateOptions { + /** + * + * + * @type {number} + * @memberof SubmoduleUpdateOptions + */ version?: number; + /** + * + * + * @type {CheckoutOptions} + * @memberof SubmoduleUpdateOptions + */ checkoutOpts?: CheckoutOptions; + /** + * + * + * @type {FetchOptions} + * @memberof SubmoduleUpdateOptions + */ fetchOpts?: FetchOptions; + /** + * + * + * @type {number} + * @memberof SubmoduleUpdateOptions + */ cloneCheckoutStrategy?: number; } From 35013236c78c0c5ecd7e024e84e8221a8b56b2f1 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 21:58:45 -0400 Subject: [PATCH 276/761] Make a type for built-in reducers in pouchdb-mapreduce --- types/pouchdb-mapreduce/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index 92ea09e172..883339bc82 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -10,6 +10,7 @@ /* tslint:disable:no-single-declare-module */ declare namespace PouchDB { + type BuiltInReducers = '_sum' | '_count' | '_stats'; type Map = (doc: Content) => void; /** * CouchDB-style Reduction function @@ -22,13 +23,13 @@ declare namespace PouchDB { interface Filter { map: Map; // Assume that Content[] | Reduction[] is enough leverage in most cases to handle intermediate map emits - reduce?: Reducer | '_sum' | '_count' | '_stats' | string; + reduce?: Reducer | BuiltInReducers | string; } namespace Query { interface Options { /** Reduce function, or the string name of a built-in function: '_sum', '_count', or '_stats'. */ - reduce?: Reducer | '_sum' | '_count' | '_stats' | boolean; + reduce?: Reducer | BuiltInReducers | boolean; /** Include the document in each row in the doc field. */ include_docs?: boolean; /** Include conflicts in the _conflicts field of a doc. */ From 5d7bff71780b97384d0c291d680fefa125a221fa Mon Sep 17 00:00:00 2001 From: Huruikagi Date: Fri, 9 Jun 2017 11:05:18 +0900 Subject: [PATCH 277/761] Added a test for fileFilter. --- types/multer/multer-tests.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/multer/multer-tests.ts b/types/multer/multer-tests.ts index 00cbc52b98..83c34da197 100644 --- a/types/multer/multer-tests.ts +++ b/types/multer/multer-tests.ts @@ -4,7 +4,12 @@ import express = require('express'); import multer = require('multer'); -var upload = multer({ dest: 'uploads/' }); +var upload = multer({ + dest: 'uploads/', + fileFilter: (req, file, cb) => { + cb(null, true); + } +}); var app = express(); From 1691d92be2bc55761af2859bc254bf684c196687 Mon Sep 17 00:00:00 2001 From: Huruikagi Date: Fri, 9 Jun 2017 11:09:49 +0900 Subject: [PATCH 278/761] Allow null in Options.fileFilter.callback first parameter --- types/multer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/multer/index.d.ts b/types/multer/index.d.ts index 35e71a251d..bd9030292f 100644 --- a/types/multer/index.d.ts +++ b/types/multer/index.d.ts @@ -36,7 +36,7 @@ declare namespace multer { headerPairs?: number; }; /** A function to control which files to upload and which to skip. */ - fileFilter?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error, acceptFile: boolean) => void) => void; + fileFilter?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, acceptFile: boolean) => void) => void; } interface StorageEngine { From 31df86f74f9afc29f6fb7a98c045ae1598d2844d Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 22:17:00 -0400 Subject: [PATCH 279/761] Support PouchDB emit-included maps Include a note that CouchDB does not support them and they always run locally. --- types/pouchdb-mapreduce/index.d.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index 883339bc82..3ac60c8293 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -11,7 +11,12 @@ declare namespace PouchDB { type BuiltInReducers = '_sum' | '_count' | '_stats'; - type Map = (doc: Content) => void; + /** + * CouchDB-style Map function + * + * @param emit CouchDB does not support emit as an argument and maps defined this way will always run locally + */ + type Map = (doc: Content, emit?: (key: any, value: Content | Result) => void) => void; /** * CouchDB-style Reduction function * @@ -21,8 +26,8 @@ declare namespace PouchDB { type Reducer = (keys: any | null, values: Content[] | Reduction[], rereduce: boolean) => Reduction[] | Reduction; interface Filter { - map: Map; - // Assume that Content[] | Reduction[] is enough leverage in most cases to handle intermediate map emits + // Assume that Content | Reduction is enough leverage in most cases to handle intermediate map emits + map: Map; reduce?: Reducer | BuiltInReducers | string; } @@ -105,17 +110,17 @@ declare namespace PouchDB { * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Map | Filter, opts: Query.Options, callback: Core.Callback>): void; + query(fun: string | Map | Filter, opts: Query.Options, callback: Core.Callback>): void; /** * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Map | Filter, callback: Core.Callback>): void; + query(fun: string | Map | Filter, callback: Core.Callback>): void; /** * Invoke a map/reduce function, which allows you to perform more complex queries * on PouchDB than what you get with allDocs(). */ - query(fun: string | Map | Filter, opts?: Query.Options): Promise>; + query(fun: string | Map | Filter, opts?: Query.Options): Promise>; } } From b937fd61dc391cbae5469538af4b8c0e54aa856d Mon Sep 17 00:00:00 2001 From: Maximilian Heinz Date: Fri, 9 Jun 2017 11:26:58 +0200 Subject: [PATCH 280/761] fix(reduxMockStore): mock store should return Redux.Store instead of own IStore --- types/redux-mock-store/index.d.ts | 15 ++++++--------- types/redux-mock-store/package.json | 5 +++-- types/redux-mock-store/redux-mock-store-tests.ts | 7 +++---- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/types/redux-mock-store/index.d.ts b/types/redux-mock-store/index.d.ts index 9183423bfd..46846cd248 100644 --- a/types/redux-mock-store/index.d.ts +++ b/types/redux-mock-store/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Redux Mock Store v0.0.6 +// Type definitions for Redux Mock Store v0.0.7 // Project: https://github.com/arnaudbenard/redux-mock-store // Definitions by: Marian Palkus , Cap3 // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -6,19 +6,16 @@ /// declare module 'redux-mock-store' { - import * as Redux from 'redux' + import * as Redux from 'redux'; function createMockStore(middlewares?: Redux.Middleware[]): mockStore; - export type mockStore = (state?: T) => IStore; - - export interface IStore { - dispatch(action: any): any; - getState(): T; + interface MockStore { getActions(): any[]; clearActions(): void; - subscribe(listener: Function): Function; } - export default createMockStore + export type mockStore = (state?: T) => Redux.Store & MockStore; + + export default createMockStore; } diff --git a/types/redux-mock-store/package.json b/types/redux-mock-store/package.json index e52256ea90..1c5803bcd8 100644 --- a/types/redux-mock-store/package.json +++ b/types/redux-mock-store/package.json @@ -1,5 +1,6 @@ { "dependencies": { - "redux": "^3.6.0" + "redux": "^3.6.0", + "redux-mock-store": "^1.2.3" } -} \ No newline at end of file +} diff --git a/types/redux-mock-store/redux-mock-store-tests.ts b/types/redux-mock-store/redux-mock-store-tests.ts index 15d51d1f23..0937e70654 100644 --- a/types/redux-mock-store/redux-mock-store-tests.ts +++ b/types/redux-mock-store/redux-mock-store-tests.ts @@ -1,5 +1,5 @@ import * as Redux from 'redux'; -import configureStore, {IStore} from 'redux-mock-store'; +import configureStore from 'redux-mock-store'; // Redux store API tests // The following test are taken from ../redux/redux-tests.ts @@ -26,9 +26,8 @@ function loggingMiddleware() { const storeMock = configureStore([loggingMiddleware]); const initialState = 0 -let store: IStore; -store = storeMock(initialState); +const store = storeMock(initialState); store.subscribe(() => { // ... @@ -44,4 +43,4 @@ store.clearActions(); // actions access without the need to cast var actions2 = store.getActions(); -actions2[10].payload.id; \ No newline at end of file +actions2[10].payload.id; From df4bb363e25a8f6c239feb47a32517ead9ee9b31 Mon Sep 17 00:00:00 2001 From: Denys Sedchenko Date: Fri, 9 Jun 2017 12:57:22 +0300 Subject: [PATCH 281/761] Add tslint.json and add style fixes --- types/normalize-url/index.d.ts | 23 ++++++++++++----------- types/normalize-url/tslint.json | 7 +++++++ 2 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 types/normalize-url/tslint.json diff --git a/types/normalize-url/index.d.ts b/types/normalize-url/index.d.ts index 84cca245a5..94cf9ee522 100644 --- a/types/normalize-url/index.d.ts +++ b/types/normalize-url/index.d.ts @@ -1,20 +1,21 @@ -// Type definitions for normalize-url v1.9.1 +// Type definitions for normalize-url 1.9 // Project: https://github.com/sindresorhus/normalize-url // Definitions by: odin3 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module NormalizeUrl { - interface INormalizeUrlArgs { - normalizeProtocol: boolean; - normalizeHttps: boolean; - stripFragment: boolean; - stripWWW: boolean; - removeQueryParameters: string[]; - removeTrailingSlash: boolean; - removeDirectoryIndex: RegExp[]; +declare namespace NormalizeUrl { + interface NormalizeUrlArgs { + normalizeProtocol?: boolean; + normalizeHttps?: boolean; + stripFragment?: boolean; + stripWWW?: boolean; + removeQueryParameters?: string[]; + removeTrailingSlash?: boolean; + removeDirectoryIndex?: RegExp[]; } - function normalizeUrl(url: string, args?: INormalizeUrlArgs): string; + // tslint:disable-next-line align + function normalizeUrl(url: string, args?: NormalizeUrlArgs): string; } export = NormalizeUrl.normalizeUrl; diff --git a/types/normalize-url/tslint.json b/types/normalize-url/tslint.json new file mode 100644 index 0000000000..279473e356 --- /dev/null +++ b/types/normalize-url/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // This package uses the Function type, and it will take effort to fix. + "ban-types": false + } +} From 8c19e8e8862acb0fff191b9d7413ead46bed7c5b Mon Sep 17 00:00:00 2001 From: David Sanders Date: Fri, 9 Jun 2017 19:03:28 +1000 Subject: [PATCH 282/761] Added InvalidEvent, onInvalid & onInvalidCapture https://developer.mozilla.org/en-US/docs/Web/Events/invalid --- types/react/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 7d71c2d183..d533a67bf4 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -330,6 +330,10 @@ declare namespace React { interface FormEvent extends SyntheticEvent { } + interface InvalidEvent extends SyntheticEvent { + target: EventTarget & T; + } + interface ChangeEvent extends SyntheticEvent { target: EventTarget & T; } @@ -502,6 +506,8 @@ declare namespace React { onResetCapture?: FormEventHandler; onSubmit?: FormEventHandler; onSubmitCapture?: FormEventHandler; + onInvalid?: FormEventHandler; + onInvalidCapture?: FormEventHandler; // Image Events onLoad?: ReactEventHandler; From 9dace9e9bd693a541d6f109159624b47df599738 Mon Sep 17 00:00:00 2001 From: Maximilian Heinz Date: Fri, 9 Jun 2017 12:06:02 +0200 Subject: [PATCH 283/761] refactor(redux-mock-store): extend Redux.Store instead of using intersection --- types/redux-mock-store/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/redux-mock-store/index.d.ts b/types/redux-mock-store/index.d.ts index 46846cd248..e8d4cced5e 100644 --- a/types/redux-mock-store/index.d.ts +++ b/types/redux-mock-store/index.d.ts @@ -10,12 +10,12 @@ declare module 'redux-mock-store' { function createMockStore(middlewares?: Redux.Middleware[]): mockStore; - interface MockStore { + interface MockStore extends Redux.Store { getActions(): any[]; clearActions(): void; } - export type mockStore = (state?: T) => Redux.Store & MockStore; + export type mockStore = (state?: T) => MockStore; export default createMockStore; } From 08f784aa8dbbb611aa6ef8d08869f1f2e3f6606f Mon Sep 17 00:00:00 2001 From: Kacper Polak Date: Fri, 9 Jun 2017 12:59:04 +0200 Subject: [PATCH 284/761] Deprecated res.status ``res.send(status, body)`` is deprecated. Use ``res.status(status).send(body)`` instead --- types/express-serve-static-core/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/express-serve-static-core/index.d.ts b/types/express-serve-static-core/index.d.ts index 8e1f075f03..a24e96d144 100644 --- a/types/express-serve-static-core/index.d.ts +++ b/types/express-serve-static-core/index.d.ts @@ -475,7 +475,6 @@ interface MediaType { } interface Send { - (status: number, body?: any): Response; (body?: any): Response; } From 0a705ea0462c897568685575669b6cfcf7a038de Mon Sep 17 00:00:00 2001 From: Kacper Polak Date: Fri, 9 Jun 2017 13:14:08 +0200 Subject: [PATCH 285/761] Update contributors I just want to review code next time --- types/express-serve-static-core/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/express-serve-static-core/index.d.ts b/types/express-serve-static-core/index.d.ts index a24e96d144..dd012cab4e 100644 --- a/types/express-serve-static-core/index.d.ts +++ b/types/express-serve-static-core/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Express 4.x // Project: http://expressjs.com -// Definitions by: Boris Yankov , Michał Lytek +// Definitions by: Boris Yankov , Michał Lytek , Kacper Polak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // This extracts the core definitions from express to prevent a circular dependency between express and serve-static /// From 9515215657a10f849f42b27cf74b46f315b58c72 Mon Sep 17 00:00:00 2001 From: andraaspar Date: Fri, 9 Jun 2017 13:57:00 +0200 Subject: [PATCH 286/761] Make Mithril component use more strict. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Removed ‘[s: string]: any’ from Lifecycle. * Added tests for component use. ‘Object literal may only specify known properties’ is the important piece. --- types/mithril/index.d.ts | 1 - types/mithril/test/test-component.ts | 29 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/types/mithril/index.d.ts b/types/mithril/index.d.ts index 1179db4fbc..e17064abfc 100644 --- a/types/mithril/index.d.ts +++ b/types/mithril/index.d.ts @@ -44,7 +44,6 @@ declare namespace Mithril { onbeforeupdate?(this: State, vnode: Vnode, old: VnodeDOM): boolean | void; /** The onremove hook is called before a DOM element is removed from the document. */ onupdate?(this: State, vnode: VnodeDOM): any; - [s: string]: any; } interface Hyperscript { diff --git a/types/mithril/test/test-component.ts b/types/mithril/test/test-component.ts index 40fdfdfd5a..67e271329e 100644 --- a/types/mithril/test/test-component.ts +++ b/types/mithril/test/test-component.ts @@ -1,5 +1,6 @@ import * as m from 'mithril'; -import {Component, Comp} from 'mithril'; + +import {Comp, Component} from 'mithril'; /////////////////////////////////////////////////////////// // 0. @@ -45,6 +46,32 @@ const comp2: Component = { } }; +// Correct use +m(comp2, {title: '', description: ''}); + +// Correct use with lifecycle method +m(comp2, {title: '', description: '', oncreate: (v) => v.attrs.title + '\n' + v.attrs.description}); + +// Properties missing +// $ExpectError +m(comp2, {}); + +// Property 'description' is missing in type '{ title: string; }'. +// $ExpectError +m(comp2, {title: ''}); + +// Property 'title' is missing in type '{ description: string; }'. +// $ExpectError +m(comp2, {description: ''}); + +// Type 'boolean' is not assignable to type 'string'. +// $ExpectError +m(comp2, {title: '', description: true}); + +// Object literal may only specify known properties, and 'foo' does not exist in type 'Comp2Attrs & Lifecycle & { key?: string | number | undefined; }'. +// $ExpectError +m(comp2, {title: '', description: '', foo: ''}); + /////////////////////////////////////////////////////////// // 3. // Declares attrs type inline. From 9878248e8d2bf54e2015d4f7f380d46a23a8102f Mon Sep 17 00:00:00 2001 From: StefanSchoof Date: Fri, 9 Jun 2017 14:15:16 +0200 Subject: [PATCH 287/761] Use ts 2.1 keyof Feature --- types/sharepoint/index.d.ts | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/types/sharepoint/index.d.ts b/types/sharepoint/index.d.ts index 3520e12f06..1d056448a4 100644 --- a/types/sharepoint/index.d.ts +++ b/types/sharepoint/index.d.ts @@ -2,6 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/office/jj193034.aspx // Definitions by: Stanislav Vyshchepan , Andrey Markeev // Definitions: https:// github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1. /// @@ -3538,7 +3539,7 @@ declare namespace SP { newMode } /** Represents a list on a SharePoint Web site. */ - class List extends SP.SecurableObject { + class List extends SP.SecurableObject { /** Gets item by id. */ getItemById(id: number): SP.ListItem; /** Gets a value that specifies whether the list supports content types. */ @@ -3750,20 +3751,20 @@ declare namespace SP { /** Sends the list to the site recycle bin. */ recycle(): SP.GuidResult; /** Returns collection of list items based on the specified CAML query. */ - getItems(query: SP.CamlQuery): SP.ListItemCollection; + getItems(query: SP.CamlQuery): SP.ListItemCollection; /** Creates a new list item in the list. */ addItem(parameters: SP.ListItemCreationInformation): SP.ListItem; } /** Represents a collection of SP.List objects */ class ListCollection extends SP.ClientObjectCollection { /** Gets the list at the specified index in the collection. */ - itemAt(index: number): SP.List; + itemAt(index: number): SP.List; /** Gets the list at the specified index in the collection. */ - get_item(index: number): SP.List; + get_item(index: number): SP.List; /** Returns the list with the specified title from the collection. */ - getByTitle(title: string): SP.List; + getByTitle(title: string): SP.List; /** Returns the list with the specified list identifier. */ - getById(id: string | SP.Guid): SP.List; + getById(id: string | SP.Guid): SP.List; /** Creates a new list or a document library. */ add(parameters: SP.ListCreationInformation): SP.List; /** Gets a list that is the default location for wiki pages. */ @@ -3830,12 +3831,12 @@ declare namespace SP { textField, } /** Represents an item or row in a list. */ - class ListItem extends SP.SecurableObject { - get_fieldValues(): any; + class ListItem extends SP.SecurableObject { + get_fieldValues(): T; /** Gets the specified field value for the list item. Field value is returned as string, but it can be casted to a specific field value type, e.g. SP.LookupFieldValue, etc. */ - get_item(fieldInternalName: string): any; + get_item(fieldInternalName: K): T[K]; /** Sets the specified field value for the list item. Consider using parseAndSetFieldValue instead. */ - set_item(fieldInternalName: string, value: any): void; + set_item(fieldInternalName: K, value: T[K]): void; /** Gets collection of objects that represent attachments for the list item. */ get_attachmentFiles(): SP.AttachmentCollection; /** Gets the content type of the item. */ @@ -3878,10 +3879,10 @@ declare namespace SP { /** Validates form values specified for the list item. Errors are returned through hasException and errorMessage properties of the ListItemFormUpdateValue objects */ validateUpdateListItem(formValues: SP.ListItemFormUpdateValue[], bNewDocumentUpdate: boolean): SP.ListItemFormUpdateValue[]; } - class ListItemCollection extends SP.ClientObjectCollection { - itemAt(index: number): SP.ListItem; - get_item(index: number): SP.ListItem; - getById(id: number | string): SP.ListItem; + class ListItemCollection extends SP.ClientObjectCollection> { + itemAt(index: number): SP.ListItem; + get_item(index: number): SP.ListItem; + getById(id: number | string): SP.ListItem; get_listItemCollectionPosition(): SP.ListItemCollectionPosition; } class ListItemCollectionPosition extends SP.ClientValueObject { From 13f2c9175e0eb8f98687dea92a9a437daba4c950 Mon Sep 17 00:00:00 2001 From: StefanSchoof Date: Fri, 9 Jun 2017 14:21:31 +0200 Subject: [PATCH 288/761] Bump required version to 2.3 --- types/sharepoint/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sharepoint/index.d.ts b/types/sharepoint/index.d.ts index 1d056448a4..dca11083a6 100644 --- a/types/sharepoint/index.d.ts +++ b/types/sharepoint/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/office/jj193034.aspx // Definitions by: Stanislav Vyshchepan , Andrey Markeev // Definitions: https:// github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1. +// TypeScript Version: 2.3 /// From e13ac9613f37db7a3ba35230ad66f80bffa9017a Mon Sep 17 00:00:00 2001 From: StefanSchoof Date: Fri, 9 Jun 2017 14:26:08 +0200 Subject: [PATCH 289/761] Add Test --- types/sharepoint/sharepoint-tests.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/sharepoint/sharepoint-tests.ts b/types/sharepoint/sharepoint-tests.ts index 20555d0cd5..63fd693fcc 100644 --- a/types/sharepoint/sharepoint-tests.ts +++ b/types/sharepoint/sharepoint-tests.ts @@ -370,11 +370,16 @@ function deleteFolder(resultpanel: HTMLElement) { } } +interface Announcements { + Title: string; + Body: string; +} + // List item tasks function readItems(resultpanel: HTMLElement) { const clientContext = SP.ClientContext.get_current(); const oWebsite = clientContext.get_web(); - const oList = oWebsite.get_lists().getByTitle("Announcements"); + const oList = oWebsite.get_lists().getByTitle("Announcements"); const camlQuery = new SP.CamlQuery(); camlQuery.set_viewXml( '' + From 887c45291d89b832ad02b6fbfba0da5da32248b2 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 9 Jun 2017 13:38:36 +0100 Subject: [PATCH 290/761] Adds fallback param to lookup function --- types/mime/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mime/index.d.ts b/types/mime/index.d.ts index 73a094492b..449875034b 100644 --- a/types/mime/index.d.ts +++ b/types/mime/index.d.ts @@ -6,7 +6,7 @@ // Imported from: https://github.com/soywiz/typescript-node-definitions/mime.d.ts -export declare function lookup(path: string): string; +export declare function lookup(path: string, fallback: string): string; export declare function extension(mime: string): string; export declare function load(filepath: string): void; export declare function define(mimes: Object): void; From 4a53abc938f80e180f3a64fdcafc33363bf1a0f4 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 9 Jun 2017 14:02:31 +0100 Subject: [PATCH 291/761] Adds tslint.json --- types/mime/tslint.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 types/mime/tslint.json diff --git a/types/mime/tslint.json b/types/mime/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mime/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f3ac12f02833a829de49996083df54d52af1a986 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 9 Jun 2017 14:02:55 +0100 Subject: [PATCH 292/761] Fixes linting errors --- types/mime/index.d.ts | 17 ++++++++--------- types/mime/mime-tests.ts | 8 ++++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/types/mime/index.d.ts b/types/mime/index.d.ts index 449875034b..b0fb1c8735 100644 --- a/types/mime/index.d.ts +++ b/types/mime/index.d.ts @@ -1,19 +1,18 @@ -// Type definitions for mime +// Type definitions for mime 1.3 // Project: https://github.com/broofa/node-mime // Definitions by: Jeff Goddard // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Imported from: https://github.com/soywiz/typescript-node-definitions/mime.d.ts +export function lookup(path: string, fallback: string): string; +export function extension(mime: string): string; +export function load(filepath: string): void; +export function define(mimes: { [key: string]: any }): void; -export declare function lookup(path: string, fallback: string): string; -export declare function extension(mime: string): string; -export declare function load(filepath: string): void; -export declare function define(mimes: Object): void; - -interface Charsets { +export interface Charsets { lookup(mime: string): string; } -export declare var charsets: Charsets; -export declare var default_type: string; +export const charsets: Charsets; +export const default_type: string; diff --git a/types/mime/mime-tests.ts b/types/mime/mime-tests.ts index abffa341f7..2eee9d9b12 100644 --- a/types/mime/mime-tests.ts +++ b/types/mime/mime-tests.ts @@ -1,10 +1,10 @@ - import * as mime from "mime"; -var str: string; -var obj: Object; +let str: string; +const obj: {} = {}; +const fallback: string = ''; -str = mime.lookup(str); +str = mime.lookup(str, fallback); str = mime.extension(str); mime.load(str); mime.define(obj); From c144d1caaf3c8f78e696a0121a9474735dee1e99 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 9 Jun 2017 14:55:57 +0100 Subject: [PATCH 293/761] Fixes declarations to namespace --- types/mime/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/mime/index.d.ts b/types/mime/index.d.ts index b0fb1c8735..71b4677ac6 100644 --- a/types/mime/index.d.ts +++ b/types/mime/index.d.ts @@ -5,6 +5,8 @@ // Imported from: https://github.com/soywiz/typescript-node-definitions/mime.d.ts +export as namespace mime; + export function lookup(path: string, fallback: string): string; export function extension(mime: string): string; export function load(filepath: string): void; From 4f8942e318d76352cf0e2e9a68e72ba4b21cee55 Mon Sep 17 00:00:00 2001 From: baywet Date: Fri, 9 Jun 2017 10:41:27 -0400 Subject: [PATCH 294/761] Adding missing properties on _spPageContextINfo --- types/sharepoint/index.d.ts | 58 ++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/types/sharepoint/index.d.ts b/types/sharepoint/index.d.ts index b4e4e4cb9d..be020bf4b5 100644 --- a/types/sharepoint/index.d.ts +++ b/types/sharepoint/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Microsoft SharePoint: 2013.1 // Project: https://msdn.microsoft.com/en-us/library/office/jj193034.aspx -// Definitions by: Stanislav Vyshchepan , Andrey Markeev +// Definitions by: Stanislav Vyshchepan , Andrey Markeev , Vincent Biret // Definitions: https:// github.com/DefinitelyTyped/DefinitelyTyped /// @@ -153,23 +153,79 @@ declare class JSRequest { declare class _spPageContextInfo { static alertsEnabled: boolean; // true static allowSilverlightPrompt: string; // "True" + static blockDownloadsExperienceEnabled: boolean; // true + static canUserCreateMicrosoftForm: boolean; // true + static cdnPrefix: string; // "static.sharepointonline.com/bld" static clientServerTimeDelta: number; // -182 + static CorrelationId: string; // "6161f99d-10e5-4000-ad30-1016270fe31d" static crossDomainPhotosEnabled: boolean; // true static currentCultureName: string; // "ru-RU" static currentLanguage: number; // 1049 static currentUICultureName: string; // "ru-RU" + static disableAppViews: boolean; // true + static disableFlows: boolean; // true + static env: string // "prod" + static farmLabel: string; // "US_4_Content" + static formDigestValue: string; // "0x5F3FE84E7EE9089C7D11DCDAFFB9E69CF8241E68B9EF071FA92CD419E878AC4F7C16E34696EFA667EFD0712FC1DF4945DDC0D09B5D23153A698A727AF076B5DE,07 Jun 2017 18:55:22 -0000" + static formDigestTimeoutSeconds: number; // 1800 + static groupColor: string; // "#d40ac7" + static groupHasHomepage: boolean; // true + static groupId: string; // + static guestsEnabled: boolean; // true + static hasManageWebPermissions: boolean; // true + static isAnonymousGuestUser: boolean; // true + static isAppWeb: boolean; // true + static isExternalGuestUser: boolean; // true + static isNoScriptEnabled: boolean; // true + static isSiteAdmin: boolean; //true + static isSPO: boolean; // true + static isTenantDevSite: boolean; // true + static isWebWelcomePage: boolean; // true static layoutsUrl: string; // "_layouts/15" + static listBaseTemplate: number; // 119 + static listId: string; // "{06ee6d96-f27f-4160-b6bb-c18f187b18a7}" + static listPermsMask: { High: number; Low: number; }; + static listTitle: string; // "Site Pages" + static listUrl: string; // "/sites/site/list" + static maximumFileSize: number; // 15360 + static openInClient: boolean; // true static pageListId: string; // "{06ee6d96-f27f-4160-b6bb-c18f187b18a7}" static pageItemId: number; + static pagePermsMask: { High: number; Low: number; }; static pagePersonalizationScope: string; // 1 + static PreviewFeaturesEnabled: boolean; // true + static preferUserTimeZone: boolean; // false + static ProfileUrl: string; // "https://tenant-my.sharepoint.com/person.aspx" + static PublishingFeatureOn: boolean; // true + static RecycleBinItemCount: number; // -1 + static serverRedirectedUrl: string; static serverRequestPath: string; // "/SPTypeScript/Lists/ConditionalFormattingTasksList/AllItems.aspx" + static serverTime: string; // "2017-06-07T18:55:22.3499459Z" static siteAbsoluteUrl: string; // "https:// gandjustas-7b20d3715e8ed4.sharepoint.com" + static siteClassification: string; // static siteClientTag: string; // "0$$15.0.4454.1021" + static siteColor: string; // "#d40ac7" + static siteId: string; // "{3e09a056-f68f-44a3-8e0f-ff2c123b82cb}" + static sitePagesEnabled: boolean; // true static siteServerRelativeUrl: string; // "/" + static siteSubscriptionId: string; // 4eedf5f3-f71f-4e73-82ee-e19081363c8c + static supportPoundStorePath: boolean; // true + static supportPercentStorePath: boolean; // true static systemUserKey: string; // "i:0h.f|membership|10033fff84e7cb2b@live.com" static tenantAppVersion: string; // "0" + static themeCacheToken: string; // "/sites/site::0:16.0.6525.1206" + static themedCssFolderUrl: string; + static themedImageFileNames: string; + static updateFormDigestPageLoaded: string; // "2017-06-07T18:55:25.821Z" + static userDisplayName: string; // "John Doe" + static userEmail: string; // "john.doe@fabrikam.onmicrosoft.com" static userId: number; // 12 + static userLoginName: string; // "john.doe@fabrikam.onmicrosoft.com" + static viewOnlyExperienceEnabled: boolean; // true + static viewId: string; // "{06ee6d96-f27f-4160-b6bb-c18f187b18a7}" static webAbsoluteUrl: string; // "https:// gandjustas-7b20d3715e8ed4.sharepoint.com/SPTypeScript" + static webDescription: string; // "Some description" + static webId: string; // "{06ee6d96-f27f-4160-b6bb-c18f187b18a7}" static webLanguage: number; // 1049 static webLogoUrl: string; // "/_layouts/15/images/siteIcon.png?rev=23" static webPermMasks: { High: number; Low: number; }; From dbb4004c484e0a6643bebb3a76e38288fb8844bd Mon Sep 17 00:00:00 2001 From: baywet Date: Fri, 9 Jun 2017 10:48:48 -0400 Subject: [PATCH 295/761] fixing linting issues on sharepoint types additions --- types/sharepoint/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/sharepoint/index.d.ts b/types/sharepoint/index.d.ts index be020bf4b5..f343a65d06 100644 --- a/types/sharepoint/index.d.ts +++ b/types/sharepoint/index.d.ts @@ -164,7 +164,7 @@ declare class _spPageContextInfo { static currentUICultureName: string; // "ru-RU" static disableAppViews: boolean; // true static disableFlows: boolean; // true - static env: string // "prod" + static env: string; // "prod" static farmLabel: string; // "US_4_Content" static formDigestValue: string; // "0x5F3FE84E7EE9089C7D11DCDAFFB9E69CF8241E68B9EF071FA92CD419E878AC4F7C16E34696EFA667EFD0712FC1DF4945DDC0D09B5D23153A698A727AF076B5DE,07 Jun 2017 18:55:22 -0000" static formDigestTimeoutSeconds: number; // 1800 @@ -177,7 +177,7 @@ declare class _spPageContextInfo { static isAppWeb: boolean; // true static isExternalGuestUser: boolean; // true static isNoScriptEnabled: boolean; // true - static isSiteAdmin: boolean; //true + static isSiteAdmin: boolean; // true static isSPO: boolean; // true static isTenantDevSite: boolean; // true static isWebWelcomePage: boolean; // true From 16170e275bfeb77d67a1c5756e4b520772e495c8 Mon Sep 17 00:00:00 2001 From: Emily Xiong Date: Fri, 9 Jun 2017 16:05:58 -0400 Subject: [PATCH 296/761] update ramda to include ascend, descend, sortWith functions --- types/ramda/index.d.ts | 23 +++++++++++++++++++++-- types/ramda/ramda-tests.ts | 8 ++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 9666c1b78f..3b4bcf098e 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -212,6 +212,12 @@ declare namespace R { */ applySpec(obj: any): (...args: any[]) => T; + /** + * Makes an ascending comparator function out of a function that returns a value that can be compared with < and >. + */ + ascend(fn: (obj: T) => any, a: T, b: T): number; + ascend(fn: (obj: T) => any): (a: T, b: T) => number; + /** * Makes a shallow clone of an object, setting or overriding the specified property with the given value. */ @@ -416,8 +422,15 @@ declare namespace R { * Returns the second argument if it is not null or undefined. If it is null or undefined, the * first (default) argument is returned. */ - defaultTo(a: T, b: U): T|U - defaultTo(a: T): (b: U) => T|U + defaultTo(a: T, b: U): T|U; + defaultTo(a: T): (b: U) => T|U; + + + /** + * Makes a descending comparator function out of a function that returns a value that can be compared with < and >. + */ + descend(fn: (obj: T) => any, a: T, b: T): number; + descend(fn: (obj: T) => any): (a: T, b: T) => number; /** * Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list. @@ -1406,6 +1419,12 @@ declare namespace R { sortBy(fn: (a: any) => Ord, list: T[]): T[]; sortBy(fn: (a: any) => Ord): (list: T[]) => T[]; + /** + * Sorts a list according to a list of comparators. + */ + sortWith(fns: ((a: T, b: T) => number)[], list: T[]): T[]; + sortWith(fns: ((a: T, b: T) => number)[]): (list: T[]) => T[]; + /** * Splits a string into an array of strings based on the given * separator. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index f9b272f8ca..755a5db06c 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -1517,6 +1517,14 @@ class Rectangle { R.sort(cmp, people); } +() => { + var people = [ + {name: 'Agy', age:33}, {name: 'Bib', age: 15}, {name: 'Cari', age: 16} + ]; + + R.sortWith([R.ascend(R.prop('age')), R.descend(R.prop('name'))], people); +} + () => { var add = function(a: number, b: number) { return a + b; }; var multiply = function(a: number, b: number) { return a * b; }; From d6d2799379f556296eec72ba396506e14bb8e5da Mon Sep 17 00:00:00 2001 From: Dvorscak Date: Fri, 9 Jun 2017 15:39:57 -0500 Subject: [PATCH 297/761] Make second parameter optional --- types/jquery/index.d.ts | 2 +- types/jquery/jquery-tests.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index 39d75e1eaf..ccfc0c0f38 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -682,7 +682,7 @@ interface JQueryCoordinates { /** * The interface used to specify the properties parameter in css() */ -type cssPropertySetter = (index: number, value: string) => string | number; +type cssPropertySetter = (index: number, value?: string) => string | number; interface JQueryCssProperties { [propertyName: string]: string | number | cssPropertySetter; } diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index 3a2d2a74bc..4b6fc4e0db 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -1062,6 +1062,9 @@ function test_css() { var color = $(this).css("background-color"); $("#result").html("That div is " + color + "."); }); + $('div.example').css('width', function (index) { + return index * 50; + }); $('div.example').css('width', function (index, style) { return style.length > 0 ? style : index * 50; }); From b6905e84ead153338cce390369842ec7ae761e74 Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Fri, 9 Jun 2017 13:42:46 -0700 Subject: [PATCH 298/761] Add Transitioner for react-navigation --- types/react-navigation/index.d.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index e343d092c6..58519400fe 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -625,3 +625,32 @@ export interface NavigationComponentProps { export const TabBarTop: React.ReactElement; export const TabBarBottom: React.ReactElement; + +interface TransitionerProps { + configureTransition: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps?: NavigationTransitionProps + ) => NavigationTransitionSpec + navigation: NavigationProp + onTransitionEnd?: () => void + onTransitionStart?: () => void + render: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps?: NavigationTransitionProps + ) => any + style?: ViewStyle +} + +interface TransitionerState { + layout: NavigationLayout + position: Animated.Value + progress: Animated.Value + scenes: Array +} + +export class Transitioner extends React.Component< + TransitionerProps, + TransitionerState +> { + +} From 0ed23c222c80638ad2b4d6bec09b4a91b5208a2b Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Fri, 9 Jun 2017 13:50:42 -0700 Subject: [PATCH 299/761] Update test for Transitioner --- .../react-navigation-tests.tsx | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 2493d92f84..c27533a6f3 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -7,6 +7,10 @@ import { TabNavigatorConfig, TabBarTop, TabBarBottom, + NavigationProp, + NavigationAction, + NavigationTransitionProps, + Transitioner } from 'react-navigation'; const Start = ( @@ -44,3 +48,28 @@ const tabNavigatorConfig: TabNavigatorConfig = { lazy: true, tabBarComponent: TabBarTop, } + +interface CustomTransitionerProps { + navigation: NavigationProp +} + +const configureTransition = ( + _transitionProps: NavigationTransitionProps, + _prevTransitionProps: NavigationTransitionProps + ) => { + return {} + } + +const renderTransitioner = (props: NavigationTransitionProps, prevProps: NavigationTransitionProps) => { + return +} + +const CustomTransitioner = (props: CustomTransitionerProps) => { + { }} + onTransitionEnd={() => { }} + /> +} From b15fc38fcb90be8a470890db28c30dad1f43d114 Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Fri, 9 Jun 2017 13:52:12 -0700 Subject: [PATCH 300/761] Update author list --- types/react-navigation/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 58519400fe..93a72b7f61 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for react-navigation 1.0 // Project: https://github.com/react-community/react-navigation -// Definitions by: Huhuanming , mhcgrq +// Definitions by: Huhuanming +// mhcgrq +// fangpenlin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as React from 'react' From 3b2f53cf6acd51b136f6c62e0ceef841b6a0adea Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 10 Jun 2017 00:05:33 +0200 Subject: [PATCH 301/761] hapi: fix incorrect connection.table() result type (#17070) --- types/hapi/index.d.ts | 19 ++++++++++++++++--- types/hapi/test/connection/table.ts | 2 ++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 9b03944e9a..efce9f3dc4 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -1256,13 +1256,14 @@ export interface RoutingTableEntry { /** * [See docs](https://hapijs.com/api/16.1.1#servertablehost) > return value + * For source [See source](https://github.com/hapijs/hapi/blob/v16.1.1/lib/route.js#L71) */ export interface Route { /** * the route config with defaults applied. * TODO check type of RouteConfiguration here is correct */ - settings: RouteConfiguration; + settings: RouteAdditionalConfigurationOptions; /** * the HTTP method in lower case. * TODO, check if it can contain 'head' or not. @@ -1270,6 +1271,18 @@ export interface Route { method: HTTP_METHODS_PARTIAL_lowercase; /** the route path. */ path: string; + + params: string[]; + + connection: ServerConnection; + + fingerprint: string; + + plugin?: any; + + public: RoutePublicInterface; + + server: Server; } /** @@ -1618,8 +1631,8 @@ export interface ServerConnection { /** Described in server.inject [See docs](https://hapijs.com/api/16.1.1#serverinjectoptions-callback) */ inject(options: string | InjectedRequestOptions, callback: (res: InjectedResponseObject) => void): void; inject(options: string | InjectedRequestOptions, ): Promise; - /** Described in server.table [See docs](https://hapijs.com/api/16.1.1#servertablehost) */ - table(host?: string): RoutingTableEntry; + /** Mentioned but not documented under server.connections [See docs](https://hapijs.com/api/16.1.1#serverconnections) */ + table(host?: string): Route[]; /** Described in server.table [See docs](https://hapijs.com/api/16.1.1#serverlookupid) */ lookup(id: string): RoutePublicInterface | null; /** Described in server.table [See docs](https://hapijs.com/api/16.1.1#servermatchmethod-path-host) */ diff --git a/types/hapi/test/connection/table.ts b/types/hapi/test/connection/table.ts index dee4741b07..24eaa28ddc 100644 --- a/types/hapi/test/connection/table.ts +++ b/types/hapi/test/connection/table.ts @@ -18,3 +18,5 @@ const table = connection.table(); } ] */ + +table.map(({method, path, settings: {description}}) => { }); From a6adbf4108231cb8735ccaf862154b978c740892 Mon Sep 17 00:00:00 2001 From: Clark Stevenson Date: Sat, 10 Jun 2017 00:54:32 +0100 Subject: [PATCH 302/761] Pixi.js v4.5 Update --- types/pixi.js/index.d.ts | 764 +++++++++++++++++++++------------ types/pixi.js/pixi.js-tests.ts | 5 +- 2 files changed, 501 insertions(+), 268 deletions(-) diff --git a/types/pixi.js/index.d.ts b/types/pixi.js/index.d.ts index 88ed75eced..bcf403d475 100644 --- a/types/pixi.js/index.d.ts +++ b/types/pixi.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Pixi.js 4.4 +// Type definitions for Pixi.js 4.5 // Project: https://github.com/pixijs/pixi.js/tree/dev // Definitions by: clark-stevenson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -20,8 +20,10 @@ declare namespace PIXI { const GC_MODES: typeof CONST.GC_MODES; const SHAPES: typeof CONST.SHAPES; const TEXT_GRADIENT: typeof CONST.TEXT_GRADIENT; + const UPDATE_PRIORITY: typeof CONST.UPDATE_PRIORITY; - function autoDetectRenderer(width: number, height: number, options?: PIXI.IRendererOptions, noWebGL?: boolean): PIXI.WebGLRenderer | PIXI.CanvasRenderer; + function autoDetectRenderer(width: number, height: number, options?: PIXI.RendererOptions, forceCanvas?: boolean): PIXI.WebGLRenderer | PIXI.CanvasRenderer; + function autoDetectRenderer(options?: PIXI.RendererOptions): PIXI.WebGLRenderer | PIXI.CanvasRenderer; const loader: PIXI.loaders.Loader; ////////////////////////////////////////////////////////////////////////////// @@ -46,6 +48,9 @@ declare namespace PIXI { clearBeforeRender: boolean, preserveDrawingBuffer: boolean, roundPixels: boolean + width: number, + height: number, + legacy: boolean, }; let TRANSFORM_MODE: number; let GC_MODE: number; @@ -53,6 +58,8 @@ declare namespace PIXI { let GC_MAX_CHECK_COUNT: number; let WRAP_MODE: number; let SCALE_MODE: number; + let PRECISION_VERTEX: string; + let PRECISION_FRAGMENT: string; let PRECISION: string; let UPLOADS_PER_FRAME: number; let CAN_UPLOAD_SAME_BUFFER: boolean; @@ -66,20 +73,19 @@ declare namespace PIXI { // accessibility class AccessibilityManager { constructor(renderer: CanvasRenderer | WebGLRenderer); - + activate(): void; + deactivate(): void; protected div: HTMLElement; protected pool: HTMLElement[]; protected renderId: number; debug: boolean; renderer: SystemRenderer; - protected children: IAccessibleTarget[]; + protected children: AccessibleTarget[]; protected isActive: boolean; - protected activate(): void; - protected deactivate(): void; protected updateAccessibleObjects(displayObject: DisplayObject): void; protected update(): void; - protected capHitArea(hitArea: IHitArea): void; + protected capHitArea(hitArea: HitArea): void; protected addChild(displayObject: DisplayObject): void; protected _onClick(e: interaction.InteractionEvent): void; protected _onFocus(e: interaction.InteractionEvent): void; @@ -89,7 +95,7 @@ declare namespace PIXI { destroy(): void; } - interface IAccessibleTarget { + interface AccessibleTarget { accessible: boolean; accessibleTitle: string | null; accessibleHint: string | null; @@ -132,6 +138,9 @@ declare namespace PIXI { SATURATION: number; COLOR: number; LUMINOSITY: number; + NORMAL_NPM: number; + ADD_NPM: number; + SCREEN_NPM: number; }; const DRAW_MODES: { POINTS: number; @@ -179,11 +188,18 @@ declare namespace PIXI { LINEAR_VERTICAL: number; LINEAR_HORIZONTAL: number; }; + const UPDATE_PRIORITY: { + INTERACTION: number; + HIGH: number; + NORMAL: number; + LOW: number; + UTILITY: number; + }; } // display - interface IApplicationOptions extends IRendererOptions { + interface ApplicationOptions extends RendererOptions { view?: HTMLCanvasElement; transparent?: boolean; autoResize?: boolean; @@ -195,10 +211,16 @@ declare namespace PIXI { context?: WebGLRenderingContext; preserveDrawingBuffer?: boolean; legacy?: boolean; + width?: number; + height?: number; + forceCanvas?: boolean; + sharedTicker?: boolean; + sharedLoader?: boolean; } class Application { - constructor(width?: number, height?: number, options?: IApplicationOptions, noWebGL?: boolean, useSharedTicker?: boolean); + constructor(options?: ApplicationOptions) + constructor(width?: number, height?: number, options?: ApplicationOptions, noWebGL?: boolean, sharedTicker?: boolean, sharedLoader?: boolean); private _ticker: ticker.Ticker; @@ -214,7 +236,7 @@ declare namespace PIXI { readonly view: HTMLCanvasElement; } - interface IDestroyOptions { + interface DestroyOptions { children?: boolean; texture?: boolean; baseTexture?: boolean; @@ -266,17 +288,18 @@ declare namespace PIXI { protected _renderWebGL(renderer: WebGLRenderer): void; protected _renderCanvas(renderer: CanvasRenderer): void; renderCanvas(renderer: CanvasRenderer): void; - destroy(options?: IDestroyOptions | boolean): void; + destroy(options?: DestroyOptions | boolean): void; - once(event: "added", fn: (displayObject: DisplayObject) => void, context?: any): this; - once(event: "removed", fn: (DisplayObject: DisplayObject) => void, context?: any): this; + once(event: "added" | "removed", fn: (displayObject: DisplayObject) => void, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types once(event: string, fn: Function, context?: any): this; - on(event: "added", fn: (displayObject: DisplayObject) => void, context?: any): this; - on(event: "removed", fn: (DisplayObject: DisplayObject) => void, context?: any): this; + on(event: "added" | "removed", fn: (displayObject: DisplayObject) => void, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types on(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types + off(event: "added" | "removed" | string, fn?: Function, context?: any): this; } - class DisplayObject extends utils.EventEmitter implements interaction.InteractiveTarget, accessibility.IAccessibleTarget { + class DisplayObject extends utils.EventEmitter implements interaction.InteractiveTarget, accessibility.AccessibleTarget { // begin extras.cacheAsBitmap protected _cacheAsBitmap: boolean; protected _cacheData: boolean; @@ -288,7 +311,7 @@ declare namespace PIXI { protected _calculateCachedBounds(): Rectangle; protected _getCachedLocalBounds(): Rectangle; protected _destroyCachedDisplayObject(): void; - protected _cacheAsBitmapDestroy(): void; + protected _cacheAsBitmapDestroy(options: boolean | any): void; // end extras.cacheAsBitmap // begin extras.getChildByName @@ -332,14 +355,15 @@ declare namespace PIXI { protected _boundsRect: Rectangle; protected _localBoundsRect: Rectangle; protected _mask: PIXI.Graphics | PIXI.Sprite; + protected readonly _destroyed: boolean; x: number; y: number; worldTransform: Matrix; localTransform: Matrix; - position: Point; - scale: Point; - pivot: Point; - skew: Point; + position: Point | ObservablePoint; + scale: Point | ObservablePoint; + pivot: Point | ObservablePoint; + skew: ObservablePoint; rotation: number; worldVisible: boolean; mask: PIXI.Graphics | PIXI.Sprite; @@ -350,55 +374,27 @@ declare namespace PIXI { protected _recursivePostUpdateTransform(): void; getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle; getLocalBounds(rect?: Rectangle): Rectangle; - toGlobal(position: Point, point?: Point, skipUpdate?: boolean): Point; - toLocal(position: Point, from?: DisplayObject, point?: Point, skipUpdate?: boolean): Point; + //creates and returns a new point + toGlobal(position: PointLike): Point; + //modifies the x and y of the passed point and returns it + toGlobal(position: PointLike, point?: T, skipUpdate?: boolean): T; + //creates and returns a new point + toLocal(position: PointLike, from?: DisplayObject): Point; + //modifies the x and y of the passed point and returns it + toLocal(position: PointLike, from?: DisplayObject, point?: T, skipUpdate?: boolean): T; renderWebGL(renderer: WebGLRenderer): void; renderCanvas(renderer: CanvasRenderer): void; setParent(container: Container): Container; setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): DisplayObject; destroy(): void; - on(event: string, fn: Function, context?: any): this; - once(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; - - /* - on(event: 'click', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mousedown', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mouseout', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mouseover', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mouseup', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mouseclick', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'mouseupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'rightclick', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'rightdown', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'rightup', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'rightupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'tap', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'touchend', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'touchendoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'touchmove', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - on(event: 'touchstart', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - - once(event: 'click', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mousedown', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mouseout', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mouseover', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mouseup', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mouseclick', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'mouseupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'rightclick', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'rightdown', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'rightup', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'rightupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'tap', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'touchend', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'touchendoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'touchmove', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - once(event: 'touchstart', fn: (event: interaction.InteractionEvent) => void, context?: any): this; - */ + on(event: interaction.InteractionEventTypes, fn: (event: interaction.InteractionEvent) => void, context?: any): this; + once(event: interaction.InteractionEventTypes, fn: (event: interaction.InteractionEvent) => void, context?: any): this; + removeListener(event: interaction.InteractionEventTypes, fn?: (event: interaction.InteractionEvent) => void, context?: any): this; + removeAllListeners(event: interaction.InteractionEventTypes): this; + off(event: interaction.InteractionEventTypes, fn?: (event: interaction.InteractionEvent) => void, context?: any): this; + addListener(event: interaction.InteractionEventTypes, fn: (event: interaction.InteractionEvent) => void, context?: any): this; } - class TransformBase { static IDENTITY: TransformBase; @@ -429,7 +425,6 @@ declare namespace PIXI { updateLocalTransform(): void; updateTransform(parentTransform: TransformBase): void; setFromMatrix(matrix: Matrix): void; - rotation: number; } class Transform extends TransformBase { @@ -453,9 +448,7 @@ declare namespace PIXI { rotation: number; } - // graphics - class GraphicsData { constructor( lineWidth: number, @@ -465,8 +458,7 @@ declare namespace PIXI { fillAlpha: number, fill: boolean, nativeLines: boolean, - shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon); - + shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle | any); lineWidth: number; nativeLines: boolean; lineColor: number; @@ -476,12 +468,12 @@ declare namespace PIXI { fillAlpha: number; protected _fillTint: number; fill: boolean; - protected holes: IShape[]; - shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon; + protected holes: Circle[] | Rectangle[] | Ellipse[] | Polygon[] | RoundedRectangle[] | any[]; + shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle | any; type?: number; clone(): GraphicsData; - addHole(shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon): void; - destroy(options?: IDestroyOptions | boolean): void; + addHole(shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle | any): void; + destroy(options?: DestroyOptions | boolean): void; } class Graphics extends Container { constructor(nativeLines?: boolean); @@ -499,7 +491,7 @@ declare namespace PIXI { isMask: boolean; boundsPadding: number; protected _localBounds: Bounds; - dirty: boolean; + dirty: number; fastRectDirty: number; clearDirty: number; boundsDirty: number; @@ -531,11 +523,11 @@ declare namespace PIXI { protected _renderSpriteRect(renderer: PIXI.SystemRenderer): void; containsPoint(point: Point): boolean; updateLocalBounds(): void; - drawShape(shape: IShape | Circle | Rectangle | Ellipse | Polygon | RoundedRectangle): GraphicsData; + drawShape(shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle | any): GraphicsData; generateCanvasTexture(scaleMode?: number, resolution?: number): Texture; protected closePath(): Graphics; protected addHole(): Graphics; - destroy(options?: IDestroyOptions | boolean): void; + destroy(options?: DestroyOptions | boolean): void; } class CanvasGraphicsRenderer { constructor(renderer: SystemRenderer); @@ -556,10 +548,10 @@ declare namespace PIXI { destroy(): void; render(graphics: Graphics): void; protected updateGraphics(graphics: PIXI.Graphics): void; - getWebGLData(webGL: WebGLRenderingContext, type: number): WebGLGraphicsData; + getWebGLData(webGL: WebGLRenderingContext, type: number, nativeLines: number): WebGLGraphicsData; } class WebGLGraphicsData { - constructor(gl: WebGLRenderingContext, shader: glCore.GLShader, attribsState: glCore.IAttribState); + constructor(gl: WebGLRenderingContext, shader: glCore.GLShader, attribsState: glCore.AttribState); gl: WebGLRenderingContext; color: number[]; @@ -572,6 +564,7 @@ declare namespace PIXI { glIndices: number[]; shader: glCore.GLShader; vao: glCore.VertexArrayObject; + nativeLines: boolean; reset(): void; upload(): void; @@ -592,7 +585,6 @@ declare namespace PIXI { const NE: number; const MIRROR_HORIZONTAL: number; const MIRROR_VERTICAL: number; - function uX(ind: number): number; function uY(ind: number): number; function vX(ind: number): number; @@ -635,32 +627,24 @@ declare namespace PIXI { static IDENTITY: Matrix; static TEMP_MATRIX: Matrix; } - class ObservablePoint { - constructor(cb: Function, scope?: any, x?: number, y?: number); - + class PointLike { x: number; y: number; + + set(x?: number, y?: number): void; + copy(point: PointLike): void; + } + class ObservablePoint extends PointLike { + constructor(cb: () => any, scope?: any, x?: number, y?: number); cb: () => any; scope: any; - - set(x?: number, y?: number): void; - copy(point: Point | ObservablePoint): void; } - class Point { + class Point extends PointLike { constructor(x?: number, y?: number); - - x: number; - y: number; - clone(): Point; - copy(p: Point): void; - equals(p: Point): boolean; - set(x?: number, y?: number): void; + equals(p: PointLike): boolean; } - - interface IShape { - } - interface IHitArea extends IShape { + interface HitArea { contains(x: number, y: number): boolean; } class Circle { @@ -690,7 +674,10 @@ declare namespace PIXI { } class Polygon { constructor(points: Point[] | number[]); + // Note - Rest Params cannot be combined with | + //tslint:disable-next-line:unified-signatures constructor(...points: Point[]); + //tslint:disable-next-line:unified-signatures constructor(...points: number[]); closed: boolean; @@ -736,10 +723,8 @@ declare namespace PIXI { clone(): RoundedRectangle; contains(x: number, y: number): boolean; } - // renderers - - interface IRendererOptions { + interface RendererOptions { view?: HTMLCanvasElement; transparent?: boolean; autoResize?: boolean; @@ -749,11 +734,16 @@ declare namespace PIXI { backgroundColor?: number; roundPixels?: boolean; context?: WebGLRenderingContext; + width?: number; + height?: number; + forceCanvas?: boolean; } class SystemRenderer extends utils.EventEmitter { - constructor(system: string, screenWidth?: number, screenHeight?: number, options?: IRendererOptions); + constructor(system: string, options?: RendererOptions); + constructor(system: string, screenWidth?: number, screenHeight?: number, options?: RendererOptions); type: number; + options: RendererOptions; screen: Rectangle; readonly width: number; readonly height: number; @@ -770,7 +760,6 @@ declare namespace PIXI { protected _backgroundColorString: string; protected _tempDisplayObjectParent: Container; protected _lastObjectRendered: DisplayObject; - backgroundColor: number; resize(screenWidth: number, screenHeight: number): void; generateTexture(displayObject: DisplayObject, scaleMode?: number, resolution?: number): RenderTexture; @@ -779,7 +768,8 @@ declare namespace PIXI { } class CanvasRenderer extends SystemRenderer { // plugintarget mixin start - static __plugins: Object; + static __plugins: any; + //tslint:disable-next-line:ban-types forbidden-types static registerPlugin(pluginName: string, ctor: Function): void; plugins: any; initPlugins(): void; @@ -789,7 +779,8 @@ declare namespace PIXI { // from InteractionManager interaction?: interaction.InteractionManager; - constructor(screenWidth?: number, screenHeight?: number, options?: IRendererOptions); + constructor(options?: RendererOptions); + constructor(screenWidth?: number, screenHeight?: number, options?: RendererOptions); rootContext: CanvasRenderingContext2D; rootResolution?: number; @@ -805,13 +796,12 @@ declare namespace PIXI { destroy(removeView?: boolean): void; clear(clearColor?: string): void; - on(event: "prerender", fn: () => void, context?: any): this; - on(event: "postrender", fn: () => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; - once(event: "prerender", fn: () => void, context?: any): this; - once(event: "postrender", fn: () => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + on(event: "prerender" | "postrender", fn: () => void, context?: any): this; + once(event: "prerender" | "postrender", fn: () => void, context?: any): this; + removeListener(event: "prerender" | "postrender", fn?: () => void, context?: any): this; + removeAllListeners(event: "prerender" | "postrender"): this; + off(event: "prerender" | "postrender", fn?: () => void, context?: any): this; + addListener(event: "prerender" | "postrender", fn: () => void, context?: any): this; } class CanvasMaskManager { constructor(renderer: CanvasRenderer); @@ -835,16 +825,25 @@ declare namespace PIXI { resize(width: number, height: number): void; destroy(): void; } - - interface IWebGLRendererOptions extends IRendererOptions { + interface WebGLRendererOptions { + view?: HTMLCanvasElement; + transparent?: boolean; + autoResize?: boolean; + antialias?: boolean; forceFXAA?: boolean; + resolution?: number; + clearBeforeRender?: boolean; + backgroundColor?: number; preserveDrawingBuffer?: boolean; + roundPixels?: boolean; legacy?: boolean; + width?: number; + height?: number; } - class WebGLRenderer extends SystemRenderer { // plugintarget mixin start - static __plugins: Object; + static __plugins: any; + //tslint:disable-next-line:ban-types forbidden-types static registerPlugin(pluginName: string, ctor: Function): void; plugins: any; initPlugins(): void; @@ -854,7 +853,8 @@ declare namespace PIXI { // from InteractionManager interaction: interaction.InteractionManager; - constructor(screenWidth?: number, screenHeight?: number, options?: IWebGLRendererOptions); + constructor(options?: WebGLRendererOptions); + constructor(screenWidth?: number, screenHeight?: number, options?: WebGLRendererOptions); protected _contextOptions: { alpha: boolean; @@ -875,6 +875,7 @@ declare namespace PIXI { boundTextures: Texture[]; filterManager: FilterManager; textureManager?: TextureManager; + textureGC?: TextureGarbageCollector; extract: extract.WebGLExtract; protected drawModes: any; protected _activeShader: Shader; @@ -900,15 +901,17 @@ declare namespace PIXI { handleContextRestored: () => void; destroy(removeView?: boolean): void; + on(event: "prerender" | "postrender", fn: () => void, context?: any): this; on(event: "context", fn: (gl: WebGLRenderingContext) => void, context?: any): this; - on(event: "prerender", fn: () => void, context?: any): this; - on(event: "postrender", fn: () => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; + once(event: "prerender" | "postrender", fn: () => void, context?: any): this; once(event: "context", fn: (gl: WebGLRenderingContext) => void, context?: any): this; - once(event: "prerender", fn: () => void, context?: any): this; - once(event: "postrender", fn: () => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + removeListener(event: "prerender" | "postrender", fn?: () => void, context?: any): this; + removeListener(event: "context", fn?: (gl: WebGLRenderingContext) => void, context?: any): this; + removeAllListeners(event: "prerender" | "postrender" | "context"): this; + off(event: "prerender" | "postrender", fn?: () => void, context?: any): this; + off(event: "context", fn?: (gl: WebGLRenderingContext) => void, context?: any): this; + addListener(event: "prerender" | "postrender", fn: () => void, context?: any): this; + addListener(event: "context", fn: (gl: WebGLRenderingContext) => void, context?: any): this; } class WebGLState { constructor(gl: WebGLRenderingContext); @@ -919,7 +922,7 @@ declare namespace PIXI { stack: number[]; gl: WebGLRenderingContext; maxAttribs: number; - attribState: glCore.IAttribState; + attribState: glCore.AttribState; nativeVaoExtension: any; push(): void; @@ -938,7 +941,7 @@ declare namespace PIXI { renderer: WebGLRenderer; gl: WebGLRenderingContext; - protected _managedTextures: WebGLTexture[]; + protected _managedTextures: Texture[]; bindTexture(): void; getTexture(): WebGLTexture; @@ -985,6 +988,11 @@ declare namespace PIXI { upload(): Quad; destroy(): void; } + interface FilterDataStackItem { + renderTarget: RenderTarget; + filter: any[]; + bounds: Rectangle; + } class RenderTarget { constructor(gl: WebGLRenderingContext, width: number, height: number, scaleMode: number, resolution: number, root?: boolean); @@ -1004,11 +1012,7 @@ declare namespace PIXI { stencilMaskStack: Graphics[]; filterData: { index: number, - stack: Array<{ - renderTarget: RenderTarget, - filter: any[]; - bounds: Rectangle - }> + stack: FilterDataStackItem[]; }; scaleMode: number; root: boolean; @@ -1029,19 +1033,19 @@ declare namespace PIXI { setBlendMode(blendMode: number): boolean; } + interface FilterManagerStackItem { + renderTarget: RenderTarget; + sourceFrame: Rectangle; + destinationFrame: Rectangle; + filters: Filter[]; + target: any; + resolution: number; + } class FilterManager extends WebGLManager { constructor(renderer: WebGLRenderer); - gl: WebGLRenderingContext; quad: Quad; - stack: Array<{ - renderTarget: RenderTarget; - sourceFrame: Rectangle; - destinationFrame: Rectangle; - filters: Filter[]; - target: any; - resolution: number; - }>; + stack: FilterManagerStackItem[]; stackIndex: number; shaderCache: any; filterData: any; @@ -1098,7 +1102,7 @@ declare namespace PIXI { onContextChange(): void; destroy(): void; } - interface IUniformData { + interface UniformData { type: string; value: any; @@ -1106,19 +1110,20 @@ declare namespace PIXI { name?: string; } class Filter { - constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: { [name: string]: IUniformData }); + constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: { [name: string]: UniformData }); vertextSrc?: string; fragmentSrc: string; blendMode: number; - protected uniformData: { [name: string]: IUniformData }; + protected uniformData: { [name: string]: UniformData }; uniforms: { [name: string]: any } | any; glShaders: any; glShaderKey?: number; padding: number; resolution: number; enabled: boolean; - apply(filterManager: FilterManager, input: RenderTarget, output: RenderTarget, clear?: boolean): void; + autoFit: boolean; + apply(filterManager: FilterManager, input: RenderTarget, output: RenderTarget, clear?: boolean, currentState?: any): void; static defaultVertexSrc: string; static defaultFragmentSrc: string; @@ -1167,7 +1172,7 @@ declare namespace PIXI { protected _renderCanvas(renderer: CanvasRenderer): void; getLocalBounds(): Rectangle; containsPoint(point: Point): boolean; - destroy(options?: IDestroyOptions | boolean): void; + destroy(options?: DestroyOptions | boolean): void; static from(source: number | string | BaseTexture | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): Sprite; static fromFrame(frameId: string): Sprite; @@ -1222,7 +1227,7 @@ declare namespace PIXI { let cacheStepsPerColorChannel: number; let convertTintToImage: boolean; let canUseMultiply: boolean; - let tintMethod: Function; + let tintMethod: number; } // text @@ -1318,12 +1323,35 @@ declare namespace PIXI { wordWrap: boolean; protected _wordWrapWidth: number; wordWrapWidth: number; + toFontString(): string; } + class TextMetrics { + protected _canvas: HTMLCanvasElement; + protected _context: CanvasRenderingContext2D; + protected _fonts: FontMetrics; + text: string; + style: TextStyle; + width: number; + height: number; + lines: number[]; + lineWidgets: number[]; + lineHeight: number; + maxLineWidth: number; + fontProperties: any; + + constructor(text: string, style: TextStyle, width: number, height: number, lines: number[], lineWidths: number[], lineHeight: number, maxLineWidth: number, fontProperties: any); + + static measureText(text: string, style: TextStyle, wordWrap?: boolean, canvas?: HTMLCanvasElement): TextMetrics; + static wordWrap(text: string, style: TextStyle, canvas?: HTMLCanvasElement): string; + static measureFont(font: string): FontMetrics; + } + interface FontMetrics { + ascent: number; + descent: number; + fontSize: number; + } class Text extends Sprite { - static getFontStyle(style: TextStyleOptions): string; - static calculateFontProperties(style: string): any; - constructor(text?: string, style?: TextStyleOptions, canvas?: HTMLCanvasElement); canvas: HTMLCanvasElement; @@ -1331,14 +1359,11 @@ declare namespace PIXI { resolution: number; protected _text: string; protected _style: TextStyle; + //tslint:disable-next-line:ban-types forbidden-types protected _styleListener: Function; protected _font: string; protected localStyleID: number; - static fontPropertiesCache: any; - static fontPropertiesCanvas: HTMLCanvasElement; - static fontPropertiesContext: CanvasRenderingContext2D; - width: number; height: number; style: TextStyle; @@ -1349,17 +1374,14 @@ declare namespace PIXI { protected updateTexture(): void; renderWebGL(renderer: WebGLRenderer): void; protected _renderCanvas(renderer: CanvasRenderer): void; - protected wordWrap(text: string): string; getLocalBounds(rect?: Rectangle): Rectangle; protected _calculateBounds(): void; protected _onStyleChange: () => void; protected _generateFillStyle(style: TextStyle, lines: string[]): string | number | CanvasGradient; - destroy(options?: IDestroyOptions | boolean): void; + destroy(options?: DestroyOptions | boolean): void; dirty: boolean; } - // textures - class BaseRenderTexture extends BaseTexture { constructor(width?: number, height?: number, scaleMode?: number, resolution?: number); @@ -1377,11 +1399,12 @@ declare namespace PIXI { resize(width: number, height: number): void; destroy(): void; - once(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; on(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + once(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; + removeListener(event: "update", fn?: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; + removeAllListeners(event: "update"): this; + off(event: "update", fn?: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; + addListener(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): this; } class BaseTexture extends utils.EventEmitter { static from(source: string | HTMLImageElement | HTMLCanvasElement, scaleMode?: number, sourceScale?: number): BaseTexture; @@ -1411,6 +1434,9 @@ declare namespace PIXI { protected _glTextures: any; protected _enabled: number; protected _id?: number; + protected _virtualBoundId: number; + protected readonly _destroyed: boolean; + textureCacheIds: string[]; update(): void; protected _updateDimensions(): void; @@ -1426,19 +1452,16 @@ declare namespace PIXI { updateSourceImage(newSrc: string): void; static fromImage(imageUrl: string, crossorigin?: boolean, scaleMode?: number, sourceScale?: number): BaseTexture; - static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): BaseTexture; + static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number, origin?: string): BaseTexture; + static addToCache(baseTexture: BaseTexture, id: string): void; + static removeFromCache(baseTexture: string | BaseTexture): BaseTexture; - on(event: "update", fn: (baseTexture: BaseTexture) => void, context?: any): this; - on(event: "loaded", fn: (baseTexture: BaseTexture) => void, context?: any): this; - on(event: "error", fn: (baseTexture: BaseTexture) => void, context?: any): this; - on(event: "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; - once(event: "update", fn: (baseTexture: BaseTexture) => void, context?: any): this; - once(event: "loaded", fn: (baseTexture: BaseTexture) => void, context?: any): this; - once(event: "error", fn: (baseTexture: BaseTexture) => void, context?: any): this; - once(event: "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + on(event: "update" | "loaded" | "error" | "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): this; + once(event: "update" | "loaded" | "error" | "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): this; + removeListener(event: "update" | "loaded" | "error" | "dispose", fn?: (baseTexture: BaseTexture) => void, context?: any): this; + removeAllListeners(event: "update" | "loaded" | "error" | "dispose"): this; + off(event: "update" | "loaded" | "error" | "dispose", fn?: (baseTexture: BaseTexture) => void, context?: any): this; + addListener(event: "update" | "loaded" | "error" | "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): this; } class RenderTexture extends Texture { constructor(baseRenderTexture: BaseRenderTexture, frame?: Rectangle); @@ -1451,8 +1474,6 @@ declare namespace PIXI { static create(width?: number, height?: number, scaleMode?: number, resolution?: number): RenderTexture; } class Texture extends utils.EventEmitter { - static from(source: number | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | BaseTexture): Texture; - constructor(baseTexture: BaseTexture, frame?: Rectangle, orig?: Rectangle, trim?: Rectangle, rotate?: number); noFrame: boolean; @@ -1465,6 +1486,7 @@ declare namespace PIXI { orig: Rectangle; protected _updateID: number; transform: any; + textureCacheIds: string[]; update(): void; protected onBaseTextureLoaded(baseTexture: BaseTexture): void; @@ -1475,12 +1497,17 @@ declare namespace PIXI { static fromImage(imageUrl: string, crossOrigin?: boolean, scaleMode?: number, sourceScale?: number): Texture; static fromFrame(frameId: string): Texture; - static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): Texture; + static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number, origin?: string): Texture; static fromVideo(video: HTMLVideoElement | string, scaleMode?: number): Texture; static fromVideoUrl(videoUrl: string, scaleMode?: number): Texture; + static from(source: number | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | BaseTexture): Texture; static fromLoader(source: HTMLImageElement | HTMLCanvasElement, imageUrl: string, name?: string): Texture; + static addToCache(texture: Texture, id: string): void; + static removeFromCache(texture: string | Texture): Texture; + + // depreciation static addTextureToCache(texture: Texture, id: string): void; - static removeTextureFromCache(id: string): Texture | undefined; + static removeTextureFromCache(id: string): Texture; frame: Rectangle; protected _rotate: boolean | 0; @@ -1489,12 +1516,14 @@ declare namespace PIXI { height: number; static EMPTY: Texture; + static WHITE: Texture; on(event: "update", fn: (texture: Texture) => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; once(event: "update", fn: (texture: Texture) => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; - off(event: string, fn: Function, context?: any): this; + removeListener(event: "update", fn?: (texture: Texture) => void, context?: any): this; + removeAllListeners(event: "update"): this; + off(event: "update", fn?: (texture: Texture) => void, context?: any): this; + addListener(event: "update", fn: (texture: Texture) => void, context?: any): this; } class TextureUvs { x0: number; @@ -1560,16 +1589,26 @@ declare namespace PIXI { namespace ticker { const shared: Ticker; + class TickerListener { + constructor(fn: (deltaTime: number) => void, context?: any, priority?: number, once?: boolean); + fn: (deltaTime: number) => void; + context: any; + priority: number; + once: boolean; + next: TickerListener; + previous: TickerListener; + protected _destroyed: boolean; + match(fn: (deltaTime: number) => void, context?: any): boolean; + emit(deltaTime: number): TickerListener; + connect(previous: TickerListener): void; + destroy(hard?: boolean): void; + } class Ticker { - protected _tick(time: number): void; - protected _emitter: utils.EventEmitter; + protected _tick: (time: number) => void; + protected _head: TickerListener; protected _requestId: number | null; protected _maxElapsedMS: number; - protected _requestIfNeeded(): void; - protected _cancelIfNeeded(): void; - protected _startIfPossible(): void; - autoStart: boolean; deltaTime: number; elapsedMS: number; @@ -1577,15 +1616,22 @@ declare namespace PIXI { speed: number; started: boolean; - FPS: number; + protected _requestIfNeeded(): void; + protected _cancelIfNeeded(): void; + protected _startIfPossible(): void; + + add(fn: (deltaTime: number) => void, context?: any, priority?: number): Ticker; + addOnce(fn: (deltaTime: number) => void, context?: any, priority?: number): Ticker; + //tslint:disable-next-line:ban-types forbidden-types + remove(fn: Function, context?: any, priority?: number): Ticker; + protected _addListener(listener: TickerListener): Ticker; + readonly FPS: number; minFPS: number; - add(fn: (deltaTime: number) => void, context?: any): Ticker; - addOnce(fn: (deltaTime: number) => void, context?: any): Ticker; - remove(fn: (deltaTime: number) => void, context?: any): Ticker; start(): void; stop(): void; - update(): void; + destroy(): void; + update(currentTime?: number): void; } } @@ -1629,7 +1675,7 @@ declare namespace PIXI { ////////////////////////////////////////////////////////////////////////////// namespace extras { - interface IBitmapTextStyle { + interface BitmapTextStyle { font?: string | { name?: string; size?: number; @@ -1640,7 +1686,7 @@ declare namespace PIXI { class BitmapText extends Container { static registerFont(xml: XMLDocument, texture: Texture): any; - constructor(text: string, style?: IBitmapTextStyle); + constructor(text: string, style?: BitmapTextStyle); protected _textWidth: number; protected _textHeight: number; @@ -1656,7 +1702,9 @@ declare namespace PIXI { size?: number; }; protected _text: string; + protected _maxWidth: number; maxWidth: number; + protected _maxLineHeight: number; maxLineHeight: number; protected _anchor: ObservablePoint; dirty: boolean; @@ -1672,17 +1720,22 @@ declare namespace PIXI { static fonts: any; } + interface AnimatedSpriteTextureTimeObject { + texture: Texture; + time?: number; + } class AnimatedSprite extends Sprite { - constructor(textures: Texture[] | Array<{ texture: Texture, time?: number }>, autoUpdate?: boolean); + constructor(textures: Texture[] | AnimatedSpriteTextureTimeObject[], autoUpdate?: boolean); protected _autoUpdate: boolean; protected _textures: Texture[]; protected _durations: number[]; - textures: Texture[] | Array<{ texture: Texture, time?: number }>; + textures: Texture[] | AnimatedSpriteTextureTimeObject[]; animationSpeed: number; loop: boolean; onComplete: () => void; onFrameChange: (currentFrame: number) => void; + onLoop: () => void; protected _currentTime: number; playing: boolean; totalFrames: number; @@ -1692,7 +1745,7 @@ declare namespace PIXI { gotoAndStop(frameNumber: number): void; gotoAndPlay(frameNumber: number): void; protected update(deltaTime: number): void; - destroy(): void; + destroy(options?: DestroyOptions | boolean): void; static fromFrames(frame: string[]): AnimatedSprite; static fromImages(images: string[]): AnimatedSprite; @@ -1711,7 +1764,7 @@ declare namespace PIXI { texture: Texture; - update(forceUpdate?: boolean): void; + update(forceUpdate?: boolean): boolean; } class TilingSprite extends Sprite { constructor(texture: Texture, width?: number, height?: number); @@ -1727,13 +1780,14 @@ declare namespace PIXI { tileScale: Point | ObservablePoint; tilePosition: Point | ObservablePoint; + multiplyUvs(uvs: Float32Array, out: Float32Array): Float32Array; protected _onTextureUpdate(): void; protected _renderWebGL(renderer: WebGLRenderer): void; protected _renderCanvas(renderer: CanvasRenderer): void; protected _calculateBounds(): void; getLocalBounds(rect?: Rectangle): Rectangle; containsPoint(point: Point): boolean; - destroy(): void; + destroy(options?: DestroyOptions | boolean): void; static from(source: number | string | BaseTexture | HTMLCanvasElement | HTMLVideoElement, width?: number, height?: number): TilingSprite; static fromFrame(frameId: string, width?: number, height?: number): TilingSprite; @@ -1802,6 +1856,7 @@ declare namespace PIXI { protected _colorMatrix(matrix: number[]): void; matrix: number[]; + alpha: number; brightness(b: number, multiply?: boolean): void; greyscale(scale: number, multiply?: boolean): void; @@ -1837,7 +1892,9 @@ declare namespace PIXI { // pixi-filters.d.ts todo // https://github.com/pixijs/pixi-filters/ class NoiseFilter extends Filter { + constructor(noise?: number, seed?: number); noise: number; + seed: number; } } @@ -1876,11 +1933,33 @@ declare namespace PIXI { class InteractionData { global: Point; target: DisplayObject; - originalEvent: Event; - identifier?: number; - + originalEvent: MouseEvent | TouchEvent | PointerEvent; + identifier: number; + isPrimary: boolean; + button: number; + buttons: number; + width: number; + height: number; + tiltX: number; + tiltY: number; + pointerType: string; + pressure: number; + rotationAngle: number; + twist: number; + tangentialPressure: number; + readonly pointerID: number; + protected _copyEvent(event: Touch | MouseEvent | PointerEvent): void; + protected _reset(): void; getLocalPosition(displayObject: DisplayObject, point?: Point, globalPos?: Point): Point; } + type InteractionPointerEvents = "pointerdown" | "pointercancel" | "pointerup" | + "pointertap" | "pointerupoutside" | "pointermove" | "pointerover" | "pointerout"; + type InteractionTouchEvents = "touchstart" | "touchcancel" | "touchend" | + "touchendoutside" | "touchmove" | "tap"; + type InteractionMouseEvents = "rightdown" | "mousedown" | "rightup" | "mouseup" | + "rightclick" | "click" | "rightupoutside" | "mouseupoutside" | "mousemove" | + "mouseover" | "mouseout" | "mouseover"; + type InteractionEventTypes = InteractionPointerEvents | InteractionTouchEvents | InteractionMouseEvents; interface InteractionManagerOptions { autoPreventDefault?: boolean; interactionFrequency?: number; @@ -1920,6 +1999,7 @@ declare namespace PIXI { cursor: string; protected _tempPoint: Point; resolution: number; + hitTest(globalPoint: Point, root?: Container): DisplayObject; protected setTargetElement(element: HTMLCanvasElement, resolution?: number): void; protected addEvents(): void; protected removeEvents(): void; @@ -1927,15 +2007,22 @@ declare namespace PIXI { setCursorMode(mode: string): void; protected dispatchEvent(displayObject: Container | Sprite | extras.TilingSprite, eventString: string, eventData: any): void; mapPositionToPoint(point: Point, x: number, y: number): void; + //tslint:disable-next-line:ban-types forbidden-types protected processInteractive( interactionEvent: InteractionEvent, displayObject: PIXI.Container | PIXI.Sprite | PIXI.extras.TilingSprite, func?: Function, hitTest?: boolean, - interactive?: boolean): boolean; - protected onPointerComplete(originalEvent: PointerEvent, cancelled: boolean, func: Function): void; + interactive?: boolean + ): boolean; + //tslint:disable-next-line:ban-types forbidden-types + protected onPointerComplete( + originalEvent: PointerEvent, + cancelled: boolean, + func: Function + ): void; protected getInteractionDataForPointerId(pointerId: number): InteractionData; - protected releaseInteractionDataForPointerId(pointerId: number): void; + protected releaseInteractionDataForPointerId(event: PointerEvent): void; protected configureInteractionEventForDOMEvent(interactionEvent: InteractionEvent, pointerEvent: PointerEvent, interactionData: InteractionData): InteractionEvent; protected normalizeToPointerData(event: TouchEvent | MouseEvent | PointerEvent): PointerEvent[]; destroy(): void; @@ -1955,8 +2042,10 @@ declare namespace PIXI { // 2.0.6 class MiniSignalBinding { + //tslint:disable-next-line:ban-types forbidden-types constructor(fn: Function, once?: boolean, thisArg?: any); + //tslint:disable-next-line:ban-types forbidden-types protected _fn: Function; protected _once: boolean; protected _thisArg: any; @@ -1978,14 +2067,16 @@ declare namespace PIXI { has(node: MiniSignalBinding): boolean; dispatch(): boolean; + //tslint:disable-next-line:ban-types forbidden-types add(fn: Function, thisArg?: any): any; + //tslint:disable-next-line:ban-types forbidden-types once(fn: Function, thisArg?: any): any; detach(node: MiniSignalBinding): MiniSignal; detachAll(): MiniSignal; } namespace loaders { - interface ILoaderOptions { + interface LoaderOptions { crossOrigin?: boolean | string; loadType?: number; xhrType?: string; @@ -1993,7 +2084,7 @@ declare namespace PIXI { loadElement?: HTMLImageElement | HTMLAudioElement | HTMLVideoElement; skipSource?: boolean; } - interface IResourceDictionary { + interface ResourceDictionary { [index: string]: PIXI.loaders.Resource; } @@ -2001,6 +2092,7 @@ declare namespace PIXI { // However, for depreciation reasons, it remains. class Loader extends utils.EventEmitter { // pixi overrides here + //tslint:disable-next-line:ban-types forbidden-types static addPixiMiddleware(fn: Function): void; // below this line is the original non-pixi loader @@ -2016,13 +2108,16 @@ declare namespace PIXI { loading: boolean; defaultQueryString: string; + //tslint:disable-next-line:ban-types forbidden-types protected _beforeMiddleware: Function[]; + //tslint:disable-next-line:ban-types forbidden-types protected _afterMiddleware: Function[]; protected _resourcesParsing: Resource[]; + //tslint:disable-next-line:ban-types forbidden-types protected _boundLoadResource: (r: Resource, d: Function) => void; protected _queue: any; - resources: IResourceDictionary; + resources: ResourceDictionary; onProgress: MiniSignal; onError: MiniSignal; @@ -2031,44 +2126,49 @@ declare namespace PIXI { onComplete: MiniSignal; add(...params: any[]): this; - add(name: string, url: string, options?: ILoaderOptions, cb?: Function): this; - add(url: string, options?: ILoaderOptions, cb?: Function): this; - add(obj: any | any[], options?: ILoaderOptions, cb?: Function): this; + //tslint:disable-next-line:ban-types forbidden-types + add(name: string, url: string, options?: LoaderOptions, cb?: Function): this; + //tslint:disable-next-line:ban-types forbidden-types + add(obj: string | any | any[], options?: LoaderOptions, cb?: Function): this; + //tslint:disable-next-line:ban-types forbidden-types pre(fn: Function): this; + //tslint:disable-next-line:ban-types forbidden-types use(fn: Function): this; reset(): this; + //tslint:disable-next-line:ban-types forbidden-types load(cb?: Function): this; protected _prepareUrl(url: string): string; + //tslint:disable-next-line:ban-types forbidden-types protected _loadResource(resource: Resource, dequeue: Function): void; protected _onComplete(): void; protected _onLoad(resource: Resource): void; + destroy(): void; + // depreciation on(event: "complete", fn: (loader: loaders.Loader, object: any) => void, context?: any): this; on(event: "error", fn: (error: Error, loader: loaders.Loader, resource: Resource) => void, context?: any): this; - on(event: "load", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; - on(event: "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; + on(event: "load" | "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; on(event: "start", fn: (loader: loaders.Loader) => void, context?: any): this; - on(event: string, fn: Function, context?: any): this; once(event: "complete", fn: (loader: loaders.Loader, object: any) => void, context?: any): this; once(event: "error", fn: (error: Error, loader: loaders.Loader, resource: Resource) => void, context?: any): this; - once(event: "load", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; - once(event: "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; + once(event: "load" | "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): this; once(event: "start", fn: (loader: loaders.Loader) => void, context?: any): this; - once(event: string, fn: Function, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types + off(event: "complete" | "error" | "load" | "progress" | "start" | string, fn?: Function, context?: any): this; } - interface ITextureDictionary { + interface TextureDictionary { [index: string]: PIXI.Texture; } class Resource { static setExtensionLoadType(extname: string, loadType: number): void; static setExtensionXhrType(extname: string, xhrType: string): void; - constructor(name: string, url: string | string[], options?: ILoaderOptions); + constructor(name: string, url: string | string[], options?: LoaderOptions); protected _flags: number; @@ -2086,14 +2186,23 @@ declare namespace PIXI { type: number; progressChunk: number; + //tslint:disable-next-line:ban-types forbidden-types protected _dequeue: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _onLoadBinding: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundComplete: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundOnError: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundOnProgress: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundXhrOnError: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundXhrOnAbort: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundXhrOnLoad: Function; + //tslint:disable-next-line:ban-types forbidden-types protected _boundXdrOnTimeout: Function; onStart: MiniSignal; @@ -2106,6 +2215,7 @@ declare namespace PIXI { isLoading: boolean; complete(): void; abort(message?: string): void; + //tslint:disable-next-line:ban-types forbidden-types load(cb?: Function): void; protected _hasFlag(flag: number): boolean; @@ -2165,7 +2275,7 @@ declare namespace PIXI { texture: Texture; spineAtlas: any; spineData: any; - textures?: ITextureDictionary; + textures?: TextureDictionary; } } @@ -2192,6 +2302,11 @@ declare namespace PIXI { texture: Texture; tintRgb: Float32Array; protected _glDatas: { [n: number]: any; }; + protected _uvTransform: extras.TextureTransform; + uploadUvTransform: boolean; + multiplyUvs(): void; + refresh(forceUpdate?: boolean): void; + protected _refresh(): void; protected _renderWebGL(renderer: WebGLRenderer): void; protected _renderCanvas(renderer: CanvasRenderer): void; protected _onTextureUpdate(): void; @@ -2262,6 +2377,7 @@ declare namespace PIXI { updateHorizontalVertices(): void; updateVerticalVertices(): void; protected drawSegment(context: CanvasRenderingContext2D | WebGLRenderingContext, textureSource: any, w: number, h: number, x1: number, y1: number, x2: number, y2: number): void; + protected _refresh(): void; } class Rope extends Mesh { @@ -2269,20 +2385,17 @@ declare namespace PIXI { points: Point[]; colors: number[]; - protected _ready: boolean; - refresh(): void; + autoUpdate: boolean; + protected _refresh(): void; - protected _onTextureUpdate(): void; - updateTransform(): void; + refreshVertices(): void; } } - ////////////////////////////////////////////////////////////////////////////// /////////////////////////////PARTICLES//////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// - namespace particles { - interface IParticleContainerProperties { + interface ParticleContainerProperties { scale?: boolean; position?: boolean; rotation?: boolean; @@ -2290,8 +2403,10 @@ declare namespace PIXI { alpha?: boolean; } class ParticleContainer extends Container { - constructor(size?: number, properties?: IParticleContainerProperties, batchSize?: number); - + constructor(size?: number, properties?: ParticleContainerProperties, batchSize?: number); + protected _tint: number; + protected tintRgb: number | any[]; + tint: number; protected _properties: boolean[]; protected _maxSize: number; protected _batchSize: number; @@ -2302,10 +2417,10 @@ declare namespace PIXI { roundPixels: boolean; baseTexture: BaseTexture; - setProperties(properties: IParticleContainerProperties): void; + setProperties(properties: ParticleContainerProperties): void; protected onChildrenChange: (smallestChildIndex?: number) => void; - destroy(options?: IDestroyOptions | boolean): void; + destroy(options?: DestroyOptions | boolean): void; } class ParticleBuffer { constructor(gl: WebGLRenderingContext, properties: any, dynamicPropertyFlags: any[], size: number); @@ -2325,7 +2440,7 @@ declare namespace PIXI { destroy(): void; } - interface IParticleRendererProperty { + interface ParticleRendererProperty { attribute: number; size: number; uploadFunction(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; @@ -2336,7 +2451,7 @@ declare namespace PIXI { shader: glCore.GLShader; indexBuffer: WebGLBuffer; - properties: IParticleRendererProperty[]; + properties: ParticleRendererProperty[]; protected tempMatrix: Matrix; start(): void; @@ -2350,13 +2465,10 @@ declare namespace PIXI { indices: Uint16Array; } - interface IParticleShader extends glCore.GLShader { } } - ////////////////////////////////////////////////////////////////////////////// ////////////////////////////PREPARE/////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// - namespace prepare { type AddHook = (item: any, queue: any[]) => boolean; type UploadHook = (prepare: UploadHookSource, item: any) => boolean; @@ -2369,14 +2481,20 @@ declare namespace PIXI { protected queue: any[]; protected addHooks: AddHook[]; protected uploadHooks: Array>; + //tslint:disable-next-line:ban-types forbidden-types protected completes: Function[]; protected ticking: boolean; protected delayedTick: () => void; + //tslint:disable-next-line:ban-types forbidden-types upload(item: Function | DisplayObject | Container | BaseTexture | Texture | Graphics | Text | any, done?: () => void): void; protected tick(): void; protected prepareItems(): void; - register(addHook?: AddHook, uploadHook?: UploadHook): this; + registerFindHook(addHook: AddHook): this; + registerUploadHook(uploadHook: UploadHook): this; + protected findMultipleBaseTextures(item: PIXI.DisplayObject, queue: any[]): boolean; + protected findBaseTexture(item: PIXI.DisplayObject, queue: any[]): boolean; + protected findTexture(item: PIXI.DisplayObject, queue: any[]): boolean; add(item: PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text | any): this; destroy(): void; } @@ -2410,7 +2528,7 @@ declare namespace PIXI { // sharedArrayBuffer as a type is not available yet. // need to fully define what an `Attrib` is. namespace glCore { - interface IContextOptions { + interface ContextOptions { /** * Boolean that indicates if the canvas contains an alpha buffer. */ @@ -2440,8 +2558,8 @@ declare namespace PIXI { */ failIfMajorPerformanceCaveat?: boolean; } - function createContext(view: HTMLCanvasElement, options?: IContextOptions): WebGLRenderingContext; - function setVertexAttribArrays(gl: WebGLRenderingContext, attribs: IAttrib[], state?: WebGLState): WebGLRenderingContext | undefined; + function createContext(view: HTMLCanvasElement, options?: ContextOptions): WebGLRenderingContext; + function setVertexAttribArrays(gl: WebGLRenderingContext, attribs: Attrib[], state?: WebGLState): WebGLRenderingContext | undefined; class GLBuffer { constructor(gl: WebGLRenderingContext, type: number, data: ArrayBuffer | ArrayBufferView | any, drawType: number); @@ -2483,7 +2601,7 @@ declare namespace PIXI { static createFloat32(gl: WebGLRenderingContext, width: number, height: number, data: ArrayBuffer | ArrayBufferView | any): GLFramebuffer; } class GLShader { - constructor(gl: WebGLRenderingContext, vertexSrc: string | string[], fragmentSrc: string | string[], precision: string, attributeLocations: { [key: string]: number }); + constructor(gl: WebGLRenderingContext, vertexSrc: string | string[], fragmentSrc: string | string[], precision?: string, attributeLocations?: { [key: string]: number }); gl: WebGLRenderingContext; program?: WebGLProgram | null; @@ -2507,7 +2625,7 @@ declare namespace PIXI { type: number; upload(source: HTMLImageElement | ImageData | HTMLVideoElement | HTMLCanvasElement): void; - uploadData(data: number, width: number, height: number): void; + uploadData(data: ArrayBuffer | ArrayBufferView, width: number, height: number): void; bind(location?: number): void; unbind(): void; minFilter(linear: boolean): void; @@ -2523,9 +2641,9 @@ declare namespace PIXI { static fromSource(gl: WebGLRenderingContext, source: HTMLImageElement | ImageData | HTMLVideoElement | HTMLCanvasElement, premultipleAlpha?: boolean): GLTexture; static fromData(gl: WebGLRenderingContext, data: number[], width: number, height: number): GLTexture; } - interface IAttrib { + interface Attrib { attribute: { - location: boolean; + location: number; size: number; }; normalized: boolean; @@ -2533,7 +2651,7 @@ declare namespace PIXI { start: number; buffer: ArrayBuffer; } - interface IWebGLRenderingContextAttribute { + interface WebGLRenderingContextAttribute { buffer: WebGLBuffer; attribute: any; type: number; @@ -2541,28 +2659,27 @@ declare namespace PIXI { stride: number; start: number; } - interface IAttribState { - tempAttribState: IAttrib[]; - attribState: IAttrib[]; + interface AttribState { + tempAttribState: Attrib[]; + attribState: Attrib[]; } - class VertexArrayObject { static FORCE_NATIVE: boolean; constructor(gl: WebGLRenderingContext, state: WebGLState); protected nativeVaoExtension: any; - protected nativeState: IAttribState; + protected nativeState: AttribState; protected nativeVao: VertexArrayObject; gl: WebGLRenderingContext; - attributes: IAttrib[]; + attributes: Attrib[]; indexBuffer: GLBuffer; dirty: boolean; bind(): VertexArrayObject; unbind(): VertexArrayObject; activate(): VertexArrayObject; - addAttribute(buffer: GLBuffer, attribute: IAttrib, type: number, normalized: boolean, stride: number, start: number): VertexArrayObject; + addAttribute(buffer: GLBuffer, attribute: Attrib, type: number, normalized: boolean, stride: number, start: number): VertexArrayObject; addIndex(buffer: GLBuffer, options?: any): VertexArrayObject; clear(): VertexArrayObject; draw(type: number, size: number, start: number): VertexArrayObject; @@ -2574,7 +2691,7 @@ declare namespace PIXI { ///////////////////////////////UTILS////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// - interface IDecomposedDataUri { + interface DecomposedDataUri { mediaType: string; subType: string; encoding: string; @@ -2585,11 +2702,11 @@ declare namespace PIXI { function uid(): number; function hex2rgb(hex: number, out?: number[]): number[]; function hex2string(hex: number): string; - function rgb2hex(rgb: Number[]): number; + function rgb2hex(rgb: number[]): number; function canUseNewCanvasBlendModes(): boolean; function getResolutionOfUrl(url: string, defaultValue?: number): number; function getSvgSize(svgString: string): any; - function decomposeDataUri(dataUri: string): IDecomposedDataUri | void; + function decomposeDataUri(dataUri: string): DecomposedDataUri | void; function getUrlFileExtension(url: string): string | void; function sayHello(type: string): void; function skipHello(): void; @@ -2635,22 +2752,107 @@ declare namespace PIXI { const phone: boolean; const tablet: boolean; } - // https://github.com/primus/eventemitter3 class EventEmitter { - listeners(event: string, exists?: boolean): Function[]; - emit(event: string, ...args: any[]): boolean; - on(event: string, fn: Function, context?: any): this; - once(event: string, fn: Function, context?: any): this; - removeListener(event: string, fn: Function, context?: any, once?: boolean): this; - removeAllListeners(event?: string): this; - eventNames(): string[]; - - off(event: string, fn: Function, context?: any, once?: boolean): this; - addListener(event: string, fn: Function, context?: any): this; + static prefixed: string | boolean; + static EventEmitter: { + new (): EventEmitter; + prefixed: string | boolean; + }; + /** + * Minimal EventEmitter interface that is molded against the Node.js + * EventEmitter interface. + * + * @constructor + * @api public + */ + constructor(); + /** + * Return an array listing the events for which the emitter has registered listeners. + * + * @returns {(string | symbol)[]} + */ + eventNames(): Array<(string | symbol)>; + /** + * Return the listeners registered for a given event. + * + * @param {(string | symbol)} event The event name. + * @returns {Function[]} + */ + //tslint:disable-next-line:ban-types forbidden-types + listeners(event: string | symbol): Function[]; + /** + * Check if there listeners for a given event. + * If `exists` argument is not `true` lists listeners. + * + * @param {(string | symbol)} event The event name. + * @param {boolean} exists Only check if there are listeners. + * @returns {boolean} + */ + listeners(event: string | symbol, exists: boolean): boolean; + /** + * Calls each of the listeners registered for a given event. + * + * @param {(string | symbol)} event The event name. + * @param {...*} args Arguments that are passed to registered listeners + * @returns {boolean} `true` if the event had listeners, else `false`. + */ + emit(event: string | symbol, ...args: any[]): boolean; + /** + * Add a listener for a given event. + * + * @param {(string | symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + */ + //tslint:disable-next-line:ban-types forbidden-types + on(event: string | symbol, fn: Function, context?: any): this; + /** + * Add a one-time listener for a given event. + * + * @param {(string | symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + */ + //tslint:disable-next-line:ban-types forbidden-types + once(event: string | symbol, fn: Function, context?: any): this; + /** + * Remove the listeners of a given event. + * + * @param {(string | symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + */ + //tslint:disable-next-line:ban-types forbidden-types + removeListener(event: string | symbol, fn?: Function, context?: any, once?: boolean): this; + /** + * Remove all listeners, or those of the specified event. + * + * @param {(string | symbol)} event The event name. + * @returns {EventEmitter} `this`. + */ + removeAllListeners(event?: string | symbol): this; + /** + * Alias method for `removeListener` + */ + //tslint:disable-next-line:ban-types forbidden-types + off(event: string | symbol, fn?: Function, context?: any, once?: boolean): this; + /** + * Alias method for `on` + */ + //tslint:disable-next-line:ban-types forbidden-types + addListener(event: string | symbol, fn: Function, context?: any): this; + /** + * This function doesn't apply anymore. + * @deprecated + */ + setMaxListeners(): this; } } - ////////////////////////////////////////////////////////////////////////////// /////////////////////////////depreciation///////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// @@ -2748,6 +2950,16 @@ declare namespace PIXI { */ type TilingSprite = extras.TilingSprite; + /** + * @class + * @private + * @name BaseTextureCache + * @memberof PIXI + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 + */ + type BaseTextureCache = any; + /** * @class * @private @@ -2857,6 +3069,15 @@ declare namespace PIXI { * @deprecated since version 4.2.0 */ type DEFAULT_RENDER_OPTIONS = number; + + /** + * @static + * @name PRECISION + * @memberof PIXI.settings + * @see PIXI.PRECISION + * @deprecated since version 4.4.0 + */ + type PRECISION = string; } namespace extras { @@ -2869,12 +3090,23 @@ declare namespace PIXI { */ type MovieClip = extras.AnimatedSprite; } + namespace settings { + /** + * @static + * @name PRECISION + * @memberof PIXI.settings + * @see PIXI.PRECISION + * @deprecated since version 4.4.0 + */ + type PRECISION = number; + } } declare namespace pixi { const gl: typeof PIXI.glCore; } +//tslint:disable-next-line:no-single-declare-module declare module "pixi.js" { export = PIXI; } diff --git a/types/pixi.js/pixi.js-tests.ts b/types/pixi.js/pixi.js-tests.ts index f73dfd7021..d14d3e0e71 100644 --- a/types/pixi.js/pixi.js-tests.ts +++ b/types/pixi.js/pixi.js-tests.ts @@ -24,7 +24,7 @@ function basics() { private renderer: PIXI.WebGLRenderer; constructor() { // Renderer should allow options from both WebGLRenderer and underlying SystemRenderer - this.renderer = new PIXI.WebGLRenderer(0, 0, { backgroundColor : 0x272d37, forceFXAA: true }); + this.renderer = new PIXI.WebGLRenderer(0, 0, { backgroundColor: 0x272d37, forceFXAA: true }); } } @@ -1507,7 +1507,8 @@ function filters() { maggot.position.y = Math.random() * bounds.height; maggot.scale.set(1 + Math.random() * 0.3); - maggot.original = maggot.scale.clone(); + //tslint:disable-next-line:whitespace + maggot.original = (maggot.scale).clone(); this.maggots.push(maggot); } From 00f84a213f0235b308654451e7fa1cb0de81d6bb Mon Sep 17 00:00:00 2001 From: Fred Morel Date: Fri, 9 Jun 2017 19:54:36 -0400 Subject: [PATCH 303/761] Range.getColumnIndex, documentation --- .../google-apps-script.spreadsheet.d.ts | 99 ++++++++++++++++++- .../google-apps-script.types.d.ts | 1 + 2 files changed, 98 insertions(+), 2 deletions(-) diff --git a/types/google-apps-script/google-apps-script.spreadsheet.d.ts b/types/google-apps-script/google-apps-script.spreadsheet.d.ts index 74ca8b2e79..e710fcfb4a 100644 --- a/types/google-apps-script/google-apps-script.spreadsheet.d.ts +++ b/types/google-apps-script/google-apps-script.spreadsheet.d.ts @@ -9,6 +9,11 @@ /// declare namespace GoogleAppsScript { + /** + * This service allows scripts to create, access, and modify Google Sheets files. See also the guide to storing data in spreadsheets. + * + * https://developers.google.com/apps-script/guides/sheets + */ export module Spreadsheet { /** * Styles that can be set on a range using @@ -24,9 +29,25 @@ declare namespace GoogleAppsScript { * sheet.updateChart(chart); */ export interface ContainerInfo { + /** + * The chart's left side will be anchored to this column. + * @returns {Integer} 1-indexed column (i.e. column C will be 3) + */ getAnchorColumn(): Integer; + /** + * The chart's top side will be anchored to this row. + * @returns {Integer} 1-indexed row (i.e. row 5 will return 5) + */ getAnchorRow(): Integer; + /** + * The chart's upper left hand corner will be offset from the anchor column by this many pixels. + * @returns {Integer} the horizontal offset in pixels for the upper left hand corner of the chart + */ getOffsetX(): Integer; + /** + * Chart's upper left hand corner will be offset from the anchor row by this many pixels. + * @returns {Integer} the vertical offset in pixels for the upper left hand corner of the chart + */ getOffsetY(): Integer; } @@ -573,16 +594,31 @@ declare namespace GoogleAppsScript { * Data > Named ranges... menu. */ export interface NamedRange { + /** + * Gets the name of this named range. + */ getName(): string; + /** + * Gets teh range referenced by this named range. + */ getRange(): Range; + /** + * Deletes this named range. + */ remove(): void; + /** + * Sets/updates the name of this named range. + */ setName(name: string): NamedRange; + /** + * Sets/updates the range for this named range. + */ setRange(range: Range): NamedRange; } /** - * - * Deprecated. For spreadsheets created in the newer version of Google Sheets, use the more powerful + * @deprecated + * For spreadsheets created in the newer version of Google Sheets, use the more powerful * Protection class instead. Although this class is deprecated, it will remain * available for compatibility with the older version of Sheets. * Access and modify protected sheets in the older version of Google Sheets. @@ -713,6 +749,7 @@ declare namespace GoogleAppsScript { getBackgrounds(): String[][]; getCell(row: Integer, column: Integer): Range; getColumn(): Integer; + getColumnIndex(): Integer; getDataSourceUrl(): string; getDataTable(): Charts.DataTable; getDataTable(firstRowIsHeader: boolean): Charts.DataTable; @@ -1021,27 +1058,85 @@ declare namespace GoogleAppsScript { * the parent class for the Spreadsheet service. */ export interface SpreadsheetApp { + /** + * An enumeration of the valid styles for setting borders on a Range. + */ BorderStyle: typeof BorderStyle; + /** + * An enumeration representing the data-validation criteria that can be set on a range. + */ DataValidationCriteria: typeof DataValidationCriteria; + /** + * An enumeration representing the parts of a spreadsheet that can be protected from edits. + */ ProtectionType: typeof ProtectionType; + /** + * Creates a new spreadsheet with the given name. + */ create(name: string): Spreadsheet; + /** + * Creates a new spreadsheet with the given name and the specified number of rows and columns. + */ create(name: string, rows: Integer, columns: Integer): Spreadsheet; + /** + * Applies all pending Spreadsheet changes. + */ flush(): void; + /** + * Returns the currently active spreadsheet, or null if there is none. + */ getActive(): Spreadsheet; + /** + * Returns the range of cells that is currently considered active. + */ getActiveRange(): Range; + /** + * Gets the active sheet in a spreadsheet. + */ getActiveSheet(): Sheet; + /** + * Returns the currently active spreadsheet, or null if there is none. + */ getActiveSpreadsheet(): Spreadsheet; + /** + * Returns an instance of the spreadsheet's user-interface environment that allows the script to add features like menus, dialogs, and sidebars. + */ getUi(): Base.Ui; + /** + * Creates a builder for a data-validation rule. + */ newDataValidation(): DataValidationBuilder; + /** + * Opens the spreadsheet that corresponds to the given File object. + */ open(file: Drive.File): Spreadsheet; + /** + * Opens the spreadsheet with the given ID. + */ openById(id: string): Spreadsheet; + /** + * Opens the spreadsheet with the given url. + */ openByUrl(url: string): Spreadsheet; + /** + * Sets the active range for the application. + */ setActiveRange(range: Range): Range; + /** + * Sets the active sheet in a spreadsheet. + */ setActiveSheet(sheet: Sheet): Sheet; + /** + * Sets the active spreadsheet. + */ setActiveSpreadsheet(newActiveSpreadsheet: Spreadsheet): void; } } } +/** + * This class allows users to open Google Sheets files and to create new ones. This class is + * the parent class for the Spreadsheet service. + */ declare var SpreadsheetApp: GoogleAppsScript.Spreadsheet.SpreadsheetApp; diff --git a/types/google-apps-script/google-apps-script.types.d.ts b/types/google-apps-script/google-apps-script.types.d.ts index 5204a8a2a4..3c7bfb550c 100644 --- a/types/google-apps-script/google-apps-script.types.d.ts +++ b/types/google-apps-script/google-apps-script.types.d.ts @@ -8,5 +8,6 @@ declare module GoogleAppsScript { type Byte = number; type Integer = number; type Char = string; + type String = string; type JdbcSQL_XML = any; } From 26d632b5f4433ec98028e2037950614be644d151 Mon Sep 17 00:00:00 2001 From: Stephen King Date: Fri, 9 Jun 2017 15:44:58 -0600 Subject: [PATCH 304/761] ramda: Allow currying of type guards --- types/ramda/index.d.ts | 46 +++++++++++++++++++++++++++++++++++++- types/ramda/ramda-tests.ts | 19 ++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 9666c1b78f..79d1b1f6cf 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1,6 +1,10 @@ // Type definitions for ramda // Project: https://github.com/donnut/typescript-ramda -// Definitions by: Erwin Poeze , Matt DeKrey , Liam Goodacre , Matt Dziuban +// Definitions by: Erwin Poeze +// Matt DeKrey +// Liam Goodacre +// Matt Dziuban +// Stephen King // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -75,6 +79,41 @@ declare namespace R { } // @see https://gist.github.com/donnut/fd56232da58d25ceecf1, comment by @albrow + interface CurriedTypeGuard2 { + (t1: T1): (t2: T2) => t2 is R; + (t1: T1, t2: T2): t2 is R; + } + + interface CurriedTypeGuard3 { + (t1: T1): CurriedTypeGuard2; + (t1: T1, t2: T2): (t3: T3) => t3 is R; + (t1: T1, t2: T2, t3: T3): t3 is R; + } + + interface CurriedTypeGuard4 { + (t1: T1): CurriedTypeGuard3; + (t1: T1, t2: T2): CurriedTypeGuard2; + (t1: T1, t2: T2, t3: T3): (t4: T4) => t4 is R; + (t1: T1, t2: T2, t3: T3, t4: T4): t4 is R; + } + + interface CurriedTypeGuard5 { + (t1: T1): CurriedTypeGuard4; + (t1: T1, t2: T2): CurriedTypeGuard3; + (t1: T1, t2: T2, t3: T3): CurriedTypeGuard2; + (t1: T1, t2: T2, t3: T3, t4: T4): (t5: T5) => t5 is R; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): t5 is R; + } + + interface CurriedTypeGuard6 { + (t1: T1): CurriedTypeGuard5; + (t1: T1, t2: T2): CurriedTypeGuard4; + (t1: T1, t2: T2, t3: T3): CurriedTypeGuard3; + (t1: T1, t2: T2, t3: T3, t4: T4): CurriedTypeGuard2; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): (t6: T6) => t6 is R; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6): t6 is R; + } + interface CurriedFunction2 { (t1: T1): (t2: T2) => R; (t1: T1, t2: T2): R; @@ -392,6 +431,11 @@ declare namespace R { * Returns a curried equivalent of the provided function. The curried function has two unusual capabilities. * First, its arguments needn't be provided one at a time. */ + curry(fn: (a: T1, b: T2) => b is TResult): CurriedTypeGuard2 + curry(fn: (a: T1, b: T2, c: T3) => c is TResult): CurriedTypeGuard3 + curry(fn: (a: T1, b: T2, c: T3, d: T4) => d is TResult): CurriedTypeGuard4 + curry(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => e is TResult): CurriedTypeGuard5 + curry(fn: (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6) => f is TResult): CurriedTypeGuard6 curry(fn: (a: T1, b: T2) => TResult): CurriedFunction2 curry(fn: (a: T1, b: T2, c: T3) => TResult): CurriedFunction3 curry(fn: (a: T1, b: T2, c: T3, d: T4) => TResult): CurriedFunction4 diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index f9b272f8ca..8fbbb5c7ba 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -86,6 +86,25 @@ class F2 { var z2:number = addTwoNumbersCurried(2,3); } +() => { + interface Car { speed?: number; } + interface FastCar { speed: number; } + + const typeGuard = function(a: number, b: number, c: number, d: number, e: number, car: Car): car is FastCar { + return car.speed !== undefined; + } + const typeGuardCurried = R.curry(typeGuard); + + const drive = function(fastCar: FastCar) {}; + + const cars: Car[] = [{ speed: 65 }, {}]; + for (const car of cars) { + if (typeGuardCurried(1)(2)(3)(4)(5)(car)) { + drive(car); + } + } +} + () => { const addFour = (a:number) => (b:number) => (c:number) => (d:number) => a + b + c + d; const uncurriedAddFour = R.uncurryN(4, addFour); From 5015d80ab505d59941a5dbd9dd45829b159ac1b2 Mon Sep 17 00:00:00 2001 From: Michael Strobel Date: Sat, 10 Jun 2017 09:05:34 +0800 Subject: [PATCH 305/761] [webpack] Add types for CommonsChunkPlugin.Options --- types/webpack/index.d.ts | 54 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 9e5d106b80..1793eeef4f 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -907,7 +907,59 @@ declare namespace webpack { } class CommonsChunkPlugin extends Plugin { - constructor(options?: any); + constructor(options?: CommonsChunkPlugin.Options); + } + + namespace CommonsChunkPlugin { + type MinChunksFn = (module: any, count: number) => boolean; + + interface Options { + /** + * The chunk name of the commons chunk. An existing chunk can be selected by passing a name of an existing chunk. + * If an array of strings is passed this is equal to invoking the plugin multiple times for each chunk name. + * If omitted and `options.async` or `options.children` is set all chunks are used, + * otherwise `options.filename` is used as chunk name. + */ + name?: string; + names?: string[]; + + /** + * The filename template for the commons chunk. Can contain the same placeholders as `output.filename`. + * If omitted the original filename is not modified (usually `output.filename` or `output.chunkFilename`). + */ + filename?: string; + + /** + * The minimum number of chunks which need to contain a module before it's moved into the commons chunk. + * The number must be greater than or equal 2 and lower than or equal to the number of chunks. + * Passing `Infinity` just creates the commons chunk, but moves no modules into it. + * By providing a `function` you can add custom logic. (Defaults to the number of chunks) + */ + minChunks?: number | MinChunksFn; + + /** + * Select the source chunks by chunk names. The chunk must be a child of the commons chunk. + * If omitted all entry chunks are selected. + */ + chunks?: string[]; + + /** + * If `true` all children of the commons chunk are selected + */ + children?: boolean; + + /** + * If `true` a new async commons chunk is created as child of `options.name` and sibling of `options.chunks`. + * It is loaded in parallel with `options.chunks`. It is possible to change the name of the output file + * by providing the desired string instead of `true`. + */ + async?: boolean | string; + + /** + * Minimum size of all common module before a commons chunk is created. + */ + minSize?: number; + } } /** @deprecated */ From 8b6097d1ddf500ee2f69173cded1b13919c5e7f2 Mon Sep 17 00:00:00 2001 From: Michael Strobel Date: Sat, 10 Jun 2017 09:27:15 +0800 Subject: [PATCH 306/761] Fix whitespace linting error --- types/webpack/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 1793eeef4f..8d4c7282ca 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -922,7 +922,7 @@ declare namespace webpack { */ name?: string; names?: string[]; - + /** * The filename template for the commons chunk. Can contain the same placeholders as `output.filename`. * If omitted the original filename is not modified (usually `output.filename` or `output.chunkFilename`). From b74bf960f39d7ec7a086b3a92ea4cf6a207ec920 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:30:11 +0100 Subject: [PATCH 307/761] Added more documentation --- types/nodegit/submodule.d.ts | 271 +++++++++++++++++++++++++++ types/nodegit/tag.d.ts | 170 ++++++++++++++++- types/nodegit/time.d.ts | 12 ++ types/nodegit/transfer-progress.d.ts | 42 +++++ types/nodegit/transport.d.ts | 39 ++++ types/nodegit/tree-builder.d.ts | 62 ++++++ types/nodegit/tree-entry.d.ts | 152 ++++++++++++++- types/nodegit/tree.d.ts | 203 +++++++++++++++++++- 8 files changed, 932 insertions(+), 19 deletions(-) diff --git a/types/nodegit/submodule.d.ts b/types/nodegit/submodule.d.ts index fd64a1c8ac..b9293f6bae 100644 --- a/types/nodegit/submodule.d.ts +++ b/types/nodegit/submodule.d.ts @@ -45,37 +45,308 @@ export namespace Submodule { } export class Submodule { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} url + * @param {string} path + * @param {number} use_gitlink + * @returns {Promise} + * + * @memberof Submodule + */ static addSetup(repo: Repository, url: string, path: string, use_gitlink: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Function} callback + * @param {*} payload + * @returns {Promise} + * + * @memberof Submodule + */ static foreach(repo: Repository, callback: Function, payload: any): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {Promise} + * + * @memberof Submodule + */ static lookup(repo: Repository, name: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} url + * @returns {Promise} + * + * @memberof Submodule + */ static resolveUrl(repo: Repository, url: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} branch + * @returns {number} + * + * @memberof Submodule + */ static setBranch(repo: Repository, name: string, branch: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {number} fetch_recurse_submodules + * @returns {number} + * + * @memberof Submodule + */ static setFetchRecurseSubmodules(repo: Repository, name: string, fetch_recurse_submodules: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {number} ignore + * @returns {Promise} + * + * @memberof Submodule + */ static setIgnore(repo: Repository, name: string, ignore: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {number} update + * @returns {Promise} + * + * @memberof Submodule + */ static setUpdate(repo: Repository, name: string, update: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} url + * @returns {Promise} + * + * @memberof Submodule + */ static setUrl(repo: Repository, name: string, url: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {number} ignore + * @returns {Promise} + * + * @memberof Submodule + */ static status(repo: Repository, name: string, ignore: number): Promise; + /** + * + * + * @static + * @param {SubmoduleUpdateOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Submodule + */ static updateInitOptions(opts: SubmoduleUpdateOptions, version: number): number; + /** + * + * + * @returns {Promise} + * + * @memberof Submodule + */ addFinalize(): Promise; + /** + * + * + * @param {number} write_index + * @returns {Promise} + * + * @memberof Submodule + */ addToIndex(write_index: number): Promise; + /** + * + * + * @returns {string} + * + * @memberof Submodule + */ branch(): string; + /** + * + * + * @returns {number} + * + * @memberof Submodule + */ fetchRecurseSubmodules(): number; + /** + * + * + * + * @memberof Submodule + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Submodule + */ headId(): Oid; + /** + * + * + * @returns {number} + * + * @memberof Submodule + */ ignore(): number; + /** + * + * + * @returns {Oid} + * + * @memberof Submodule + */ indexId(): Oid; + /** + * + * + * @param {number} overwrite + * @returns {Promise} + * + * @memberof Submodule + */ init(overwrite: number): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Submodule + */ location(): Promise; + /** + * + * + * @returns {string} + * + * @memberof Submodule + */ name(): string; + /** + * + * + * @returns {Promise} + * + * @memberof Submodule + */ open(): Promise; + /** + * + * + * @returns {Repository} + * + * @memberof Submodule + */ owner(): Repository; + /** + * + * + * @returns {string} + * + * @memberof Submodule + */ path(): string; + /** + * + * + * @param {number} force + * @returns {number} + * + * @memberof Submodule + */ reload(force: number): number; + /** + * + * + * @param {number} use_gitlink + * @returns {Promise} + * + * @memberof Submodule + */ repoInit(use_gitlink: number): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Submodule + */ sync(): Promise; + /** + * Updates a submodule + * + * @param {number} init + * @param {SubmoduleUpdateOptions} options + * @returns {Promise} + * + * @memberof Submodule + */ update(init: number, options: SubmoduleUpdateOptions): Promise; + /** + * + * + * @returns {number} + * + * @memberof Submodule + */ updateStrategy(): number; + /** + * + * + * @returns {string} + * + * @memberof Submodule + */ url(): string; + /** + * + * + * @returns {Oid} + * + * @memberof Submodule + */ wdId(): Oid; } diff --git a/types/nodegit/tag.d.ts b/types/nodegit/tag.d.ts index d8f98953a0..8c419ce15f 100644 --- a/types/nodegit/tag.d.ts +++ b/types/nodegit/tag.d.ts @@ -5,23 +5,191 @@ import { Signature } from './signature'; import { Strarray } from './str-array'; export class Tag { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} tag_name + * @param {Object} target + * @param {Signature} tagger + * @param {string} message + * @returns {Promise} + * + * @memberof Tag + */ static annotationCreate(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} tag_name + * @param {Object} target + * @param {Signature} tagger + * @param {string} message + * @param {number} force + * @returns {Promise} + * + * @memberof Tag + */ static create(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string, force: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} tag_name + * @param {Object} target + * @param {number} force + * @returns {Promise} + * + * @memberof Tag + */ static createLightweight(repo: Repository, tag_name: string, target: Object, force: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} tag_name + * @returns {Promise} + * + * @memberof Tag + */ static delete(repo: Repository, tag_name: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @returns {Promise} + * + * @memberof Tag + */ static list(repo: Repository): Promise; + /** + * + * + * @static + * @param {Strarray} tag_names + * @param {string} pattern + * @param {Repository} repo + * @returns {number} + * + * @memberof Tag + */ static listMatch(tag_names: Strarray, pattern: string, repo: Repository): number; + /** + * Retrieves the tag pointed to by the oid + * + * @static + * @param {Repository} repo + * @param {(string | Oid | Tag)} id + * @returns {Promise} + * + * @memberof Tag + */ static lookup(repo: Repository, id: string | Oid | Tag): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} len + * @returns {Promise} + * + * @memberof Tag + */ static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Tag + */ + dup(): Promise; + /** + * + * + * + * @memberof Tag + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Tag + */ id(): Oid; + /** + * + * + * @returns {string} + * + * @memberof Tag + */ message(): string; + /** + * + * + * @returns {string} + * + * @memberof Tag + */ name(): string; + /** + * + * + * @returns {Repository} + * + * @memberof Tag + */ owner(): Repository; - peel(tag_target_out: Object): number; + /** + * + * + * @param {Object} tagTargetOut + * @returns {number} + * + * @memberof Tag + */ + peel(tagTargetOut: Object): number; + /** + * + * + * @returns {Signature} + * + * @memberof Tag + */ tagger(): Signature; + /** + * + * + * @returns {Object} + * + * @memberof Tag + */ target(): Object; + /** + * + * + * @returns {Oid} + * + * @memberof Tag + */ targetId(): Oid; + /** + * + * + * @returns {number} + * + * @memberof Tag + */ targetType(): number; } diff --git a/types/nodegit/time.d.ts b/types/nodegit/time.d.ts index 575c005781..299bcfa35e 100644 --- a/types/nodegit/time.d.ts +++ b/types/nodegit/time.d.ts @@ -1,4 +1,16 @@ export class Time { + /** + * + * + * @type {number} + * @memberof Time + */ time: number; + /** + * + * + * @type {number} + * @memberof Time + */ offset: number; } diff --git a/types/nodegit/transfer-progress.d.ts b/types/nodegit/transfer-progress.d.ts index 1589d4b6c6..f4c0d21065 100644 --- a/types/nodegit/transfer-progress.d.ts +++ b/types/nodegit/transfer-progress.d.ts @@ -1,9 +1,51 @@ export class TransferProgress { + /** + * + * + * @type {number} + * @memberof TransferProgress + */ totalObjects: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ indexedObjects: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ receivedObjects: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ localObjects: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ totalDeltas: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ indexedDeltas: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ receivedBytes: number; } diff --git a/types/nodegit/transport.d.ts b/types/nodegit/transport.d.ts index 189985c469..01dd4312ef 100644 --- a/types/nodegit/transport.d.ts +++ b/types/nodegit/transport.d.ts @@ -1,5 +1,6 @@ import { Remote } from './remote'; import { Strarray } from './str-array'; +import { Cert } from './cert'; export namespace Transport { const enum FLAGS { @@ -8,7 +9,45 @@ export namespace Transport { } export class Transport { + /** + * å + * + * @static + * @param {Remote} owner + * @param {Strarray} payload + * @returns {Promise} + * + * @memberof Transport + */ static sshWithPaths(owner: Remote, payload: Strarray): Promise; + /** + * + * + * @static + * @param {string} prefix + * @returns {number} + * + * @memberof Transport + */ static unregister(prefix: string): number; + /** + * + * + * @param {number} version + * @returns {number} + * + * @memberof Transport + */ init(version: number): number; + /** + * + * + * @param {Cert} cert + * @param {number} valid + * @param {string} hostName + * @returns {number} + * + * @memberof Transport + */ + smartCertificateCheck(cert: Cert, valid: number, hostName: string): number; } diff --git a/types/nodegit/tree-builder.d.ts b/types/nodegit/tree-builder.d.ts index 03d11db900..4c50cdbd65 100644 --- a/types/nodegit/tree-builder.d.ts +++ b/types/nodegit/tree-builder.d.ts @@ -4,13 +4,75 @@ import { Tree } from './tree'; import { TreeEntry } from './tree-entry'; export class Treebuilder { + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} source + * @returns {Promise} + * + * @memberof Treebuilder + */ static create(repo: Repository, source: Tree): Promise; + /** + * + * + * + * @memberof Treebuilder + */ clear(): void; + /** + * + * + * @returns {number} + * + * @memberof Treebuilder + */ entrycount(): number; + /** + * + * + * + * @memberof Treebuilder + */ free(): void; + /** + * + * + * @param {string} filename + * @returns {TreeEntry} + * + * @memberof Treebuilder + */ get(filename: string): TreeEntry; + /** + * + * + * @param {string} filename + * @param {Oid} id + * @param {number} filemode + * @returns {Promise} + * + * @memberof Treebuilder + */ insert(filename: string, id: Oid, filemode: number): Promise; + /** + * + * + * @param {string} filename + * @returns {number} + * + * @memberof Treebuilder + */ remove(filename: string): number; + /** + * + * + * @returns {Oid} + * + * @memberof Treebuilder + */ write(): Oid; } diff --git a/types/nodegit/tree-entry.d.ts b/types/nodegit/tree-entry.d.ts index a56a658ce1..3cf20499d3 100644 --- a/types/nodegit/tree-entry.d.ts +++ b/types/nodegit/tree-entry.d.ts @@ -1,6 +1,7 @@ import { Tree } from './tree'; import { Oid } from './oid'; import { Blob } from './blob'; +import { Repository } from './repository'; export namespace TreeEntry { const enum FILEMODE { @@ -14,17 +15,148 @@ export namespace TreeEntry { } export class TreeEntry { - isFile(): boolean; - isTree(): boolean; - isDirectory(): boolean; - isBlob(): boolean; - sha(): string; - getTree(): Promise; + /** + * + * + * @returns {TreeEntry.FILEMODE} + * + * @memberof TreeEntry + */ + filemode(): TreeEntry.FILEMODE; + /** + * + * + * @returns {TreeEntry.FILEMODE} + * + * @memberof TreeEntry + */ + filemodeRaw(): TreeEntry.FILEMODE; + /** + * + * + * + * @memberof TreeEntry + */ + free(): void; + /** + * + * + * @returns {Promise} + * + * @memberof TreeEntry + */ getBlob(): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof TreeEntry + */ + getTree(): Promise; + /** + * + * + * @returns {Oid} + * + * @memberof TreeEntry + */ + id(): Oid; + /** + * + * + * @returns {boolean} + * + * @memberof TreeEntry + */ + isBlob(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof TreeEntry + */ + isFile(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof TreeEntry + */ + isTree(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof TreeEntry + */ + isDirectory(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof TreeEntry + */ + isSubmodule(): boolean; + /** + * Retrieve the SHA for this TreeEntry. + * + * @returns {string} + * + * @memberof TreeEntry + */ + sha(): string; + /** + * + * + * @returns {string} + * + * @memberof TreeEntry + */ + name(): string; + /** + * Retrieve the SHA for this TreeEntry. Alias for sha + * + * @returns {string} + * + * @memberof TreeEntry + */ + oid(): string; + /** + * Returns the path for this entry. + * + * @returns {string} + * + * @memberof TreeEntry + */ path(): string; + /** + * Alias for path + * + * @returns {string} + * + * @memberof TreeEntry + */ toString(): string; - attr: number; - oid: Oid; - filenameLen: number; - filename: string; + /** + * + * + * @param {Repository} repo + * @returns {Object} + * + * @memberof TreeEntry + */ + toObject(repo: Repository): Object; + /** + * + * + * @returns {number} + * + * @memberof TreeEntry + */ + type(): number; } diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index a4101217d3..eaa0c65ed3 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -13,32 +13,219 @@ export namespace Tree { } export class Tree { - static entryCmp(e1: TreeEntry, e2: TreeEntry): number; + /** + * + * + * @static + * @param {TreeEntry} tree1 + * @param {TreeEntry} tree2 + * @returns {number} + * + * @memberof Tree + */ + static entryCmp(tree1: TreeEntry, tree2: TreeEntry): number; + /** + * + * + * @static + * @param {TreeEntry} dest + * @param {TreeEntry} source + * @returns {number} + * + * @memberof Tree + */ static entryDup(dest: TreeEntry, source: TreeEntry): number; - static entryFilemode(entry: TreeEntry): number; - static entryFilemodeRaw(entry: TreeEntry): number; - static entryFree(entry: TreeEntry): void; - static entryId(entry: TreeEntry): Oid; - static entryName(entry: TreeEntry): string; - static entryToObject(object_out: Object, repo: Repository, entry: TreeEntry): number; - static entryType(entry: TreeEntry): number; + /** + * Retrieves the tree pointed to by the oid + * + * @static + * @returns {Promise} + * + * @memberof Tree + */ + static lookup(): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} len + * @returns {Promise} + * + * @memberof Tree + */ + static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + + /** + * Retrieves the tree pointed to by the oid + * + * @static + * @param {Repository} repo + * @param {(string | Oid | Tree)} id + * @param {Function} callback + * @returns {Promise} + * + * @memberof Tree + */ static lookup(repo: Repository, id: string | Oid | Tree, callback: Function): Promise; static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + /** + * + * + * @param {Oid} id + * @returns {TreeEntry} + * + * @memberof Tree + */ entryById(id: Oid): TreeEntry; + /** + * + * + * @param {number} idx + * @returns {TreeEntry} + * + * @memberof Tree + */ _entryByIndex(idx: number): TreeEntry; + /** + * Get an entry by name; if the tree is a directory, the name is the filename. + * + * @param {string} name + * @returns {TreeEntry} + * + * @memberof Tree + */ entryByName(name: string): TreeEntry; + /** + * + * + * @param {string} filename + * @returns {TreeEntry} + * + * @memberof Tree + */ + _entryByName(filename: string): TreeEntry; + /** + * + * + * @param {string} path + * @returns {Promise} + * + * @memberof Tree + */ entryByPath(path: string): Promise; + /** + * + * + * @returns {number} + * + * @memberof Tree + */ entryCount(): number; + /** + * + * + * + * @memberof Tree + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Tree + */ id(): Oid; + /** + * + * + * @returns {Repository} + * + * @memberof Tree + */ owner(): Repository; + /** + * Diff two trees + * + * @param {Tree} tree + * @param {Function} callback + * @returns {Promise} + * + * @memberof Tree + */ diff(tree: Tree, callback: Function): Promise; + /** + * Diff two trees with options + * + * @param {Tree} tree + * @param {Object} options + * @param {Function} callback + * @returns {Promise} + * + * @memberof Tree + */ diffWithOptions(tree: Tree, options: Object, callback: Function): Promise; + /** + * Get an entry at the ith position. + * + * @param {number} i + * @returns {TreeEntry} + * + * @memberof Tree + */ entryByIndex(i: number): TreeEntry; + /** + * Get an entry at a path. Unlike by name, this takes a fully qualified path, like /foo/bar/baz.javascript + * + * @param {string} filePath + * @returns {TreeEntry} + * + * @memberof Tree + */ getEntry(filePath: string): TreeEntry; + /** + * Return an array of the entries in this tree (excluding its children). + * + * @returns {TreeEntry[]} + * + * @memberof Tree + */ entries(): TreeEntry[]; + /** + * Recursively walk the tree in breadth-first order. Fires an event for each entry. + * + * @param {boolean} [blobsOnly] + * @returns {NodeJS.EventEmitter} + * + * @memberof Tree + */ walk(blobsOnly?: boolean): NodeJS.EventEmitter; + /** + * Return the path of this tree, like /lib/foo/bar + * + * @returns {string} + * + * @memberof Tree + */ path(): string; + /** + * Make builder. This is helpful for modifying trees. + * + * @returns {Treebuilder} + * + * @memberof Tree + */ builder(): Treebuilder; + /** + * + * + * @returns {Promise} + * + * @memberof Tree + */ + dup(): Promise; + createUpdated(repo: Repository, nUpdates: number, updates: TreeUpdate): Promise; } From e9fbe7110a21a0a5663b2f07d5018d82d377d2d7 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:32:54 +0100 Subject: [PATCH 308/761] Added TreeUpdate --- types/nodegit/index.d.ts | 1 + types/nodegit/tree-update.d.ts | 8 ++++++++ types/nodegit/tree.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 4 files changed, 11 insertions(+) create mode 100644 types/nodegit/tree-update.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 6551907ea4..2c955933d1 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -98,4 +98,5 @@ export { TransferProgress } from './transfer-progress'; export { Transport } from './transport'; export { Treebuilder } from './tree-builder'; export { TreeEntry } from './tree-entry'; +export { TreeUpdate } from './tree-update'; export { Tree } from './tree'; diff --git a/types/nodegit/tree-update.d.ts b/types/nodegit/tree-update.d.ts new file mode 100644 index 0000000000..fde63d064e --- /dev/null +++ b/types/nodegit/tree-update.d.ts @@ -0,0 +1,8 @@ +import { Oid } from './oid'; + +export class TreeUpdate { + action: number; + filemode: number; + id: Oid; + path: string; +} diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index eaa0c65ed3..d6fca995de 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -4,6 +4,7 @@ import { Repository } from './repository'; import { Object } from './object'; import { Treebuilder } from './tree-builder'; import { DiffFile } from './diff-file'; +import { TreeUpdate } from './tree-update'; export namespace Tree { const enum WALK_MODE { diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 829e49aedd..17b5c3fa6e 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -112,6 +112,7 @@ "transport.d.ts", "tree-builder.d.ts", "tree-entry.d.ts", + "tree-update.d.ts", "tree.d.ts" ] } From a38a576c6eb4f06bafe5489dbd1339cbfccffecc Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:36:24 +0100 Subject: [PATCH 309/761] Added proxy --- types/nodegit/index.d.ts | 1 + types/nodegit/proxy.d.ts | 5 +++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 7 insertions(+) create mode 100644 types/nodegit/proxy.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 2c955933d1..b0a68f67b5 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -67,6 +67,7 @@ export { Openssl } from './open-ssl'; export { Packbuilder } from './pack-builder'; export { Pathspec } from './path-spec'; export { ProxyOptions } from './proxy-options'; +export { Proxy } from './proxy'; export { PushOptions } from './push-options'; export { PushUpdate } from './push-update'; export { Push } from './push'; diff --git a/types/nodegit/proxy.d.ts b/types/nodegit/proxy.d.ts new file mode 100644 index 0000000000..8b4806a2e0 --- /dev/null +++ b/types/nodegit/proxy.d.ts @@ -0,0 +1,5 @@ +import { ProxyOptions } from './proxy-options'; + +export class Proxy { + static initOptions(opts: ProxyOptions, version: number): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 17b5c3fa6e..394ec731df 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -81,6 +81,7 @@ "pack-builder.d.ts", "path-spec.d.ts", "proxy-options.d.ts", + "proxy.d.ts", "push-options.d.ts", "push-update.d.ts", "push.d.ts", From 8f535fe731495a8019b7f6816fcad22accb5e205 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:37:21 +0100 Subject: [PATCH 310/761] Added documentation for TreeUpdate --- types/nodegit/tree-update.d.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/types/nodegit/tree-update.d.ts b/types/nodegit/tree-update.d.ts index fde63d064e..f8834513f4 100644 --- a/types/nodegit/tree-update.d.ts +++ b/types/nodegit/tree-update.d.ts @@ -1,8 +1,32 @@ import { Oid } from './oid'; export class TreeUpdate { + /** + * + * + * @type {number} + * @memberof TreeUpdate + */ action: number; + /** + * + * + * @type {number} + * @memberof TreeUpdate + */ filemode: number; + /** + * + * + * @type {Oid} + * @memberof TreeUpdate + */ id: Oid; + /** + * + * + * @type {string} + * @memberof TreeUpdate + */ path: string; } From 0aaac09a4471f1906b4c341cb7d5cfe38b5cfce5 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:42:46 +0100 Subject: [PATCH 311/761] fixed linting errors --- types/nodegit/diff.d.ts | 6 +++--- types/nodegit/odb-expand-id.d.ts | 6 +++--- types/nodegit/proxy-options.d.ts | 12 ++++++------ types/nodegit/push-options.d.ts | 4 ++-- types/nodegit/rev-walk.d.ts | 1 - types/nodegit/tree.d.ts | 11 ----------- 6 files changed, 14 insertions(+), 26 deletions(-) diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 23d3ddf5fc..0150313cfb 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -172,7 +172,7 @@ export class Diff { * Directly run a diff between a blob and a buffer. * * @static - * @param {Blob} old_blob + * @param {Blob} oldBlob * @param {string} oldAsPath * @param {string} buffer * @param {string} bufferAsPath @@ -185,8 +185,8 @@ export class Diff { * * @memberof Diff */ - static blobToBuffer(old_blob: Blob, oldAsPath: string, - buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; + static blobToBuffer(oldBlob: Blob, oldAsPath: string, + buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; /** * * diff --git a/types/nodegit/odb-expand-id.d.ts b/types/nodegit/odb-expand-id.d.ts index 842c65774e..d4fe264c3a 100644 --- a/types/nodegit/odb-expand-id.d.ts +++ b/types/nodegit/odb-expand-id.d.ts @@ -1,7 +1,7 @@ import { Oid } from './oid'; export class OdbExpandId { - id: Oid - length: number - type: number + id: Oid; + length: number; + type: number; } diff --git a/types/nodegit/proxy-options.d.ts b/types/nodegit/proxy-options.d.ts index 512d70c99a..600b34cd04 100644 --- a/types/nodegit/proxy-options.d.ts +++ b/types/nodegit/proxy-options.d.ts @@ -5,40 +5,40 @@ export class ProxyOptions { * @type {Function} * @memberof ProxyOptions */ - certificateCheck?: Function + certificateCheck?: Function; /** * * * @type {Function} * @memberof ProxyOptions */ - credentials?: Function + credentials?: Function; /** * * * @type {*} * @memberof ProxyOptions */ - payload?: any + payload?: any; /** * * * @type {number} * @memberof ProxyOptions */ - type?: number + type?: number; /** * * * @type {string} * @memberof ProxyOptions */ - url?: string + url?: string; /** * * * @type {number} * @memberof ProxyOptions */ - version?: number + version?: number; } diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index 6cf501c84a..e9cc6e2dcb 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -30,12 +30,12 @@ export interface PushOptions { * @type {Strarray} * @memberof PushOptions */ - customHeaders: Strarray + customHeaders: Strarray; /** * * * @type {ProxyOptions} * @memberof PushOptions */ - proxyOpts: ProxyOptions + proxyOpts: ProxyOptions; } diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts index 8ba18bf83a..82b322cd79 100644 --- a/types/nodegit/rev-walk.d.ts +++ b/types/nodegit/rev-walk.d.ts @@ -187,5 +187,4 @@ export class Revwalk { * @memberof Revwalk */ getCommits(count: number): Promise; - } diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index d6fca995de..057d3b2907 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -36,15 +36,6 @@ export class Tree { * @memberof Tree */ static entryDup(dest: TreeEntry, source: TreeEntry): number; - /** - * Retrieves the tree pointed to by the oid - * - * @static - * @returns {Promise} - * - * @memberof Tree - */ - static lookup(): Promise; /** * * @@ -57,7 +48,6 @@ export class Tree { * @memberof Tree */ static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; - /** * Retrieves the tree pointed to by the oid * @@ -70,7 +60,6 @@ export class Tree { * @memberof Tree */ static lookup(repo: Repository, id: string | Oid | Tree, callback: Function): Promise; - static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; /** * From 0a0206e30123f7efa74f501619e7eed4120ddd76 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:51:39 +0100 Subject: [PATCH 312/761] Use camelCase for variables --- types/nodegit/buf.d.ts | 4 ++-- types/nodegit/clone.d.ts | 4 ++-- types/nodegit/commit.d.ts | 4 ++-- types/nodegit/diff.d.ts | 16 ++++++++-------- types/nodegit/index_.d.ts | 20 ++++++++++---------- types/nodegit/merge.d.ts | 8 ++++---- types/nodegit/note.d.ts | 28 ++++++++++++++-------------- types/nodegit/object.d.ts | 4 ++-- types/nodegit/rebase.d.ts | 4 ++-- types/nodegit/ref-log.d.ts | 8 ++++---- types/nodegit/remote.d.ts | 12 ++++++------ types/nodegit/repository.d.ts | 6 +++--- types/nodegit/reset.d.ts | 12 ++++++------ types/nodegit/rev-parse.d.ts | 6 +++--- types/nodegit/rev-walk.d.ts | 12 ++++++------ types/nodegit/revert.d.ts | 4 ++-- types/nodegit/submodule.d.ts | 16 ++++++++-------- types/nodegit/tag.d.ts | 20 ++++++++++---------- 18 files changed, 94 insertions(+), 94 deletions(-) diff --git a/types/nodegit/buf.d.ts b/types/nodegit/buf.d.ts index d9670bb293..380d76172b 100644 --- a/types/nodegit/buf.d.ts +++ b/types/nodegit/buf.d.ts @@ -19,12 +19,12 @@ export class Buf { /** * * - * @param {number} target_size + * @param {number} targetSize * @returns {Promise} * * @memberof Buf */ - grow(target_size: number): Promise; + grow(targetSize: number): Promise; /** * * diff --git a/types/nodegit/clone.d.ts b/types/nodegit/clone.d.ts index 61f8cfe2cf..7fe3b00a37 100644 --- a/types/nodegit/clone.d.ts +++ b/types/nodegit/clone.d.ts @@ -16,13 +16,13 @@ export class Clone { * * @static * @param {string} url - * @param {string} local_path + * @param {string} localPath * @param {CloneOptions} [options] * @returns {Promise} * * @memberof Clone */ - static clone(url: string, local_path: string, options?: CloneOptions): Promise; + static clone(url: string, localPath: string, options?: CloneOptions): Promise; /** * * diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts index 247fdb102d..59928817a6 100644 --- a/types/nodegit/commit.d.ts +++ b/types/nodegit/commit.d.ts @@ -239,12 +239,12 @@ export class Commit { /** * * - * @param {Tree} tree_out + * @param {Tree} treeOut * @returns {number} * * @memberof Commit */ - tree(tree_out: Tree): number; + tree(treeOut: Tree): number; /** * * diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 0150313cfb..5c2b29a33b 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -228,51 +228,51 @@ export class Diff { * * @static * @param {Repository} repo - * @param {Tree} old_tree + * @param {Tree} oldTree * @param {Index} index * @param {DiffOptions} opts * @returns {Promise} * * @memberof Diff */ - static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; + static treeToIndex(repo: Repository, oldTree: Tree, index: Index, opts: DiffOptions): Promise; /** * * * @static * @param {Repository} repo - * @param {Tree} old_tree + * @param {Tree} oldTree * @param {Tree} new_tree * @param {DiffOptions} opts * @returns {Promise} * * @memberof Diff */ - static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; + static treeToTree(repo: Repository, oldTree: Tree, new_tree: Tree, opts: DiffOptions): Promise; /** * * * @static * @param {Repository} repo - * @param {Tree} old_tree + * @param {Tree} oldTree * @param {DiffOptions} opts * @returns {Promise} * * @memberof Diff */ - static treeToWorkdir(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + static treeToWorkdir(repo: Repository, oldTree: Tree, opts: DiffOptions): Promise; /** * * * @static * @param {Repository} repo - * @param {Tree} old_tree + * @param {Tree} oldTree * @param {DiffOptions} opts * @returns {Promise} * * @memberof Diff */ - static treeToWorkdirWithIndex(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + static treeToWorkdirWithIndex(repo: Repository, oldTree: Tree, opts: DiffOptions): Promise; /** * diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index a805a19c97..ebc7f692f2 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -45,22 +45,22 @@ export class Index { * * * @static - * @param {string} index_path + * @param {string} indexPath * @returns {Promise} * * @memberof Index */ - static open(index_path: string): Promise; + static open(indexPath: string): Promise; /** * * - * @param {IndexEntry} source_entry + * @param {IndexEntry} sourceEntry * @returns {number} * * @memberof Index */ - add(source_entry: IndexEntry): number; + add(sourceEntry: IndexEntry): number; /** * * @@ -109,14 +109,14 @@ export class Index { /** * * - * @param {IndexEntry} ancestor_entry - * @param {IndexEntry} our_entry - * @param {IndexEntry} their_entry + * @param {IndexEntry} ancestorEntry + * @param {IndexEntry} ourEntry + * @param {IndexEntry} theirEntry * @returns {number} * * @memberof Index */ - conflictAdd(ancestor_entry: IndexEntry, our_entry: IndexEntry, their_entry: IndexEntry): number; + conflictAdd(ancestorEntry: IndexEntry, ourEntry: IndexEntry, theirEntry: IndexEntry): number; /** * * @@ -308,13 +308,13 @@ export class Index { /** * * - * @param {number} at_pos + * @param {number} atPos * @param {string} prefix * @returns {number} * * @memberof Index */ - findPrefix(at_pos: number, prefix: string): number; + findPrefix(atPos: number, prefix: string): number; /** * * diff --git a/types/nodegit/merge.d.ts b/types/nodegit/merge.d.ts index 5603d2b66e..ae4a7d053c 100644 --- a/types/nodegit/merge.d.ts +++ b/types/nodegit/merge.d.ts @@ -126,13 +126,13 @@ export class Merge { * * @static * @param {Repository} repo - * @param {Tree} ancestor_tree - * @param {Tree} our_tree - * @param {Tree} their_tree + * @param {Tree} ancestorTree + * @param {Tree} ourTree + * @param {Tree} theirTree * @param {MergeOptions} opts * @returns {Promise} * * @memberof Merge */ - static trees(repo: Repository, ancestor_tree: Tree, our_tree: Tree, their_tree: Tree, opts: MergeOptions): Promise; + static trees(repo: Repository, ancestorTree: Tree, ourTree: Tree, theirTree: Tree, opts: MergeOptions): Promise; } diff --git a/types/nodegit/note.d.ts b/types/nodegit/note.d.ts index 1e9382b712..e1412afe3c 100644 --- a/types/nodegit/note.d.ts +++ b/types/nodegit/note.d.ts @@ -8,7 +8,7 @@ export class Note { * * @static * @param {Repository} repo - * @param {string} notes_ref + * @param {string} notesRef * @param {Signature} author * @param {Signature} committer * @param {Oid} oid @@ -18,61 +18,61 @@ export class Note { * * @memberof Note */ - static create(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid, note: string, force: number): Promise; + static create(repo: Repository, notesRef: string, author: Signature, committer: Signature, oid: Oid, note: string, force: number): Promise; /** * * * @static * @param {Repository} repo - * @param {string} notes_ref - * @param {Function} note_cb + * @param {string} notesRef + * @param {Function} noteCb * @param {*} payload * @returns {Promise} * * @memberof Note */ - static foreach(repo: Repository, notes_ref: string, note_cb: Function, payload: any): Promise; + static foreach(repo: Repository, notesRef: string, noteCb: Function, payload: any): Promise; /** * * * @static * @param {Repository} repo - * @param {string} notes_ref + * @param {string} notesRef * @returns {Promise} * * @memberof Note */ - static iteratorNew(repo: Repository, notes_ref: string): Promise; + static iteratorNew(repo: Repository, notesRef: string): Promise; /** * * * @static - * @param {Oid} note_id - * @param {Oid} annotated_id + * @param {Oid} noteId + * @param {Oid} annotatedId * @param {*} it * @returns {number} * * @memberof Note */ - static next(note_id: Oid, annotated_id: Oid, it: any): number; + static next(noteId: Oid, annotatedId: Oid, it: any): number; /** * * * @static * @param {Repository} repo - * @param {string} notes_ref + * @param {string} notesRef * @param {Oid} oid * @returns {Promise} * * @memberof Note */ - static read(repo: Repository, notes_ref: string, oid: Oid): Promise; + static read(repo: Repository, notesRef: string, oid: Oid): Promise; /** * * * @static * @param {Repository} repo - * @param {string} notes_ref + * @param {string} notesRef * @param {Signature} author * @param {Signature} committer * @param {Oid} oid @@ -80,7 +80,7 @@ export class Note { * * @memberof Note */ - static remove(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid): Promise; + static remove(repo: Repository, notesRef: string, author: Signature, committer: Signature, oid: Oid): Promise; /** * diff --git a/types/nodegit/object.d.ts b/types/nodegit/object.d.ts index 8030943e0d..747e4ffc28 100644 --- a/types/nodegit/object.d.ts +++ b/types/nodegit/object.d.ts @@ -113,12 +113,12 @@ export class Object { /** * * - * @param {number} target_type + * @param {number} targetType * @returns {Promise} * * @memberof Object */ - peel(target_type: number): Promise; + peel(targetType: number): Promise; /** * * diff --git a/types/nodegit/rebase.d.ts b/types/nodegit/rebase.d.ts index 6e254545bc..e1d64ede01 100644 --- a/types/nodegit/rebase.d.ts +++ b/types/nodegit/rebase.d.ts @@ -64,13 +64,13 @@ export class Rebase { * * @param {Signature} author * @param {Signature} committer - * @param {string} message_encoding + * @param {string} messageEncoding * @param {string} message * @returns {Oid} * * @memberof Rebase */ - commit(author: Signature, committer: Signature, message_encoding: string, message: string): Oid; + commit(author: Signature, committer: Signature, messageEncoding: string, message: string): Oid; /** * * diff --git a/types/nodegit/ref-log.d.ts b/types/nodegit/ref-log.d.ts index dec49731eb..78367ffccd 100644 --- a/types/nodegit/ref-log.d.ts +++ b/types/nodegit/ref-log.d.ts @@ -30,13 +30,13 @@ export class Reflog { * * @static * @param {Repository} repo - * @param {string} old_name + * @param {string} oldName * @param {string} name * @returns {number} * * @memberof Reflog */ - static rename(repo: Repository, old_name: string, name: string): number; + static rename(repo: Repository, oldName: string, name: string): number; /** * @@ -53,12 +53,12 @@ export class Reflog { * * * @param {number} idx - * @param {number} rewrite_previous_entry + * @param {number} rewritePreviousEntry * @returns {number} * * @memberof Reflog */ - drop(idx: number, rewrite_previous_entry: number): number; + drop(idx: number, rewritePreviousEntry: number): number; /** * * diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 165df83036..d1bee99365 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -110,12 +110,12 @@ export class Remote { * * * @static - * @param {string} remote_name + * @param {string} remoteName * @returns {number} * * @memberof Remote */ - static isValidName(remote_name: string): number; + static isValidName(remoteName: string): number; /** * * @@ -353,14 +353,14 @@ export class Remote { * * * @param {RemoteCallbacks} callbacks - * @param {number} update_fetchhead - * @param {number} download_tags - * @param {string} reflog_message + * @param {number} updateFetchhead + * @param {number} downloadTags + * @param {string} reflogMessage * @returns {number} * * @memberof Remote */ - updateTips(callbacks: RemoteCallbacks, update_fetchhead: number, download_tags: number, reflog_message: string): number; + updateTips(callbacks: RemoteCallbacks, updateFetchhead: number, downloadTags: number, reflogMessage: string): number; /** * * diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index bf598d5a9f..a8882b5d55 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -17,7 +17,7 @@ import { Config } from './config'; import { Merge } from './merge'; import { MergeOptions } from './merge-options'; import { Refdb } from './ref-db'; -import {Revwalk} from './rev-walk'; +import { Revwalk } from './rev-walk'; export interface RepositoryInitOptions { description: string; @@ -310,12 +310,12 @@ export class Repository { * * * @param {string} workdir - * @param {number} update_gitlink + * @param {number} updateGitLink * @returns {number} * * @memberof Repository */ - setWorkdir(workdir: string, update_gitlink: number): number; + setWorkdir(workdir: string, updateGitLink: number): number; /** * * diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 1335eb8365..0fb3af1088 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -19,13 +19,13 @@ export class Reset { * @static * @param {Repository} repo * @param {Object} target - * @param {number} reset_type - * @param {CheckoutOptions} checkout_opts + * @param {number} resetType + * @param {CheckoutOptions} checkoutOpts * @returns {Promise} * * @memberof Reset */ - static reset(repo: Repository, target: Object, reset_type: number, checkout_opts: CheckoutOptions): Promise; + static reset(repo: Repository, target: Object, resetType: number, checkoutOpts: CheckoutOptions): Promise; /** * Look up a refs's commit. * @@ -46,11 +46,11 @@ export class Reset { * @static * @param {Repository} repo * @param {AnnotatedCommit} commit - * @param {number} reset_type - * @param {CheckoutOptions} checkout_opts + * @param {number} resetType + * @param {CheckoutOptions} checkoutOpts * @returns {number} * * @memberof Reset */ - static fromAnnotated(repo: Repository, commit: AnnotatedCommit, reset_type: number, checkout_opts: CheckoutOptions): number; + static fromAnnotated(repo: Repository, commit: AnnotatedCommit, resetType: number, checkoutOpts: CheckoutOptions): number; } diff --git a/types/nodegit/rev-parse.d.ts b/types/nodegit/rev-parse.d.ts index b4ef63f2f2..098f880cd0 100644 --- a/types/nodegit/rev-parse.d.ts +++ b/types/nodegit/rev-parse.d.ts @@ -15,15 +15,15 @@ export class Revparse { * * * @static - * @param {Object} object_out - * @param {Reference} reference_out + * @param {Object} objectOut + * @param {Reference} referenceOut * @param {Repository} repo * @param {string} spec * @returns {number} * * @memberof Revparse */ - static ext(object_out: Object, reference_out: Reference, repo: Repository, spec: string): number; + static ext(objectOut: Object, referenceOut: Reference, repo: Repository, spec: string): number; /** * * diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts index 82b322cd79..2736f57323 100644 --- a/types/nodegit/rev-walk.d.ts +++ b/types/nodegit/rev-walk.d.ts @@ -26,12 +26,12 @@ export class Revwalk { /** * * - * @param {Oid} commit_id + * @param {Oid} commitId * @returns {number} * * @memberof Revwalk */ - hide(commit_id: Oid): number; + hide(commitId: Oid): number; /** * * @@ -143,22 +143,22 @@ export class Revwalk { /** * * - * @param {number} max_count + * @param {number} maxCount * @returns {Promise} * * @memberof Revwalk */ - fastWalk(max_count: number): Promise; + fastWalk(maxCount: number): Promise; /** * * * @param {string} filePath - * @param {number} max_count + * @param {number} maxCount * @returns {Promise} * * @memberof Revwalk */ - fileHistoryWalk(filePath: string, max_count: number): Promise; + fileHistoryWalk(filePath: string, maxCount: number): Promise; /** * Walk the history from the given oid. The callback is invoked for each commit; When the walk is over, the callback is invoked with (null, null). * diff --git a/types/nodegit/revert.d.ts b/types/nodegit/revert.d.ts index ac0cbf531a..2e04f78758 100644 --- a/types/nodegit/revert.d.ts +++ b/types/nodegit/revert.d.ts @@ -29,7 +29,7 @@ export class Revert { * * @static * @param {Repository} repo - * @param {Commit} revert_commit + * @param {Commit} revertCommit * @param {Commit} ourCommit * @param {number} mainline * @param {MergeOptions} mergeOptions @@ -37,5 +37,5 @@ export class Revert { * * @memberof Revert */ - static commit(repo: Repository, revert_commit: Commit, ourCommit: Commit, mainline: number, mergeOptions: MergeOptions): Promise; + static commit(repo: Repository, revertCommit: Commit, ourCommit: Commit, mainline: number, mergeOptions: MergeOptions): Promise; } diff --git a/types/nodegit/submodule.d.ts b/types/nodegit/submodule.d.ts index b9293f6bae..a946e28fa4 100644 --- a/types/nodegit/submodule.d.ts +++ b/types/nodegit/submodule.d.ts @@ -52,12 +52,12 @@ export class Submodule { * @param {Repository} repo * @param {string} url * @param {string} path - * @param {number} use_gitlink + * @param {number} useGitLink * @returns {Promise} * * @memberof Submodule */ - static addSetup(repo: Repository, url: string, path: string, use_gitlink: number): Promise; + static addSetup(repo: Repository, url: string, path: string, useGitLink: number): Promise; /** * * @@ -110,12 +110,12 @@ export class Submodule { * @static * @param {Repository} repo * @param {string} name - * @param {number} fetch_recurse_submodules + * @param {number} fetchRecurseSubmodules * @returns {number} * * @memberof Submodule */ - static setFetchRecurseSubmodules(repo: Repository, name: string, fetch_recurse_submodules: number): number; + static setFetchRecurseSubmodules(repo: Repository, name: string, fetchRecurseSubmodules: number): number; /** * * @@ -187,12 +187,12 @@ export class Submodule { /** * * - * @param {number} write_index + * @param {number} writeIndex * @returns {Promise} * * @memberof Submodule */ - addToIndex(write_index: number): Promise; + addToIndex(writeIndex: number): Promise; /** * * @@ -301,12 +301,12 @@ export class Submodule { /** * * - * @param {number} use_gitlink + * @param {number} useGitLink * @returns {Promise} * * @memberof Submodule */ - repoInit(use_gitlink: number): Promise; + repoInit(useGitLink: number): Promise; /** * * diff --git a/types/nodegit/tag.d.ts b/types/nodegit/tag.d.ts index 8c419ce15f..f676c72ab5 100644 --- a/types/nodegit/tag.d.ts +++ b/types/nodegit/tag.d.ts @@ -10,7 +10,7 @@ export class Tag { * * @static * @param {Repository} repo - * @param {string} tag_name + * @param {string} tagName * @param {Object} target * @param {Signature} tagger * @param {string} message @@ -18,13 +18,13 @@ export class Tag { * * @memberof Tag */ - static annotationCreate(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string): Promise; + static annotationCreate(repo: Repository, tagName: string, target: Object, tagger: Signature, message: string): Promise; /** * * * @static * @param {Repository} repo - * @param {string} tag_name + * @param {string} tagName * @param {Object} target * @param {Signature} tagger * @param {string} message @@ -33,31 +33,31 @@ export class Tag { * * @memberof Tag */ - static create(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string, force: number): Promise; + static create(repo: Repository, tagName: string, target: Object, tagger: Signature, message: string, force: number): Promise; /** * * * @static * @param {Repository} repo - * @param {string} tag_name + * @param {string} tagName * @param {Object} target * @param {number} force * @returns {Promise} * * @memberof Tag */ - static createLightweight(repo: Repository, tag_name: string, target: Object, force: number): Promise; + static createLightweight(repo: Repository, tagName: string, target: Object, force: number): Promise; /** * * * @static * @param {Repository} repo - * @param {string} tag_name + * @param {string} tagName * @returns {Promise} * * @memberof Tag */ - static delete(repo: Repository, tag_name: string): Promise; + static delete(repo: Repository, tagName: string): Promise; /** * * @@ -72,14 +72,14 @@ export class Tag { * * * @static - * @param {Strarray} tag_names + * @param {Strarray} tagNames * @param {string} pattern * @param {Repository} repo * @returns {number} * * @memberof Tag */ - static listMatch(tag_names: Strarray, pattern: string, repo: Repository): number; + static listMatch(tagNames: Strarray, pattern: string, repo: Repository): number; /** * Retrieves the tag pointed to by the oid * From 6b44fac17517f6501ed75b2dd97b8c06b5658310 Mon Sep 17 00:00:00 2001 From: clarenceh Date: Sat, 10 Jun 2017 13:22:28 +0800 Subject: [PATCH 313/761] Updated for massive 3.0.0-rc1 --- types/massive/index.d.ts | 146 +++++++++++---------------------- types/massive/massive-tests.ts | 18 +++- types/massive/tsconfig.json | 4 +- 3 files changed, 66 insertions(+), 102 deletions(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 512c9067e2..f97d047c30 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -1,105 +1,57 @@ -// Type definitions for massive-js 2.2 -// Project: https://github.com/robconery/massive-js +// Type definitions for massive 3.0.0-rc1 +// Project: https://github.com/dmfay/massive-js.git // Definitions by: Pascal Birchler +// Clarence Ho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export namespace massive { - interface ConnectionOptions { - connectionString?: string; - db?: string; - } +/// - interface Doc { - findDoc(context: any, callback: ResultCallback): void; - searchDoc( - options: { keys: string[], term: string }, - callback: ResultCallback): void; - saveDoc(context: string, callback: ResultCallback): void; - destroy(context: any, callback: ResultCallback): void; - } +export = massive; - interface QueryFile { - schema: string; - name: string; - db: Massive; - delimitedName: string; - delimitedSchema: string; - fullname: string; - delimitedFullName: string; - sql: string; - filePath: string; - } +declare function massive( + connection: object | string, + loaderConfig?: object, + driverConfig?: object): Promise; - interface QueryFunction { - find(params: any|any[], callback: ResultCallback): void; - } +declare namespace massive { + + export interface ConnectionInfo { + + user?: string; + database?: string; + password?: string | null; + port?: number; + host?: string; + ssl?: boolean; + application_name?: string; + fallback_application_name?: boolean; + + } + + export interface Database { + + attach(ctor: Function, ...sources: (Function | Promise)[]): Promise; + + detach(entity: string, collection: string): void; + + reload(): void; + + query(query: any, params: any, options: any): Promise; + + saveDoc(collection: any, doc: any): any; + + createDocumentTable(path: any): Promise; + + getObject(path: any, collection: any): object; + + dropTable(table: string, options: any): void; + + createSchema(schemaName: string): void; + + dropSchema(schemaName: string, options: any): void; + + [name: string]: any; + + } - interface QueryArguments { - sql: string; - options: any; - params: any; - next: ResultCallback; - } } - -export interface Massive { - custom: any; - comment: Table; - friendship: Table; - participation: Table; - person: Table; - practice: Table; - practicesession: Table; - sport: Table; - testdata(callback: ResultCallback): void; - team: Table; - teammember: Table; - teamsport: Table; - scriptsDir: string; - connectionString: string; - query(): void; - stream(): void; - executeSqlFile(args: any, next: ResultCallback): void; - end(): void; - tables: Array; - views: any[]; - queryFiles: massive.QueryFile[]; - schemas: any[]; - functions: any[]; - allowedSchemas: string; - blacklist: string; - exceptions: string; - excludeFunctions: boolean; - functionBlacklist: string; -} - -export type ResultCallback = (err: Error, res: any) => void; -export type ConnectCallback = (err: Error, db: Massive) => void; - -export interface QueryOptions { - limit?: number; - order?: string; - offset?: number; - columns?: string[]; -} - -export interface Table { - count(context: any, callback: ResultCallback): void; - find(context: any, callback: ResultCallback): void; - find(context: any, options: QueryOptions, callback: ResultCallback): void; - findOne(context: any, callback: ResultCallback): void; - findOne(context: any, options: QueryOptions, callback: ResultCallback): void; - insert(context: any, callback: ResultCallback): void; - save(context: any, callback: ResultCallback): void; - update(context: any, callback: ResultCallback): void; - update(context: any, data: any, callback: ResultCallback): void; - destroy(context: any, callback: ResultCallback): void; -} - -export function connectSync(options: massive.ConnectionOptions): Massive; - -export function connect(options: massive.ConnectionOptions, callback: ConnectCallback): void; - -export function run(context: string, filter: number|number[], callback: ResultCallback): void; - -export function saveDoc(name: string, data: any, callback: ResultCallback): void; diff --git a/types/massive/massive-tests.ts b/types/massive/massive-tests.ts index cb53e3e7c8..9a28910c23 100644 --- a/types/massive/massive-tests.ts +++ b/types/massive/massive-tests.ts @@ -1,5 +1,17 @@ -import * as Massive from 'massive'; +import massive = require('massive'); -Massive.connect({connectionString: 'foo'}, (err: Error, db: Massive.Massive) => {}); +let dbconn: massive.Database; -Massive.run('foo', 123, (err: Error, db: Massive.Massive) => {}); +function findUserById(id: number): Promise { + return dbconn.users.findOne({id: id}); +} + +massive('postgres://app:password@localhost:5432/app').then( db => { + + console.log(`DB connected successfully`); + + dbconn = db; + + findUserById(1).then(user => console.log(`User: ${JSON.stringify(user)}`)); + +}); diff --git a/types/massive/tsconfig.json b/types/massive/tsconfig.json index 7c91e19b44..cfa32399c8 100644 --- a/types/massive/tsconfig.json +++ b/types/massive/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5" + "es2015" ], "noImplicitAny": true, "noImplicitThis": true, @@ -19,4 +19,4 @@ "index.d.ts", "massive-tests.ts" ] -} \ No newline at end of file +} From 5db985c075eea3380543f14dd2d74dc7cee2c45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Parditka?= Date: Sat, 10 Jun 2017 07:27:37 +0200 Subject: [PATCH 314/761] Added workaround for TS 2.4. --- types/mithril/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/mithril/index.d.ts b/types/mithril/index.d.ts index e17064abfc..006e649d6e 100644 --- a/types/mithril/index.d.ts +++ b/types/mithril/index.d.ts @@ -44,6 +44,8 @@ declare namespace Mithril { onbeforeupdate?(this: State, vnode: Vnode, old: VnodeDOM): boolean | void; /** The onremove hook is called before a DOM element is removed from the document. */ onupdate?(this: State, vnode: VnodeDOM): any; + /** WORKAROUND: TypeScript 2.4 does not allow extending an interface with all-optional properties. */ + [_: number]: any; } interface Hyperscript { From 89da66a28bdb0a4354c5552a33a54edf947e3fef Mon Sep 17 00:00:00 2001 From: clarenceh Date: Sat, 10 Jun 2017 14:19:30 +0800 Subject: [PATCH 315/761] Minor updates --- types/massive/index.d.ts | 2 +- types/massive/massive-tests.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index f97d047c30..9f68b030ce 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -30,7 +30,7 @@ declare namespace massive { export interface Database { - attach(ctor: Function, ...sources: (Function | Promise)[]): Promise; + attach(ctor: any, ...sources: Array): Promise; detach(entity: string, collection: string): void; diff --git a/types/massive/massive-tests.ts b/types/massive/massive-tests.ts index 9a28910c23..30cb977596 100644 --- a/types/massive/massive-tests.ts +++ b/types/massive/massive-tests.ts @@ -12,6 +12,8 @@ massive('postgres://app:password@localhost:5432/app').then( db => { dbconn = db; - findUserById(1).then(user => console.log(`User: ${JSON.stringify(user)}`)); +}).catch(err => { + + console.error(`Error connecting DB`); }); From 09a3e2fa0ef0cf15aecd5179da72411e80446887 Mon Sep 17 00:00:00 2001 From: clarenceh Date: Sat, 10 Jun 2017 14:37:53 +0800 Subject: [PATCH 316/761] Fix lint and test errors --- types/massive/index.d.ts | 25 +++++-------------------- types/massive/massive-tests.ts | 9 --------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 9f68b030ce..08a4ed6b7b 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for massive 3.0.0-rc1 +// Type definitions for massive 3.0 // Project: https://github.com/dmfay/massive-js.git // Definitions by: Pascal Birchler // Clarence Ho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// @@ -14,9 +15,7 @@ declare function massive( driverConfig?: object): Promise; declare namespace massive { - - export interface ConnectionInfo { - + interface ConnectionInfo { user?: string; database?: string; password?: string | null; @@ -25,33 +24,19 @@ declare namespace massive { ssl?: boolean; application_name?: string; fallback_application_name?: boolean; - } - export interface Database { - - attach(ctor: any, ...sources: Array): Promise; - + interface Database { + attach(ctor: any, ...sources: any[]): Promise; detach(entity: string, collection: string): void; - reload(): void; - query(query: any, params: any, options: any): Promise; - saveDoc(collection: any, doc: any): any; - createDocumentTable(path: any): Promise; - getObject(path: any, collection: any): object; - dropTable(table: string, options: any): void; - createSchema(schemaName: string): void; - dropSchema(schemaName: string, options: any): void; - [name: string]: any; - } - } diff --git a/types/massive/massive-tests.ts b/types/massive/massive-tests.ts index 30cb977596..e43755b7f3 100644 --- a/types/massive/massive-tests.ts +++ b/types/massive/massive-tests.ts @@ -2,18 +2,9 @@ import massive = require('massive'); let dbconn: massive.Database; -function findUserById(id: number): Promise { - return dbconn.users.findOne({id: id}); -} - massive('postgres://app:password@localhost:5432/app').then( db => { - console.log(`DB connected successfully`); - dbconn = db; - }).catch(err => { - console.error(`Error connecting DB`); - }); From c8f6820103e777d5775dd896ba76b2836a2d9cae Mon Sep 17 00:00:00 2001 From: clarenceh Date: Sat, 10 Jun 2017 14:43:31 +0800 Subject: [PATCH 317/761] Update massive version number --- types/massive/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 08a4ed6b7b..2e1493242f 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for massive 3.0 +// Type definitions for massive 3.0.0 // Project: https://github.com/dmfay/massive-js.git // Definitions by: Pascal Birchler // Clarence Ho From c3c731a101d24bd1bfd8100226ba56e55bc5657d Mon Sep 17 00:00:00 2001 From: clarenceh Date: Sat, 10 Jun 2017 14:46:28 +0800 Subject: [PATCH 318/761] Updated version no. --- types/massive/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 2e1493242f..8a55659414 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for massive 3.0.0 +// Type definitions for massive v3.x // Project: https://github.com/dmfay/massive-js.git // Definitions by: Pascal Birchler // Clarence Ho From 88ce1b7d5775ab4bf3cbc45ec60461a9cfd0daae Mon Sep 17 00:00:00 2001 From: clarenceh Date: Sat, 10 Jun 2017 14:51:03 +0800 Subject: [PATCH 319/761] Updated version --- types/massive/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 8a55659414..1ed6b62ac6 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for massive v3.x +// Type definitions for massive 3.x // Project: https://github.com/dmfay/massive-js.git // Definitions by: Pascal Birchler // Clarence Ho From a51ac28b167787694a3cd6d2daa2de6cba83c7d0 Mon Sep 17 00:00:00 2001 From: Chris Gervang Date: Sat, 10 Jun 2017 13:16:18 -0700 Subject: [PATCH 320/761] added Legend, Axis title, and Data types are Partials --- types/plotly.js/index.d.ts | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index c35811aa4d..7a631c76eb 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -40,11 +40,27 @@ declare namespace Plotly { 'xaxis.autorange': boolean; 'yaxis.autorange': boolean; shapes: Array>; + legend: Partial + } + + interface Legend { + traceorder: "grouped" | "normal" | "reversed" + x: number + y: number + font: Partial + bgcolor: string + bordercolor: string + borderwidth: number + orientation: "v" | "h" + tracegroupgap: number + xanchor: 'auto' | 'left' | 'center' | 'right' + yanchor: 'auto' | 'top' | 'middle' | 'bottom' } type AxisType = "date" | "log" | "linear"; interface Axis { + title: string showgrid: boolean; fixedrange: boolean; rangemode: "tozero" | 'normal' | 'nonnegative'; @@ -104,7 +120,7 @@ declare namespace Plotly { type Dash = 'solid' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot'; - type Data = ScatterData | BarData; + type Data = Partial | Partial; // Bar interface BarData { @@ -132,9 +148,10 @@ declare namespace Plotly { } interface ScatterMarker { - symbol: ""; // Drawing.symbolList - opacity: number; - size: number; + symbol: string | string[]; // Drawing.symbolList + color: string | string[] + opacity: number | number[]; + size: number | number[]; maxdisplayed: number; sizeref: number; sizemin: number; From 322433919ab544d32b289f33217a8978a06cd63b Mon Sep 17 00:00:00 2001 From: Chris Gervang Date: Sat, 10 Jun 2017 13:20:23 -0700 Subject: [PATCH 321/761] lint corrections and version bump --- types/plotly.js/index.d.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 7a631c76eb..04de340c22 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for plotly.js 1.22 +// Type definitions for plotly.js 1.27 // Project: https://plot.ly/javascript/ // Definitions by: Chris Gervang , Martin Duparc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -40,27 +40,27 @@ declare namespace Plotly { 'xaxis.autorange': boolean; 'yaxis.autorange': boolean; shapes: Array>; - legend: Partial + legend: Partial; } interface Legend { - traceorder: "grouped" | "normal" | "reversed" - x: number - y: number - font: Partial - bgcolor: string - bordercolor: string - borderwidth: number - orientation: "v" | "h" - tracegroupgap: number - xanchor: 'auto' | 'left' | 'center' | 'right' - yanchor: 'auto' | 'top' | 'middle' | 'bottom' + traceorder: "grouped" | "normal" | "reversed"; + x: number; + y: number; + font: Partial; + bgcolor: string; + bordercolor: string; + borderwidth: number; + orientation: "v" | "h"; + tracegroupgap: number; + xanchor: 'auto' | 'left' | 'center' | 'right'; + yanchor: 'auto' | 'top' | 'middle' | 'bottom'; } type AxisType = "date" | "log" | "linear"; interface Axis { - title: string + title: string; showgrid: boolean; fixedrange: boolean; rangemode: "tozero" | 'normal' | 'nonnegative'; @@ -149,7 +149,7 @@ declare namespace Plotly { interface ScatterMarker { symbol: string | string[]; // Drawing.symbolList - color: string | string[] + color: string | string[]; opacity: number | number[]; size: number | number[]; maxdisplayed: number; From 4e4d4d3879e87f181dcaff62036bfa2f5cb51327 Mon Sep 17 00:00:00 2001 From: Yui T Date: Sat, 10 Jun 2017 20:33:46 -0700 Subject: [PATCH 322/761] constraint type parameter in Map and Pane --- types/react-leaflet/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index 76a1be1125..9c70a79ddf 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -143,7 +143,7 @@ export interface MapProps extends MapEvents, Leaflet.MapOptions, Leaflet.LocateO zoom?: number; } -export class Map

extends MapComponent { +export class Map

extends MapComponent { className?: string; container: HTMLDivElement; getChildContext(): { layerContainer: E, map: E }; @@ -165,7 +165,7 @@ export interface PaneProps { export interface PaneState { name?: string; } -export class Pane

extends React.Component { +export class Pane

extends React.Component { getChildContext(): { pane: string }; createPane(props: P): void; removePane(): void; From c818a5296e123449454d5160e8530fcb461d965a Mon Sep 17 00:00:00 2001 From: Yui T Date: Sat, 10 Jun 2017 20:48:12 -0700 Subject: [PATCH 323/761] add missing constraint --- types/react-leaflet/index.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index 9c70a79ddf..8af2bbd14b 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -224,7 +224,7 @@ export interface MarkerProps extends MarkerEvents, Leaflet.MarkerOptions { children?: Children; position: Leaflet.LatLngExpression; } -export class Marker

extends MapLayer { +export class Marker

extends MapLayer { getChildContext(): { popupContainer: E }; } @@ -248,12 +248,12 @@ export interface CircleMarkerProps extends PathEvents, Leaflet.CircleMarkerOptio children?: Children; radius: number; } -export class CircleMarker

extends Path { } +export class CircleMarker

extends Path { } export interface FeatureGroupProps extends FeatureGroupEvents, Leaflet.PathOptions { children?: Children; } -export class FeatureGroup

extends Path { +export class FeatureGroup

extends Path { getChildContext(): { layerContainer: E, popupContainer: E }; } @@ -268,14 +268,14 @@ export interface PolylineProps extends PathEvents, Leaflet.PolylineOptions { children?: Children; positions: Leaflet.LatLngExpression[] | Leaflet.LatLngExpression[][]; } -export class Polyline

extends Path { } +export class Polyline

extends Path { } export interface PolygonProps extends PathEvents, Leaflet.PolylineOptions { children?: Children; popupContainer?: Leaflet.FeatureGroup; positions: Leaflet.LatLngExpression[] | Leaflet.LatLngExpression[][] | Leaflet.LatLngExpression[][][]; } -export class Polygon

extends Path { } +export class Polygon

extends Path { } export interface RectangleProps extends PathEvents, Leaflet.PolylineOptions { children?: Children; @@ -288,7 +288,7 @@ export interface PopupProps extends Leaflet.PopupOptions { children?: Children; position?: Leaflet.LatLngExpression; } -export class Popup

extends MapComponent { +export class Popup

extends MapComponent { onPopupOpen(arg: { popup: E }): void; onPopupClose(arg: { popup: E }): void; renderPopupContent(): void; @@ -298,7 +298,7 @@ export class Popup

extends MapComponent export interface TooltipProps extends Leaflet.TooltipOptions { children?: Children; } -export class Tooltip

extends MapComponent { +export class Tooltip

extends MapComponent { onTooltipOpen(arg: { tooltip: E }): void; onTooltipClose(arg: { tooltip: E }): void; renderTooltipContent(): void; From 3417d93fdc3179adc5edecb5c09a071b8de0048b Mon Sep 17 00:00:00 2001 From: Yui T Date: Sat, 10 Jun 2017 20:51:35 -0700 Subject: [PATCH 324/761] add more missing constraint --- types/react-leaflet/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index 8af2bbd14b..618fcd5c73 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -241,7 +241,7 @@ export interface CircleProps extends PathEvents, Leaflet.CircleMarkerOptions { children?: Children; radius: number; } -export class Circle

extends Path { } +export class Circle

extends Path { } export interface CircleMarkerProps extends PathEvents, Leaflet.CircleMarkerOptions { center: Leaflet.LatLngExpression; @@ -282,7 +282,7 @@ export interface RectangleProps extends PathEvents, Leaflet.PolylineOptions { bounds: Leaflet.LatLngBoundsExpression; popupContainer?: Leaflet.FeatureGroup; } -export class Rectangle

extends Path { } +export class Rectangle

extends Path { } export interface PopupProps extends Leaflet.PopupOptions { children?: Children; @@ -298,7 +298,7 @@ export class Popup

extends MapComponent { +export class Tooltip

extends MapComponent { onTooltipOpen(arg: { tooltip: E }): void; onTooltipClose(arg: { tooltip: E }): void; renderTooltipContent(): void; From be064f6e2f98d29d5af2e3eecfbadaaa3a193c73 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 10 Jun 2017 20:57:06 -0700 Subject: [PATCH 325/761] Add rudimentary `hubot` type definitions --- types/hubot/index.d.ts | 53 +++++++++++++++++++++++++++++++++++++++ types/hubot/tsconfig.json | 21 ++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 types/hubot/index.d.ts create mode 100644 types/hubot/tsconfig.json diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts new file mode 100644 index 0000000000..6e81398a33 --- /dev/null +++ b/types/hubot/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for hubot 2.19.0 +// Project: https://hubot.github.com +// Definitions by: Dirk Gadsden +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'hubot' { + interface Brain { + userForId: (id: any) => any + } + + interface User { + id: any + name: string + } + + interface Message { + user: User + text: string + id: string + } + + interface Response { + match: RegExpMatchArray + message: Message + send: (...strings: string[]) => void + reply: (...strings: string[]) => void + random: (items: T[]) => T + } + + interface ListenerCallback { + (response: Response): void + } + + interface HearWithOptions { + (regex: RegExp, options: any, callback: ListenerCallback): void + } + interface HearWithoutOptions { + (regex: RegExp, callback: ListenerCallback): void + } + + interface RespondWithOptions { + (regex: RegExp, options: any, callback: ListenerCallback): void + } + interface RespondWithoutOptions { + (regex: RegExp, callback: ListenerCallback): void + } + + export interface Robot { + brain: Brain + hear: HearWithOptions & HearWithoutOptions + respond: RespondWithOptions & RespondWithoutOptions + } +} diff --git a/types/hubot/tsconfig.json b/types/hubot/tsconfig.json new file mode 100644 index 0000000000..7a0988e344 --- /dev/null +++ b/types/hubot/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} From e65b10905d5ec66f9fcae5c5d69160a9e9057e97 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 10 Jun 2017 21:09:49 -0700 Subject: [PATCH 326/761] Add semicolons to match style --- types/hubot/index.d.ts | 50 ++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index 6e81398a33..b3c58947ba 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -3,51 +3,53 @@ // Definitions by: Dirk Gadsden // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module 'hubot' { - interface Brain { - userForId: (id: any) => any +declare namespace Hubot { + class Brain { + userForId: (id: any) => any; } - interface User { - id: any - name: string + class User { + id: any; + name: string; } - interface Message { - user: User - text: string - id: string + class Message { + user: User; + text: string; + id: string; } - interface Response { - match: RegExpMatchArray - message: Message - send: (...strings: string[]) => void - reply: (...strings: string[]) => void - random: (items: T[]) => T + class Response { + match: RegExpMatchArray; + message: Message; + send: (...strings: string[]) => void; + reply: (...strings: string[]) => void; + random: (items: T[]) => T; } interface ListenerCallback { - (response: Response): void + (response: Response): void; } interface HearWithOptions { - (regex: RegExp, options: any, callback: ListenerCallback): void + (regex: RegExp, options: any, callback: ListenerCallback): void; } interface HearWithoutOptions { - (regex: RegExp, callback: ListenerCallback): void + (regex: RegExp, callback: ListenerCallback): void; } interface RespondWithOptions { - (regex: RegExp, options: any, callback: ListenerCallback): void + (regex: RegExp, options: any, callback: ListenerCallback): void; } interface RespondWithoutOptions { - (regex: RegExp, callback: ListenerCallback): void + (regex: RegExp, callback: ListenerCallback): void; } export interface Robot { - brain: Brain - hear: HearWithOptions & HearWithoutOptions - respond: RespondWithOptions & RespondWithoutOptions + brain: Brain; + hear: HearWithOptions & HearWithoutOptions; + respond: RespondWithOptions & RespondWithoutOptions; } } + +export = Hubot; From 0cdc06e03f287d97f313b3427151fd0df5df1da4 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 10 Jun 2017 21:14:57 -0700 Subject: [PATCH 327/761] Add more complete type definitions for classes' methods --- types/hubot/index.d.ts | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index b3c58947ba..f136d88ceb 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -5,7 +5,8 @@ declare namespace Hubot { class Brain { - userForId: (id: any) => any; + userForId(id: any): any; + userForName(name: string): any; } class User { @@ -22,33 +23,24 @@ declare namespace Hubot { class Response { match: RegExpMatchArray; message: Message; - send: (...strings: string[]) => void; - reply: (...strings: string[]) => void; - random: (items: T[]) => T; + + constructor(robot: Robot, message: Message, match: RegExpMatchArray); + send(...strings: string[]): void; + reply(...strings: string[]): void; + random(items: T[]): T; } interface ListenerCallback { (response: Response): void; } - interface HearWithOptions { - (regex: RegExp, options: any, callback: ListenerCallback): void; - } - interface HearWithoutOptions { - (regex: RegExp, callback: ListenerCallback): void; - } - - interface RespondWithOptions { - (regex: RegExp, options: any, callback: ListenerCallback): void; - } - interface RespondWithoutOptions { - (regex: RegExp, callback: ListenerCallback): void; - } - export interface Robot { brain: Brain; - hear: HearWithOptions & HearWithoutOptions; - respond: RespondWithOptions & RespondWithoutOptions; + + hear(regex: RegExp, callback: ListenerCallback): void; + hear(regex: RegExp, options: any, callback: ListenerCallback): void; + response(regex: RegExp, callback: ListenerCallback): void; + response(regex: RegExp, options: any, callback: ListenerCallback): void; } } From 9bb3726120be4d4c0da629fb37943541fb848df8 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 10 Jun 2017 21:21:53 -0700 Subject: [PATCH 328/761] Convert to class definition for `Robot` --- types/hubot/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index f136d88ceb..2126f7a2ff 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -34,9 +34,10 @@ declare namespace Hubot { (response: Response): void; } - export interface Robot { + class Robot { brain: Brain; + constructor(adapterPath: string, adapter: string, httpd: boolean, name: string, alias?: string); hear(regex: RegExp, callback: ListenerCallback): void; hear(regex: RegExp, options: any, callback: ListenerCallback): void; response(regex: RegExp, callback: ListenerCallback): void; From a2e65d34905fb1a0f36c6c9ecbb99d60251912b3 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 10 Jun 2017 21:22:12 -0700 Subject: [PATCH 329/761] Add basic tests file for `hubot` --- types/hubot/hubot-tests.ts | 13 +++++++++++++ types/hubot/tsconfig.json | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 types/hubot/hubot-tests.ts diff --git a/types/hubot/hubot-tests.ts b/types/hubot/hubot-tests.ts new file mode 100644 index 0000000000..98307f1097 --- /dev/null +++ b/types/hubot/hubot-tests.ts @@ -0,0 +1,13 @@ +import * as Hubot from "hubot"; + +var brain = new Hubot.Brain(); // $ExpectType Hubot.Brain +brain.userForName('someone'); // $ExpectType any + +// $ExpectType Hubot.Robot +var robot = new Hubot.Robot( + 'src/adapters', + 'slack', + false, + 'hubot', +); +robot.hear(/hello/, () => null); // $ExpectType void diff --git a/types/hubot/tsconfig.json b/types/hubot/tsconfig.json index 7a0988e344..3477a2bde8 100644 --- a/types/hubot/tsconfig.json +++ b/types/hubot/tsconfig.json @@ -16,6 +16,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "hubot-tests.ts" ] } From c34ad711717c8df439438c38a7640da6cc82c766 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 10 Jun 2017 21:28:25 -0700 Subject: [PATCH 330/761] `dts-gen` template for type definitions for `hubot` --- types/hubot/hubot-tests.ts | 0 types/hubot/index.d.ts | 4 ++++ types/hubot/tsconfig.json | 22 ++++++++++++++++++++++ types/hubot/tslint.json | 1 + 4 files changed, 27 insertions(+) create mode 100644 types/hubot/hubot-tests.ts create mode 100644 types/hubot/index.d.ts create mode 100644 types/hubot/tsconfig.json create mode 100644 types/hubot/tslint.json diff --git a/types/hubot/hubot-tests.ts b/types/hubot/hubot-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts new file mode 100644 index 0000000000..220809d09d --- /dev/null +++ b/types/hubot/index.d.ts @@ -0,0 +1,4 @@ +// Type definitions for hubot 2.19 +// Project: https://github.com/github/hubot +// Definitions by: Dirk Gadsden +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/hubot/tsconfig.json b/types/hubot/tsconfig.json new file mode 100644 index 0000000000..0e3faa4c35 --- /dev/null +++ b/types/hubot/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "hubot-tests.ts" + ] +} diff --git a/types/hubot/tslint.json b/types/hubot/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hubot/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b1b4c8a64f3d881c73ef08cc39b330108235cbc8 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 10 Jun 2017 21:43:26 -0700 Subject: [PATCH 331/761] Reorder export and fix function type --- types/hubot/index.d.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index f0daff69b6..bf21fd6160 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Dirk Gadsden // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export = Hubot; + declare namespace Hubot { class Brain { userForId(id: any): any; @@ -30,9 +32,7 @@ declare namespace Hubot { random(items: T[]): T; } - interface ListenerCallback { - (response: Response): void; - } + type ListenerCallback = (response: Response) => void; class Robot { brain: Brain; @@ -44,5 +44,3 @@ declare namespace Hubot { response(regex: RegExp, options: any, callback: ListenerCallback): void; } } - -export = Hubot; From 8e110b17d0e02f148a25bae1afb907f6be513bcf Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 10 Jun 2017 21:43:49 -0700 Subject: [PATCH 332/761] Improve tests for `hubot` definitions --- types/hubot/hubot-tests.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/types/hubot/hubot-tests.ts b/types/hubot/hubot-tests.ts index 98307f1097..9c5e832bc2 100644 --- a/types/hubot/hubot-tests.ts +++ b/types/hubot/hubot-tests.ts @@ -1,13 +1,14 @@ import * as Hubot from "hubot"; -var brain = new Hubot.Brain(); // $ExpectType Hubot.Brain +const brain = new Hubot.Brain(); +brain; // $ExpectType Brain brain.userForName('someone'); // $ExpectType any -// $ExpectType Hubot.Robot -var robot = new Hubot.Robot( +const robot = new Hubot.Robot( 'src/adapters', 'slack', false, 'hubot', ); +robot; // $ExpectType Robot robot.hear(/hello/, () => null); // $ExpectType void From 79c97393ebe7ca776d41fb603dade05f37035948 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 10 Jun 2017 22:04:57 -0700 Subject: [PATCH 333/761] Maintain compatibility with CommonJS export pattern from `hubot`'s CoffeeScript --- types/hubot/index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index bf21fd6160..6ed71de50c 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: Dirk Gadsden // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export = Hubot; - declare namespace Hubot { class Brain { userForId(id: any): any; @@ -44,3 +42,8 @@ declare namespace Hubot { response(regex: RegExp, options: any, callback: ListenerCallback): void; } } + +// Compatibility with CommonJS syntax exported by Hubot's CoffeeScript. +// tslint:disable-next-line export-just-namespace +export = Hubot; +export as namespace Hubot; From 1aed6f7d4ef58d0088aa99d1559a7cfe42b14b28 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 10 Jun 2017 22:07:41 -0700 Subject: [PATCH 334/761] Fix typo for `Hubot.Robot` --- types/hubot/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index 6ed71de50c..e0a809f69a 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -38,8 +38,8 @@ declare namespace Hubot { constructor(adapterPath: string, adapter: string, httpd: boolean, name: string, alias?: string); hear(regex: RegExp, callback: ListenerCallback): void; hear(regex: RegExp, options: any, callback: ListenerCallback): void; - response(regex: RegExp, callback: ListenerCallback): void; - response(regex: RegExp, options: any, callback: ListenerCallback): void; + respond(regex: RegExp, callback: ListenerCallback): void; + respond(regex: RegExp, options: any, callback: ListenerCallback): void; } } From 640742de3b44921d7b282b4c331329cc9d32f793 Mon Sep 17 00:00:00 2001 From: clarenceh Date: Sun, 11 Jun 2017 15:43:56 +0800 Subject: [PATCH 335/761] Add and fix types definition for massive js 3.0 --- types/massive/index.d.ts | 46 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 1ed6b62ac6..1bf0550b2c 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for massive 3.x +// Type definitions for massive 3.0 // Project: https://github.com/dmfay/massive-js.git // Definitions by: Pascal Birchler // Clarence Ho @@ -10,7 +10,7 @@ export = massive; declare function massive( - connection: object | string, + connection: massive.ConnectionInfo | string, loaderConfig?: object, driverConfig?: object): Promise; @@ -26,17 +26,55 @@ declare namespace massive { fallback_application_name?: boolean; } + interface QueryOptions { + columns?: string[]; + limit?: number; + offset?: number; + only?: boolean; + order?: string[]; + orderBody?: boolean; + build?: boolean; + document?: boolean; + single?: boolean; + stream?: boolean; + } + + interface SearchCriteria { + fields: string[]; + term: string; + } + + interface Table { + find(criteria: object | {}, queryOptions?: QueryOptions): Promise; + findOne(criteria: number | object, queryOptions?: QueryOptions): Promise; + count(criteria: object): Promise; + where(query: string, params: any[] | object): Promise; + search(criteria: SearchCriteria, queryOptions?: QueryOptions): Promise; + save(data: object): Promise; + insert(data: object): Promise; + update(dataOrCriteria: object, changesMap?: object): Promise; + destroy(criteria: object): Promise; + } + + interface Document { + countDoc(criteria: object): Promise; + findDoc(criteria: number | string| object): Promise; + searchDoc(criteria: SearchCriteria): Promise; + saveDoc(doc: object): Promise; + modify(docId: number | string, doc: object, fieldName?: string): Promise; + } + interface Database { attach(ctor: any, ...sources: any[]): Promise; detach(entity: string, collection: string): void; reload(): void; query(query: any, params: any, options: any): Promise; - saveDoc(collection: any, doc: any): any; + saveDoc(collectionName: string, doc: object): Promise; createDocumentTable(path: any): Promise; getObject(path: any, collection: any): object; dropTable(table: string, options: any): void; createSchema(schemaName: string): void; dropSchema(schemaName: string, options: any): void; - [name: string]: any; + run(query: string, params: any[] | object): Promise; } } From cb9c454213520c636c594e99b043647e7d01ac8a Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Sun, 11 Jun 2017 10:50:12 +0200 Subject: [PATCH 336/761] Add missing triangle prop to react-color GitHub GithubPicker has the "triangle" prop, missing from the types. From the docs: > triangle - String, Either hide, top-left or top-right. Default top-left --- types/react-color/index.d.ts | 2 +- types/react-color/lib/components/github/Github.d.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-color/index.d.ts b/types/react-color/index.d.ts index 798f44d6eb..579ec8e73a 100644 --- a/types/react-color/index.d.ts +++ b/types/react-color/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-color 2.11 // Project: https://github.com/casesandberg/react-color/ -// Definitions by: Karol Janyst +// Definitions by: Karol Janyst , Marks Polakovs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 diff --git a/types/react-color/lib/components/github/Github.d.ts b/types/react-color/lib/components/github/Github.d.ts index fd1479abad..05df2f01a9 100644 --- a/types/react-color/lib/components/github/Github.d.ts +++ b/types/react-color/lib/components/github/Github.d.ts @@ -4,6 +4,7 @@ import { ColorPickerProps } from "react-color"; export interface GithubPickerProps extends ColorPickerProps { colors?: string[]; width?: string; + triangle?: 'hide' | 'top-left' | 'top-right'; } export default class GithubPicker extends Component {} From a87ec5fe4911f3979cdcee9fa5b3ee6fbba1f8b8 Mon Sep 17 00:00:00 2001 From: Cyril Schumacher Date: Sun, 11 Jun 2017 12:31:34 +0200 Subject: [PATCH 337/761] Update bunnymq definition (2.3.2). --- types/bunnymq/bunnymq-tests.ts | 21 ++++------------ types/bunnymq/index.d.ts | 45 +++++++++------------------------- 2 files changed, 16 insertions(+), 50 deletions(-) diff --git a/types/bunnymq/bunnymq-tests.ts b/types/bunnymq/bunnymq-tests.ts index 4105363f25..e83fe606da 100644 --- a/types/bunnymq/bunnymq-tests.ts +++ b/types/bunnymq/bunnymq-tests.ts @@ -4,31 +4,20 @@ import * as bunnymq from "bunnymq"; var instance = bunnymq({ host: 'amqp://localhost' }); // Publisher -instance.producer.produce('queue:name', 'Hello World!'); +instance.publish("queue:name", "message"); // Subscriber -instance.consumer.consume('queue:name', message => { }); +instance.subscribe('queue:name', (message: string) => "hello,world"); // RPC Support -instance.producer.produce('queue:name', { message: 'content' }, { rpc: true }) - .then(function (consumerResponse) { - console.log(consumerResponse); - }); - -// Routing keys -instance.producer.produce('queue:name', { message: 'content' }, { routingKey: 'my-routing-key' }); +instance.publish('queue:name', { message: 'content' }, { routingKey: 'my-routing-key', rpc: true }).then((consumerResponse: string) => { }); // Config var custom = bunnymq({ host: 'amqp://localhost', - //number of fetched messages at once on the channel prefetch: 5, - //requeue put back message into the broker if consumer crashes/trigger exception requeue: true, - //time between two reconnect (ms) timeout: 1000, - consumerSuffix: '', - //generate a hostname so we can track this connection on the broker (rabbitmq management plugin) + consumerSuffix: "", hostname: "", - //the transport to use to debug. if provided, bunnymq will show some logs transport: new Object() -}); \ No newline at end of file +}); diff --git a/types/bunnymq/index.d.ts b/types/bunnymq/index.d.ts index 1167db21ed..867ebfd82c 100644 --- a/types/bunnymq/index.d.ts +++ b/types/bunnymq/index.d.ts @@ -1,25 +1,10 @@ -// Type definitions for node-bunnymq 2.2.1 +// Type definitions for node-bunnymq 2.3.2 // Project: https://github.com/dial-once/node-bunnymq // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "bunnymq" { namespace bunnymq { - export type ConsumerCallback = (message: Object) => void; - - /** - * Consumer. - * @interface - */ - export interface Consumer { - /** - * Handle messages from a named queue. - * @param {string} queue A named queue. - * @param {ConsumerCallback} callback A callback. - */ - consume(queue: string, callback: ConsumerCallback): void; - } - /** * bunnymq instance. * @interface @@ -29,13 +14,13 @@ declare module "bunnymq" { * Consumer. * @type {Consumer} */ - consumer: Consumer; + subscribe(queueName: string, callback: (...args: any[]) => T): void; /** * Producer. * @type {Producer} */ - producer: Producer; + publish(queueName: string, message: any, options?: PublisherOptions): Promise; } /** @@ -73,6 +58,12 @@ declare module "bunnymq" { */ requeue?: boolean; + /** + * Default timeout for RPC calls. + * @type {number} + */ + rpcTimeout?: number; + /** * Time between two reconnect (in milliseconds). * @type {number} @@ -87,24 +78,10 @@ declare module "bunnymq" { } /** - * Producer. - * @inteface - */ - export interface Producer { - /** - * Send messages to a named queue. - * @param {string} queue A named queue. - * @param {Object} message A message. - * @return {Object} The consumer response. - */ - produce(queue: string, message: Object, options?: ProducerOptions): PromiseLike; - } - - /** - * Options for producer. + * Options for publisher. * @interface */ - export interface ProducerOptions { + export interface PublisherOptions { routingKey?: string; rpc?: boolean; } From 94330023d9fe246f72c306086d683c3a4b4946e6 Mon Sep 17 00:00:00 2001 From: Cyril Schumacher Date: Sun, 11 Jun 2017 13:37:59 +0200 Subject: [PATCH 338/761] Update bunnymq definition and tests. --- types/bunnymq/bunnymq-tests.ts | 12 ++-- types/bunnymq/index.d.ts | 113 +++++++++++++++++---------------- 2 files changed, 65 insertions(+), 60 deletions(-) diff --git a/types/bunnymq/bunnymq-tests.ts b/types/bunnymq/bunnymq-tests.ts index e83fe606da..3ab71dbb80 100644 --- a/types/bunnymq/bunnymq-tests.ts +++ b/types/bunnymq/bunnymq-tests.ts @@ -1,19 +1,23 @@ import * as bunnymq from "bunnymq"; // Basic usage -var instance = bunnymq({ host: 'amqp://localhost' }); +var instance = bunnymq({ host: "amqp://localhost" }); // Publisher instance.publish("queue:name", "message"); +instance.producer.produce("queue:name", "message"); + // Subscriber -instance.subscribe('queue:name', (message: string) => "hello,world"); +instance.subscribe("queue:name", (message: string) => "response"); +instance.consumer.consume("queue:name", (message: string) => "response"); // RPC Support -instance.publish('queue:name', { message: 'content' }, { routingKey: 'my-routing-key', rpc: true }).then((consumerResponse: string) => { }); +instance.publish("queue:name", { message: "content" }, { routingKey: "my-routing-key", rpc: true, timeout: 1000 }).then((consumerResponse: string) => "response"); +instance.producer.produce("queue:name", { message: "content" }, { rpc: true, routingKey: "my-routing-key", timeout: 1000 }); // Config var custom = bunnymq({ - host: 'amqp://localhost', + host: "amqp://localhost", prefetch: 5, requeue: true, timeout: 1000, diff --git a/types/bunnymq/index.d.ts b/types/bunnymq/index.d.ts index 867ebfd82c..62b96144b8 100644 --- a/types/bunnymq/index.d.ts +++ b/types/bunnymq/index.d.ts @@ -5,93 +5,94 @@ declare module "bunnymq" { namespace bunnymq { - /** - * bunnymq instance. - * @interface - */ - export interface Instance { - /** - * Consumer. - * @type {Consumer} - */ - subscribe(queueName: string, callback: (...args: any[]) => T): void; + export type ConsumerCallback = (...args: any[]) => T; + export type LoggerOutput = (format: any, ...args: any[]) => void; + export interface Connection { + [address: string]: any; + startedAt: string; + } + export interface Consumer { /** - * Producer. - * @type {Producer} + * Handle messages from a named queue. + * + * @param {string} queue A named queue. + * @param {ConsumerCallback} callback A callback. */ - publish(queueName: string, message: any, options?: PublisherOptions): Promise; + consume(queue: string, callback: ConsumerCallback): void; + } + + export interface Instance { + connection: Connection; + consumer: Consumer; + producer: Producer; + + /** + * Subscriber to handle messages from a named queue. + * + * @param {string} queue A named queue. + * @param {ConsumerCallback} callback A callback. + */ + subscribe(queueName: string, callback: ConsumerCallback): void; + + /** + * Publisher to send messages to a named queue. + * + * @type {Producer} + * @return {Promise} The consumer response. + */ + publish(queueName: string, message: any, options?: ProducerOptions): Promise; + } + + export interface Logger { + debug: LoggerOutput; + error: LoggerOutput; + info: LoggerOutput; + log: LoggerOutput; + warn: LoggerOutput; } - /** - * Options. - * @interface - */ export interface Options { - /** - * Consumer suffix. - * @type {string} - */ consumerSuffix?: string; - - /** - * Host. - * @type {string} - */ host?: string; - - /** - * Hostname. - * @type {string} - */ hostname?: string; /** * Number of fetched messages at once on the channel. + * * @type {number} */ prefetch?: number; /** * Requeue put back message into the broker if consumer crashes/trigger exception. + * * @type {boolean} */ requeue?: boolean; - - /** - * Default timeout for RPC calls. - * @type {number} - */ rpcTimeout?: number; - - /** - * Time between two reconnect (in milliseconds). - * @type {number} - */ timeout?: number; - - /** - * Transport. - * @type {any} - */ transport?: any; } - /** - * Options for publisher. - * @interface - */ - export interface PublisherOptions { + export interface Producer { + /** + * Send messages to a named queue. + * + * @param {string} queue A named queue. + * @param {any} message A message. + * @return {Promise} The consumer response. + */ + produce(queue: string, message: any, options?: ProducerOptions): Promise; + } + + export interface ProducerOptions { routingKey?: string; rpc?: boolean; + timeout?: number; } } - /** - * Constructor. - * @param {Options} [options] Options. - * @return {Instance} A instance of bunnymq. - */ function bunnymq(options?: bunnymq.Options): bunnymq.Instance; export = bunnymq; } From d290995d52892fe613621a59c91ad8c7b0847bba Mon Sep 17 00:00:00 2001 From: Cyril Schumacher Date: Sun, 11 Jun 2017 13:49:55 +0200 Subject: [PATCH 339/761] Add file: "tslint.json". Fix tslint errors. --- types/bunnymq/bunnymq-tests.ts | 4 +- types/bunnymq/index.d.ts | 180 ++++++++++++++++----------------- types/bunnymq/tslint.json | 3 + 3 files changed, 95 insertions(+), 92 deletions(-) create mode 100644 types/bunnymq/tslint.json diff --git a/types/bunnymq/bunnymq-tests.ts b/types/bunnymq/bunnymq-tests.ts index 3ab71dbb80..960c0b6949 100644 --- a/types/bunnymq/bunnymq-tests.ts +++ b/types/bunnymq/bunnymq-tests.ts @@ -1,7 +1,7 @@ import * as bunnymq from "bunnymq"; // Basic usage -var instance = bunnymq({ host: "amqp://localhost" }); +const instance = bunnymq({ host: "amqp://localhost" }); // Publisher instance.publish("queue:name", "message"); @@ -16,7 +16,7 @@ instance.publish("queue:name", { message: "content" }, { routingKey: "my-routing instance.producer.produce("queue:name", { message: "content" }, { rpc: true, routingKey: "my-routing-key", timeout: 1000 }); // Config -var custom = bunnymq({ +const instanceWithCustomOptions = bunnymq({ host: "amqp://localhost", prefetch: 5, requeue: true, diff --git a/types/bunnymq/index.d.ts b/types/bunnymq/index.d.ts index 62b96144b8..c4c0a770e1 100644 --- a/types/bunnymq/index.d.ts +++ b/types/bunnymq/index.d.ts @@ -1,98 +1,98 @@ -// Type definitions for node-bunnymq 2.3.2 +// Type definitions for node-bunnymq 2.3 // Project: https://github.com/dial-once/node-bunnymq // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "bunnymq" { - namespace bunnymq { - export type ConsumerCallback = (...args: any[]) => T; - export type LoggerOutput = (format: any, ...args: any[]) => void; +declare function bunnymq(options?: bunnymq.Options): bunnymq.Instance; +declare namespace bunnymq { + type ConsumerCallback = (...args: any[]) => T; + type LoggerOutput = (format: any, ...args: any[]) => void; - export interface Connection { - [address: string]: any; - startedAt: string; - } - export interface Consumer { - /** - * Handle messages from a named queue. - * - * @param {string} queue A named queue. - * @param {ConsumerCallback} callback A callback. - */ - consume(queue: string, callback: ConsumerCallback): void; - } - - export interface Instance { - connection: Connection; - consumer: Consumer; - producer: Producer; - - /** - * Subscriber to handle messages from a named queue. - * - * @param {string} queue A named queue. - * @param {ConsumerCallback} callback A callback. - */ - subscribe(queueName: string, callback: ConsumerCallback): void; - - /** - * Publisher to send messages to a named queue. - * - * @type {Producer} - * @return {Promise} The consumer response. - */ - publish(queueName: string, message: any, options?: ProducerOptions): Promise; - } - - export interface Logger { - debug: LoggerOutput; - error: LoggerOutput; - info: LoggerOutput; - log: LoggerOutput; - warn: LoggerOutput; - } - - export interface Options { - consumerSuffix?: string; - host?: string; - hostname?: string; - - /** - * Number of fetched messages at once on the channel. - * - * @type {number} - */ - prefetch?: number; - - /** - * Requeue put back message into the broker if consumer crashes/trigger exception. - * - * @type {boolean} - */ - requeue?: boolean; - rpcTimeout?: number; - timeout?: number; - transport?: any; - } - - export interface Producer { - /** - * Send messages to a named queue. - * - * @param {string} queue A named queue. - * @param {any} message A message. - * @return {Promise} The consumer response. - */ - produce(queue: string, message: any, options?: ProducerOptions): Promise; - } - - export interface ProducerOptions { - routingKey?: string; - rpc?: boolean; - timeout?: number; - } + interface Connection { + [address: string]: any; + startedAt: string; } - function bunnymq(options?: bunnymq.Options): bunnymq.Instance; - export = bunnymq; + interface Consumer { + /** + * Handle messages from a named queue. + * + * @param {string} queue A named queue. + * @param {ConsumerCallback} callback A callback. + */ + consume(queue: string, callback: ConsumerCallback): void; + } + + interface Instance { + connection: Connection; + consumer: Consumer; + producer: Producer; + + /** + * Subscriber to handle messages from a named queue. + * + * @param {string} queue A named queue. + * @param {ConsumerCallback} callback A callback. + */ + subscribe(queueName: string, callback: ConsumerCallback): void; + + /** + * Publisher to send messages to a named queue. + * + * @type {Producer} + * @return {Promise} The consumer response. + */ + publish(queueName: string, message: any, options?: ProducerOptions): Promise; + } + + interface Logger { + debug: LoggerOutput; + error: LoggerOutput; + info: LoggerOutput; + log: LoggerOutput; + warn: LoggerOutput; + } + + interface Options { + consumerSuffix?: string; + host?: string; + hostname?: string; + + /** + * Number of fetched messages at once on the channel. + * + * @type {number} + */ + prefetch?: number; + + /** + * Requeue put back message into the broker if consumer crashes/trigger exception. + * + * @type {boolean} + */ + requeue?: boolean; + rpcTimeout?: number; + timeout?: number; + transport?: any; + } + + interface Producer { + /** + * Send messages to a named queue. + * + * @param {string} queue A named queue. + * @param {any} message A message. + * @return {Promise} The consumer response. + */ + produce(queue: string, message: any, options?: ProducerOptions): Promise; + } + + interface ProducerOptions { + routingKey?: string; + rpc?: boolean; + timeout?: number; + } } + +export = bunnymq; +export as namespace bunnymq; diff --git a/types/bunnymq/tslint.json b/types/bunnymq/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/bunnymq/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 6c22ae1eb60d33c225ac30a14b4090a1d47d69d0 Mon Sep 17 00:00:00 2001 From: Kasidit Iamthong Date: Sun, 11 Jun 2017 20:28:00 +0700 Subject: [PATCH 340/761] Update `getBounds()`'s return type According to Google Maps JavaScript API V3 Reference, `getBounds()` method on `Map` class can also return `null` or `undefined`. --- types/googlemaps/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/googlemaps/index.d.ts b/types/googlemaps/index.d.ts index e2a4f89922..e2017523ad 100644 --- a/types/googlemaps/index.d.ts +++ b/types/googlemaps/index.d.ts @@ -32,7 +32,7 @@ declare namespace google.maps { export class Map extends MVCObject { constructor(mapDiv: Element|null, opts?: MapOptions); fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; - getBounds(): LatLngBounds; + getBounds(): LatLngBounds|null|undefined; getCenter(): LatLng; getDiv(): Element; getHeading(): number; From feff9f9c3813b2a285a1fd31e0a672507fd92ee9 Mon Sep 17 00:00:00 2001 From: afractal Date: Sun, 11 Jun 2017 19:29:58 +0200 Subject: [PATCH 341/761] add declarations for sharp-timer --- types/sharp-timer/index.d.ts | 52 ++++++++++++++++++++++++++ types/sharp-timer/sharp-timer-tests.ts | 11 ++++++ types/sharp-timer/tsconfig.json | 22 +++++++++++ types/sharp-timer/tslint.json | 3 ++ 4 files changed, 88 insertions(+) create mode 100644 types/sharp-timer/index.d.ts create mode 100644 types/sharp-timer/sharp-timer-tests.ts create mode 100644 types/sharp-timer/tsconfig.json create mode 100644 types/sharp-timer/tslint.json diff --git a/types/sharp-timer/index.d.ts b/types/sharp-timer/index.d.ts new file mode 100644 index 0000000000..65cf798feb --- /dev/null +++ b/types/sharp-timer/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for sharp-timer 0.3 +// Project: https://github.com/afractal/SharpTimer +// Definitions by: Hermes Gjini - afractal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type ElapsedEvent = () => void; +export type ElapsingEvent = (intervalValue: number) => void; + +export class Timer { + private _enabled; + private _stopped; + private _interval; + private _intervalElapsedEvents; + private _intervalElapsingEvents; + constructor(interval: number); + readonly enabled: boolean; + readonly stopped: boolean; + interval: number; + start(): void; + pause(): void; + resume(): void; + stop(): void; + onIntervalElapsed(intervalElapsedHandler: any): void; + onIntervalElapsing(intervalElapsingHandler: any): void; + toString(): string; + private getDoubleDigit(number); + private checkForValidInterval(interval); +} + +export class Stopwatch { + private _isRunning; + private _elapsedMilliseconds; + private _startedTimeInMillis; + private _intervalIds; + private static readonly millisPerSecond; + private static readonly millisPerMinute; + private static readonly millisPerHour; + constructor(); + readonly elapsed: string; + readonly elapsedMilliseconds: number; + readonly elapsedSeconds: number; + readonly elapsedMinutes: number; + readonly elapsedHours: number; + readonly isRunning: boolean; + static startNew(): Stopwatch; + start(): void; + stop(): void; + reset(): void; + restart(): void; + dispose(): void; + private getDoubleDigit(num); +} diff --git a/types/sharp-timer/sharp-timer-tests.ts b/types/sharp-timer/sharp-timer-tests.ts new file mode 100644 index 0000000000..685bf1b1d9 --- /dev/null +++ b/types/sharp-timer/sharp-timer-tests.ts @@ -0,0 +1,11 @@ +import { Timer, Stopwatch } from 'sharp-timer'; + +let timer = new Timer(10); + +timer.onIntervalElapsing(i => { }); +timer.onIntervalElapsed(() => { + timer.stop(); + timer = null; +}); + +timer.start(); diff --git a/types/sharp-timer/tsconfig.json b/types/sharp-timer/tsconfig.json new file mode 100644 index 0000000000..851bf69389 --- /dev/null +++ b/types/sharp-timer/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": false, + "noImplicitThis": false, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sharp-timer-tests.ts" + ] +} diff --git a/types/sharp-timer/tslint.json b/types/sharp-timer/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/sharp-timer/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From bec4cf3ed07fd50e6a0d85bb4f7b627a99272f7c Mon Sep 17 00:00:00 2001 From: clarenceh Date: Mon, 12 Jun 2017 09:26:29 +0800 Subject: [PATCH 342/761] Updated Table type to support generics --- types/massive/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 1bf0550b2c..67be093bb0 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -44,16 +44,16 @@ declare namespace massive { term: string; } - interface Table { - find(criteria: object | {}, queryOptions?: QueryOptions): Promise; - findOne(criteria: number | object, queryOptions?: QueryOptions): Promise; + interface Table { + find(criteria: object | {}, queryOptions?: QueryOptions): Promise; + findOne(criteria: number | object, queryOptions?: QueryOptions): Promise; count(criteria: object): Promise; - where(query: string, params: any[] | object): Promise; + where(query: string, params: any[] | object): Promise; search(criteria: SearchCriteria, queryOptions?: QueryOptions): Promise; - save(data: object): Promise; - insert(data: object): Promise; - update(dataOrCriteria: object, changesMap?: object): Promise; - destroy(criteria: object): Promise; + save(data: object): Promise; + insert(data: object): Promise; + update(dataOrCriteria: object, changesMap?: object): Promise; + destroy(criteria: object): Promise; } interface Document { From 465f8b7798e59f7549c9009b9dc8b79366926c74 Mon Sep 17 00:00:00 2001 From: Yui T Date: Sun, 11 Jun 2017 19:36:57 -0700 Subject: [PATCH 343/761] Add default parameter --- types/react-leaflet/index.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index 618fcd5c73..db3dc44e7c 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -181,7 +181,7 @@ export interface LayerContainer { addLayer(layer: Leaflet.Layer): this; removeLayer(layer: number | Leaflet.Layer): this; } -export class MapLayer

extends MapComponent { +export class MapLayer

extends MapComponent { createLeafletElement(props: P): E; updateLeafletElement(fromProps: P, toProps: P): void; readonly layerContainer: LayerContainer | Leaflet.Map; @@ -190,7 +190,7 @@ export class MapLayer

extends export interface GridLayerProps extends Leaflet.GridLayerOptions { children?: Children; } -export class GridLayer

extends MapLayer {} +export class GridLayer

extends MapLayer {} export interface TileLayerProps extends TileLayerEvents, Leaflet.TileLayerOptions { children?: Children; @@ -209,14 +209,14 @@ export interface ImageOverlayProps extends Leaflet.ImageOverlayOptions { children?: Children; url: string; } -export class ImageOverlay

extends MapLayer { +export class ImageOverlay

extends MapLayer { getChildContext(): { popupContainer: E }; } export interface LayerGroupProps { children?: Children; } -export class LayerGroup

extends MapLayer { +export class LayerGroup

extends MapLayer { getChildContext(): { layerContainer: E }; } @@ -262,7 +262,7 @@ export interface GeoJSONProps extends FeatureGroupEvents, Leaflet.GeoJSONOptions data: GeoJSON.GeoJsonObject; style?: Leaflet.StyleFunction; } -export class GeoJSON

extends Path { } +export class GeoJSON

extends Path { } export interface PolylineProps extends PathEvents, Leaflet.PolylineOptions { children?: Children; @@ -306,14 +306,14 @@ export class Tooltip

extends React.Component { +export class MapControl

extends React.Component { leafletElement: E; createLeafletElement(props: P): E; updateLeafletElement(fromProps: P, toProps: P): void; } export type AttributionControlProps = Leaflet.Control.AttributionOptions; -export class AttributionControl

extends MapControl { } +export class AttributionControl

extends MapControl { } export interface LayersControlProps extends LayersControlEvents, Leaflet.Control.LayersOptions { baseLayers?: Leaflet.Control.LayersObject; @@ -334,18 +334,18 @@ export namespace LayersControl { addOverlay?(layer: Leaflet.Layer, name: string, checked: boolean): void; name: string; } - class ControlledLayer

extends React.Component { + class ControlledLayer

extends React.Component { layer?: Leaflet.Layer; getChildContext(): { layerContainer: LayerContainer }; addLayer(): void; removeLayer(layer: Leaflet.Layer): void; } - class BaseLayer

extends ControlledLayer

{ } + class BaseLayer

extends ControlledLayer

{ } class Overlay

extends ControlledLayer

{ } } export type ScaleControlProps = Leaflet.Control.ScaleOptions; -export class ScaleControl

extends MapControl { } +export class ScaleControl

extends MapControl { } export type ZoomControlProps = Leaflet.Control.ZoomOptions; export class ZoomControl

extends MapControl { } From 05ddcaf6c234ee861b0f59d5f6b27acc4b914cfe Mon Sep 17 00:00:00 2001 From: Yui T Date: Sun, 11 Jun 2017 20:46:11 -0700 Subject: [PATCH 344/761] Update Cordova breaking on 2.4 --- .../cordova-plugin-battery-status/index.d.ts | 119 +++--------------- types/cordova-plugin-inappbrowser/index.d.ts | 95 +------------- 2 files changed, 18 insertions(+), 196 deletions(-) diff --git a/types/cordova-plugin-battery-status/index.d.ts b/types/cordova-plugin-battery-status/index.d.ts index 9baedc8cb0..60480135df 100644 --- a/types/cordova-plugin-battery-status/index.d.ts +++ b/types/cordova-plugin-battery-status/index.d.ts @@ -6,114 +6,25 @@ // Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. +interface WindowEventMap { + /** + * batterystatus: event fires when the percentage of battery charge changes by at least 1 percent, or if the device is plugged in or unplugged. + */ + "batterystatus" : BatteryStatusEvent; + /** + * batterycritical: event fires when the percentage of battery charge has reached the critical battery threshold. The value is device-specific. + */ + "batterycritical": BatteryStatusEvent; + /** + * batterylow: event fires when the percentage of battery charge has reached the low battery threshold, device-specific value. + */ + "batterylow": BatteryStatusEvent; +} + interface Window { onbatterystatus: (type: BatteryStatusEvent) => void; onbatterycritical: (type: BatteryStatusEvent) => void; onbatterylow: (type: BatteryStatusEvent) => void; - /** - * Adds a listener for an event from the BatteryStatus plugin. - * @param type the event to listen for - * batterystatus: event fires when the percentage of battery charge - * changes by at least 1 percent, or if the device is plugged in or unplugged. - * batterycritical: event fires when the percentage of battery charge has reached - * the critical battery threshold. The value is device-specific. - * batterylow: event fires when the percentage of battery charge has - * reached the low battery threshold, device-specific value. - * @param listener the function that executes when the event fires. The function is - * passed an BatteryStatusEvent object as a parameter. - */ - addEventListener(type: "batterystatus", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void; - /** - * Adds a listener for an event from the BatteryStatus plugin. - * @param type the event to listen for - * batterystatus: event fires when the percentage of battery charge - * changes by at least 1 percent, or if the device is plugged in or unplugged. - * batterycritical: event fires when the percentage of battery charge has reached - * the critical battery threshold. The value is device-specific. - * batterylow: event fires when the percentage of battery charge has - * reached the low battery threshold, device-specific value. - * @param listener the function that executes when the event fires. The function is - * passed an BatteryStatusEvent object as a parameter. - */ - addEventListener(type: "batterycritical", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void; - /** - * Adds a listener for an event from the BatteryStatus plugin. - * @param type the event to listen for - * batterystatus: event fires when the percentage of battery charge - * changes by at least 1 percent, or if the device is plugged in or unplugged. - * batterycritical: event fires when the percentage of battery charge has reached - * the critical battery threshold. The value is device-specific. - * batterylow: event fires when the percentage of battery charge has - * reached the low battery threshold, device-specific value. - * @param listener the function that executes when the event fires. The function is - * passed an BatteryStatusEvent object as a parameter. - */ - addEventListener(type: "batterylow", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void; - /** - * Adds a listener for an event from the BatteryStatus plugin. - * @param type the event to listen for - * batterystatus: event fires when the percentage of battery charge - * changes by at least 1 percent, or if the device is plugged in or unplugged. - * batterycritical: event fires when the percentage of battery charge has reached - * the critical battery threshold. The value is device-specific. - * batterylow: event fires when the percentage of battery charge has - * reached the low battery threshold, device-specific value. - * @param listener the function that executes when the event fires. The function is - * passed an BatteryStatusEvent object as a parameter. - */ - addEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void; - /** - * Removes a listener for an event from the BatteryStatus plugin. - * @param type The event to stop listening for. - * batterystatus: event fires when the percentage of battery charge - * changes by at least 1 percent, or if the device is plugged in or unplugged. - * batterycritical: event fires when the percentage of battery charge has reached - * the critical battery threshold. The value is device-specific. - * batterylow: event fires when the percentage of battery charge has - * reached the low battery threshold, device-specific value. - * @param callback the function that executes when the event fires. The function is - * passed an BatteryStatusEvent object as a parameter. - */ - removeEventListener(type: "batterystatus", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void; - /** - * Removes a listener for an event from the BatteryStatus plugin. - * @param type The event to stop listening for. - * batterystatus: event fires when the percentage of battery charge - * changes by at least 1 percent, or if the device is plugged in or unplugged. - * batterycritical: event fires when the percentage of battery charge has reached - * the critical battery threshold. The value is device-specific. - * batterylow: event fires when the percentage of battery charge has - * reached the low battery threshold, device-specific value. - * @param callback the function that executes when the event fires. The function is - * passed an BatteryStatusEvent object as a parameter. - */ - removeEventListener(type: "batterycritical", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void; - /** - * Removes a listener for an event from the BatteryStatus plugin. - * @param type The event to stop listening for. - * batterystatus: event fires when the percentage of battery charge - * changes by at least 1 percent, or if the device is plugged in or unplugged. - * batterycritical: event fires when the percentage of battery charge has reached - * the critical battery threshold. The value is device-specific. - * batterylow: event fires when the percentage of battery charge has - * reached the low battery threshold, device-specific value. - * @param callback the function that executes when the event fires. The function is - * passed an BatteryStatusEvent object as a parameter. - */ - removeEventListener(type: "batterylow", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void; - /** - * Removes a listener for an event from the BatteryStatus plugin. - * @param type The event to stop listening for. - * batterystatus: event fires when the percentage of battery charge - * changes by at least 1 percent, or if the device is plugged in or unplugged. - * batterycritical: event fires when the percentage of battery charge has reached - * the critical battery threshold. The value is device-specific. - * batterylow: event fires when the percentage of battery charge has - * reached the low battery threshold, device-specific value. - * @param callback the function that executes when the event fires. The function is - * passed an BatteryStatusEvent object as a parameter. - */ - removeEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void; } /** Object, that passed into battery event listener */ diff --git a/types/cordova-plugin-inappbrowser/index.d.ts b/types/cordova-plugin-inappbrowser/index.d.ts index ea3d3adba8..78859d4209 100644 --- a/types/cordova-plugin-inappbrowser/index.d.ts +++ b/types/cordova-plugin-inappbrowser/index.d.ts @@ -57,59 +57,14 @@ interface InAppBrowser extends Window { // addEventListener overloads /** * Adds a listener for an event from the InAppBrowser. - * @param type the event to listen for - * loadstart: event fires when the InAppBrowser starts to load a URL. + * @param type loadstart: event fires when the InAppBrowser starts to load a URL. * loadstop: event fires when the InAppBrowser finishes loading a URL. * loaderror: event fires when the InAppBrowser encounters an error when loading a URL. * exit: event fires when the InAppBrowser window is closed. * @param callback the function that executes when the event fires. The function is * passed an InAppBrowserEvent object as a parameter. */ - addEventListener(type: "loadstart", callback: (event: InAppBrowserEvent) => void): void; - /** - * Adds a listener for an event from the InAppBrowser. - * @param type the event to listen for - * loadstart: event fires when the InAppBrowser starts to load a URL. - * loadstop: event fires when the InAppBrowser finishes loading a URL. - * loaderror: event fires when the InAppBrowser encounters an error when loading a URL. - * exit: event fires when the InAppBrowser window is closed. - * @param callback the function that executes when the event fires. The function is - * passed an InAppBrowserEvent object as a parameter. - */ - addEventListener(type: "loadstop", callback: (event: InAppBrowserEvent) => void): void; - /** - * Adds a listener for an event from the InAppBrowser. - * @param type the event to listen for - * loadstart: event fires when the InAppBrowser starts to load a URL. - * loadstop: event fires when the InAppBrowser finishes loading a URL. - * loaderror: event fires when the InAppBrowser encounters an error when loading a URL. - * exit: event fires when the InAppBrowser window is closed. - * @param callback the function that executes when the event fires. The function is - * passed an InAppBrowserEvent object as a parameter. - */ - addEventListener(type: "loaderror", callback: (event: InAppBrowserEvent) => void): void; - /** - * Adds a listener for an event from the InAppBrowser. - * @param type the event to listen for - * loadstart: event fires when the InAppBrowser starts to load a URL. - * loadstop: event fires when the InAppBrowser finishes loading a URL. - * loaderror: event fires when the InAppBrowser encounters an error when loading a URL. - * exit: event fires when the InAppBrowser window is closed. - * @param callback the function that executes when the event fires. The function is - * passed an InAppBrowserEvent object as a parameter. - */ - addEventListener(type: "exit", callback: (event: InAppBrowserEvent) => void): void; - /** - * Adds a listener for an event from the InAppBrowser. - * @param type the event to listen for - * loadstart: event fires when the InAppBrowser starts to load a URL. - * loadstop: event fires when the InAppBrowser finishes loading a URL. - * loaderror: event fires when the InAppBrowser encounters an error when loading a URL. - * exit: event fires when the InAppBrowser window is closed. - * @param callback the function that executes when the event fires. The function is - * passed an Event object as a parameter. - */ - addEventListener(type: string, callback: (event: Event) => void): void; + addEventListener(type: "loadstart" | "loadstop" | "loaderror" | "exit", callback: (event: InAppBrowserEvent) => void): void; // removeEventListener overloads /** * Removes a listener for an event from the InAppBrowser. @@ -121,51 +76,7 @@ interface InAppBrowser extends Window { * @param callback the function that executes when the event fires. The function is * passed an InAppBrowserEvent object as a parameter. */ - removeEventListener(type: "loadstart", callback: (event: InAppBrowserEvent) => void): void; - /** - * Removes a listener for an event from the InAppBrowser. - * @param type The event to stop listening for. - * loadstart: event fires when the InAppBrowser starts to load a URL. - * loadstop: event fires when the InAppBrowser finishes loading a URL. - * loaderror: event fires when the InAppBrowser encounters an error when loading a URL. - * exit: event fires when the InAppBrowser window is closed. - * @param callback the function that executes when the event fires. The function is - * passed an InAppBrowserEvent object as a parameter. - */ - removeEventListener(type: "loadstop", callback: (event: InAppBrowserEvent) => void): void; - /** - * Removes a listener for an event from the InAppBrowser. - * @param type The event to stop listening for. - * loadstart: event fires when the InAppBrowser starts to load a URL. - * loadstop: event fires when the InAppBrowser finishes loading a URL. - * loaderror: event fires when the InAppBrowser encounters an error when loading a URL. - * exit: event fires when the InAppBrowser window is closed. - * @param callback the function that executes when the event fires. The function is - * passed an InAppBrowserEvent object as a parameter. - */ - removeEventListener(type: "loaderror", callback: (event: InAppBrowserEvent) => void): void; - /** - * Removes a listener for an event from the InAppBrowser. - * @param type The event to stop listening for. - * loadstart: event fires when the InAppBrowser starts to load a URL. - * loadstop: event fires when the InAppBrowser finishes loading a URL. - * loaderror: event fires when the InAppBrowser encounters an error when loading a URL. - * exit: event fires when the InAppBrowser window is closed. - * @param callback the function that executes when the event fires. The function is - * passed an InAppBrowserEvent object as a parameter. - */ - removeEventListener(type: "exit", callback: (event: InAppBrowserEvent) => void): void; - /** - * Removes a listener for an event from the InAppBrowser. - * @param type The event to stop listening for. - * loadstart: event fires when the InAppBrowser starts to load a URL. - * loadstop: event fires when the InAppBrowser finishes loading a URL. - * loaderror: event fires when the InAppBrowser encounters an error when loading a URL. - * exit: event fires when the InAppBrowser window is closed. - * @param callback the function that executes when the event fires. The function is - * passed an Event object as a parameter. - */ - removeEventListener(type: string, callback: (event: Event) => void): void; + removeEventListener(type: "loadstart" | "loadstop" | "loaderror" | "exit", callback: (event: InAppBrowserEvent) => void): void; /** Closes the InAppBrowser window. */ close(): void; /** Hides the InAppBrowser window. Calling this has no effect if the InAppBrowser was already hidden. */ From 127ed8a779e7f6d7c84c09134be141a3122524bc Mon Sep 17 00:00:00 2001 From: Yui T Date: Sun, 11 Jun 2017 20:46:21 -0700 Subject: [PATCH 345/761] Update tests --- .../cordova-plugin-battery-status-tests.ts | 10 ++++++++-- .../cordova-plugin-inappbrowser-tests.ts | 11 ++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts b/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts index 1c62521293..4d31c36a7f 100644 --- a/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts +++ b/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts @@ -1,5 +1,11 @@ -window.addEventListener('batterystatus', - (ev: BatteryStatusEvent) => { console.log('Battery level is ' + ev.level); }); +/// +window.addEventListener('batterystatus', (ev) => { console.log('Battery level is ' + ev.level); }); +window.addEventListener('batterycritical', (ev) => { console.log('Battery is critical: ' + ev.level); }); +window.addEventListener('batterylow', (ev) => { console.log('Battery is low: ' + ev.level); }); + +window.removeEventListener('batterystatus', (ev) => { console.log('Remove: Battery level is ' + ev.level); }); +window.removeEventListener('batterycritical', (ev) => { console.log('Remove: Battery is critical: ' + ev.level); }); +window.removeEventListener('batterylow', (ev) => { console.log('Remove: Battery is low: ' + ev.level); }); window.addEventListener('batterycritical', () => { alert('Battery is critical low!'); }); \ No newline at end of file diff --git a/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts b/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts index cef288c921..ec98249893 100644 --- a/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts +++ b/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts @@ -1,3 +1,4 @@ +/// // InAppBrowser plugin //---------------------------------------------------------------------- @@ -5,7 +6,15 @@ // is similar to native window.open signature, so the compiler can's // select proper overload, but we cast result to InAppBrowser manually. var iab = window.open('google.com', '_self'); -iab.addEventListener('loadstart', (ev: InAppBrowserEvent) => { console.log('Start opening ' + ev.url); }); +iab.addEventListener('loadstart', (ev) => { console.log('loadstart' + ev.url); }); +iab.addEventListener('loadstop', (ev) => { console.log('loadstop' + ev.code); }); +iab.addEventListener('loaderror', (ev) => { console.log('loaderror' + ev.code); }); +iab.addEventListener('exit', (ev) => { console.log('exit' + ev.code); }); + +iab.removeEventListener('loadstart', (ev) => { console.log('Remove loadstart' + ev.url); }); +iab.removeEventListener('loadstop', (ev) => { console.log('Remove loadstop ' + ev.code); }); +iab.removeEventListener('loaderror', (ev) => { console.log('Remove loaderror ' + ev.code); }); +iab.removeEventListener('exit', (ev) => { console.log('Remove exit ' + ev.code); }); iab.show(); iab.executeScript( { code: "console.log('Injected script in action')" }, From d898918cc6eda557a3a874434397d5529c585ef4 Mon Sep 17 00:00:00 2001 From: Yui T Date: Sun, 11 Jun 2017 21:09:56 -0700 Subject: [PATCH 346/761] Add removeEventListener --- types/cordova-plugin-battery-status/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/cordova-plugin-battery-status/index.d.ts b/types/cordova-plugin-battery-status/index.d.ts index 60480135df..4bf3115fe4 100644 --- a/types/cordova-plugin-battery-status/index.d.ts +++ b/types/cordova-plugin-battery-status/index.d.ts @@ -25,6 +25,8 @@ interface Window { onbatterystatus: (type: BatteryStatusEvent) => void; onbatterycritical: (type: BatteryStatusEvent) => void; onbatterylow: (type: BatteryStatusEvent) => void; + removeEventListener(type: K, listener: (ev: WindowEventMap[K]) => any, useCapture?: boolean): void; + removeEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void; } /** Object, that passed into battery event listener */ From 16cb5a4a1436787091b7f8a589beaff13af8fb7d Mon Sep 17 00:00:00 2001 From: Yui T Date: Sun, 11 Jun 2017 21:23:41 -0700 Subject: [PATCH 347/761] Remove test failure cause --- .../cordova-plugin-inappbrowser-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts b/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts index ec98249893..d381f52375 100644 --- a/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts +++ b/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts @@ -1,4 +1,3 @@ -/// // InAppBrowser plugin //---------------------------------------------------------------------- From 86e7e14c723a59c30c7ad5ef2fc5cdaf4a7813b2 Mon Sep 17 00:00:00 2001 From: Yui T Date: Sun, 11 Jun 2017 21:27:18 -0700 Subject: [PATCH 348/761] Remove test failure cause --- .../cordova-plugin-battery-status-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts b/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts index 4d31c36a7f..e0433bf89b 100644 --- a/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts +++ b/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts @@ -1,4 +1,3 @@ -/// window.addEventListener('batterystatus', (ev) => { console.log('Battery level is ' + ev.level); }); window.addEventListener('batterycritical', (ev) => { console.log('Battery is critical: ' + ev.level); }); window.addEventListener('batterylow', (ev) => { console.log('Battery is low: ' + ev.level); }); From 61dd4d34f82c5a0f2bb86bd444c0fdd8a1d2255a Mon Sep 17 00:00:00 2001 From: Yui T Date: Sun, 11 Jun 2017 21:43:52 -0700 Subject: [PATCH 349/761] Add Typescript Version 2.3 --- types/cordova-plugin-battery-status/index.d.ts | 3 ++- types/cordova-plugin-inappbrowser/index.d.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/cordova-plugin-battery-status/index.d.ts b/types/cordova-plugin-battery-status/index.d.ts index 4bf3115fe4..f120d3d7e9 100644 --- a/types/cordova-plugin-battery-status/index.d.ts +++ b/types/cordova-plugin-battery-status/index.d.ts @@ -4,7 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // // Copyright (c) Microsoft Open Technologies Inc -// Licensed under the MIT license. +// Licensed under the MIT license. +// TypeScript Version: 2.3 interface WindowEventMap { /** diff --git a/types/cordova-plugin-inappbrowser/index.d.ts b/types/cordova-plugin-inappbrowser/index.d.ts index 78859d4209..91dc61314f 100644 --- a/types/cordova-plugin-inappbrowser/index.d.ts +++ b/types/cordova-plugin-inappbrowser/index.d.ts @@ -5,6 +5,7 @@ // // Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. +// TypeScript Version: 2.3 interface Window { /** From e77bb4a004e634f6649b75109b1d978026314e88 Mon Sep 17 00:00:00 2001 From: Christopher Mckay Date: Mon, 12 Jun 2017 15:39:11 +1000 Subject: [PATCH 350/761] ramda find functions can return undefined http://ramdajs.com/docs/#find --- types/ramda/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 79d1b1f6cf..4d6be6138f 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -587,8 +587,8 @@ declare namespace R { * Returns the first element of the list which matches the predicate, or `undefined` if no * element matches. */ - find(fn: (a: T) => boolean, list: T[]): T; - find(fn: (a: T) => boolean): (list: T[]) => T; + find(fn: (a: T) => boolean, list: T[]): T | undefined; + find(fn: (a: T) => boolean): (list: T[]) => T | undefined; /** @@ -602,8 +602,8 @@ declare namespace R { * Returns the last element of the list which matches the predicate, or `undefined` if no * element matches. */ - findLast(fn: (a: T) => boolean, list: T[]): T; - findLast(fn: (a: T) => boolean): (list: T[]) => T; + findLast(fn: (a: T) => boolean, list: T[]): T | undefined; + findLast(fn: (a: T) => boolean): (list: T[]) => T | undefined; /** * Returns the index of the last element of the list which matches the predicate, or From 6e5e672d9234372b9eb07e66af7a9809eebd80cf Mon Sep 17 00:00:00 2001 From: Anton Cholakov Date: Mon, 12 Jun 2017 11:43:50 +0300 Subject: [PATCH 351/761] Update select2.d.ts to support some functions/props - disabled property of main options - headers object, templateResult and templateSelection functions --- types/select2/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/select2/index.d.ts b/types/select2/index.d.ts index 5828dba2e9..15c4def81a 100644 --- a/types/select2/index.d.ts +++ b/types/select2/index.d.ts @@ -25,10 +25,13 @@ interface Select2AjaxOptions { url?: any; dataType?: string; delay?: number; + headers?: any; cache?: boolean; data?: (params: Select2QueryOptions, page: number, context: any) => any; results?: (term: any, page: number, context: any) => any; processResults?:(data: any, params: any) => any; + templateResult?: (data: any) => any; + templateSelection?: (data: any) => any; } interface IdTextPair { @@ -49,6 +52,7 @@ interface Select2Options { separator?: string; allowClear?: boolean; multiple?: boolean; + disabled?: boolean; closeOnSelect?: boolean; openOnEnter?: boolean; id?: (object: any) => string; From dc4db8db5668cad7d50209f2438fa84954b9036d Mon Sep 17 00:00:00 2001 From: afractal Date: Mon, 12 Jun 2017 10:58:49 +0200 Subject: [PATCH 352/761] update definitions for sharp-timer --- types/sharp-timer/index.d.ts | 4 ++-- types/sharp-timer/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/sharp-timer/index.d.ts b/types/sharp-timer/index.d.ts index 65cf798feb..928a47eed7 100644 --- a/types/sharp-timer/index.d.ts +++ b/types/sharp-timer/index.d.ts @@ -20,8 +20,8 @@ export class Timer { pause(): void; resume(): void; stop(): void; - onIntervalElapsed(intervalElapsedHandler: any): void; - onIntervalElapsing(intervalElapsingHandler: any): void; + onIntervalElapsed(intervalElapsedHandler: ElapsedEvent): void; + onIntervalElapsing(intervalElapsingHandler: ElapsingEvent): void; toString(): string; private getDoubleDigit(number); private checkForValidInterval(interval); diff --git a/types/sharp-timer/tsconfig.json b/types/sharp-timer/tsconfig.json index 851bf69389..3306511dec 100644 --- a/types/sharp-timer/tsconfig.json +++ b/types/sharp-timer/tsconfig.json @@ -4,7 +4,7 @@ "lib": [ "es6" ], - "noImplicitAny": false, + "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, "baseUrl": "../", From 4c8419ee78c8dd5a61e97dbd7fb0d756f773a4f7 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 12 Jun 2017 10:12:31 +0100 Subject: [PATCH 353/761] Removes whitespace from multer to fix linting issues --- types/multer/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/multer/index.d.ts b/types/multer/index.d.ts index 1199fbe181..fb9bee6c0d 100644 --- a/types/multer/index.d.ts +++ b/types/multer/index.d.ts @@ -41,7 +41,6 @@ declare namespace multer { headerPairs?: number; /** Keep the full path of files instead of just the base name (Default: false) */ preservePath?: boolean; - }; /** A function to control which files to upload and which to skip. */ fileFilter?(req: Express.Request, file: Express.Multer.File, callback: (error: Error, acceptFile: boolean) => void): void; From a0d5848d4ba7f1063431b3f7b04027516dddce19 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 12 Jun 2017 10:48:01 +0100 Subject: [PATCH 354/761] send: removes setting default_type on mime in test.. .. as this is not possible (anymore) on the current library --- types/send/send-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/send/send-tests.ts b/types/send/send-tests.ts index 22e3e171f2..da41697e96 100644 --- a/types/send/send-tests.ts +++ b/types/send/send-tests.ts @@ -5,7 +5,6 @@ import * as send from 'send'; var app = express(); -send.mime.default_type = 'text/plain'; send.mime.define({ 'application/x-my-type': ['x-mt', 'x-mtt'] }); @@ -34,4 +33,4 @@ app.get('/test.html', (req, res) => { res.setHeader('Content-Disposition', 'attachment'); }) .pipe(res); -}); \ No newline at end of file +}); From 14a0bee08cdded4f8cb67dc0fbca9b11e8290add Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Mon, 12 Jun 2017 15:27:49 +0200 Subject: [PATCH 355/761] fix return value of Polyline.clip() --- types/heremaps/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/heremaps/index.d.ts b/types/heremaps/index.d.ts index 05895c5d11..fee3bbab04 100644 --- a/types/heremaps/index.d.ts +++ b/types/heremaps/index.d.ts @@ -2165,7 +2165,7 @@ declare namespace H { * @param geoRect {H.geo.Rect} * @returns {Array>} */ - clip(geoRect: H.geo.Rect): [number[]]; + clip(geoRect: H.geo.Rect): number[][]; } namespace Polyline { From 98faf31f6471a6da8a01d889d1ec496d02e704ae Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Mon, 12 Jun 2017 15:39:29 +0200 Subject: [PATCH 356/761] add test for Polyline.clip() --- types/heremaps/heremaps-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/heremaps/heremaps-tests.ts b/types/heremaps/heremaps-tests.ts index 31d722f042..216040c68a 100644 --- a/types/heremaps/heremaps-tests.ts +++ b/types/heremaps/heremaps-tests.ts @@ -80,3 +80,7 @@ captureBtn.onclick = () => { }; let icon = new H.map.Icon('svg', { size: 5, crossOrigin: false }); + +let polyline = new H.map.Polyline(new H.geo.Strip()); +let clipArr: Array>; +clipArr = polyline.clip(new H.geo.Rect(5, 5, 5, 5)); From d819ae8dcf971b19995ea312817d895c59d72bf1 Mon Sep 17 00:00:00 2001 From: Naor Torgeman Date: Mon, 12 Jun 2017 16:46:57 +0300 Subject: [PATCH 357/761] Create index.d.ts ReactInputMask should be exported as default to be proper used. --- types/react-input-mask/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index 560dc8cc2b..28095b4104 100644 --- a/types/react-input-mask/index.d.ts +++ b/types/react-input-mask/index.d.ts @@ -41,4 +41,4 @@ declare namespace reactInputMask { } } declare var ReactInputMask: typeof reactInputMask.ReactInputMask; -export = ReactInputMask; +export default ReactInputMask; From 59dfc1e43456fd4e853ff92335a21390ad140ee3 Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Mon, 12 Jun 2017 15:54:08 +0200 Subject: [PATCH 358/761] fix failing test --- types/heremaps/heremaps-tests.ts | 1 + types/heremaps/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/heremaps/heremaps-tests.ts b/types/heremaps/heremaps-tests.ts index 216040c68a..01360c1bdf 100644 --- a/types/heremaps/heremaps-tests.ts +++ b/types/heremaps/heremaps-tests.ts @@ -82,5 +82,6 @@ captureBtn.onclick = () => { let icon = new H.map.Icon('svg', { size: 5, crossOrigin: false }); let polyline = new H.map.Polyline(new H.geo.Strip()); +// tslint:disable-next-line:array-type let clipArr: Array>; clipArr = polyline.clip(new H.geo.Rect(5, 5, 5, 5)); diff --git a/types/heremaps/index.d.ts b/types/heremaps/index.d.ts index fee3bbab04..28b29bfc09 100644 --- a/types/heremaps/index.d.ts +++ b/types/heremaps/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Joshua Efiong // Bernd Hacker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 declare namespace H { /***** Map *****/ From c9e01b3e760ee7e2f93a7c9052d432f6713347c8 Mon Sep 17 00:00:00 2001 From: Michiel de Bruijne Date: Mon, 12 Jun 2017 15:56:21 +0200 Subject: [PATCH 359/761] [node] improve type definitions in cluster, http, https, process modules (#16705) * [node] fix headers and trailers in interface IncomingMessage * [node] set correct type to requestListener in https.createServer * [node] export required interfaces in https * [node] add process events * [node] make worker and workers optional in cluster module cluster.worker is not available in the master process cluster.workers is not available in the worker process * [node] add string[] to headers type to account for the set-cookie exception * [node] set TypeScript version to 2.2 to enable Promise support --- types/node/index.d.ts | 96 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 8 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 1b121efb2d..2fd023b56b 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -7,6 +7,7 @@ // Christian Vaagland Tellnes // Wilco Bakker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /************************************************ * * @@ -377,6 +378,12 @@ declare namespace NodeJS { | 'sunos' | 'win32'; + type Signals = + "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | + "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | + "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | + "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ"; + export interface Socket extends ReadWriteStream { isTTY?: true; } @@ -449,6 +456,73 @@ declare namespace NodeJS { send?(message: any, sendHandle?: any): void; disconnect(): void; connected: boolean; + + /** + * EventEmitter + * 1. beforeExit + * 2. disconnect + * 3. exit + * 4. message + * 5. rejectionHandled + * 6. uncaughtException + * 7. unhandledRejection + * 8. warning + * 9. + */ + + addListener(event: "beforeExit", listener: (code: number) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "exit", listener: (code: number) => void): this; + addListener(event: "rejectionHandled", listener: (promise: Promise) => void): this; + addListener(event: "uncaughtException", listener: (error: Error) => void): this; + addListener(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): this; + addListener(event: "warning", listener: (warning: Error) => void): this; + addListener(event: Signals, listener: () => void): this; + + emit(event: "beforeExit", listener: (code: number) => void): boolean; + emit(event: "disconnect", listener: () => void): boolean; + emit(event: "exit", listener: (code: number) => void): boolean; + emit(event: "rejectionHandled", listener: (promise: Promise) => void): boolean; + emit(event: "uncaughtException", listener: (error: Error) => void): boolean; + emit(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): boolean; + emit(event: "warning", listener: (warning: Error) => void): boolean; + emit(event: Signals, listener: () => void): boolean; + + on(event: "beforeExit", listener: (code: number) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "exit", listener: (code: number) => void): this; + on(event: "rejectionHandled", listener: (promise: Promise) => void): this; + on(event: "uncaughtException", listener: (error: Error) => void): this; + on(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): this; + on(event: "warning", listener: (warning: Error) => void): this; + on(event: Signals, listener: () => void): this; + + once(event: "beforeExit", listener: (code: number) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "exit", listener: (code: number) => void): this; + once(event: "rejectionHandled", listener: (promise: Promise) => void): this; + once(event: "uncaughtException", listener: (error: Error) => void): this; + once(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): this; + once(event: "warning", listener: (warning: Error) => void): this; + once(event: Signals, listener: () => void): this; + + prependListener(event: "beforeExit", listener: (code: number) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "exit", listener: (code: number) => void): this; + prependListener(event: "rejectionHandled", listener: (promise: Promise) => void): this; + prependListener(event: "uncaughtException", listener: (error: Error) => void): this; + prependListener(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): this; + prependListener(event: "warning", listener: (warning: Error) => void): this; + prependListener(event: Signals, listener: () => void): this; + + prependOnceListener(event: "beforeExit", listener: (code: number) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "exit", listener: (code: number) => void): this; + prependOnceListener(event: "rejectionHandled", listener: (promise: Promise) => void): this; + prependOnceListener(event: "uncaughtException", listener: (error: Error) => void): this; + prependOnceListener(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): this; + prependOnceListener(event: "warning", listener: (warning: Error) => void): this; + prependOnceListener(event: Signals, listener: () => void): this; } export interface Global { @@ -734,10 +808,10 @@ declare module "http" { httpVersionMajor: number; httpVersionMinor: number; connection: net.Socket; - headers: any; + headers: { [key: string]: string | string[] }; rawHeaders: string[]; - trailers: any; - rawTrailers: any; + trailers: { [key: string]: string }; + rawTrailers: string[]; setTimeout(msecs: number, callback: Function): NodeJS.Timer; /** * Only valid for request obtained from http.Server. @@ -920,8 +994,8 @@ declare module "cluster" { // TODO: cluster.schedulingPolicy settings: ClusterSettings; setupMaster(settings?: ClusterSetupMasterSettings): void; - worker: Worker; - workers: { + worker?: Worker; + workers?: { [index: string]: Worker }; @@ -1391,6 +1465,12 @@ declare module "https" { secureProtocol?: string; } + export interface ClientRequest extends http.ClientRequest {} + + export interface IncomingMessage extends http.IncomingMessage {} + + export interface ServerResponse extends http.ServerResponse { } + export interface Agent extends http.Agent { } export interface AgentOptions extends http.AgentOptions { @@ -1409,9 +1489,9 @@ declare module "https" { new (options?: AgentOptions): Agent; }; export interface Server extends tls.Server { } - export function createServer(options: ServerOptions, requestListener?: Function): Server; - export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; - export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function createServer(options: ServerOptions, requestListener?: (req: IncomingMessage, res: ServerResponse) => void): Server; + export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; export var globalAgent: Agent; } From d0e32728038891ef24559d819affc53699a5cc1d Mon Sep 17 00:00:00 2001 From: Albert Kurniawan Date: Mon, 12 Jun 2017 23:06:46 +1000 Subject: [PATCH 360/761] Updated RedisStoreOptions in @types/connect-redis --- types/connect-redis/connect-redis-tests.ts | 6 ++++++ types/connect-redis/index.d.ts | 3 +++ 2 files changed, 9 insertions(+) diff --git a/types/connect-redis/connect-redis-tests.ts b/types/connect-redis/connect-redis-tests.ts index 3c50074117..11cd583a74 100644 --- a/types/connect-redis/connect-redis-tests.ts +++ b/types/connect-redis/connect-redis-tests.ts @@ -2,3 +2,9 @@ import * as connectRedis from "connect-redis"; import * as session from "express-session"; let RedisStore = connectRedis(session); +const store = new RedisStore({ + host: 'localhost', + port: 6379, + logErrors: error => console.warn(error), + scanCount: 80, +}); diff --git a/types/connect-redis/index.d.ts b/types/connect-redis/index.d.ts index f66314a083..b5084609a2 100644 --- a/types/connect-redis/index.d.ts +++ b/types/connect-redis/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for connect-redis // Project: https://npmjs.com/package/connect-redis // Definitions by: Xavier Stouder +// Albert Kurniawan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -32,6 +33,8 @@ declare module "connect-redis" { prefix?: string; unref?: boolean; serializer?: Serializer | JSON; + logErrors?: boolean | ((error: string) => void); + scanCount?: number; } interface Serializer { stringify: Function; From 3d7140921aad06c309ba0d5bd4800b196d5087e4 Mon Sep 17 00:00:00 2001 From: Fabien Lavocat Date: Mon, 12 Jun 2017 08:28:17 -0700 Subject: [PATCH 361/761] Remove the interface LinearChartData and move the properties to ChartData --- types/chart.js/chart.js-tests.ts | 6 ++++-- types/chart.js/index.d.ts | 4 ---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 2b38efaa25..447e3cb79e 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -1,4 +1,4 @@ -import { Chart, LinearChartData } from 'chart.js'; +import { Chart, ChartData } from 'chart.js'; //alternative: //import chartjs = require('chart.js'); @@ -6,10 +6,12 @@ import { Chart, LinearChartData } from 'chart.js'; var chart = new Chart(new CanvasRenderingContext2D(), { type: 'bar', - data: { + data: { labels: ['group 1'], datasets: [ { + backgroundColor: '#000000', + borderWidth: 1, label: 'test', data: [1] } diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index ec8a7c0c03..3de99408d9 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -128,10 +128,6 @@ declare namespace Chart { } export interface ChartData { - - } - - export interface LinearChartData extends ChartData { labels?: string[]; datasets?: ChartDataSets[]; } From f6e5448b48ec8a71bdaecda65404d7affccb0705 Mon Sep 17 00:00:00 2001 From: Fabien Lavocat Date: Mon, 12 Jun 2017 08:33:30 -0700 Subject: [PATCH 362/761] Add Definition By in header --- types/chart.js/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 3de99408d9..b2899cd851 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Chart.js 2.4.0 // Project: https://github.com/nnnick/Chart.js // Definitions by: Alberto Nuti +// Fabien Lavocat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From aad041f57f0ae79d4788a87897fde8dbf4ff0070 Mon Sep 17 00:00:00 2001 From: Fabien Lavocat Date: Mon, 12 Jun 2017 09:05:39 -0700 Subject: [PATCH 363/761] Add tslint and fix errors --- types/chart.js/chart.js-tests.ts | 6 +- types/chart.js/index.d.ts | 205 ++++++++++++++++--------------- types/chart.js/tslint.json | 6 + 3 files changed, 112 insertions(+), 105 deletions(-) create mode 100644 types/chart.js/tslint.json diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 447e3cb79e..b9ffd7a8f6 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -1,10 +1,10 @@ import { Chart, ChartData } from 'chart.js'; -//alternative: -//import chartjs = require('chart.js'); +// alternative: +// import chartjs = require('chart.js'); // => chartjs.Chart -var chart = new Chart(new CanvasRenderingContext2D(), { +let chart: Chart = new Chart(new CanvasRenderingContext2D(), { type: 'bar', data: { labels: ['group 1'], diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index b2899cd851..f5ce46728a 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chart.js 2.4.0 +// Type definitions for Chart.js 2.4 // Project: https://github.com/nnnick/Chart.js // Definitions by: Alberto Nuti // Fabien Lavocat @@ -23,63 +23,63 @@ declare class Chart { toBase64: () => string; generateLegend: () => {}; getElementAtEvent: (e: any) => {}; - getElementsAtEvent: (e: any) => {}[]; - getDatasetAtEvent: (e: any) => {}[]; + getElementsAtEvent: (e: any) => Array<{}>; + getDatasetAtEvent: (e: any) => Array<{}>; static pluginService: PluginServiceStatic; static defaults: { global: Chart.ChartOptions; - } + }; } declare class PluginServiceStatic { register(plugin?: PluginServiceRegistrationOptions): void; } -declare interface PluginServiceRegistrationOptions { - beforeInit?: (chartInstance: Chart) => void, - afterInit?: (chartInstance: Chart) => void, +interface PluginServiceRegistrationOptions { + beforeInit?(chartInstance: Chart): void; + afterInit?(chartInstance: Chart): void; - resize?: (chartInstance: Chart, newChartSize: Size) => void, + resize?(chartInstance: Chart, newChartSize: Size): void; - beforeUpdate?: (chartInstance: Chart) => void, - afterScaleUpdate?: (chartInstance: Chart) => void, - beforeDatasetsUpdate?: (chartInstance: Chart) => void, - afterDatasetsUpdate?: (chartInstance: Chart) => void, - afterUpdate?: (chartInstance: Chart) => void, + beforeUpdate?(chartInstance: Chart): void; + afterScaleUpdate?(chartInstance: Chart): void; + beforeDatasetsUpdate?(chartInstance: Chart): void; + afterDatasetsUpdate?(chartInstance: Chart): void; + afterUpdate?(chartInstance: Chart): void; // This is called at the start of a render. It is only called once, even if the animation will run for a number of frames. Use beforeDraw or afterDraw // to do something on each animation frame - beforeRender?: (chartInstance: Chart) => void, + beforeRender?(chartInstance: Chart): void; // Easing is for animation - beforeDraw?: (chartInstance: Chart, easing: string) => void, - afterDraw?: (chartInstance: Chart, easing: string) => void, + beforeDraw?(chartInstance: Chart, easing: string): void; + afterDraw?(chartInstance: Chart, easing: string): void; // Before the datasets are drawn but after scales are drawn - beforeDatasetsDraw?: (chartInstance: Chart, easing: string) => void, - afterDatasetsDraw?: (chartInstance: Chart, easing: string) => void, + beforeDatasetsDraw?(chartInstance: Chart, easing: string): void; + afterDatasetsDraw?(chartInstance: Chart, easing: string): void; - destroy?: (chartInstance: Chart) => void, + destroy?(chartInstance: Chart): void; // Called when an event occurs on the chart - beforeEvent?: (chartInstance: Chart, event: Event) => void, - afterEvent?: (chartInstance: Chart, event: Event) => void + beforeEvent?(chartInstance: Chart, event: Event): void; + afterEvent?(chartInstance: Chart, event: Event): void; } -declare interface Size { +interface Size { height: number; width: number; } declare namespace Chart { - export type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble'; + type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble'; - export type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; + type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; - export type ScaleType = 'category' | 'linear' | 'logarithmic' | 'time' | 'radialLinear'; + type ScaleType = 'category' | 'linear' | 'logarithmic' | 'time' | 'radialLinear'; - export type PositionType = 'left' | 'right' | 'top' | 'bottom'; + type PositionType = 'left' | 'right' | 'top' | 'bottom'; - export interface ChartLegendItem { + interface ChartLegendItem { text?: string; fillStyle?: string; hidden?: boolean; @@ -91,54 +91,54 @@ declare namespace Chart { strokeStyle?: string; } - export interface ChartTooltipItem { + interface ChartTooltipItem { xLabel?: string; yLabel?: string; datasetIndex?: number; index?: number; } - export 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 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; } - export interface ChartAnimationParameter { + interface ChartAnimationParameter { chartInstance?: any; animationObject?: any; } - export interface ChartPoint { + interface ChartPoint { x?: number | string | Date; y?: number; } - export interface ChartConfiguration { + interface ChartConfiguration { type?: ChartType | string; data?: ChartData; options?: ChartOptions; } - export interface ChartData { + interface ChartData { labels?: string[]; datasets?: ChartDataSets[]; } - export interface ChartOptions { + interface ChartOptions { responsive?: boolean; responsiveAnimationDuration?: number; maintainAspectRatio?: boolean; events?: string[]; - onClick?: (any?: any) => any; + onClick?(any?: any): any; title?: ChartTitleOptions; legend?: ChartLegendOptions; tooltips?: ChartTooltipOptions; @@ -149,14 +149,14 @@ declare namespace Chart { cutoutPercentage?: number; } - export interface ChartFontOptions { + interface ChartFontOptions { defaultFontColor?: ChartColor; defaultFontFamily?: string; defaultFontSize?: number; defaultFontStyle?: string; } - export interface ChartTitleOptions { + interface ChartTitleOptions { display?: boolean; position?: string; fullWdith?: boolean; @@ -168,27 +168,27 @@ declare namespace Chart { text?: string; } - export interface ChartLegendOptions { + interface ChartLegendOptions { display?: boolean; position?: string; fullWidth?: boolean; - onClick?: (event: any, legendItem: any) => void; + onClick?(event: any, legendItem: any): void; labels?: ChartLegendLabelOptions; } - export interface ChartLegendLabelOptions { + interface ChartLegendLabelOptions { boxWidth?: number; fontSize?: number; fontStyle?: number; fontColor?: ChartColor; fontFamily?: string; padding?: number; - generateLabels?: (chart: any) => any; + generateLabels?(chart: any): any; } - export interface ChartTooltipOptions { + interface ChartTooltipOptions { enabled?: boolean; - custom?: (a: any) => void; + custom?(a: any): void; mode?: string; backgroundColor?: ChartColor; titleFontFamily?: string; @@ -216,42 +216,42 @@ declare namespace Chart { callbacks?: ChartTooltipCallback; } - export interface ChartHoverOptions { + interface ChartHoverOptions { mode?: string; animationDuration?: number; - onHover?: (active: any) => void; + onHover?(active: any): void; } - export interface ChartAnimationObject { + interface ChartAnimationObject { currentStep?: number; numSteps?: number; easing?: string; - render?: (arg: any) => void; - onAnimationProgress?: (arg: any) => void; - onAnimationComplete?: (arg: any) => void; + render?(arg: any): void; + onAnimationProgress?(arg: any): void; + onAnimationComplete?(arg: any): void; } - export interface ChartAnimationOptions { + interface ChartAnimationOptions { duration?: number; easing?: string; - onProgress?: (chart: any) => void; - onComplete?: (chart: any) => void; + onProgress?(chart: any): void; + onComplete?(chart: any): void; } - export interface ChartElementsOptions { + interface ChartElementsOptions { point?: ChartPointOptions; line?: ChartLineOptions; arc?: ChartArcOptions; rectangle?: ChartRectangleOptions; } - export interface ChartArcOptions { + interface ChartArcOptions { backgroundColor?: ChartColor; borderColor?: ChartColor; borderWidth?: number; } - export interface ChartLineOptions { + interface ChartLineOptions { tension?: number; backgroundColor?: ChartColor; borderWidth?: number; @@ -262,7 +262,7 @@ declare namespace Chart { borderJoinStyle?: string; } - export interface ChartPointOptions { + interface ChartPointOptions { radius?: number; pointStyle?: string; backgroundColor?: ChartColor; @@ -273,13 +273,13 @@ declare namespace Chart { hoverBorderWidth?: number; } - export interface ChartRectangleOptions { + interface ChartRectangleOptions { backgroundColor?: ChartColor; borderWidth?: number; borderColor?: ChartColor; borderSkipped?: string; } - export interface GridLineOptions { + interface GridLineOptions { display?: boolean; color?: ChartColor; lineWidth?: number; @@ -292,7 +292,7 @@ declare namespace Chart { offsetGridLines?: boolean; } - export interface ScaleTitleOptions { + interface ScaleTitleOptions { display?: boolean; labelString?: string; fontColor?: ChartColor; @@ -301,9 +301,9 @@ declare namespace Chart { fontStyle?: string; } - export interface TickOptions { + interface TickOptions { autoSkip?: boolean; - callback?: (value: any, index: any, values: any) => string; + callback?(value: any, index: any, values: any): string; display?: boolean; fontColor?: ChartColor; fontFamily?: string; @@ -318,28 +318,28 @@ declare namespace Chart { min?: any; max?: any; } - export interface AngleLineOptions { + interface AngleLineOptions { display?: boolean; color?: ChartColor; lineWidth?: number; } - export interface PointLabelOptions { - callback?: (arg: any) => any; + interface PointLabelOptions { + callback?(arg: any): any; fontColor?: ChartColor; fontFamily?: string; fontSize?: number; fontStyle?: string; } - export interface TickOptions { + interface TickOptions { backdropColor?: ChartColor; backdropPaddingX?: number; backdropPaddingY?: number; maxTicksLimit?: number; showLabelBackdrop?: boolean; } - export interface LinearTickOptions extends TickOptions { + interface LinearTickOptions extends TickOptions { beginAtZero?: boolean; min?: number; max?: number; @@ -349,14 +349,14 @@ declare namespace Chart { suggestedMax?: number; } - export interface LogarithmicTickOptions extends TickOptions { + interface LogarithmicTickOptions extends TickOptions { min?: number; max?: number; } type ChartColor = string | CanvasGradient | CanvasPattern; - export interface ChartDataSets { + interface ChartDataSets { backgroundColor?: ChartColor; borderWidth?: number; borderColor?: ChartColor; @@ -382,24 +382,24 @@ declare namespace Chart { yAxisID?: string; } - export interface ChartScales { + interface ChartScales { type?: ScaleType | string; display?: boolean; position?: PositionType | 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; + 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; @@ -407,7 +407,7 @@ declare namespace Chart { yAxes?: ChartYAxe[]; } - export interface CommonAxe { + interface CommonAxe { type?: ScaleType | string; display?: boolean; id?: string; @@ -419,24 +419,25 @@ declare namespace Chart { scaleLabel?: ScaleTitleOptions; } - export interface ChartXAxe extends CommonAxe { + interface ChartXAxe extends CommonAxe { categoryPercentage?: number; barPercentage?: number; time?: TimeScale; } - export interface ChartYAxe extends CommonAxe { + // tslint:disable-next-line no-empty-interface + interface ChartYAxe extends CommonAxe { } - export interface LinearScale extends ChartScales { + interface LinearScale extends ChartScales { ticks?: LinearTickOptions; } - export interface LogarithmicScale extends ChartScales { + interface LogarithmicScale extends ChartScales { ticks?: LogarithmicTickOptions; } - export interface TimeDisplayFormat { + interface TimeDisplayFormat { millisecond?: string; second?: string; minute?: string; @@ -448,7 +449,7 @@ declare namespace Chart { year?: string; } - export interface TimeScale extends ChartScales { + interface TimeScale extends ChartScales { displayFormats?: TimeDisplayFormat; isoWeekday?: boolean; max?: string; @@ -461,7 +462,7 @@ declare namespace Chart { minUnit?: TimeUnit; } - export interface RadialLinearScale { + interface RadialLinearScale { lineArc?: boolean; angleLines?: AngleLineOptions; pointLabels?: PointLabelOptions; diff --git a/types/chart.js/tslint.json b/types/chart.js/tslint.json new file mode 100644 index 0000000000..a62d0d4e68 --- /dev/null +++ b/types/chart.js/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false + } +} From d807e9544ab77f97ef2bfab336161def61bc113f Mon Sep 17 00:00:00 2001 From: esplo Date: Tue, 13 Jun 2017 01:06:28 +0900 Subject: [PATCH 364/761] [material-ui] add iconStyle to CardHeader --- types/material-ui/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 7308c0f089..560b21f2ca 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -832,6 +832,7 @@ declare namespace __MaterialUI { className?: string; openIcon?: React.ReactNode; closeIcon?: React.ReactNode; + iconStyle?: React.CSSProperties; } export class CardHeader extends React.Component { } From c8d5eeea73c42274e6a2cada1c40578334baa9b7 Mon Sep 17 00:00:00 2001 From: Fabien Lavocat Date: Mon, 12 Jun 2017 09:23:01 -0700 Subject: [PATCH 365/761] Update the library react-chartjs-2 that depends on chart.js --- types/react-chartjs-2/index.d.ts | 3 ++- types/react-chartjs-2/test/doughnut.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/react-chartjs-2/index.d.ts b/types/react-chartjs-2/index.d.ts index e3e2da896c..1814a34932 100644 --- a/types/react-chartjs-2/index.d.ts +++ b/types/react-chartjs-2/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-chartjs-2 2.0 // Project: https://github.com/gor181/react-chartjs-2 // Definitions by: Alexandre Paré +// Fabien Lavocat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -25,7 +26,7 @@ export interface ChartComponentProps { } export interface LinearComponentProps extends ChartComponentProps { - data: ChartData; + data: ChartData; } export default class ChartComponent

extends React.Component { diff --git a/types/react-chartjs-2/test/doughnut.tsx b/types/react-chartjs-2/test/doughnut.tsx index 4051310185..268ddfe40e 100755 --- a/types/react-chartjs-2/test/doughnut.tsx +++ b/types/react-chartjs-2/test/doughnut.tsx @@ -14,7 +14,7 @@ const data = { '#36A2EB', '#FFCE56' ], - hoverBackgroundColor: [ + pointHoverBackgroundColor: [ '#FF6384', '#36A2EB', '#FFCE56' From 8ac784aac5ddbc67b9724f3d0bc9e177c965eca6 Mon Sep 17 00:00:00 2001 From: Fabien Lavocat Date: Mon, 12 Jun 2017 09:36:25 -0700 Subject: [PATCH 366/761] Add missing file in last commit --- types/chart.js/index.d.ts | 2 +- types/react-chartjs-2/test/pie.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index f5ce46728a..0b1f70beae 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -357,7 +357,7 @@ declare namespace Chart { type ChartColor = string | CanvasGradient | CanvasPattern; interface ChartDataSets { - backgroundColor?: ChartColor; + backgroundColor?: ChartColor | ChartColor[]; borderWidth?: number; borderColor?: ChartColor; borderCapStyle?: string; diff --git a/types/react-chartjs-2/test/pie.tsx b/types/react-chartjs-2/test/pie.tsx index ba0a23ffb3..454088331d 100755 --- a/types/react-chartjs-2/test/pie.tsx +++ b/types/react-chartjs-2/test/pie.tsx @@ -14,7 +14,7 @@ const data = { '#36A2EB', '#FFCE56' ], - hoverBackgroundColor: [ + pointHoverBackgroundColor: [ '#FF6384', '#36A2EB', '#FFCE56' From 2b9d93ec88f7da5e427ab7f81910dbdf7946e2e5 Mon Sep 17 00:00:00 2001 From: krister Date: Mon, 12 Jun 2017 21:57:51 +0300 Subject: [PATCH 367/761] Enable linting --- types/react-intl/index.d.ts | 64 +++++++++++++-------------- types/react-intl/react-intl-tests.tsx | 28 +++++++----- types/react-intl/tslint.json | 1 + 3 files changed, 49 insertions(+), 44 deletions(-) create mode 100644 types/react-intl/tslint.json diff --git a/types/react-intl/index.d.ts b/types/react-intl/index.d.ts index 9777987c8d..644e9c9450 100644 --- a/types/react-intl/index.d.ts +++ b/types/react-intl/index.d.ts @@ -1,22 +1,22 @@ -// Type definitions for react-intl 2.2 +// Type definitions for react-intl 2.3 // Project: http://formatjs.io/react/ // Definitions by: Bruno Grieder , // Christian Droulers , // Fedor Nezhivoi , // Till Wolff , // Karol Janyst , -// Brian Houser +// Brian Houser , +// Krister Kari // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 declare namespace ReactIntl { - type DateSource = Date | string | number; interface Locale { locale: string; - fields?: { [key: string]: string }, - pluralRuleFunction?: (n: number, ord: boolean) => string; + fields?: { [key: string]: string }; + pluralRuleFunction?(n: number, ord: boolean): string; } type LocaleData = Locale[]; @@ -26,7 +26,7 @@ declare namespace ReactIntl { withRef?: boolean; } - type ComponentConstructor

= React.ComponentClass

| React.StatelessComponent

+ type ComponentConstructor

= React.ComponentClass

| React.StatelessComponent

; function injectIntl

(component: ComponentConstructor

, options?: InjectIntlConfig): React.ComponentClass

& { WrappedComponent: ComponentConstructor

}; @@ -34,7 +34,7 @@ declare namespace ReactIntl { function addLocaleData(data: Locale[] | Locale): void; interface Messages { - [key: string]: FormattedMessage.MessageDescriptor + [key: string]: FormattedMessage.MessageDescriptor; } function defineMessages(messages: T): T; @@ -64,19 +64,19 @@ declare namespace ReactIntl { const intlShape: IntlShape; interface InjectedIntl { - formatDate: (value: DateSource, options?: FormattedDate.PropsBase) => string; - formatTime: (value: DateSource, options?: FormattedTime.PropsBase) => string; - formatRelative: (value: DateSource, options?: FormattedRelative.PropsBase & { now?: any }) => string; - formatNumber: (value: number, options?: FormattedNumber.PropsBase) => string; - formatPlural: (value: number, options?: FormattedPlural.Base) => keyof FormattedPlural.PropsBase; - formatMessage: (messageDescriptor: FormattedMessage.MessageDescriptor, values?: {[key: string]: string | number}) => string; - formatHTMLMessage: (messageDescriptor: FormattedMessage.MessageDescriptor, values?: {[key: string]: string}) => string; + formatDate(value: DateSource, options?: FormattedDate.PropsBase): string; + formatTime(value: DateSource, options?: FormattedTime.PropsBase): string; + formatRelative(value: DateSource, options?: FormattedRelative.PropsBase & { now?: any }): string; + formatNumber(value: number, options?: FormattedNumber.PropsBase): string; + formatPlural(value: number, options?: FormattedPlural.Base): keyof FormattedPlural.PropsBase; + formatMessage(messageDescriptor: FormattedMessage.MessageDescriptor, values?: {[key: string]: string | number}): string; + formatHTMLMessage(messageDescriptor: FormattedMessage.MessageDescriptor, values?: {[key: string]: string}): string; locale: string; formats: any; messages: { [id: string]: string }; defaultLocale: string; defaultFormats: any; - now : () => number; + now(): number; } interface InjectedIntlProps { @@ -90,9 +90,9 @@ declare namespace ReactIntl { } namespace FormattedDate { - export interface PropsBase extends IntlComponent.DateTimeFormatProps {} + type PropsBase = IntlComponent.DateTimeFormatProps; - export interface Props extends PropsBase { + interface Props extends PropsBase { value: DateSource; } } @@ -100,16 +100,16 @@ declare namespace ReactIntl { class FormattedDate extends React.Component { } namespace FormattedTime { - export interface PropsBase extends IntlComponent.DateTimeFormatProps {} + type PropsBase = IntlComponent.DateTimeFormatProps; - export interface Props extends PropsBase { + interface Props extends PropsBase { value: DateSource; } } class FormattedTime extends React.Component { } namespace FormattedRelative { - export interface PropsBase { + interface PropsBase { /* * one of "second", "minute", "hour", "day", "month" or "year" */ @@ -123,7 +123,7 @@ declare namespace ReactIntl { initialNow?: any; } - export interface Props extends PropsBase { + interface Props extends PropsBase { value: DateSource; } } @@ -131,13 +131,13 @@ declare namespace ReactIntl { class FormattedRelative extends React.Component { } namespace FormattedMessage { - export interface MessageDescriptor { + interface MessageDescriptor { id: string; description?: string; defaultMessage?: string; } - export interface Props extends MessageDescriptor { + interface Props extends MessageDescriptor { values?: {[key: string]: string | number | JSX.Element}; tagName?: string; } @@ -147,26 +147,25 @@ declare namespace ReactIntl { class FormattedHTMLMessage extends React.Component { } namespace FormattedNumber { - export interface PropsBase extends Intl.NumberFormatOptions { + interface PropsBase extends Intl.NumberFormatOptions { format?: string; } - export interface Props extends PropsBase { + interface Props extends PropsBase { value: number; } } class FormattedNumber extends React.Component { } - namespace FormattedPlural { - export interface Base { + interface Base { /* * one of "cardinal" (default) | "ordinal" */ style?: "cardinal" | "ordinal"; } - export interface PropsBase extends Base { + interface PropsBase extends Base { other?: any; zero?: any; one?: any; @@ -175,15 +174,14 @@ declare namespace ReactIntl { many?: any; } - export interface Props extends PropsBase { + interface Props extends PropsBase { value: number; } } class FormattedPlural extends React.Component { } - namespace IntlProvider { - export interface Props { + interface Props { locale?: string; formats?: any; messages?: any; @@ -196,12 +194,12 @@ declare namespace ReactIntl { class IntlProvider extends React.Component { getChildContext(): { intl: InjectedIntl; - } + }; } } declare module "react-intl" { - export = ReactIntl + export = ReactIntl; } declare module "react-intl/locale-data/af" { diff --git a/types/react-intl/react-intl-tests.tsx b/types/react-intl/react-intl-tests.tsx index 8b21ef8651..42305ef571 100644 --- a/types/react-intl/react-intl-tests.tsx +++ b/types/react-intl/react-intl-tests.tsx @@ -3,8 +3,8 @@ * Updated by Fedor Nezhivoi */ -import * as React from "react" -import * as reactMixin from "react-mixin" +import * as React from "react"; +import * as reactMixin from "react-mixin"; import { IntlProvider, @@ -21,14 +21,14 @@ import { FormattedPlural, FormattedDate, FormattedTime -} from "react-intl" +} from "react-intl"; import reactIntlEn = require("react-intl/locale-data/en"); addLocaleData(reactIntlEn); interface SomeComponentProps { - className: string + className: string; } const SomeFunctionalComponentWithIntl: React.ComponentClass = injectIntl(({ @@ -51,7 +51,10 @@ const SomeFunctionalComponentWithIntl: React.ComponentClass const formattedNumber = formatNumber(123, { format: "short" }); const formattedPlural = formatPlural(1, { style: "ordinal" }); const formattedMessage = formatMessage({ id: "hello", defaultMessage: "Hello {name}!" }, { name: "Roger" }); - const formattedMessagePlurals = formatMessage({ id: "hello", defaultMessage: "Hello {name} you have {unreadCount, number} {unreadCount, plural, one {message} other {messages}}!" }, { name: "Roger", unreadCount: 123 }); + const formattedMessagePlurals = formatMessage({ + id: "hello", + defaultMessage: "Hello {name} you have {unreadCount, number} {unreadCount, plural, one {message} other {messages}}!" }, + { name: "Roger", unreadCount: 123 }); const formattedHTMLMessage = formatHTMLMessage({ id: "hello", defaultMessage: "Hello {name}!" }, { name: "Roger" }); return (

@@ -71,7 +74,10 @@ class SomeComponent extends React.Component{name}!" }, { name: "Roger" }); return
{formattedNum} )} -
+
; } } @@ -230,14 +236,14 @@ const SomeComponentWithIntl = injectIntl(SomeComponent); class TestApp extends React.Component<{}, {}> { render(): React.ReactElement<{}> { const definedMessages = defineMessages({ - "sup": { + sup: { id: "sup", defaultMessage: "Hai mom" } }); const messages = { - "hello": "Hello, {name}!" + hello: "Hello, {name}!" }; return ( @@ -250,9 +256,9 @@ class TestApp extends React.Component<{}, {}> { const intlProvider = new IntlProvider({ locale: 'en' }, {}); const { intl } = intlProvider.getChildContext(); -const wrappedComponent = +const wrappedComponent = ; export default { TestApp, SomeComponent: SomeComponentWithIntl -} +}; diff --git a/types/react-intl/tslint.json b/types/react-intl/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-intl/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 81e990d1d742f9f2a4e8f1b9cf787624a77327fd Mon Sep 17 00:00:00 2001 From: krister Date: Mon, 12 Jun 2017 22:08:09 +0300 Subject: [PATCH 368/761] Allow booleans, dates and numbers when formatting a message --- types/react-intl/index.d.ts | 4 ++-- types/react-intl/react-intl-tests.tsx | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/types/react-intl/index.d.ts b/types/react-intl/index.d.ts index 644e9c9450..f52fbc1cbc 100644 --- a/types/react-intl/index.d.ts +++ b/types/react-intl/index.d.ts @@ -69,8 +69,8 @@ declare namespace ReactIntl { formatRelative(value: DateSource, options?: FormattedRelative.PropsBase & { now?: any }): string; formatNumber(value: number, options?: FormattedNumber.PropsBase): string; formatPlural(value: number, options?: FormattedPlural.Base): keyof FormattedPlural.PropsBase; - formatMessage(messageDescriptor: FormattedMessage.MessageDescriptor, values?: {[key: string]: string | number}): string; - formatHTMLMessage(messageDescriptor: FormattedMessage.MessageDescriptor, values?: {[key: string]: string}): string; + formatMessage(messageDescriptor: FormattedMessage.MessageDescriptor, values?: {[key: string]: string | number | boolean | Date}): string; + formatHTMLMessage(messageDescriptor: FormattedMessage.MessageDescriptor, values?: {[key: string]: string | number | boolean | Date}): string; locale: string; formats: any; messages: { [id: string]: string }; diff --git a/types/react-intl/react-intl-tests.tsx b/types/react-intl/react-intl-tests.tsx index 42305ef571..1550aafcbe 100644 --- a/types/react-intl/react-intl-tests.tsx +++ b/types/react-intl/react-intl-tests.tsx @@ -74,11 +74,17 @@ class SomeComponent extends React.Component{name}!" }, { name: "Roger" }); + const formattedHTMLMessageNumber = intl.formatHTMLMessage({ id: "hello", defaultMessage: "Hello {num}!" }, { num: 1 }); + const formattedHTMLMessageDate = intl.formatHTMLMessage({ id: "hello", defaultMessage: "Hello {date}!" }, { date: new Date() }); + const formattedHTMLMessageBool = intl.formatHTMLMessage({ id: "hello", defaultMessage: "Hello {bool}!" }, { bool: true }); return
Date: Mon, 12 Jun 2017 23:52:00 +0300 Subject: [PATCH 369/761] add jasmine-given --- types/jasmine-given/index.d.ts | 10 ++++++++++ types/jasmine-given/jasmine-given-tests.ts | 9 +++++++++ types/jasmine-given/tsconfig.json | 22 ++++++++++++++++++++++ types/jasmine-given/tslint.json | 1 + 4 files changed, 42 insertions(+) create mode 100644 types/jasmine-given/index.d.ts create mode 100644 types/jasmine-given/jasmine-given-tests.ts create mode 100644 types/jasmine-given/tsconfig.json create mode 100644 types/jasmine-given/tslint.json diff --git a/types/jasmine-given/index.d.ts b/types/jasmine-given/index.d.ts new file mode 100644 index 0000000000..70a23d7e07 --- /dev/null +++ b/types/jasmine-given/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for jasmine-given 2.6 +// Project: https://github.com/searls/jasmine-given +// Definitions by: Shai Reznik +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function Given(func: () => void): void; +declare function When(func: () => void): void; +declare function Then(func: () => void): void; +declare function And(func: () => void): void; +declare function Invariant(func: () => void): void; diff --git a/types/jasmine-given/jasmine-given-tests.ts b/types/jasmine-given/jasmine-given-tests.ts new file mode 100644 index 0000000000..8a994ecbbe --- /dev/null +++ b/types/jasmine-given/jasmine-given-tests.ts @@ -0,0 +1,9 @@ +Given(() => { }); + +When(() => { }); + +Then(() => { }); + +And(() => { }); + +Invariant(() => {}); diff --git a/types/jasmine-given/tsconfig.json b/types/jasmine-given/tsconfig.json new file mode 100644 index 0000000000..cb1571590b --- /dev/null +++ b/types/jasmine-given/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jasmine-given-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jasmine-given/tslint.json b/types/jasmine-given/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/jasmine-given/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 1e6529ab1f13540ccfbc91936bb04f311868855a Mon Sep 17 00:00:00 2001 From: Bryan Johnson Date: Mon, 12 Jun 2017 16:36:39 -0600 Subject: [PATCH 370/761] fix parts of mapbox-gl def for v0.38.0 --- types/mapbox-gl/index.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 41c7f84d98..9438bfafac 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mapbox GL JS v0.35.1 +// Type definitions for Mapbox GL JS v0.38.0 // Project: https://github.com/mapbox/mapbox-gl-js // Definitions by: Dominik Bruderer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -57,10 +57,14 @@ declare namespace mapboxgl { getStyle(): mapboxgl.Style; + isStyleLoaded(): boolean; + addSource(id: string, source: VectorSource | RasterSource | GeoJSONSource | ImageSource | VideoSource | GeoJSONSourceRaw): this; isSourceLoaded(id: string): boolean; + areTilesLoaded(): boolean; + removeSource(id: string): this; getSource(id: string): VectorSource | RasterSource | GeoJSONSource | ImageSource | VideoSource; @@ -252,7 +256,7 @@ declare namespace mapboxgl { zoom?: number; } - export class PaddingOptions extends Evented { + export interface PaddingOptions { top: number; bottom: number; left: number; @@ -600,8 +604,6 @@ declare namespace mapboxgl { /** Return a new LngLat object whose longitude is wrapped to the range (-180, 180). */ wrap(): mapboxgl.LngLat; - wrapToBestWorld(center: mapboxgl.LngLat): mapboxgl.LngLat; - /** Return a LngLat as an array */ toArray(): number[]; From cd62ed775dc310f22d841c283748be8c8723bed3 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 12 Jun 2017 16:36:37 -0700 Subject: [PATCH 371/761] Add 'message' to process.on (#17137) It was omitted by mistake in #16705 --- types/node/index.d.ts | 1 + types/node/node-tests.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 2fd023b56b..178a8920e1 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -495,6 +495,7 @@ declare namespace NodeJS { on(event: "uncaughtException", listener: (error: Error) => void): this; on(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): this; on(event: "warning", listener: (warning: Error) => void): this; + on(event: "message", listener: (message: any, sendHandle: any) => void): this; on(event: Signals, listener: () => void): this; once(event: "beforeExit", listener: (code: number) => void): this; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index de401eb0fc..35260b138b 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -1890,6 +1890,9 @@ namespace process_tests { var module: NodeModule | undefined; module = process.mainModule; } + { + process.on("message", (req: any) => { }); + } } /////////////////////////////////////////////////////////// From dea10c7a6de3226a981d7c75c3391a6e2db38369 Mon Sep 17 00:00:00 2001 From: e020873 Date: Tue, 13 Jun 2017 01:50:09 +0200 Subject: [PATCH 372/761] [request] fix for Typescript 2.4 --- types/request/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/request/index.d.ts b/types/request/index.d.ts index d27e2e89ed..97a58531c5 100644 --- a/types/request/index.d.ts +++ b/types/request/index.d.ts @@ -131,8 +131,8 @@ declare namespace request { export type RequiredUriUrl = UriOptions | UrlOptions; interface OptionalUriUrl { - uri?: string; - url?: string; + uri?: string | Url; + url?: string | Url; } export type OptionsWithUri = UriOptions & CoreOptions; From d2af6a8f5a937f3764eacee4f01f1f4c54ff60d0 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 12 Jun 2017 17:17:49 -0700 Subject: [PATCH 373/761] Add Type annotation to tests --- .../cordova-plugin-battery-status-tests.ts | 2 ++ .../cordova-plugin-inappbrowser-tests.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts b/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts index e0433bf89b..bc2d516697 100644 --- a/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts +++ b/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts @@ -1,7 +1,9 @@ +window.addEventListener('batterystatus', (ev: BatteryStatusEvent) => { console.log('Battery level is ' + ev.level); }); window.addEventListener('batterystatus', (ev) => { console.log('Battery level is ' + ev.level); }); window.addEventListener('batterycritical', (ev) => { console.log('Battery is critical: ' + ev.level); }); window.addEventListener('batterylow', (ev) => { console.log('Battery is low: ' + ev.level); }); +window.removeEventListener('batterystatus', (ev: BatteryStatusEvent) => { console.log('Remove: Battery level is ' + ev.level); }); window.removeEventListener('batterystatus', (ev) => { console.log('Remove: Battery level is ' + ev.level); }); window.removeEventListener('batterycritical', (ev) => { console.log('Remove: Battery is critical: ' + ev.level); }); window.removeEventListener('batterylow', (ev) => { console.log('Remove: Battery is low: ' + ev.level); }); diff --git a/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts b/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts index d381f52375..12914e4110 100644 --- a/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts +++ b/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts @@ -5,11 +5,13 @@ // is similar to native window.open signature, so the compiler can's // select proper overload, but we cast result to InAppBrowser manually. var iab = window.open('google.com', '_self'); +iab.addEventListener('loadstart', (ev: InAppBrowserEvent) => { console.log('Start opening ' + ev.url); }); iab.addEventListener('loadstart', (ev) => { console.log('loadstart' + ev.url); }); iab.addEventListener('loadstop', (ev) => { console.log('loadstop' + ev.code); }); iab.addEventListener('loaderror', (ev) => { console.log('loaderror' + ev.code); }); iab.addEventListener('exit', (ev) => { console.log('exit' + ev.code); }); +iab.removeEventListener('loadstart', (ev: InAppBrowserEvent) => { console.log('Remove loadstart' + ev.url); }); iab.removeEventListener('loadstart', (ev) => { console.log('Remove loadstart' + ev.url); }); iab.removeEventListener('loadstop', (ev) => { console.log('Remove loadstop ' + ev.code); }); iab.removeEventListener('loaderror', (ev) => { console.log('Remove loaderror ' + ev.code); }); From 97d232d5f7200b00415d6c81421a4f9073bc1a5b Mon Sep 17 00:00:00 2001 From: Michiel de Bruijne Date: Tue, 13 Jun 2017 04:23:33 +0200 Subject: [PATCH 374/761] [node] port is optional in server.listen --- types/node/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 178a8920e1..6ab20accaa 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2275,10 +2275,10 @@ declare module "net" { } export interface Server extends events.EventEmitter { - listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server; - listen(port: number, hostname?: string, listeningListener?: Function): Server; - listen(port: number, backlog?: number, listeningListener?: Function): Server; - listen(port: number, listeningListener?: Function): Server; + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: Function): Server; + listen(port?: number, hostname?: string, listeningListener?: Function): Server; + listen(port?: number, backlog?: number, listeningListener?: Function): Server; + listen(port?: number, listeningListener?: Function): Server; listen(path: string, backlog?: number, listeningListener?: Function): Server; listen(path: string, listeningListener?: Function): Server; listen(options: ListenOptions, listeningListener?: Function): Server; From 0b5e9d380ad9b8be2a8c97362c5b6a62cf97916a Mon Sep 17 00:00:00 2001 From: Yoriki Yamaguchi Date: Tue, 13 Jun 2017 12:10:19 +0900 Subject: [PATCH 375/761] add type definition for AWS CloudFormation custom resource --- types/aws-lambda/aws-lambda-tests.ts | 29 ++++++++++++++ types/aws-lambda/index.d.ts | 58 ++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 55a3d6b99f..7f8b8fabdd 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -61,6 +61,8 @@ var S3CreateEvent: AWSLambda.S3CreateEvent = { ] }; var cognitoUserPoolEvent: AWSLambda.CognitoUserPoolEvent; +var cloudformationCustomResourceEvent: AWSLambda.CloudFormationCustomResourceEvent; +var cloudformationCustomResourceResponse: AWSLambda.CloudFormationCustomResourceResponse; /* API Gateway Event */ str = apiGwEvt.body; @@ -213,6 +215,33 @@ str = cognitoUserPoolEvent.response.privateChallengeParameters["answer"]; str = cognitoUserPoolEvent.response.challengeMetaData; b = cognitoUserPoolEvent.response.answerCorrect; +// CloudFormation Custom Resource +switch (cloudformationCustomResourceEvent.RequestType) { + case "Create": + str = cloudformationCustomResourceEvent.LogicalResourceId; + str = cloudformationCustomResourceEvent.RequestId; + anyObj = cloudformationCustomResourceEvent.ResourceProperties; + str = cloudformationCustomResourceEvent.ResourceProperties.ServiceToken; + str = cloudformationCustomResourceEvent.ResourceType; + str = cloudformationCustomResourceEvent.ResponseURL; + str = cloudformationCustomResourceEvent.ServiceToken; + str = cloudformationCustomResourceEvent.StackId; + break; + case "Update": + anyObj = cloudformationCustomResourceEvent.OldResourceProperties; + break; + case "Delete": + str = cloudformationCustomResourceEvent.PhysicalResourceId; + break; +} +anyObj = cloudformationCustomResourceResponse.Data; +str = cloudformationCustomResourceResponse.LogicalResourceId; +str = cloudformationCustomResourceResponse.PhysicalResourceId; +str = cloudformationCustomResourceResponse.Reason; +str = cloudformationCustomResourceResponse.RequestId; +str = cloudformationCustomResourceResponse.StackId; +str = cloudformationCustomResourceResponse.Status; + /* Context */ b = context.callbackWaitsForEmptyEventLoop; str = context.functionName; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index ca84cd350d..731701c0a7 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -168,6 +168,64 @@ interface CognitoUserPoolEvent { }; } +/** + * CloudFormation Custom Resource event and response + * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref.html + */ +type CloudFormationCustomResourceEventCommon = { + ServiceToken: string; + ResponseURL: string; + StackId: string; + RequestId: string; + LogicalResourceId: string; + ResourceType: string; + ResourceProperties: { + ServiceToken: string; + [Key: string]: any; + } +} + +type CloudFormationCustomResourceCreateEvent = CloudFormationCustomResourceEventCommon & { + RequestType: "Create"; +} + +type CloudFormationCustomResourceUpdateEvent = CloudFormationCustomResourceEventCommon & { + RequestType: "Update"; + PhysicalResourceId: string; + OldResourceProperties: { + [Key: string]: any; + }; +} + +type CloudFormationCustomResourceDeleteEvent = CloudFormationCustomResourceEventCommon & { + RequestType: "Delete"; + PhysicalResourceId: string; +} + +export type CloudFormationCustomResourceEvent = CloudFormationCustomResourceCreateEvent | CloudFormationCustomResourceUpdateEvent | CloudFormationCustomResourceDeleteEvent; + +type CloudFormationCustomResourceResponseCommon = { + PhysicalResourceId: string; + StackId: string; + RequestId: string; + LogicalResourceId: string; + Data?: { + [Key: string]: any; + } +} + +type CloudFormationCustomResourceSuccessResponse = CloudFormationCustomResourceResponseCommon & { + Status: "SUCCESS"; + Reason?: string; +} + +type CloudFormationCustomResourceFailedResponse = CloudFormationCustomResourceResponseCommon & { + Status: "FAILED"; + Reason: string; +} + +export type CloudFormationCustomResourceResponse = CloudFormationCustomResourceSuccessResponse | CloudFormationCustomResourceFailedResponse; + // Context // http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html interface Context { From eb27ec80abcab66fbe3e3fd6ecec15b05736558f Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Tue, 13 Jun 2017 01:56:39 -0300 Subject: [PATCH 376/761] [ofe] Add type declaration file --- types/ofe/index.d.ts | 6 ++++++ types/ofe/ofe-tests.ts | 8 ++++++++ types/ofe/tsconfig.json | 22 ++++++++++++++++++++++ types/ofe/tslint.json | 3 +++ 4 files changed, 39 insertions(+) create mode 100644 types/ofe/index.d.ts create mode 100644 types/ofe/ofe-tests.ts create mode 100644 types/ofe/tsconfig.json create mode 100644 types/ofe/tslint.json diff --git a/types/ofe/index.d.ts b/types/ofe/index.d.ts new file mode 100644 index 0000000000..663bc0510c --- /dev/null +++ b/types/ofe/index.d.ts @@ -0,0 +1,6 @@ +// Type definitions for ofe 0.5 +// Project: https://github.com/trevnorris/node-ofe +// Definitions by: Ben Davies +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function call(): 'done'; diff --git a/types/ofe/ofe-tests.ts b/types/ofe/ofe-tests.ts new file mode 100644 index 0000000000..002aecba23 --- /dev/null +++ b/types/ofe/ofe-tests.ts @@ -0,0 +1,8 @@ +/// + +import * as ofe from 'ofe'; + +let ret = ofe.call(); +if (ret === 'done') { + console.log('The ofe module was successfully called to create a heapdump if the process runs out of memory.'); +} diff --git a/types/ofe/tsconfig.json b/types/ofe/tsconfig.json new file mode 100644 index 0000000000..9c1f9c174a --- /dev/null +++ b/types/ofe/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ofe-tests.ts" + ] +} diff --git a/types/ofe/tslint.json b/types/ofe/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/ofe/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From fc7026e3bfa90ac77aafe5909b90705427c026ff Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Mon, 12 Jun 2017 23:20:53 -0300 Subject: [PATCH 377/761] [node-static] Add type declaration file --- types/node-static/index.d.ts | 56 ++++++++++++++++++++++++++ types/node-static/node-static-tests.ts | 7 ++++ types/node-static/tsconfig.json | 19 +++++++++ types/node-static/tslint.json | 3 ++ 4 files changed, 85 insertions(+) create mode 100644 types/node-static/index.d.ts create mode 100644 types/node-static/node-static-tests.ts create mode 100644 types/node-static/tsconfig.json create mode 100644 types/node-static/tslint.json diff --git a/types/node-static/index.d.ts b/types/node-static/index.d.ts new file mode 100644 index 0000000000..23e5ba1f87 --- /dev/null +++ b/types/node-static/index.d.ts @@ -0,0 +1,56 @@ +// Type definitions for node-static 0.7 +// Project: https://github.com/cloudhead/node-static +// Definitions by: Ben Davies +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as events from 'events'; +import * as fs from 'fs'; +import * as http from 'http'; +import * as mime from 'mime'; + +export interface Headers { [k: string]: any; } +export type Finish = (status: number, headers?: Headers) => void; +export type Callback = (e: Error) => void; + +export interface Options { + headers?: Headers; + indexFile?: string; + cache?: number | boolean; + serverInfo?: Buffer; + server?: string; + "cache-control"?: string; +} + +export interface ByteRange { + from: number; + to: number; + valid: boolean; +} + +export class Server { + root: string; + options: Options; + cache: number | boolean; + defaultHeaders: Headers; + serverInfo: string; + constructor(root: string, options?: Options); + + serveDir: (pathname: string, req: http.ServerRequest, res: http.ServerResponse, finish: Finish) => void; + serveFile: (pathname: string, status: number, headers: Headers, req: http.ServerRequest, res: http.ServerResponse) => events.EventEmitter; + finish: (status: number, headers: Headers, req: http.ServerRequest, res: http.ServerResponse, promise: events.EventEmitter, callback: Callback) => void; + servePath: (pathname: string, status: number, headers: Headers, req: http.ServerRequest, res: http.ServerResponse, finish: Finish) => events.EventEmitter; + resolve: (pathname: string) => string; + serve: (req: http.ServerRequest, res: http.ServerResponse, callback: Callback) => events.EventEmitter; + gzipOk: (req: http.ServerRequest, contentType: string) => boolean; + respondGzip: (pathname: string, status: number, contentType: string, _headers: Headers, files: string[], stat: fs.Stats, req: http.ServerRequest, res: http.ServerResponse, finish: Finish) => void; + parseByteRange: (req: http.ServerRequest, stat: fs.Stats) => ByteRange; + // tslint:disable-next-line max-line-length + respondNoGzip: (pathname: string, status: number, contentType: string, _headers: Headers, files: string[], stat: fs.Stats, req: http.ServerRequest, res: http.ServerResponse, finish: Finish) => void; + respond: (pathname: string, status: number, _headers: Headers, files: string[], stat: fs.Stats, req: http.ServerRequest, res: http.ServerResponse, finish: Finish) => void; + stream: (pathname: string, files: string[], length: number, startByte: number, res: http.ServerResponse, callback: Callback) => void; +} + +export const version: [number, number, number]; +export {mime}; diff --git a/types/node-static/node-static-tests.ts b/types/node-static/node-static-tests.ts new file mode 100644 index 0000000000..4bf2673ab4 --- /dev/null +++ b/types/node-static/node-static-tests.ts @@ -0,0 +1,7 @@ +import {Server, version, mime} from 'node-static'; + +let server = new Server(__dirname); +let pathname = server.resolve('./tsconfig.json'); +let mimetype = mime.lookup(pathname); +let versionNum = version.join('.'); +console.log(`The node-static server constructed an instance of itself, fetched the mimetype of ${pathname} (${mimetype}), and has a version of ${versionNum}! The package is working.`); diff --git a/types/node-static/tsconfig.json b/types/node-static/tsconfig.json new file mode 100644 index 0000000000..e857fac482 --- /dev/null +++ b/types/node-static/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "node-static-tests.ts" + ] +} diff --git a/types/node-static/tslint.json b/types/node-static/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/node-static/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 8bc37013d690a20542237f58e7b96abf62c73477 Mon Sep 17 00:00:00 2001 From: kerol2r20 Date: Tue, 13 Jun 2017 15:47:14 +0800 Subject: [PATCH 378/761] Update koa-session definition file Reference to koa's official project https://github.com/koajs/session --- types/koa-session/index.d.ts | 96 ++++++++++++++++++++++++++ types/koa-session/koa-session-tests.ts | 8 +++ types/koa-session/tsconfig.json | 22 ++++++ types/koa-session/tslint.json | 1 + 4 files changed, 127 insertions(+) create mode 100644 types/koa-session/index.d.ts create mode 100644 types/koa-session/koa-session-tests.ts create mode 100644 types/koa-session/tsconfig.json create mode 100644 types/koa-session/tslint.json diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts new file mode 100644 index 0000000000..eca81e17e3 --- /dev/null +++ b/types/koa-session/index.d.ts @@ -0,0 +1,96 @@ +// Type definitions for koa-static 3.0 +// Project: https://github.com/koajs/static +// Definitions by: Yu-Hsin Lu +// Definitions: https://github.com/kerol2r20/DefinitelyTyped + +/* =================== USAGE =================== + + import session = require("koa-session"); + var Koa = require('koa'); + + var app = new Koa(); + app.use(session(app)); + + =============================================== */ + +import * as Koa from "koa"; + +declare function session(CONFIG: { + /** + * cookie key (default is koa:sess) + */ + key?: string, + + /** + * maxAge in ms (default is 1 days) + * 'session' will result in a cookie that expires when session/browser is closed + * Warning: If a session cookie is stolen, this cookie will never expire + */ + maxAge?: number|'session', + + /** + * can overwrite or not (default true) + */ + overwrite?: boolean, + + /** + * httpOnly or not (default true) + */ + httpOnly?: boolean, + + /** + * signed or not (default true) + */ + signed?: boolean, + + /** + * You can store the session content in external stores(redis, mongodb or other DBs) + */ + store?: session.stores, + + /** + * Hook: valid session value before use it + */ + valid(...rest: any[]): void, + + /** + * Hook: before save session + */ + beforeSave(...rest: any[]): void, +}, app: Koa): Koa.Middleware; + +declare function session(app: Koa): Koa.Middleware; + +declare module 'koa' { + interface Context { + session: session.sessionProps; + } +} + +declare namespace session { + interface sessionProps { + isNew: boolean; + maxAge: number; + save(): void; + [propName: string]: any; + } + + interface stores { + /** + * get session object by key + */ + get(key: any): any; + + /** + * set session object for key, with a maxAge (in ms) + */ + set(key: any, sess: any, maxAge?: number): any; + + /** + * destroy session for key + */ + destroy(key: any): void; + } +} + +export = session; diff --git a/types/koa-session/koa-session-tests.ts b/types/koa-session/koa-session-tests.ts new file mode 100644 index 0000000000..dfed78426e --- /dev/null +++ b/types/koa-session/koa-session-tests.ts @@ -0,0 +1,8 @@ +import * as Koa from 'koa'; +import * as session from 'koa-session'; + +const app = new Koa(); + +app.use(session(app)); + +app.listen(3000); diff --git a/types/koa-session/tsconfig.json b/types/koa-session/tsconfig.json new file mode 100644 index 0000000000..d312ce0105 --- /dev/null +++ b/types/koa-session/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-session-tests.ts" + ] +} diff --git a/types/koa-session/tslint.json b/types/koa-session/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-session/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 48407866a13a5392fc5de7201a103776b0852ddc Mon Sep 17 00:00:00 2001 From: kerol2r20 Date: Tue, 13 Jun 2017 15:53:09 +0800 Subject: [PATCH 379/761] Add comment to serssionProps interface --- types/koa-session/index.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index eca81e17e3..32692c625d 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -69,8 +69,19 @@ declare module 'koa' { declare namespace session { interface sessionProps { + /** + * Returns true if the session is new + */ isNew: boolean; + + /** + * Set cookie's maxAge + */ maxAge: number; + + /** + * Save this session no matter whether it is populated + */ save(): void; [propName: string]: any; } From fbd60547d4589b1e24275fc156befb97c3d2ff0a Mon Sep 17 00:00:00 2001 From: kkpoon Date: Tue, 13 Jun 2017 15:53:35 +0800 Subject: [PATCH 380/761] Fix rethinkdb connection SSL options --- types/rethinkdb/index.d.ts | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index f375a50fc7..c2dbf4b49b 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -13,6 +13,8 @@ /// +import { ConnectionOptions as TLSConnectionOptions } from "tls"; + /** * https://rethinkdb.com/api/javascript/ */ @@ -80,7 +82,7 @@ declare module "rethinkdb" { } interface Row extends Expression { - (name: string): Expression; + (name: string): Expression; } /** @@ -112,14 +114,11 @@ declare module "rethinkdb" { * there is only one option available, and if the `ssl` option is specified, * this key is required. */ - ssl?: { - /** A list of Node.js `Buffer` objects containing SSL CA certificates */ - ca: Buffer[]; - }; + ssl?: TLSConnectionOptions; } interface NoReplyWait { - noreplyWait: boolean; + noreplyWait: boolean; } interface Connection { @@ -241,8 +240,8 @@ declare module "rethinkdb" { filter(rql: ExpressionFunction): Sequence; filter(rql: Expression): Sequence; - filter(obj: { [key: string]: any }): Sequence; - + filter(obj: { [key: string]: any }): Sequence; + /** * Turn a query into a changefeed, an infinite stream of objects representing * changes to the query’s results as they occur. A changefeed may return changes @@ -346,7 +345,7 @@ declare module "rethinkdb" { } interface BooleanMap { - [ key: string ]: Boolean | BooleanMap; + [key: string]: Boolean | BooleanMap; } interface Expression extends Writeable, Operation, HasFields> { @@ -490,21 +489,21 @@ declare module "rethinkdb" { interface Sort { } interface ReqlType { - $reql_type$: string; + $reql_type$: string; } interface Time extends ReqlType { - $reql_type$: "TIME"; - epoch_time: number; - timezone: string; + $reql_type$: "TIME"; + epoch_time: number; + timezone: string; } interface Binary extends ReqlType { - $reql_type$: "BINARY"; - data: string; + $reql_type$: "BINARY"; + data: string; } - interface ReqlError extends Error {} + interface ReqlError extends Error { } /** * An error has occurred within the driver. This may be a driver bug, or it may @@ -512,5 +511,5 @@ declare module "rethinkdb" { * * See https://www.rethinkdb.com/docs/error-types/ */ - interface ReqlDriverError extends ReqlError {} + interface ReqlDriverError extends ReqlError { } } From 5e8c959abccf2975115e07556df769f3f69f3553 Mon Sep 17 00:00:00 2001 From: kerol2r20 Date: Tue, 13 Jun 2017 16:09:08 +0800 Subject: [PATCH 381/761] Fix jsdoc comment format error --- types/koa-session/index.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index 32692c625d..582e48ed1f 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -70,36 +70,36 @@ declare module 'koa' { declare namespace session { interface sessionProps { /** - * Returns true if the session is new - */ + * Returns true if the session is new + */ isNew: boolean; /** - * Set cookie's maxAge - */ + * Set cookie's maxAge + */ maxAge: number; /** - * Save this session no matter whether it is populated - */ + * Save this session no matter whether it is populated + */ save(): void; [propName: string]: any; } interface stores { /** - * get session object by key - */ + * get session object by key + */ get(key: any): any; /** - * set session object for key, with a maxAge (in ms) - */ + * set session object for key, with a maxAge (in ms) + */ set(key: any, sess: any, maxAge?: number): any; /** - * destroy session for key - */ + * destroy session for key + */ destroy(key: any): void; } } From 0bb157d4f97ff81535c7b6a8062b28995b854e53 Mon Sep 17 00:00:00 2001 From: kerol2r20 Date: Tue, 13 Jun 2017 16:26:43 +0800 Subject: [PATCH 382/761] Fix document format align --- types/koa-session/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index 582e48ed1f..0d6f6637a4 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -26,7 +26,7 @@ declare function session(CONFIG: { * 'session' will result in a cookie that expires when session/browser is closed * Warning: If a session cookie is stolen, this cookie will never expire */ - maxAge?: number|'session', + maxAge?: number | 'session', /** * can overwrite or not (default true) From e2a16b64b3470475d40d08eefbe0a4e0602f8c62 Mon Sep 17 00:00:00 2001 From: kerol2r20 Date: Tue, 13 Jun 2017 16:40:25 +0800 Subject: [PATCH 383/761] add sessionConfig interface --- types/koa-session/index.d.ts | 105 ++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index 0d6f6637a4..d32fcceeee 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -15,59 +15,50 @@ import * as Koa from "koa"; -declare function session(CONFIG: { - /** - * cookie key (default is koa:sess) - */ - key?: string, - - /** - * maxAge in ms (default is 1 days) - * 'session' will result in a cookie that expires when session/browser is closed - * Warning: If a session cookie is stolen, this cookie will never expire - */ - maxAge?: number | 'session', - - /** - * can overwrite or not (default true) - */ - overwrite?: boolean, - - /** - * httpOnly or not (default true) - */ - httpOnly?: boolean, - - /** - * signed or not (default true) - */ - signed?: boolean, - - /** - * You can store the session content in external stores(redis, mongodb or other DBs) - */ - store?: session.stores, - - /** - * Hook: valid session value before use it - */ - valid(...rest: any[]): void, - - /** - * Hook: before save session - */ - beforeSave(...rest: any[]): void, -}, app: Koa): Koa.Middleware; - -declare function session(app: Koa): Koa.Middleware; - -declare module 'koa' { - interface Context { - session: session.sessionProps; - } -} - declare namespace session { + interface sessionConfig { + /** + * cookie key (default is koa:sess) + */ + key?: string, + + /** + * maxAge in ms (default is 1 days) + * 'session' will result in a cookie that expires when session/browser is closed + * Warning: If a session cookie is stolen, this cookie will never expire + */ + maxAge?: number | 'session', + + /** + * can overwrite or not (default true) + */ + overwrite?: boolean, + + /** + * httpOnly or not (default true) + */ + httpOnly?: boolean, + + /** + * signed or not (default true) + */ + signed?: boolean, + + /** + * You can store the session content in external stores(redis, mongodb or other DBs) + */ + store?: session.stores, + + /** + * Hook: valid session value before use it + */ + valid(...rest: any[]): void, + + /** + * Hook: before save session + */ + beforeSave(...rest: any[]): void, + } interface sessionProps { /** * Returns true if the session is new @@ -104,4 +95,14 @@ declare namespace session { } } +declare function session(CONFIG: session.sessionConfig, app: Koa): Koa.Middleware; + +declare function session(app: Koa): Koa.Middleware; + +declare module 'koa' { + interface Context { + session: session.sessionProps; + } +} + export = session; From ea2ab409e923d5640579ceb4adba3aa50a69b09f Mon Sep 17 00:00:00 2001 From: kerol2r20 Date: Tue, 13 Jun 2017 16:44:50 +0800 Subject: [PATCH 384/761] Fix interface EOL should be semicolon not comma --- types/koa-session/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index d32fcceeee..ad8626650f 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -20,44 +20,44 @@ declare namespace session { /** * cookie key (default is koa:sess) */ - key?: string, + key?: string; /** * maxAge in ms (default is 1 days) * 'session' will result in a cookie that expires when session/browser is closed * Warning: If a session cookie is stolen, this cookie will never expire */ - maxAge?: number | 'session', + maxAge?: number | 'session'; /** * can overwrite or not (default true) */ - overwrite?: boolean, + overwrite?: boolean; /** * httpOnly or not (default true) */ - httpOnly?: boolean, + httpOnly?: boolean; /** * signed or not (default true) */ - signed?: boolean, + signed?: boolean; /** * You can store the session content in external stores(redis, mongodb or other DBs) */ - store?: session.stores, + store?: session.stores; /** * Hook: valid session value before use it */ - valid(...rest: any[]): void, + valid(...rest: any[]): void; /** * Hook: before save session */ - beforeSave(...rest: any[]): void, + beforeSave(...rest: any[]): void; } interface sessionProps { /** From 0bf3602c2b576cf4e7fbe903cfd0dfafa19ca050 Mon Sep 17 00:00:00 2001 From: kerol2r20 Date: Tue, 13 Jun 2017 16:53:33 +0800 Subject: [PATCH 385/761] Modify the wrong base information of index.d.ts --- types/koa-session/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index ad8626650f..b3c7922ec8 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -1,5 +1,5 @@ -// Type definitions for koa-static 3.0 -// Project: https://github.com/koajs/static +// Type definitions for koa-session 3.0 +// Project: https://github.com/koajs/session // Definitions by: Yu-Hsin Lu // Definitions: https://github.com/kerol2r20/DefinitelyTyped From 16efcb943dd0eb9879fbf9e3b3e18eba9deeabe0 Mon Sep 17 00:00:00 2001 From: Alex Brick Date: Tue, 13 Jun 2017 11:50:09 +0200 Subject: [PATCH 386/761] Adding types for swagger-tools https://github.com/apigee-127/swagger-tools --- types/swagger-tools/index.d.ts | 78 ++++++++++++++++++++++ types/swagger-tools/swagger-tools-tests.ts | 77 +++++++++++++++++++++ types/swagger-tools/tsconfig.json | 22 ++++++ types/swagger-tools/tslint.json | 1 + 4 files changed, 178 insertions(+) create mode 100644 types/swagger-tools/index.d.ts create mode 100644 types/swagger-tools/swagger-tools-tests.ts create mode 100644 types/swagger-tools/tsconfig.json create mode 100644 types/swagger-tools/tslint.json diff --git a/types/swagger-tools/index.d.ts b/types/swagger-tools/index.d.ts new file mode 100644 index 0000000000..340d962ba0 --- /dev/null +++ b/types/swagger-tools/index.d.ts @@ -0,0 +1,78 @@ +// Type definitions for swagger-tools 0.10 +// Project: https://github.com/apigee-127/swagger-tools +// Definitions by: Alex Brick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { NextHandleFunction } from 'connect'; +import { IncomingMessage } from 'http'; + +export interface SwaggerRouterOptionsControllers { + [handlerName: string]: NextHandleFunction; +} + +export interface SwaggerRouterOptions { + controllers?: SwaggerRouterOptionsControllers | string | string[]; + useStubs?: boolean; +} + +export interface SwaggerSecurityError { + code?: string; + message?: string; + state?: string; + statusCode?: number; +} + +export type SwaggerSecurityCallback = (err?: SwaggerSecurityError) => void; + +export type SwaggerSecurityHandler = (request: IncomingMessage, securityDefinition: any, scopes: string | string[], callback: SwaggerSecurityCallback) => void; + +export interface SwaggerSecurityOptions { + [securityDefinitionName: string]: SwaggerSecurityHandler; +} + +export interface SwaggerUi12ApiDeclarations { + [path: string]: any; +} + +export interface SwaggerUiOptions { + apiDocs?: string; + apiDocsPrefix?: string; + swaggerUi?: string; + swaggerUiDir?: string; + swaggerUiPrefix?: string; +} + +export interface SwaggerValidatorOptions { + validateResponse?: boolean; +} + +export interface Middleware { + swaggerMetadata(): NextHandleFunction; + swaggerRouter(options?: SwaggerRouterOptions): NextHandleFunction; + swaggerSecurity(options?: SwaggerSecurityOptions): NextHandleFunction; + swaggerValidator(options?: SwaggerValidatorOptions): NextHandleFunction; +} + +export interface Middleware12 extends Middleware { + swaggerUi(apiDeclarations: SwaggerUi12ApiDeclarations, options?: SwaggerUiOptions): NextHandleFunction; +} + +export interface Middleware20 extends Middleware { + swaggerUi(options: SwaggerUiOptions): NextHandleFunction; +} + +export type InitializeMiddlewareCallback12 = (middleware: Middleware12) => void; + +export type InitializeMiddlewareCallback20 = (middleware: Middleware20) => void; + +export interface Resource { + resourcePath: string; +} + +export function initializeMiddleware(swaggerObject: any, callback: InitializeMiddlewareCallback20): void; + +export function initializeMiddleware( + swaggerObject: any, + resources: Resource[], + callback: InitializeMiddlewareCallback12 +): void; diff --git a/types/swagger-tools/swagger-tools-tests.ts b/types/swagger-tools/swagger-tools-tests.ts new file mode 100644 index 0000000000..e39670be7c --- /dev/null +++ b/types/swagger-tools/swagger-tools-tests.ts @@ -0,0 +1,77 @@ +// 2.0 examples from https://github.com/apigee-127/swagger-tools/blob/master/examples/2.0/index.js + +import * as connect from 'connect'; +import { createServer } from 'http'; +import * as swaggerTools from 'swagger-tools'; + +const app = connect(); + +const serverPort = 3000; + +// swaggerRouter configuration +const options = { + controllers: './controllers', + useStubs: process.env.NODE_ENV === 'development' ? true : false // Conditionally turn on stubs (mock mode) +}; + +const swaggerUiOptions = { + apiDocs: 'apiDocs', + swaggerUi: 'swaggerUi', +}; + +// The Swagger document (require it, build it programmatically, fetch it from a URL, ...) +// tslint:disable-next-line no-var-requires +const swaggerDoc20 = require('./api/swagger.json'); + +// Initialize the Swagger middleware +swaggerTools.initializeMiddleware(swaggerDoc20, middleware => { + // Interpret Swagger resources and attach metadata to request - must be first in swagger-tools middleware chain + app.use(middleware.swaggerMetadata()); + + // Validate Swagger requests + app.use(middleware.swaggerValidator()); + + // Route validated requests to appropriate controller + app.use(middleware.swaggerRouter(options)); + + // Serve the Swagger documents and Swagger UI + app.use(middleware.swaggerUi(swaggerUiOptions)); + + // Start the server + createServer(app).listen(serverPort, () => { + console.log('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort); + }); +}); + +// 1.2 examples from https://github.com/apigee-127/swagger-tools/blob/master/examples/1.2/index.js + +// The Swagger Resource Listing Document (require it, build it programmatically, fetch it from a URL, ...) +// tslint:disable-next-line no-var-requires +const apiDoc12 = require('./api/api-doc.json'); +// The Swagger API Declaration Documents (require them, build them programmatically, fetch them from a URL, ...) +const apiDeclarations = [ + // tslint:disable-next-line no-var-requires + require('./api/weather.json') +]; + +// Initialize the Swagger middleware +swaggerTools.initializeMiddleware(apiDoc12, apiDeclarations, middleware => { + // Interpret Swagger resources and attach metadata to request - must be first in swagger-tools middleware chain + app.use(middleware.swaggerMetadata()); + + // Validate Swagger requests + app.use(middleware.swaggerValidator()); + + // Route validated requests to appropriate controller + app.use(middleware.swaggerRouter(options)); + + // Serve the Swagger documents and Swagger UI + app.use(middleware.swaggerUi({ + '/weather': apiDeclarations[0] + })); + + // Start the server + createServer(app).listen(serverPort, () => { + console.log('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort); + }); +}); diff --git a/types/swagger-tools/tsconfig.json b/types/swagger-tools/tsconfig.json new file mode 100644 index 0000000000..a926cbf792 --- /dev/null +++ b/types/swagger-tools/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "swagger-tools-tests.ts" + ] +} diff --git a/types/swagger-tools/tslint.json b/types/swagger-tools/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/swagger-tools/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 58875cb0cd86570e684e196f5e05e1cb8d467887 Mon Sep 17 00:00:00 2001 From: afractal Date: Tue, 13 Jun 2017 12:14:28 +0200 Subject: [PATCH 387/761] update sharp-timer types to be more strict --- types/sharp-timer/sharp-timer-tests.ts | 1 - types/sharp-timer/tsconfig.json | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/types/sharp-timer/sharp-timer-tests.ts b/types/sharp-timer/sharp-timer-tests.ts index 685bf1b1d9..5d8976e474 100644 --- a/types/sharp-timer/sharp-timer-tests.ts +++ b/types/sharp-timer/sharp-timer-tests.ts @@ -5,7 +5,6 @@ let timer = new Timer(10); timer.onIntervalElapsing(i => { }); timer.onIntervalElapsed(() => { timer.stop(); - timer = null; }); timer.start(); diff --git a/types/sharp-timer/tsconfig.json b/types/sharp-timer/tsconfig.json index 3306511dec..ffaeaf9685 100644 --- a/types/sharp-timer/tsconfig.json +++ b/types/sharp-timer/tsconfig.json @@ -5,8 +5,8 @@ "es6" ], "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, + "noImplicitThis": true, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From 18960ebc18cc19073031f4c1be12de34d98c2dee Mon Sep 17 00:00:00 2001 From: Alejandro Haro Date: Tue, 13 Jun 2017 11:30:53 +0100 Subject: [PATCH 388/761] ramda: Add R.pathSatisfies --- types/ramda/index.d.ts | 8 ++++++++ types/ramda/ramda-tests.ts | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 79d1b1f6cf..fcae7ef5c0 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -5,6 +5,7 @@ // Liam Goodacre // Matt Dziuban // Stephen King +// Alejandro Fernandez Haro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -1195,6 +1196,13 @@ declare namespace R { pathOr(d: T, p: Path): (obj: any) => T|any; pathOr(d: T): CurriedFunction2; + /** + * Returns true if the specified object property satisfies the given predicate; false otherwise. + */ + pathSatisfies(pred: (val: T) => boolean, path: Path, obj: U): boolean; + pathSatisfies(pred: (val: T) => boolean, path: Path): (obj: U) => boolean; + pathSatisfies(pred: (val: T) => boolean): CurriedFunction2; + /** * Returns a partial copy of an object containing only the keys specified. If the key does not exist, the * property is ignored. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 8fbbb5c7ba..a5f28e0559 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -1294,6 +1294,12 @@ class Rectangle { R.pathOr(orValue, testPath, {c: {b: 2}}); //=> "N/A" } +() => { + const a: boolean = R.pathSatisfies(x => x > 0, ['x'], {x: 1, y: 2}); //=> true + const b: boolean = R.pathSatisfies(x => x > 0, ['x'])({x: 1, y: 2}); //=> true + const c: boolean = R.pathSatisfies(x => x > 0)(['x'])({x: 1, y: 2}); //=> true +} + () => { var isPositive = function(n: number) { return n > 0; From 15e315003c58e29e2920222884dadca27e4cc245 Mon Sep 17 00:00:00 2001 From: Flarna Date: Tue, 13 Jun 2017 13:05:18 +0200 Subject: [PATCH 389/761] * Add missing OS signals * add missing process APIs --- types/node/index.d.ts | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 178a8920e1..5ed6beb44c 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -382,7 +382,7 @@ declare namespace NodeJS { "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | - "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ"; + "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO"; export interface Socket extends ReadWriteStream { isTTY?: true; @@ -467,7 +467,9 @@ declare namespace NodeJS { * 6. uncaughtException * 7. unhandledRejection * 8. warning - * 9. + * 9. message + * 10. + * 11. anything else */ addListener(event: "beforeExit", listener: (code: number) => void): this; @@ -477,16 +479,20 @@ declare namespace NodeJS { addListener(event: "uncaughtException", listener: (error: Error) => void): this; addListener(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): this; addListener(event: "warning", listener: (warning: Error) => void): this; + addListener(event: "message", listener: (message: any, sendHandle: any) => void): this; addListener(event: Signals, listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "beforeExit", listener: (code: number) => void): boolean; - emit(event: "disconnect", listener: () => void): boolean; - emit(event: "exit", listener: (code: number) => void): boolean; - emit(event: "rejectionHandled", listener: (promise: Promise) => void): boolean; - emit(event: "uncaughtException", listener: (error: Error) => void): boolean; - emit(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): boolean; - emit(event: "warning", listener: (warning: Error) => void): boolean; - emit(event: Signals, listener: () => void): boolean; + emit(event: "beforeExit", code: number): boolean; + emit(event: "disconnect"): boolean; + emit(event: "exit", code: number): boolean; + emit(event: "rejectionHandled", promise: Promise): boolean; + emit(event: "uncaughtException", error: Error): boolean; + emit(event: "unhandledRejection", reason: any, promise: Promise): boolean; + emit(event: "warning", warning: Error): boolean; + emit(event: "message", message: any, sendHandle: any): this; + emit(event: Signals): boolean; + emit(event: string | symbol, ...args: any[]): boolean; on(event: "beforeExit", listener: (code: number) => void): this; on(event: "disconnect", listener: () => void): this; @@ -497,6 +503,7 @@ declare namespace NodeJS { on(event: "warning", listener: (warning: Error) => void): this; on(event: "message", listener: (message: any, sendHandle: any) => void): this; on(event: Signals, listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; once(event: "beforeExit", listener: (code: number) => void): this; once(event: "disconnect", listener: () => void): this; @@ -505,7 +512,9 @@ declare namespace NodeJS { once(event: "uncaughtException", listener: (error: Error) => void): this; once(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): this; once(event: "warning", listener: (warning: Error) => void): this; + once(event: "message", listener: (message: any, sendHandle: any) => void): this; once(event: Signals, listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; prependListener(event: "beforeExit", listener: (code: number) => void): this; prependListener(event: "disconnect", listener: () => void): this; @@ -514,7 +523,9 @@ declare namespace NodeJS { prependListener(event: "uncaughtException", listener: (error: Error) => void): this; prependListener(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): this; prependListener(event: "warning", listener: (warning: Error) => void): this; + prependListener(event: "message", listener: (message: any, sendHandle: any) => void): this; prependListener(event: Signals, listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; prependOnceListener(event: "beforeExit", listener: (code: number) => void): this; prependOnceListener(event: "disconnect", listener: () => void): this; @@ -523,7 +534,9 @@ declare namespace NodeJS { prependOnceListener(event: "uncaughtException", listener: (error: Error) => void): this; prependOnceListener(event: "unhandledRejection", listener: (reason: any, promise: Promise) => void): this; prependOnceListener(event: "warning", listener: (warning: Error) => void): this; + prependOnceListener(event: "message", listener: (message: any, sendHandle: any) => void): this; prependOnceListener(event: Signals, listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; } export interface Global { From b2368b04db607eddf965c2bcb52dac9a8a05bb9f Mon Sep 17 00:00:00 2001 From: Pascal Brokmeier Date: Tue, 13 Jun 2017 13:58:06 +0200 Subject: [PATCH 390/761] fix(alexa-sdk): updated lint rules --- types/alexa-sdk/tslint.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/types/alexa-sdk/tslint.json b/types/alexa-sdk/tslint.json index 3db14f85ea..0c1ca3b5b4 100644 --- a/types/alexa-sdk/tslint.json +++ b/types/alexa-sdk/tslint.json @@ -1 +1,9 @@ -{ "extends": "dtslint/dt.json" } +{ "extends": "dtslint/dt.json", + "rules": { + "object-literal-shorthand": false, + "object-literal-key-quote": false, + "no-empty-interface": false, + "prefer-method-signature": false, + "object-literal-key-quotes": false + } +} From 8c4aadf11325550bfd01620982161c1d4b38c84c Mon Sep 17 00:00:00 2001 From: Joe Vanderstelt Date: Tue, 13 Jun 2017 08:44:43 -0400 Subject: [PATCH 391/761] cwd in rsync --- types/rsync/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/rsync/index.d.ts b/types/rsync/index.d.ts index 7ec975e992..e86d22647a 100644 --- a/types/rsync/index.d.ts +++ b/types/rsync/index.d.ts @@ -48,7 +48,9 @@ interface Rsync { stdout: StreamDataHandler, stderr: StreamDataHandler ): child_process.ChildProcess; - + + // cwd + cwd(cwd: string): string; // option shorthands shell(shell: string): Rsync; From 76260f6cf3f4fff04c402f70784e749f4550dc38 Mon Sep 17 00:00:00 2001 From: Sebastien PUECH Date: Tue, 13 Jun 2017 16:24:43 +0200 Subject: [PATCH 392/761] Fix "connect" method for node typings. --- types/node/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 178a8920e1..9ec5eff946 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2338,7 +2338,7 @@ declare module "net" { } export function createServer(connectionListener?: (socket: Socket) => void): Server; export function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server; - export function connect(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function connect(options: { port: number, host?: string, localAddress?: string, localPort?: number, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; export function connect(port: number, host?: string, connectionListener?: Function): Socket; export function connect(path: string, connectionListener?: Function): Socket; export function createConnection(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; From 0ce6fd3ee4398e14585a2fbc9901260bc3b48730 Mon Sep 17 00:00:00 2001 From: Codemonk Date: Tue, 13 Jun 2017 22:56:28 +0800 Subject: [PATCH 393/761] Create tsconfig.json --- types/baidumap-web-sdk/tsconfig.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 types/baidumap-web-sdk/tsconfig.json diff --git a/types/baidumap-web-sdk/tsconfig.json b/types/baidumap-web-sdk/tsconfig.json new file mode 100644 index 0000000000..0f670e4bc5 --- /dev/null +++ b/types/baidumap-web-sdk/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "q": ["q/v0"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "baidumap-tests.ts" + ] +} From 7a1ae0bfbf201a10fe7f3f3573b5aaba776466c0 Mon Sep 17 00:00:00 2001 From: Codemonk Date: Tue, 13 Jun 2017 22:57:00 +0800 Subject: [PATCH 394/761] Add files via upload --- types/baidumap-web-sdk/baidumap-tests.ts | 25 + types/baidumap-web-sdk/baidumap.base.d.ts | 56 +++ types/baidumap-web-sdk/baidumap.control.d.ts | 132 ++++++ types/baidumap-web-sdk/baidumap.core.d.ts | 154 ++++++ types/baidumap-web-sdk/baidumap.maplayer.d.ts | 82 ++++ types/baidumap-web-sdk/baidumap.maptype.d.ts | 51 ++ types/baidumap-web-sdk/baidumap.overlay.d.ts | 438 ++++++++++++++++++ types/baidumap-web-sdk/baidumap.panorama.d.ts | 121 +++++ .../baidumap-web-sdk/baidumap.rightmenu.d.ts | 47 ++ types/baidumap-web-sdk/baidumap.service.d.ts | 432 +++++++++++++++++ types/baidumap-web-sdk/baidumap.tools.d.ts | 61 +++ types/baidumap-web-sdk/index.d.ts | 28 ++ 12 files changed, 1627 insertions(+) create mode 100644 types/baidumap-web-sdk/baidumap-tests.ts create mode 100644 types/baidumap-web-sdk/baidumap.base.d.ts create mode 100644 types/baidumap-web-sdk/baidumap.control.d.ts create mode 100644 types/baidumap-web-sdk/baidumap.core.d.ts create mode 100644 types/baidumap-web-sdk/baidumap.maplayer.d.ts create mode 100644 types/baidumap-web-sdk/baidumap.maptype.d.ts create mode 100644 types/baidumap-web-sdk/baidumap.overlay.d.ts create mode 100644 types/baidumap-web-sdk/baidumap.panorama.d.ts create mode 100644 types/baidumap-web-sdk/baidumap.rightmenu.d.ts create mode 100644 types/baidumap-web-sdk/baidumap.service.d.ts create mode 100644 types/baidumap-web-sdk/baidumap.tools.d.ts create mode 100644 types/baidumap-web-sdk/index.d.ts diff --git a/types/baidumap-web-sdk/baidumap-tests.ts b/types/baidumap-web-sdk/baidumap-tests.ts new file mode 100644 index 0000000000..8dff733b3b --- /dev/null +++ b/types/baidumap-web-sdk/baidumap-tests.ts @@ -0,0 +1,25 @@ +/// + +namespace BMapTests { + export class TestFixture { + //document: http://lbsyun.baidu.com/index.php?title=jspopular + public createMap(container: string | HTMLElement) { + navigator.geolocation.getCurrentPosition((position: Position) => { + let point = new BMap.Point(position.coords.longitude, position.coords.latitude); + let map = new BMap.Map(container); + map.centerAndZoom(point, 15); + }, console.log, { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true }); + } + public addControl(map: BMap.Map) { + map.addControl(new BMap.ScaleControl({ anchor: BMAP_ANCHOR_TOP_LEFT })); + map.addControl(new BMap.NavigationControl()); + map.addControl(new BMap.MapTypeControl({ mapTypes: [BMAP_NORMAL_MAP, BMAP_HYBRID_MAP] })); + map.addControl(new BMap.OverviewMapControl({ isOpen: true, anchor: BMAP_ANCHOR_BOTTOM_RIGHT })); + } + public addMarker(map: BMap.Map, point: BMap.Point) { + var marker = new BMap.Marker(point); + map.addOverlay(marker); + marker.setAnimation(BMAP_ANIMATION_BOUNCE); + } + } +} \ No newline at end of file diff --git a/types/baidumap-web-sdk/baidumap.base.d.ts b/types/baidumap-web-sdk/baidumap.base.d.ts new file mode 100644 index 0000000000..4bea8ad872 --- /dev/null +++ b/types/baidumap-web-sdk/baidumap.base.d.ts @@ -0,0 +1,56 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +declare namespace BMap { + class Point { + constructor (lng: number, lat: number) + lng: number + lat: number + equals(other: Point): boolean + } + class Pixel { + constructor (x: number, y: number) + x: number + y: number + equals(other: Pixel): boolean + } + class Size { + constructor (width: number, height: number) + width: number + height: number + equals(other: Size): boolean + } + class Bounds { + constructor (minX: number, minY: number, maxX: number, maxY: number) + constructor (sw: Point, ne: Point) + minX: number + minY: number + maxX: number + maxY: number + equals(other: Bounds): boolean + containsPoint(point: Point): boolean + containsBounds(bounds: Bounds): boolean + intersects(other: Bounds): boolean + extend(point: Point): void + getCenter(): Point + isEmpty(): boolean + getSouthWest(): Point + getNorthEast(): Point + toSpan(): Point + } +} \ No newline at end of file diff --git a/types/baidumap-web-sdk/baidumap.control.d.ts b/types/baidumap-web-sdk/baidumap.control.d.ts new file mode 100644 index 0000000000..2eb4344dc9 --- /dev/null +++ b/types/baidumap-web-sdk/baidumap.control.d.ts @@ -0,0 +1,132 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +/// +/// +/// +declare namespace BMap { + class Control { + constructor() + defaultAnchor: ControlAnchor + defaultOffset: Size + initialize(map: Map): HTMLElement + setAnchor(anchor: ControlAnchor): void + getAnchor(): ControlAnchor + setOffset(offset: Size): void + getOffset(): Size + show(): void + hide(): void + isVisible(): boolean + } + interface NavigationControlOptions { + anchor?: ControlAnchor + offset?: Size + type?: NavigationControlType + showZoomInfo?: boolean + enableGeolocation?: boolean + } + interface ScaleControlOptions { + anchor?: ControlAnchor + offset?: Size + } + interface CopyrightControlOptions { + anchor?: ControlAnchor + offset?: Size + } + type ControlAnchor = number + class OverviewMapControl extends Control { + constructor(opts: OverviewMapControlOptions) + changeView(): void + setSize(size: Size): void + getSize(): Size + onviewchanged: (event: { type: string, target: any, isOpen: boolean }) => void + onviewchanging: (event: { type: string, target: any }) => void + } + type LengthUnit = string + class MapTypeControl extends Control { + constructor(opts?: MapTypeControlOptions) + } + class NavigationControl extends Control { + constructor(opts?: NavigationControlOptions) + getType(): NavigationControlOptions + setType(type: NavigationControlType): void + } + interface OverviewMapControlOptions { + anchor?: ControlAnchor + offset?: Size + size?: Size + isOpen?: boolean + } + class CopyrightControl extends Control { + constructor(opts?: CopyrightControlOptions) + addCopyright(copyright: Copyright): void + removeCopyright(id: number): void + getCopyright(id: number): Copyright + getCopyrightCollection(): Copyright[] + } + interface MapTypeControlOptions { + type?: MapTypeControlType, + mapTypes?: MapType[] + } + type NavigationControlType = number + class ScaleControl extends Control { + constructor(opts?: ScaleControlOptions) + getUnit(): LengthUnit + setUnit(unit: LengthUnit): void + } + interface Copyright { + id?: number + content?: string + bounds?: Bounds + } + type MapTypeControlType = number + class GeolocationControl extends Control { + constructor(opts?: GeolocationControlOptions) + } + interface GeolocationControlOptions { + anchor?: ControlAnchor + offset?: Size + showAddressBar?: boolean + enableAutoLocation?: boolean + locationIcon?: Icon + } + type StatusCode = number + class PanoramaControl extends Control { + constructor() + } +} +declare const BMAP_UNIT_METRIC: BMap.LengthUnit +declare const BMAP_UNIT_IMPERIAL: BMap.LengthUnit + +declare const BMAP_ANCHOR_TOP_LEFT: BMap.ControlAnchor +declare const BMAP_ANCHOR_TOP_RIGHT: BMap.ControlAnchor +declare const BMAP_ANCHOR_BOTTOM_LEFT: BMap.ControlAnchor +declare const BMAP_ANCHOR_BOTTOM_RIGHT: BMap.ControlAnchor + +declare const BMAP_NAVIGATION_CONTROL_LARGE: BMap.NavigationControlType +declare const BMAP_NAVIGATION_CONTROL_SMALL: BMap.NavigationControlType +declare const BMAP_NAVIGATION_CONTROL_PAN: BMap.NavigationControlType +declare const BMAP_NAVIGATION_CONTROL_ZOOM: BMap.NavigationControlType + +declare const BMAP_MAPTYPE_CONTROL_HORIZONTAL: BMap.MapTypeControlType +declare const BMAP_MAPTYPE_CONTROL_DROPDOWN: BMap.MapTypeControlType +declare const BMAP_MAPTYPE_CONTROL_MAP: BMap.MapTypeControlType + +declare const BMAP_STATUS_PERMISSION_DENIED: BMap.StatusCode +declare const BMAP_STATUS_SERVICE_UNAVAILABLE: BMap.StatusCode +declare const BMAP_STATUS_TIMEOUT: BMap.StatusCode \ No newline at end of file diff --git a/types/baidumap-web-sdk/baidumap.core.d.ts b/types/baidumap-web-sdk/baidumap.core.d.ts new file mode 100644 index 0000000000..f736013589 --- /dev/null +++ b/types/baidumap-web-sdk/baidumap.core.d.ts @@ -0,0 +1,154 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +/// +/// +/// +declare namespace BMap { + class Map { + constructor(container: string | HTMLElement, opts?: MapOptions) + enableDragging(): void + disableDragging(): void + enableScrollWheelZoom(): void + disableScrollWheelZoom(): void + enableDoubleClickZoom(): void + disableDoubleClickZoom(): void + enableKeyboard(): void + disableKeyboard(): void + enableInertialDragging(): void + disableInertialDragging(): void + enableContinuousZoom(): void + disableContinuousZoom(): void + enablePinchToZoom(): void + disablePinchToZoom(): void + enableAutoResize(): void + disableAutoResize(): void + setDefaultCursor(cursor: string): void + getDefaultCursor(): string + setDraggingCursor(cursor: string): void + getDraggingCursor(): string + setMinZoom(zoom: number): void + setMaxZoom(zoom: number): void + setMapStyle(mapStyle: MapStyle): void + setPanorama(pano: Panorama): void + disable3DBuilding(): void + getBounds(): Bounds + getCenter(): Point + getDistance(start: Point, end: Point): number + getMapType(): MapType + getSize(): Size + getViewport(view: Point[], viewportOptions?: ViewportOptions): Viewport + getZoom(): number + getPanorama(): Panorama + centerAndZoom(center: Point, zoom: number): void + panTo(center: Point, opts?: PanOptions): void + panBy(x: number, y: number, opts?: PanOptions): void + reset(): void + setCenter(center: Point | string): void + setCurrentCity(city: string): void + setMapType(mapType: MapType): void + setViewport(view: Point[], viewportOptions?: ViewportOptions): void + setZoom(zoom: number): void + highResolutionEnabled(): boolean + zoomIn(): void + zoomOut(): void + addHotspot(hotspot: Hotspot): void + removeHotspot(hotspot: Hotspot): void + clearHotspots(): void + addControl(control: Control): void + removeControl(control: Control): void + getContainer(): HTMLElement + addContextMenu(menu: ContextMenu): void + removeContextMenu(menu: ContextMenu): void + addOverlay(overlay: Overlay): void + removeOverlay(overlay: Overlay): void + clearOverlays(): void + openInfoWindow(infoWnd: InfoWindow, point: Point): void + closeInfoWindow(): void + pointToOverlayPixel(point: Point): Pixel + overlayPixelToPoint(pixel: Pixel): Point + getInfoWindow(): InfoWindow + getOverlays(): Overlay[] + getPanes(): MapPanes + addTileLayer(tileLayer: TileLayer): void + removeTileLayer(tilelayer: TileLayer): void + getTileLayer(mapType: string): TileLayer + pixelToPoint(pixel: Pixel): Point + pointToPixel(point: Point): Pixel + onclick: (event: { type: string, target: any, point: Point, pixel: Pixel, overlay: Overlay }) => void + ondblclick: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onrightclick: (event: { type: string, target: any, point: Point, pixel: Pixel, overlay: Overlay }) => void + onrightdblclick: (event: { type: string, target: any, point: Point, pixel: Pixel, overlay: Overlay }) => void + onmaptypechange: (event: { type: string, target: any }) => void + onmousemove: (event: { type: string, target: any, point: Point, pixel: Pixel, overlay: Overlay }) => void + onmouseover: (event: { type: string, target: any }) => void + onmouseout: (event: { type: string, target: any }) => void + onmovestart: (event: { type: string, target: any }) => void + onmoving: (event: { type: string, target: any }) => void + onmoveend: (event: { type: string, target: any }) => void + onzoomstart: (event: { type: string, target: any }) => void + onzoomend: (event: { type: string, target: any }) => void + onaddoverlay: (event: { type: string, target: any }) => void + onaddcontrol: (event: { type: string, target: any }) => void + onremovecontrol: (event: { type: string, target: any }) => void + onremoveoverlay: (event: { type: string, target: any }) => void + onclearoverlays: (event: { type: string, target: any }) => void + ondragstart: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + ondragging: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + ondragend: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onaddtilelayer: (event: { type: string, target: any }) => void + onremovetilelayer: (event: { type: string, target: any }) => void + onload: (event: { type: string, target: any, point: Point, pixel: Pixel, zoom: number }) => void + onresize: (event: { type: string, target: any, size: Size }) => void + onhotspotclick: (event: { type: string, target: any, spots: HotspotOptions }) => void + onhotspotover: (event: { type: string, target: any, spots: HotspotOptions }) => void + onhotspotout: (event: { type: string, target: any, spots: HotspotOptions }) => void + ontilesloaded: (event: { type: string, target: any }) => void + ontouchstart: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + ontouchmove: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + ontouchend: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onlongpress: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + } + interface PanOptions { + noAnimation?: boolean + } + interface MapOptions { + minZoom?: number + maxZoom?: number + mapType?: MapType + enableHighResolution?: boolean + enableAutoResize?: boolean + enableMapClick?: boolean + } + interface Viewport { + center: Point + zoom: number + } + interface ViewportOptions { + enableAnimation?: boolean + margins?: number[] + zoomFactor?: number + delay?: number + } + type APIVersion = number + interface MapStyle { + features: any[] + style: string + } +} +declare const BMAP_API_VERSION: BMap.APIVersion \ No newline at end of file diff --git a/types/baidumap-web-sdk/baidumap.maplayer.d.ts b/types/baidumap-web-sdk/baidumap.maplayer.d.ts new file mode 100644 index 0000000000..4ed2230bfb --- /dev/null +++ b/types/baidumap-web-sdk/baidumap.maplayer.d.ts @@ -0,0 +1,82 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +/// +/// +declare namespace BMap { + class TileLayer { + constructor(opts?: TileLayerOptions) + getTilesUrl(tileCoord: Pixel, zoom: number): string + getCopyright(): Copyright + isTransparentPng(): boolean + } + interface TileLayerOptions { + transparentPng?: boolean + tileUrlTemplate?: string + copyright?: Copyright + zIndex?: number + } + class TrafficLayer extends TileLayer { + constructor(opts?: TrafficLayerOptions) + } + interface TrafficLayerOptions { + predictDate?: PredictDate + } + interface PredictDate { + weekday: number + hour: number + } + class CustomLayer extends TileLayer { + constructor(opts: CustomLayerOptions) + onhotspotclick: (event: { type: string, target: any, content: any }) => void + } + interface Custompoi { + poiId: string + databoxId: string + title: string + address: string + phoneNumber: string + postcode: string + provinceCode: number + province: string + cityCode: number + city: string + districtCode: number + district: string + point: Point + tags: string[] + typeId: number + extendedData: any + } + class PanoramaCoverageLayer extends TileLayer { + constructor() + } + interface CustomLayerOptions { + databoxId?: string + geotableId?: string + q?: string + tags?: string + filter?: string + pointDensityType?: PointDensityType + } + type PointDensityType = number +} + +declare const BMAP_POINT_DENSITY_HIGH: BMap.PointDensityType +declare const BMAP_POINT_DENSITY_MEDIUM: BMap.PointDensityType +declare const BMAP_POINT_DENSITY_LOW: BMap.PointDensityType \ No newline at end of file diff --git a/types/baidumap-web-sdk/baidumap.maptype.d.ts b/types/baidumap-web-sdk/baidumap.maptype.d.ts new file mode 100644 index 0000000000..804b200cb1 --- /dev/null +++ b/types/baidumap-web-sdk/baidumap.maptype.d.ts @@ -0,0 +1,51 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +/// +/// +declare namespace BMap { + class MapType { + constructor(name: string, layers: TileLayer | TileLayer[], opts?: MapTypeOptions) + getName(): string + getTileLayer(): TileLayer + getMinZoom(): number + getMaxZoom(): number + getProjection(): Projection + getTextColor(): string + getTips(): string + } + interface MapTypeOptions { + minZoom?: number + maxZoom?: number + errorImageUrl?: string + textColor?: number + tips?: string + } + interface Projection { + lngLatToPoint(lngLat: Point): Pixel + pointToLngLat(point: Pixel): Point + } + interface MercatorProjection extends Projection { + } + interface PerspectiveProjection extends Projection { + } +} +declare const BMAP_NORMAL_MAP: BMap.MapType +declare const BMAP_PERSPECTIVE_MAP: BMap.MapType +declare const BMAP_SATELLITE_MAP: BMap.MapType +declare const BMAP_HYBRID_MAP: BMap.MapType \ No newline at end of file diff --git a/types/baidumap-web-sdk/baidumap.overlay.d.ts b/types/baidumap-web-sdk/baidumap.overlay.d.ts new file mode 100644 index 0000000000..295c30ff8a --- /dev/null +++ b/types/baidumap-web-sdk/baidumap.overlay.d.ts @@ -0,0 +1,438 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +/// +/// +/// +declare namespace BMap { + interface Overlay { + initialize?(map: Map): HTMLElement + isVisible?(): boolean + draw?(): void + show?(): void + hide?(): void + } + type SymbolShapeType = number + interface PolylineOptions { + strokeColor?: string + strokeWeight?: number + strokeOpacity?: number + strokeStyle?: string + enableMassClear?: boolean + enableEditing?: boolean + enableClicking?: boolean + } + interface GroundOverlayOptions { + opacity?: number + imageURL?: string + displayOnMinLevel?: number + displayOnMaxLevel?: number + } + class Marker implements Overlay { + constructor(point: Point, opts?: MarkerOptions) + openInfoWindow(infoWnd: InfoWindow): void + closeInfoWindow(): void + setIcon(icon: Icon): void + getIcon(): Icon + setPosition(position: Point): void + getPosition(): Point + setOffset(offset: Size): void + getOffset(): Size + setLabel(label: Label): void + getLabel(): Label + setTitle(title: string): void + getTitle(): string + setTop(isTop: boolean): void + enableDragging(): void + disableDragging(): void + enableMassClear(): void + disableMassClear(): void + setZIndex(zIndex: number): void + getMap(): Map + addContextMenu(menu: ContextMenu): void + removeContextMenu(menu: ContextMenu): void + setAnimation(animation?: Animation): void + setRotation(rotation: number): void + getRotation(): number + setShadow(shadow: Icon): void + getShadow(): void + addEventListener(event: string, handler: Function): void + removeEventListener(event: string, handler: Function): void + onclick: (event: { type: string, target: any }) => void + ondblclick: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmousedown: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseup: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseout: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseover: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onremove: (event: { type: string, target: any }) => void + oninfowindowclose: (event: { type: string, target: any }) => void + oninfowindowopen: (event: { type: string, target: any }) => void + ondragstart: (event: { type: string, target: any }) => void + ondragging: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + ondragend: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onrightclick: (event: { type: string, target: any }) => void + } + interface SymbolOptions { + anchor?: Size + fillColor?: string + fillOpacity?: number + scale?: number + rotation?: number + strokeColor?: string + strokeOpacity?: number + strokeWeight?: number + } + class IconSequence { + constructor(symbol: Symbol, offset?: string, repeat?: string, fixedRotation?: boolean) + } + class PointCollection implements Overlay { + constructor(points: Point[], opts?: PointCollectionOption) + setPoints(points: Point[]): void + setStyles(styles: PointCollectionOption): void + clear(): void + onclick: (event: { type: string, target: any, point: Point }) => void + onmouseover: (event: { type: string, target: any, point: Point }) => void + onmouseout: (event: { type: string, target: any, point: Point }) => void + } + interface MarkerOptions { + offset?: Size + icon?: Icon + enableMassClear?: boolean + enableDragging?: boolean + enableClicking?: boolean + raiseOnDrag?: boolean + draggingCursor?: string + rotation?: number + shadow?: Icon + title?: string + } + class InfoWindow implements Overlay { + constructor(content: string | HTMLElement, opts?: InfoWindowOptions) + setWidth(width: number): void + setHeight(height: number): void + redraw(): void + setTitle(title: string | HTMLElement): void + getTitle(): string | HTMLElement + setContent(content: string | HTMLElement): void + getContent(): string | HTMLElement + getPosition(): Point + enableMaximize(): void + disableMaximize(): void + isOpen(): boolean + setMaxContent(content: string): void + maximize(): void + restore(): void + enableAutoPan(): void + disableAutoPan(): void + enableCloseOnClick(): void + disableCloseOnClick(): void + addEventListener(event: string, handler: Function): void + removeEventListener(event: string, handler: Function): void + onclose: (event: { type: string, target: any, point: Point }) => void + onopen: (event: { type: string, target: any, point: Point }) => void + onmaximize: (event: { type: string, target: any }) => void + onrestore: (event: { type: string, target: any }) => void + onclickclose: (event: { type: string, target: any }) => void + } + class Polygon implements Overlay { + constructor(points: Array, opts?: PolygonOptions) + setPath(path: Point[]): void + getPath(): Point[] + setStrokeColor(color: string): void + getStrokeColor(): string + setFillColor(color: string): void + getFillColor(): string + setStrokeOpacity(opacity: number): void + getStrokeOpacity(): number + setFillOpacity(opacity: number): void + getFillOpacity(): number + setStrokeWeight(weight: number): void + getStrokeWeight(): number + setStrokeStyle(style: string): void + getStrokeStyle(): string + getBounds(): Bounds + enableEditing(): void + disableEditing(): void + enableMassClear(): void + disableMassClear(): void + setPointAt(index: number, point: Point): void + setPositionAt(index: number, point: Point): void + getMap(): Map + addEventListener(event: string, handler: Function): void + removeEventListener(event: string, handler: Function): void + onclick: (event: { type: string, target: any }) => void + ondblclick: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmousedown: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseup: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseout: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseover: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onremove: (event: { type: string, target: any }) => void + onlineupdate: (event: { type: string, target: any }) => void + } + interface PointCollectionOption { + shape?: ShapeType + color?: string + size?: SizeType + } + type Animation = number + interface InfoWindowOptions { + width?: number + height?: number + maxWidth?: number + offset?: Size + title?: string + enableAutoPan?: boolean + enableCloseOnClick?: boolean + enableMessage?: boolean + message?: string + } + interface PolygonOptions { + strokeColor?: string + fillColor?: string + strokeWeight?: number + strokeOpacity?: number + fillOpacity?: number + strokeStyle?: number + enableMassClear?: boolean + enableEditing?: boolean + enableClicking?: boolean + } + type ShapeType = number + class Icon implements Overlay { + constructor(url: string, size: Size, opts?: IconOptions) + anchor: Size + size: Size + imageOffset: Size + imageSize: Size + imageUrl: Size + infoWindowAnchor: Size + printImageUrl: string + setImageUrl(imageUrl: string): void + setSize(size: Size): void + setImageSize(offset: Size): void + setAnchor(anchor: Size): void + setImageOffset(offset: Size): void + setInfoWindowAnchor(anchor: Size): void + setPrintImageUrl(url: string): void + } + class Label implements Overlay { + constructor(content: string, opts?: LabelOptions) + setStyle(styles: Object): void + setContent(content: string): void + setPosition(position: Point): void + getPosition(): Point + setOffset(offset: Size): void + getOffset(): Size + setTitle(title: string): void + getTitle(): string + enableMassClear(): void + disableMassClear(): void + setZIndex(zIndex: number): void + setPosition(position: Point): void + getMap(): Map + addEventListener(event: string, handler: Function): void + removeEventListener(event: string, handler: Function): void + onclick: (event: { type: string, target: any }) => void + ondblclick: (event: { type: string, target: any }) => void + onmousedown: (event: { type: string, target: any }) => void + onmouseup: (event: { type: string, target: any }) => void + onmouseout: (event: { type: string, target: any }) => void + onmouseover: (event: { type: string, target: any }) => void + onremove: (event: { type: string, target: any }) => void + onrightclick: (event: { type: string, target: any }) => void + } + class Circle implements Overlay { + constructor(center: Point, radius: number, opts?: CircleOptions) + setCenter(center: Point): void + getCenter(): Point + setRadius(radius: number): void + getRadius(): number + getBounds(): Bounds + setStrokeColor(color: string): void + getStrokeColor(): string + setFillColor(color: string): void + getFillColor(): string + setStrokeOpacity(opacity: number): void + getStrokeOpacity(): number + setFillOpacity(opacity: number): void + getFillOpacity(): number + setStrokeWeight(weight: number): void + getStrokeWeight(): number + setStrokeStyle(style: string): void + getStrokeStyle(): string + getBounds(): Bounds + enableEditing(): void + disableEditing(): void + enableMassClear(): void + disableMassClear(): void + getMap(): Map + addEventListener(event: string, handler: Function): void + removeEventListener(event: string, handler: Function): void + onclick: (event: { type: string, target: any }) => void + ondblclick: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmousedown: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseup: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseout: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseover: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onremove: (event: { type: string, target: any }) => void + onlineupdate: (event: { type: string, target: any }) => void + } + type SizeType = number + interface IconOptions { + anchor?: Size + imageOffset?: Size + infoWindowAnchor?: Size + printImageUrl?: string + } + interface LabelOptions { + offset?: Size + position?: Point + enableMassClear?: boolean + } + interface CircleOptions { + strokeColor?: string + fillColor?: string + strokeWeight?: number + strokeOpacity?: number + fillOpacity?: number + strokeStyle?: string + enableMassClear?: boolean + enableEditing?: boolean + enableClicking?: boolean + } + class Hotspot implements Overlay { + constructor(position: Point, opts?: HotspotOptions) + setPosition(position: Point): void + getPosition(): Point + setText(text: string): void + getText(): string + setUserData(data: any): void + getUserData(): any + } + class Symbol implements Overlay { + constructor(path: string | SymbolShapeType, opts?: SymbolOptions) + setPath(path: string | SymbolShapeType): void + setAnchor(anchor: Size): void + setRotation(rotation: number): void + setScale(scale: number): void + setStrokeWeight(strokeWeight: number): void + setStrokeColor(color: string): void + setStrokeOpacity(opacity: number): void + setFillOpacity(opacity: number): void + setFillColor(color: string): void + } + class Polyline implements Overlay { + constructor(points: Point[], opts?: PolylineOptions) + setPath(path: Point[]): void + getPath(): Point[] + setStrokeColor(color: string): void + getStrokeColor(): string + setFillColor(color: string): void + getFillColor(): string + setStrokeOpacity(opacity: number): void + getStrokeOpacity(): number + setFillOpacity(opacity: number): void + getFillOpacity(): number + setStrokeWeight(weight: number): void + getStrokeWeight(): number + setStrokeStyle(style: string): void + getStrokeStyle(): string + getBounds(): Bounds + enableEditing(): void + disableEditing(): void + enableMassClear(): void + disableMassClear(): void + setPointAt(index: number, point: Point): void + setPositionAt(index: number, point: Point): void + getMap(): Map + addEventListener(event: string, handler: Function): void + removeEventListener(event: string, handler: Function): void + onclick: (event: { type: string, target: any }) => void + ondblclick: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmousedown: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseup: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseout: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onmouseover: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onremove: (event: { type: string, target: any }) => void + onlineupdate: (event: { type: string, target: any }) => void + } + class GroundOverlay implements Overlay { + constructor(bounds: Bounds, opts?: GroundOverlayOptions) + setBounds(bounds: Bounds): void + getBounds(): Bounds + setOpacity(opcity: number): void + getOpacity(): number + setImageURL(url: string): void + getImageURL(): string + setDisplayOnMinLevel(level: number): void + getDisplayOnMinLevel(): number + setDispalyOnMaxLevel(level: number): void + getDispalyOnMaxLevel(): number + onclick: (event: { type: string, target: any }) => void + ondblclick: (event: { type: string, target: any }) => void + } + interface HotspotOptions { + text?: string + offsets?: number[] + userData?: any + minZoom?: number + maxZoom?: number + } + interface MapPanes { + floatPane?: HTMLElement + markerMouseTarget?: HTMLElement + floatShadow?: HTMLElement + labelPane?: HTMLElement + markerPane?: HTMLElement + markerShadow?: HTMLElement + mapPane?: HTMLElement + } +} + +declare const BMap_Symbol_SHAPE_CIRCLE: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_RECTANGLE: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_RHOMBUS: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_STAR: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_POINT: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_PLANE: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_CAMERA: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_WARNING: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_SMILE: BMap.SymbolShapeType +declare const BMap_Symbol_SHAPE_CLOCK: BMap.SymbolShapeType + + +declare const BMAP_ANIMATION_DROP: BMap.Animation +declare const BMAP_ANIMATION_BOUNCE: BMap.Animation + +declare const BMAP_POINT_SHAPE_CIRCLE: BMap.ShapeType +declare const APE_STAR: BMap.ShapeType +declare const APE_SQUARE: BMap.ShapeType +declare const APE_RHOMBUS: BMap.ShapeType +declare const APE_WATERDROP: BMap.ShapeType + +declare const BMAP_POINT_SIZE_TINY: BMap.SizeType +declare const BMAP_POINT_SIZE_SMALLER: BMap.SizeType +declare const BMAP_POINT_SIZE_SMALL: BMap.SizeType +declare const BMAP_POINT_SIZE_NORMAL: BMap.SizeType +declare const BMAP_POINT_SIZE_BIG: BMap.SizeType +declare const BMAP_POINT_SIZE_BIGGER: BMap.SizeType +declare const BMAP_POINT_SIZE_HUGE: BMap.SizeType \ No newline at end of file diff --git a/types/baidumap-web-sdk/baidumap.panorama.d.ts b/types/baidumap-web-sdk/baidumap.panorama.d.ts new file mode 100644 index 0000000000..6b3e10f6b2 --- /dev/null +++ b/types/baidumap-web-sdk/baidumap.panorama.d.ts @@ -0,0 +1,121 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +/// +/// +declare namespace BMap { + class Panorama { + constructor(container: string | HTMLElement, opts?: PanoramaOptions) + getLinks(): PanoramaLink[] + getId(): string + getPosition(): Point + getPov(): PanoramaPov + getZoom(): number + setId(id: string): void + setPosition(position: Point): void + setPov(pov: PanoramaPov): void + setZoom(zoom: number): void + enableScrollWheelZoom(): void + disableScrollWheelZoom(): void + show(): void + hide(): void + addOverlay(overlay: PanoramaLabel): void + removeOverlay(overlay: PanoramaLabel): void + getSceneType(): PanoramaSceneType + setOptions(opts?: PanoramaOptions): void + setPanoramaPOIType(): PanoramaPOIType + onposition_changed: () => void + onlinks_changed: () => void + onpov_changed: () => void + onzoom_changed: () => void + onscene_type_changed: () => void + } + + interface PanoramaOptions { + navigationControl?: boolean + linksControl?: boolean + indoorSceneSwitchControl?: boolean + albumsControl?: boolean + albumsControlOptions?: AlbumsControlOptions + } + interface PanoramaLink { + description: string + heading: string + id: string + } + interface PanoramaPov { + heading: number + pitch: number + } + class PanoramaService { + constructor() + getPanoramaById(id: string, callback: (data: PanoramaData) => void): void + getPanoramaByLocation(point: Point, radius?: number, callback?: (data: PanoramaData) => void): void + } + interface PanoramaData { + id: string + description: string + links: PanoramaLink[] + position: Point + tiles: PanoramaTileData + } + interface PanoramaTileData { + centerHeading: number + tileSize: Size + worldSize: Size + } + class PanoramaLabel { + constructor(content: string, opts?: PanoramaLabelOptions) + setPosition(position: Point): void + getPosition(): Point + getPov(): PanoramaPov + setContent(content: string): void + getContent(): string + show(): void + hide(): void + setAltitude(altitude: number): void + getAltitude(): number + addEventListener(event: string, handler: Function): void + removeEventListener(event: string, handler: Function): void + onclick: (event: { type: string, target: any }) => void + onmouseover: (event: { type: string, target: any }) => void + onmouseout: (event: { type: string, target: any }) => void + onremove: (event: { type: string, target: any }) => void + } + interface PanoramaLabelOptions { + position?: Point + altitude?: number + } + interface AlbumsControlOptions { + anchor?: ControlAnchor + offset?: Size + maxWidth?: number | string + imageHeight?: number + } + type PanoramaSceneType = string + type PanoramaPOIType = string +} +declare const BMAP_PANORAMA_INDOOR_SCENE: string +declare const BMAP_PANORAMA_STREET_SCENE: string + +declare const BMAP_PANORAMA_POI_HOTEL: string +declare const BMAP_PANORAMA_POI_CATERING: string +declare const BMAP_PANORAMA_POI_MOVIE: string +declare const BMAP_PANORAMA_POI_TRANSIT: string +declare const BMAP_PANORAMA_POI_INDOOR_SCENE: string +declare const BMAP_PANORAMA_POI_NONE: string diff --git a/types/baidumap-web-sdk/baidumap.rightmenu.d.ts b/types/baidumap-web-sdk/baidumap.rightmenu.d.ts new file mode 100644 index 0000000000..ef79b71641 --- /dev/null +++ b/types/baidumap-web-sdk/baidumap.rightmenu.d.ts @@ -0,0 +1,47 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +/// + +declare namespace BMap { + type ContextMenuIcon = string + interface MenuItemOptions { + width?: number + id?: string + iconUrl?: string + } + class MenuItem { + constructor(text: string, callback: (point: Point) => void, opts?: MenuItemOptions) + setText(text: string): void + setIcon(iconUrl: string): void + enable(): void + disable(): void + } + class ContextMenu { + constructor() + addItem(item: MenuItem): void + getItem(index: number): MenuItem + removeItem(item: MenuItem): void + addSeparator(): void + removeSeparator(index: number): void + onopen: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + onclose: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void + } +} +declare const BMAP_CONTEXT_MENU_ICON_ZOOMIN: string +declare const BMAP_CONTEXT_MENU_ICON_ZOOMOUT: string \ No newline at end of file diff --git a/types/baidumap-web-sdk/baidumap.service.d.ts b/types/baidumap-web-sdk/baidumap.service.d.ts new file mode 100644 index 0000000000..54ca6f7e1d --- /dev/null +++ b/types/baidumap-web-sdk/baidumap.service.d.ts @@ -0,0 +1,432 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +/// +/// +declare namespace BMap { + class LocalSearch { + constructor(location: Map | Point | string, opts?: LocalSearchOptions) + search(keyword: string | Array, option?: Object): void + searchInBounds(keyword: string | Array, bounds: Bounds, option?: Object): void + searchNearby(keyword: string | Array, center: LocalResultPoi | string | Point, radius: number, option?: Object): void + getResults(): LocalResult | LocalResult[] + clearResults(): void + gotoPage(page: number): void + enableAutoViewport(): void + disableAutoViewport(): void + enableFirstResultSelection(): void + disableFirstResultSelection(): void + setLocation(location: Map | Point | string): void + setPageCapacity(capacity: number): void + getPageCapacity(): number + setSearchCompleteCallback(callback: (results: LocalResult | LocalResult[]) => void): void + setMarkersSetCallback(callback: (pois: LocalResultPoi[]) => void): void + setInfoHtmlSetCallback(callback: (poi: LocalResultPoi, html: HTMLElement) => void): void + setResultsHtmlSetCallback(callback: (container: HTMLElement) => void): void + getStatus(): ServiceStatusCode + } + type LineType = number + interface WalkingRouteResult { + city: string + getStart(): LocalResultPoi + getEnd(): LocalResultPoi + getNumPlans(): number + getPlan(i: number): RoutePlan + } + class BusLineSearch { + constructor(location: Map | Point | string, opts?: BusLineSearchOptions) + getBusList(keyword: string): void + getBusLine(busLstItem: BusListItem): void + clearResults(): void + enableAutoViewport(): void + disableAutoViewport(): void + setLocation(location: Map | Point | string): void + getStatus(): ServiceStatusCode + toString(): string + setGetBusListCompleteCallback(callback: (rs: BusListResult) => void): void + setGetBusLineCompleteCallback(callback: (rs: BusLine) => void): void + setBusListHtmlSetCallback(callback: (container: HTMLElement) => void): void + setBusLineHtmlSetCallback(callback: (container: HTMLElement) => void): void + setPolylinesSetCallback(callback: (ply: Polyline) => void): void + setMarkersSetCallback(callback: (markers: Marker[]) => void): void + } + interface LocalSearchOptions { + renderOptions?: RenderOptions + onMarkersSet?: (pois: LocalResultPoi[]) => void + onInfoHtmlSet?: (poi: LocalResultPoi, html: HTMLElement) => void + onResultsHtmlSet?: (container: HTMLElement) => void + pageCapacity?: number + onSearchComplete?: (results: LocalResult[]) => void + } + class DrivingRoute { + constructor(location: Map | Point | string, opts?: DrivingRouteOptions) + search(start: string | Point | LocalResultPoi, end: string | Point | LocalResultPoi, opts?: Object): void + getResults(): DrivingRouteResult + clearResults(): void + enableAutoViewport(): void + disableAutoViewport(): void + setLocation(location: Map | Point | string): void + setPolicy(policy: DrivingPolicy): void + setSearchCompleteCallback(callback: (results: DrivingRouteResult) => void): void + setMarkersSetCallback(callback: (pois: LocalResultPoi[]) => void): void + setInfoHtmlSetCallback(callback: (poi: LocalResultPoi, html: HTMLElement) => void): void + setPolylinesSetCallback(callback: (routes: Route[]) => void): void + setResultsHtmlSetCallback(callback: (container: HTMLElement) => void): void + getStatus(): ServiceStatusCode + toString(): string + } + class Geocoder { + constructor() + getPoint(address: string, callback: (point: Point) => void, city: string): void + getLocation(point: Point, callback: (result: GeocoderResult) => void, opts?: LocationOptions): void + } + interface BusLineSearchOptions { + renderOptions?: RenderOptions + onGetBusListComplete?: (rs: BusListResult) => void + onGetBusLineComplete?: (rs: BusLine) => void + onBusListHtmlSet?: (container: HTMLElement) => void + onBusLineHtmlSet?: (container: HTMLElement) => void + onPolylinesSet?: (ply: Polyline) => void + onMarkersSet?: (sts: Marker[]) => void + } + interface CustomData { + geotableId: number + tags: string + filter: string + } + interface DrivingRouteOptions { + renderOptions?: RenderOptions + policy?: DrivingPolicy + onSearchComplete?: (results: DrivingRouteResult) => void + onMarkersSet?: (pois: LocalResultPoi[]) => void + onInfoHtmlSet?: (poi: LocalResultPoi, html: HTMLElement) => void + onPolylinesSet?: (routes: Route[]) => void + onResultsHtmlSet?: (container: HTMLElement) => void + } + interface GeocoderResult { + point: Point + address: string + addressComponents: AddressComponent + surroundingPoi: LocalResultPoi[] + business: string + } + interface BusListResult { + keyword: string + city: string + moreResultsUrl: string + getNumBusList(): number + getBusListItem(i: number): BusListItem + } + interface RenderOptions { + map: Map + panel?: string | HTMLElement + selectFirstResult?: boolean + autoViewport?: boolean + highlightMode?: HighlightModes + } + type DrivingPolicy = number + interface AddressComponent { + streetNumber: string + street: string + district: string + city: string + province: string + } + interface BusLine { + name: string + startTime: string + endTime: string + company: string + getNumBusStations(): string + getBusStation(i: number): BusStation + getPath(): Point[] + getPolyline(): Polyline + } + interface LocalResult { + keyword: string + center: LocalResultPoi + radius: number + bounds: Bounds + city: string + moreResultsUrl: string + province: string + suggestions: string[] + getPoi(i: number): LocalResultPoi + getCurrentNumPois(): number + getNumPois(): number + getNumPages(): number + getPageIndex(): number + getCityList(): any[] + } + + interface DrivingRouteResult { + policy: DrivingPolicy + city: string + moreResultsUrl: string + taxiFare: TaxiFare + getStart(): LocalResultPoi + getEnd(): LocalResultPoi + getNumPlans(): number + getPlan(i: number): RoutePlan + } + interface LocationOptions { + poiRadius?: number + numPois?: number + } + interface BusListItem { + name: string + } + interface LocalResultPoi { + title: string + point: Point + url: string + address: string + city: string + phoneNumber: string + postcode: string + type: PoiType + isAccurate: boolean + province: string + tags: string[] + detailUrl: string + } + interface TaxiFare { + day: TaxiFareDetail + night: TaxiFareDetail + distance: number + remark: string + } + class LocalCity { + constructor(opts?: LocalCityOptions) + get(callback: (result: LocalCityResult) => void): void + } + interface BusStation { + name: string + position: Point + } + type PoiType = number + interface TaxiFareDetail { + initialFare: number + unitFare: number + totalFare: number + } + interface LocalCityOptions { + renderOptions?: RenderOptions + } + class Autocomplete { + constructor(opts?: AutocompleteOptions) + show(): void + hide(): void + setTypes(types: string[]): void + setLocation(location: string | Map | Point): void + search(keywords: string): void + getResults(): AutocompleteResult + setInputValue(keyword: string): void + dispose(): void + onconfirm: (event: { type: string, target: any, item: any }) => void + onhighlight: (event: { type: string, target: any, fromitem: any, toitem: any }) => void + } + class TransitRoute { + constructor(location: Map | Point | string, opts?: TransitRouteOptions) + search(start: string | Point | LocalResultPoi, end: string | Point | LocalResultPoi): void + getResults(): TransitRouteResult + clearResults(): void + enableAutoViewport(): void + disableAutoViewport(): void + setPageCapacity(capacity: number): void + setLocation(location: Map | Point | string): void + setPolicy(policy: TransitPolicy): void + setSearchCompleteCallback(callback: (results: TransitRouteResult) => void): void + setMarkersSetCallback(callback: (pois: LocalResultPoi[]) => void): void + setInfoHtmlSetCallback(callback: (poi: LocalResultPoi, html: HTMLElement) => void): void + setPolylinesSetCallback(callback: (lines: Line[], routes: Route[]) => void): void + setResultsHtmlSetCallback(callback: (container: HTMLElement) => void): void + getStatus(): ServiceStatusCode + toString(): string + } + interface RoutePlan { + getNumRoutes(): number + getRoute(i: number): Route + getDistance(format?: boolean): string | number + getDuration(format?: boolean): string | number + getDragPois(): LocalResultPoi[] + } + interface LocalCityResult { + center: Point + level: number + name: string + } + interface AutocompleteOptions { + location?: string | Map | Point + types?: string[] + onSearchComplete?: (result: AutocompleteResult) => void + input?: string | HTMLElement + } + interface TransitRouteOptions { + renderOptions?: RenderOptions + policy?: TransitPolicy + pageCapacity?: number + onSearchComplete?: (result: TransitRouteResult) => void + onMarkersSet?: (pois: LocalResultPoi[], transfers: LocalResultPoi[]) => void + onInfoHtmlSet?: (poi: LocalResultPoi, html: HTMLElement) => void + onPolylinesSet?: (lines: Line[]) => void + onResultsHtmlSet?: (container: HTMLElement) => void + } + interface Route { + getNumRoutes(): number + getStep(i: number): Step + getDistance(format?: boolean): string | number + getIndex(): number + getPolyline(): Polyline + getPoints(): Point[] + getPath(): Point[] + getRouteType(): RouteType + } + class TrafficControl { + constructor() + setPanelOffset(offset: Size): void + show(): void + hide(): void + } + interface AutocompleteResultPoi { + province: string + City: string//wtf + district: string + street: string + streetNumber: string + business: string + } + type TransitPolicy = number + type RouteType = number + class Geolocation { + constructor() + getCurrentPosition(callback: (result: GeolocationResult) => void, opts?: PositionOptions): void + getStatus(): ServiceStatusCode + } + interface AutocompleteResult { + keyword: string + getPoi(i: number): AutocompleteResultPoi + getNumPois(): number + } + interface TransitRouteResult { + policy: TransitPolicy + city: string + moreResultsUrl: string + getStart(): LocalResultPoi + getEnd(): LocalResultPoi + getNumPlans(): number + getPlan(i: number): TransitRoutePlan + } + interface Step { + getPoint(): Point + getPosition(): Point + getIndex(): number + getDescription(includeHtml: boolean): string + getDistance(format?: boolean): string | number + } + interface GeolocationResult { + point: Point + accuracy: number + } + class Boundary { + constructor() + get(name: string, callback: (result: string[]) => void): void + } + interface TransitRoutePlan { + getNumLines(): number + getLine(i: number): Line + getNumRoutes(): number + getRoute(i: number): Route + getDistance(format?: boolean): string | number + getDuration(format?: boolean): string | number + getDescription(includeHtml: boolean): string + } + class WalkingRoute { + constructor(location: Map | Point | string, opts?: WalkingRouteOptions) + search(start: string | Point | LocalResultPoi, end: string | Point | LocalResultPoi): void + getResults(): WalkingRouteResult + clearResults(): void + enableAutoViewport(): void + disableAutoViewport(): void + setLocation(location: Map | Point | string): void + setSearchCompleteCallback(callback: (result: WalkingRouteResult) => void): void + setMarkersSetCallback(callback: (pois: LocalResultPoi[]) => void): void + setInfoHtmlSetCallback(callback: (poi: LocalResultPoi, html: HTMLElement) => void): void + setPolylinesSetCallback(callback: (routes: Route[]) => void): void + setResultsHtmlSetCallback(callback: (container: HTMLElement) => void): void + getStatus(): ServiceStatusCode + toString(): string + } + interface PositionOptions { + enableHighAccuracy?: boolean + timeout?: number + maximumAge?: number + } + interface Line { + title: string + type: LineType + getNumViaStops(): number + getGetOnStop(): LocalResultPoi + getGetOffStop(): LocalResultPoi + getPoints(): Point[] + getPath(): Point[] + getPolyline(): Polyline + getDistance(format?: boolean): string | number + } + interface WalkingRouteOptions { + renderOptions?: RenderOptions, + onSearchComplete?: (result: WalkingRouteResult) => void, + onMarkersSet?: (pois: LocalResultPoi[]) => void, + onPolylinesSet?: (routes: Route[]) => void, + onInfoHtmlSet?: (poi: LocalResultPoi, html: HTMLElement) => void, + onResultsHtmlSet?: (container: HTMLElement) => void + } + type HighlightModes = number + type ServiceStatusCode = number +} + +declare const BMAP_LINE_TYPE_BUS: BMap.LineType +declare const BMAP_LINE_TYPE_SUBWAY: BMap.LineType +declare const BMAP_LINE_TYPE_FERRY: BMap.LineType + +declare const BMAP_DRIVING_POLICY_LEAST_TIME: BMap.DrivingPolicy +declare const BMAP_DRIVING_POLICY_LEAST_DISTANCE: BMap.DrivingPolicy +declare const BMAP_DRIVING_POLICY_AVOID_HIGHWAYS: BMap.DrivingPolicy + +declare const BMAP_POI_TYPE_NORMAL: BMap.PoiType +declare const BMAP_POI_TYPE_BUSSTOP: BMap.PoiType +declare const BMAP_POI_TYPE_SUBSTOP: BMap.PoiType + + +declare const BMAP_TRANSIT_POLICY_LEAST_TIME: BMap.TransitPolicy +declare const BMAP_TRANSIT_POLICY_LEAST_TRANSFER: BMap.TransitPolicy +declare const BMAP_TRANSIT_POLICY_LEAST_WALKING: BMap.TransitPolicy +declare const BMAP_TRANSIT_POLICY_AVOID_SUBWAYS: BMap.TransitPolicy + +declare const BMAP_ROUTE_TYPE_DRIVING: BMap.RouteType +declare const BMAP_ROUTE_TYPE_WALKING: BMap.RouteType + +declare const BMAP_HIGHLIGHT_STEP: BMap.HighlightModes +declare const BMAP_HIGHLIGHT_ROUTE: BMap.HighlightModes + +declare const BMAP_STATUS_SUCCESS: BMap.ServiceStatusCode +declare const BMAP_STATUS_CITY_LIST: BMap.ServiceStatusCode +declare const BMAP_STATUS_UNKNOWN_LOCATION: BMap.ServiceStatusCode +declare const BMAP_STATUS_UNKNOWN_ROUTE: BMap.ServiceStatusCode +declare const BMAP_STATUS_INVALID_KEY: BMap.ServiceStatusCode +declare const BMAP_STATUS_INVALID_REQUEST: BMap.ServiceStatusCode \ No newline at end of file diff --git a/types/baidumap-web-sdk/baidumap.tools.d.ts b/types/baidumap-web-sdk/baidumap.tools.d.ts new file mode 100644 index 0000000000..cd3ba6b619 --- /dev/null +++ b/types/baidumap-web-sdk/baidumap.tools.d.ts @@ -0,0 +1,61 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +/// +/// +/// +declare namespace BMap { + class PushpinTool { + constructor(map: Map, opts?: PushpinToolOptions) + open(): boolean + close(): boolean + setIcon(icon: Icon): Icon + getIcon(): Icon + setCursor(cursor: string): string + getCursor(): string + toString(): string + onmarkend: (event: { type: string, target: any, marker: Marker }) => void + } + interface PushpinToolOptions { + icon?: Icon + cursor?: string + followText?: string + } + class DistanceTool { + constructor(map: Map) + open(): boolean + close(): void + toString(): string + ondrawend: (event: { type: string, target: any, points: Point[], polylines: Polyline[], distance: number }) => void + } + class DragAndZoomTool { + constructor(map: Map, opts?: DragAndZoomToolOptions) + open(): boolean + close(): void + toString(): string + ondrawend: (event: { type: string, target: any, bounds: Bounds[] }) => void + } + interface DragAndZoomToolOptions { + zoomType?: ZoomType, + autoClose?: boolean, + followText?: string + } + type ZoomType = number +} +declare const BMAP_ZOOM_IN: BMap.ZoomType +declare const BMAP_ZOOM_OUT: BMap.ZoomType \ No newline at end of file diff --git a/types/baidumap-web-sdk/index.d.ts b/types/baidumap-web-sdk/index.d.ts new file mode 100644 index 0000000000..cfab71e884 --- /dev/null +++ b/types/baidumap-web-sdk/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for BaiduMap v2.0 +// Project: http://lbsyun.baidu.com/index.php?title=jspopular +// Definitions by: Codemonk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** +Copyright [Codemonk] [Codemonk@live.cn] + +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. + +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. +***************************************************************************** */ + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// \ No newline at end of file From 470076f168d5a484c327792b6a71d9b3cf0f31cd Mon Sep 17 00:00:00 2001 From: Codemonk Date: Tue, 13 Jun 2017 23:01:34 +0800 Subject: [PATCH 395/761] Create tsconfig.json --- types/baidumap-web-sdk/tsconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/baidumap-web-sdk/tsconfig.json b/types/baidumap-web-sdk/tsconfig.json index 0f670e4bc5..edb9a320c5 100644 --- a/types/baidumap-web-sdk/tsconfig.json +++ b/types/baidumap-web-sdk/tsconfig.json @@ -1,6 +1,9 @@ { "compilerOptions": { "module": "commonjs", + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, From 2aa22bd15959c2fbcd5669da7fa38b47820747de Mon Sep 17 00:00:00 2001 From: Codemonk Date: Tue, 13 Jun 2017 23:10:37 +0800 Subject: [PATCH 396/761] Create baidumap-web-sdk-tests.ts --- .../{baidumap-tests.ts => baidumap-web-sdk-tests.ts} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename types/baidumap-web-sdk/{baidumap-tests.ts => baidumap-web-sdk-tests.ts} (97%) diff --git a/types/baidumap-web-sdk/baidumap-tests.ts b/types/baidumap-web-sdk/baidumap-web-sdk-tests.ts similarity index 97% rename from types/baidumap-web-sdk/baidumap-tests.ts rename to types/baidumap-web-sdk/baidumap-web-sdk-tests.ts index 8dff733b3b..9fb4d047ff 100644 --- a/types/baidumap-web-sdk/baidumap-tests.ts +++ b/types/baidumap-web-sdk/baidumap-web-sdk-tests.ts @@ -22,4 +22,4 @@ namespace BMapTests { marker.setAnimation(BMAP_ANIMATION_BOUNCE); } } -} \ No newline at end of file +} From dc2efe8f118552f5cfa7004918d91e2a2ac70299 Mon Sep 17 00:00:00 2001 From: Codemonk Date: Tue, 13 Jun 2017 23:12:11 +0800 Subject: [PATCH 397/761] Update tsconfig.json --- types/baidumap-web-sdk/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/baidumap-web-sdk/tsconfig.json b/types/baidumap-web-sdk/tsconfig.json index edb9a320c5..0e08124214 100644 --- a/types/baidumap-web-sdk/tsconfig.json +++ b/types/baidumap-web-sdk/tsconfig.json @@ -20,6 +20,6 @@ }, "files": [ "index.d.ts", - "baidumap-tests.ts" + "baidumap-web-sdk-tests.ts" ] } From eb7cfc536a90c8bbf0274d255b31f9b796fb15f1 Mon Sep 17 00:00:00 2001 From: Parvez Date: Tue, 13 Jun 2017 08:12:21 -0700 Subject: [PATCH 398/761] Added a missing type on Question interface (#17094) --- types/inquirer/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index dd2f4ad3c7..2a0b9f60f4 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Inquirer.js // Project: https://github.com/SBoudrias/Inquirer.js // Definitions by: Qubo +// Parvez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -110,6 +111,10 @@ declare namespace inquirer { * Change the number of lines that will be rendered when using list, rawList, expand or checkbox. */ pageSize?: number; + /** + * Add a mask when password will entered + */ + mask?: string; } /** From 85758f5ce19c61ffd7af2bbe79166106267cae85 Mon Sep 17 00:00:00 2001 From: Codemonk Date: Tue, 13 Jun 2017 23:24:28 +0800 Subject: [PATCH 399/761] Update baidumap-web-sdk-tests.ts --- types/baidumap-web-sdk/baidumap-web-sdk-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/baidumap-web-sdk/baidumap-web-sdk-tests.ts b/types/baidumap-web-sdk/baidumap-web-sdk-tests.ts index 9fb4d047ff..0a4052b147 100644 --- a/types/baidumap-web-sdk/baidumap-web-sdk-tests.ts +++ b/types/baidumap-web-sdk/baidumap-web-sdk-tests.ts @@ -1,5 +1,4 @@ -/// - +import "./index" namespace BMapTests { export class TestFixture { //document: http://lbsyun.baidu.com/index.php?title=jspopular From d93a64abbf45dbc47d35187fb4cc770d1c4a201a Mon Sep 17 00:00:00 2001 From: Codemonk Date: Tue, 13 Jun 2017 23:29:37 +0800 Subject: [PATCH 400/761] Create tsconfig.json --- types/baidumap-web-sdk/tsconfig.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/types/baidumap-web-sdk/tsconfig.json b/types/baidumap-web-sdk/tsconfig.json index 0e08124214..d841f5d92a 100644 --- a/types/baidumap-web-sdk/tsconfig.json +++ b/types/baidumap-web-sdk/tsconfig.json @@ -6,15 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "paths": { - "q": ["q/v0"] - }, - "types": [], + "strictNullChecks": true, "noEmit": true, "forceConsistentCasingInFileNames": true }, From 415dfb04e676144448d1ec79d586cb084ea86427 Mon Sep 17 00:00:00 2001 From: Codemonk Date: Tue, 13 Jun 2017 23:35:07 +0800 Subject: [PATCH 401/761] Update tsconfig.json --- types/baidumap-web-sdk/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/baidumap-web-sdk/tsconfig.json b/types/baidumap-web-sdk/tsconfig.json index d841f5d92a..6af444e434 100644 --- a/types/baidumap-web-sdk/tsconfig.json +++ b/types/baidumap-web-sdk/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, From 6a556da667ad5eac21c171c50d26bd81c75a99a5 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 13 Jun 2017 11:49:07 -0400 Subject: [PATCH 402/761] [jquery] Update type definitions (new for v3). --- types/jquery/index.d.ts | 8082 +++++++++++++++------------ types/jquery/jquery-tests.ts | 3614 +----------- types/jquery/test/example-tests.ts | 5003 +++++++++++++++++ types/jquery/test/longdesc-tests.ts | 2524 +++++++++ types/jquery/test/module-tests.ts | 7 + types/jquery/tsconfig.json | 14 +- types/jquery/tslint.json | 9 + types/jquery/v1/index.d.ts | 3817 +++++++++++++ types/jquery/v1/jquery-tests.ts | 3552 ++++++++++++ types/jquery/v1/tsconfig.json | 28 + types/jquery/v2/index.d.ts | 3817 +++++++++++++ types/jquery/v2/jquery-tests.ts | 3552 ++++++++++++ types/jquery/v2/tsconfig.json | 28 + 13 files changed, 26886 insertions(+), 7161 deletions(-) create mode 100644 types/jquery/test/example-tests.ts create mode 100644 types/jquery/test/longdesc-tests.ts create mode 100644 types/jquery/test/module-tests.ts create mode 100644 types/jquery/tslint.json create mode 100644 types/jquery/v1/index.d.ts create mode 100644 types/jquery/v1/jquery-tests.ts create mode 100644 types/jquery/v1/tsconfig.json create mode 100644 types/jquery/v2/index.d.ts create mode 100644 types/jquery/v2/jquery-tests.ts create mode 100644 types/jquery/v2/tsconfig.json diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index a8b2895d6b..89d8b873fa 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -1,513 +1,4470 @@ -// Type definitions for jQuery 2.0 -// Project: http://jquery.com/ -// Definitions by: Boris Yankov -// Christian Hoffmeister -// Steve Fenton -// Diullei Gomes -// Tass Iliopoulos -// Jason Swearingen -// Sean Hill -// Guus Goossens -// Kelly Summerlin -// Basarat Ali Syed -// Nicholas Wolverson -// Derek Cicerone -// Andrew Gaspar -// Seikichi Kondo -// Benjamin Jackman -// Poul Sorensen -// Josh Strobl -// John Reilly -// Dick van den Brink -// Thomas Schulz -// Leonard Thieu +// Type definitions for jquery 3.2 +// Project: https://jquery.com +// Definitions by: Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - - -/** - * Interface for the AJAX setting that will configure the AJAX request - * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings} - */ -interface JQueryAjaxSettings { - /** - * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. - */ - accepts?: any; - /** - * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). - */ - async?: boolean; - /** - * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. - */ - beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; - /** - * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. - */ - cache?: boolean; - /** - * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. - */ - complete? (jqXHR: JQueryXHR, textStatus: string): any; - /** - * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) - */ - contents?: { [key: string]: any; }; - //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" - // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/742 - /** - * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. - */ - contentType?: any; - /** - * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). - */ - context?: any; - /** - * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) - */ - converters?: { [key: string]: any; }; - /** - * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) - */ - crossDomain?: boolean; - /** - * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be key-value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). - */ - data?: any; - /** - * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. - */ - dataFilter? (data: any, ty: any): any; - /** - * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). - */ - dataType?: string; - /** - * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. - */ - error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; - /** - * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. - */ - global?: boolean; - /** - * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) - */ - headers?: { [key: string]: any; }; - /** - * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. - */ - ifModified?: boolean; - /** - * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) - */ - isLocal?: boolean; - /** - * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } - */ - jsonp?: any; - /** - * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. - */ - jsonpCallback?: any; - /** - * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0) - */ - method?: string; - /** - * A MIME type to override the XHR MIME type. (version added: 1.5.1) - */ - mimeType?: string; - /** - * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. - */ - password?: string; - /** - * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. - */ - processData?: boolean; - /** - * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. - */ - scriptCharset?: string; - /** - * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) - */ - statusCode?: { [key: string]: any; }; - /** - * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. - */ - success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; - /** - * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. - */ - timeout?: number; - /** - * Set this to true if you wish to use the traditional style of parameter serialization. - */ - traditional?: boolean; - /** - * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. - */ - type?: string; - /** - * A string containing the URL to which the request is sent. - */ - url?: string; - /** - * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. - */ - username?: string; - /** - * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. - */ - xhr?: any; - /** - * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) - */ - xhrFields?: { [key: string]: any; }; +declare module 'jquery' { + export = factory; } -/** - * Interface for the jqXHR object - * @see {@link https://api.jquery.com/jQuery.ajax/#jqXHR} - */ -interface JQueryXHR extends XMLHttpRequest, JQueryPromise { - /** - * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). - */ - overrideMimeType(mimeType: string): any; - /** - * Cancel the request. - * - * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" - */ - abort(statusText?: string): void; - /** - * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. - */ - then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => R|JQueryPromise, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; - /** - * Property containing the parsed response if the response content type is json - */ - responseJSON?: any; - /** - * A function to be called if the request fails. - */ - error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void; +declare module 'jquery/dist/jquery.slim' { + export = factory; } -/** - * Interface for the JQuery callback - * @see {@link https://api.jquery.com/category/callbacks-object/} - */ -interface JQueryCallback { +declare function factory(window: Window, noGlobal?: boolean): JQueryStatic; + +declare const jQuery: JQueryStatic; +declare const $: JQueryStatic; + +// Used by JQuery.Event +type _Event = Event; + +interface JQuery { /** - * Add a callback or a collection of callbacks to a callback list. + * A string containing the jQuery version number. * - * @param callbacks A function, or array of functions, that are to be added to the callback list. - * @see {@link https://api.jquery.com/callbacks.add/} + * @see {@link https://api.jquery.com/jquery/} + * @since 1.0 */ - add(callbacks: Function): JQueryCallback; + jquery: string; /** - * Add a callback or a collection of callbacks to a callback list. + * The number of elements in the jQuery object. * - * @param callbacks A function, or array of functions, that are to be added to the callback list. - * @see {@link https://api.jquery.com/callbacks.add/} + * @see {@link https://api.jquery.com/length/} + * @since 1.0 */ - add(callbacks: Function[]): JQueryCallback; - + length: number; /** - * Disable a callback list from doing anything more. - * @see {@link https://api.jquery.com/callbacks.disable/} - */ - disable(): JQueryCallback; - - /** - * Determine if the callbacks list has been disabled. - * @see {@link https://api.jquery.com/callbacks.disabled/} - */ - disabled(): boolean; - - /** - * Remove all of the callbacks from a list. - * @see {@link https://api.jquery.com/callbacks.empty/} - */ - empty(): JQueryCallback; - - /** - * Call all of the callbacks with the given arguments + * Create a new jQuery object with elements added to the set of matched elements. * - * @param arguments The argument or list of arguments to pass back to the callback list. - * @see {@link https://api.jquery.com/callbacks.fire/} + * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. + * @param context The point in the document at which the selector should begin matching; similar to the context + * argument of the $(selector, context) method. + * @see {@link https://api.jquery.com/add/} + * @since 1.4 */ - fire(...arguments: any[]): JQueryCallback; - + add(selector: JQuery.Selector, context: Element): JQuery; /** - * Determine if the callbacks have already been called at least once. - * @see {@link https://api.jquery.com/callbacks.fired/} - */ - fired(): boolean; - - /** - * Call all callbacks in a list with the given context and arguments. + * Create a new jQuery object with elements added to the set of matched elements. * - * @param context A reference to the context in which the callbacks in the list should be fired. - * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. - * @see {@link https://api.jquery.com/callbacks.fireWith/} + * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. + * One or more elements to add to the set of matched elements. + * An HTML fragment to add to the set of matched elements. + * An existing jQuery object to add to the set of matched elements. + * @see {@link https://api.jquery.com/add/} + * @since 1.0 + * @since 1.3.2 */ - fireWith(context?: any, args?: any[]): JQueryCallback; - + add(selector: JQuery.Selector | JQuery.TypeOrArray | JQuery.htmlString | JQuery): JQuery; /** - * Determine whether a supplied callback is in a list + * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. * - * @param callback The callback to search for. - * @see {@link https://api.jquery.com/callbacks.has/} + * @param selector A string containing a selector expression to match the current set of elements against. + * @see {@link https://api.jquery.com/addBack/} + * @since 1.8 */ - has(callback: Function): boolean; - + addBack(selector?: JQuery.Selector): this; /** - * Lock a callback list in its current state. - * @see {@link https://api.jquery.com/callbacks.lock/} - */ - lock(): JQueryCallback; - - /** - * Determine if the callbacks list has been locked. - * @see {@link https://api.jquery.com/callbacks.locked/} - */ - locked(): boolean; - - /** - * Remove a callback or a collection of callbacks from a callback list. + * Adds the specified class(es) to each element in the set of matched elements. * - * @param callbacks A function, or array of functions, that are to be removed from the callback list. - * @see {@link https://api.jquery.com/callbacks.remove/} + * @param className One or more space-separated classes to be added to the class attribute of each matched element. + * A function returning one or more space-separated class names to be added to the existing class + * name(s). Receives the index position of the element in the set and the existing class name(s) as + * arguments. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/addClass/} + * @since 1.0 + * @since 1.4 */ - remove(callbacks: Function): JQueryCallback; + addClass(className: string | ((this: TElement, index: number, currentClassName: string) => string)): this; /** - * Remove a callback or a collection of callbacks from a callback list. + * Insert content, specified by the parameter, after each element in the set of matched elements. * - * @param callbacks A function, or array of functions, that are to be removed from the callback list. - * @see {@link https://api.jquery.com/callbacks.remove/} + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert after each element in the set of matched elements. + * @see {@link https://api.jquery.com/after/} + * @since 1.0 */ - remove(callbacks: Function[]): JQueryCallback; + after(...contents: Array | JQuery>): this; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert + * after each element in the set of matched elements. Receives the index position of the element in the + * set and the old HTML value of the element as arguments. Within the function, this refers to the + * current element in the set. + * @see {@link https://api.jquery.com/after/} + * @since 1.4 + * @since 1.10 + */ + after(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxComplete/} + * @since 1.0 + */ + ajaxComplete(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; + /** + * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxError/} + * @since 1.0 + */ + ajaxError(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxSettings: JQuery.AjaxSettings, thrownError: string) => void | false): this; + /** + * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxSend/} + * @since 1.0 + */ + ajaxSend(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; + /** + * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxStart/} + * @since 1.0 + */ + ajaxStart(handler: (this: Document) => void | false): this; + /** + * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxStop/} + * @since 1.0 + */ + ajaxStop(handler: (this: Document) => void | false): this; + /** + * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + * + * @param handler The function to be invoked. + * @see {@link https://api.jquery.com/ajaxSuccess/} + * @since 1.0 + */ + ajaxSuccess(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings, data: JQuery.PlainObject) => void | false): this; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/animate/} + * @since 1.0 + */ + animate(properties: JQuery.PlainObject, + duration: JQuery.Duration, + easing: string, + complete?: (this: TElement) => void): this; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration_easing A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/animate/} + * @since 1.0 + */ + animate(properties: JQuery.PlainObject, + duration_easing: JQuery.Duration | string, + complete?: (this: TElement) => void): this; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration_easing_complete_options A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/animate/} + * @since 1.0 + */ + animate(properties: JQuery.PlainObject, + duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert at the end of each element in the set of matched elements. + * @see {@link https://api.jquery.com/append/} + * @since 1.0 + */ + append(...contents: Array | JQuery>): this; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at + * the end of each element in the set of matched elements. Receives the index position of the element + * in the set and the old HTML value of the element as arguments. Within the function, this refers to + * the current element in the set. + * @see {@link https://api.jquery.com/append/} + * @since 1.4 + */ + append(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Insert every element in the set of matched elements to the end of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements + * will be inserted at the end of the element(s) specified by this parameter. + * @see {@link https://api.jquery.com/appendTo/} + * @since 1.0 + */ + appendTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param value A value to set for the attribute. If null, the specified attribute will be removed (as in .removeAttr()). + * A function returning the value to set. this is the current element. Receives the index position of + * the element in the set and the old attribute value as arguments. + * @see {@link https://api.jquery.com/attr/} + * @since 1.0 + * @since 1.1 + */ + attr(attributeName: string, + value: string | number | null | ((this: TElement, index: number, attr: string) => string | number | void | undefined)): this; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributes An object of attribute-value pairs to set. + * @see {@link https://api.jquery.com/attr/} + * @since 1.0 + */ + attr(attributes: JQuery.PlainObject): this; + /** + * Get the value of an attribute for the first element in the set of matched elements. + * + * @param attributeName The name of the attribute to get. + * @see {@link https://api.jquery.com/attr/} + * @since 1.0 + */ + attr(attributeName: string): string | undefined; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert before each element in the set of matched elements. + * @see {@link https://api.jquery.com/before/} + * @since 1.0 + */ + before(...contents: Array | JQuery>): this; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert + * before each element in the set of matched elements. Receives the index position of the element in + * the set and the old HTML value of the element as arguments. Within the function, this refers to the + * current element in the set. + * @see {@link https://api.jquery.com/before/} + * @since 1.4 + * @since 1.10 + */ + before(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/bind/} + * @since 1.0 + * @deprecated 3.0 + */ + bind(eventType: string, eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from + * occurring and stops the event from bubbling. The default is true. + * @see {@link https://api.jquery.com/bind/} + * @since 1.4.3 + * @deprecated 3.0 + */ + bind(eventType: string, eventData: any, preventBubble: boolean): this; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/bind/} + * @since 1.0 + * @deprecated 3.0 + */ + bind(eventType: string, handler: JQuery.EventHandler | false): this; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param preventBubble_eventData Setting the third argument to false will attach a function that prevents the default action from + * occurring and stops the event from bubbling. The default is true. + * An object containing data that will be passed to the event handler. + * @see {@link https://api.jquery.com/bind/} + * @since 1.0 + * @deprecated 3.0 + */ + bind(eventType: string, preventBubble_eventData?: boolean | any): this; + /** + * Attach a handler to an event for the elements. + * + * @param events An object containing one or more DOM event types and functions to execute for them. + * @see {@link https://api.jquery.com/bind/} + * @since 1.4 + * @deprecated 3.0 + */ + bind(events: JQuery.PlainObject | false>): this; + /** + * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/blur/} + * @since 1.4.3 + */ + blur(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/blur/} + * @since 1.0 + */ + blur(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/change/} + * @since 1.4.3 + */ + change(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/change/} + * @since 1.0 + */ + change(handler?: JQuery.EventHandler | false): this; + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/children/} + * @since 1.0 + */ + children(selector?: JQuery.Selector): this; + /** + * Remove from the queue all items that have not yet been run. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/clearQueue/} + * @since 1.4 + */ + clearQueue(queueName?: string): this; + /** + * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/click/} + * @since 1.4.3 + */ + click(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/click/} + * @since 1.0 + */ + click(handler?: JQuery.EventHandler | false): this; + /** + * Create a deep copy of the set of matched elements. + * + * @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The + * default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back + * to false in 1.5.1 and up. + * @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should + * be copied. By default its value matches the first argument's value (which defaults to false). + * @see {@link https://api.jquery.com/clone/} + * @since 1.0 + * @since 1.5 + */ + clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): this; + /** + * For each element in the set, get the first element that matches the selector by testing the element + * itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * @param context A DOM element within which a matching element may be found. + * @see {@link https://api.jquery.com/closest/} + * @since 1.4 + */ + closest(selector: JQuery.Selector, context: Element): this; + /** + * For each element in the set, get the first element that matches the selector by testing the element + * itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * A jQuery object to match elements against. + * An element to match elements against. + * @see {@link https://api.jquery.com/closest/} + * @since 1.3 + * @since 1.6 + */ + closest(selector: JQuery.Selector | JQuery | Element): this; + /** + * Get the children of each element in the set of matched elements, including text and comment nodes. + * + * @see {@link https://api.jquery.com/contents/} + * @since 1.2 + */ + contents(): this; + /** + * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/contextmenu/} + * @since 1.4.3 + */ + contextmenu(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/contextmenu/} + * @since 1.0 + */ + contextmenu(handler?: JQuery.EventHandler | false): this; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + * A function returning the value to set. this is the current element. Receives the index position of + * the element in the set and the old value as arguments. + * @see {@link https://api.jquery.com/css/} + * @since 1.0 + * @since 1.4 + */ + css(propertyName: string, + value: string | number | ((this: TElement, index: number, value: string) => string | number | void | undefined)): this; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + * @see {@link https://api.jquery.com/css/} + * @since 1.0 + */ + css(properties: JQuery.PlainObject string | number | void | undefined)>): this; + /** + * Get the computed style properties for the first element in the set of matched elements. + * + * @param propertyName A CSS property. + * An array of one or more CSS properties. + * @see {@link https://api.jquery.com/css/} + * @since 1.0 + */ + css(propertyName: string): string; + /** + * Get the computed style properties for the first element in the set of matched elements. + * + * @param propertyNames An array of one or more CSS properties. + * @see {@link https://api.jquery.com/css/} + * @since 1.9 + */ + css(propertyNames: string[]): JQuery.PlainObject; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by + * data(name, value) or by an HTML5 data-* attribute. + * + * @param key Name of the data stored. + * @param undefined + * @see {@link https://api.jquery.com/data/} + * @since 1.2.3 + */ + // tslint:disable-next-line:unified-signatures + data(key: string, undefined: undefined): any; + /** + * Store arbitrary data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; this can be any Javascript type except undefined. + * @see {@link https://api.jquery.com/data/} + * @since 1.2.3 + */ + data(key: string, value: any): this; + /** + * Store arbitrary data associated with the matched elements. + * + * @param obj An object of key-value pairs of data to update. + * @see {@link https://api.jquery.com/data/} + * @since 1.4.3 + */ + data(obj: JQuery.PlainObject): this; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by + * data(name, value) or by an HTML5 data-* attribute. + * + * @param key Name of the data stored. + * @see {@link https://api.jquery.com/data/} + * @since 1.2.3 + */ + data(key: string): any; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by + * data(name, value) or by an HTML5 data-* attribute. + * + * @see {@link https://api.jquery.com/data/} + * @since 1.4 + */ + data(): JQuery.PlainObject; + /** + * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/dblclick/} + * @since 1.4.3 + */ + dblclick(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/dblclick/} + * @since 1.0 + */ + dblclick(handler?: JQuery.EventHandler | false): this; + /** + * Set a timer to delay execution of subsequent items in the queue. + * + * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/delay/} + * @since 1.4 + */ + delay(duration: JQuery.Duration, queueName?: string): this; + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the + * future, based on a specific set of root elements. + * + * @param selector A selector to filter the elements that trigger the event. + * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or + * "keydown," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/delegate/} + * @since 1.4.2 + * @deprecated 3.0 + */ + delegate(selector: string, eventType: string, eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the + * future, based on a specific set of root elements. + * + * @param selector A selector to filter the elements that trigger the event. + * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or + * "keydown," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/delegate/} + * @since 1.4.2 + * @deprecated 3.0 + */ + delegate(selector: string, eventType: string, handler: JQuery.EventHandler | false): this; + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the + * future, based on a specific set of root elements. + * + * @param selector A selector to filter the elements that trigger the event. + * @param events A plain object of one or more event types and functions to execute for them. + * @see {@link https://api.jquery.com/delegate/} + * @since 1.4.3 + * @deprecated 3.0 + */ + delegate(selector: string, events: JQuery.PlainObject | false>): this; + /** + * Execute the next function on the queue for the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/dequeue/} + * @since 1.2 + */ + dequeue(queueName?: string): this; + /** + * Remove the set of matched elements from the DOM. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + * @see {@link https://api.jquery.com/detach/} + * @since 1.4 + */ + detach(selector?: JQuery.Selector): this; + /** + * Iterate over a jQuery object, executing a function for each matched element. + * + * @param fn A function to execute for each matched element. + * @see {@link https://api.jquery.com/each/} + * @since 1.0 + */ + each(fn: (this: TElement, index: number, element: Element) => void | false): this; + /** + * Remove all child nodes of the set of matched elements from the DOM. + * + * @see {@link https://api.jquery.com/empty/} + * @since 1.0 + */ + empty(): this; + /** + * End the most recent filtering operation in the current chain and return the set of matched elements + * to its previous state. + * + * @see {@link https://api.jquery.com/end/} + * @since 1.0 + */ + end(): this; + /** + * Reduce the set of matched elements to the one at the specified index. + * + * @param index An integer indicating the 0-based position of the element. + * @see {@link https://api.jquery.com/eq/} + * @since 1.1.2 + */ + eq(index: number): this; + /** + * Reduce the set of matched elements to the one at the specified index. + * + * @param indexFromEnd An integer indicating the position of the element, counting backwards from the last element in the set. + * @see {@link https://api.jquery.com/eq/} + * @since 1.4 + */ + eq(indexFromEnd: number): this; + /** + * Merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods. + * + * @param obj An object to merge onto the jQuery prototype. + * @see {@link https://api.jquery.com/jQuery.fn.extend/} + * @since 1.0 + */ + extend(obj: object): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/fadeIn/} + * @since 1.4.3 + */ + fadeIn(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display the matched elements by fading them to opaque. + * + * @param duration_easing A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/fadeIn/} + * @since 1.0 + * @since 1.4.3 + */ + fadeIn(duration_easing: JQuery.Duration | string, complete?: (this: TElement) => void): this; + /** + * Display the matched elements by fading them to opaque. + * + * @param duration_easing_complete_options A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/fadeIn/} + * @since 1.0 + * @since 1.4.3 + */ + fadeIn(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/fadeOut/} + * @since 1.4.3 + */ + fadeOut(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration_easing A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/fadeOut/} + * @since 1.0 + * @since 1.4.3 + */ + fadeOut(duration_easing: JQuery.Duration | string, complete?: (this: TElement) => void): this; + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration_easing_complete_options A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/fadeOut/} + * @since 1.0 + * @since 1.4.3 + */ + fadeOut(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/fadeTo/} + * @since 1.4.3 + */ + fadeTo(duration: JQuery.Duration, opacity: number, easing: string, complete?: (this: TElement) => void): this; + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/fadeTo/} + * @since 1.0 + */ + fadeTo(duration: JQuery.Duration, opacity: number, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/fadeToggle/} + * @since 1.4.4 + */ + fadeToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration_easing A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/fadeToggle/} + * @since 1.0 + * @since 1.4.3 + */ + fadeToggle(duration_easing: JQuery.Duration | string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration_easing_complete_options A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/fadeToggle/} + * @since 1.0 + * @since 1.4.3 + */ + fadeToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param selector A string containing a selector expression to match the current set of elements against. + * One or more DOM elements to match the current set of elements against. + * An existing jQuery object to match the current set of elements against. + * A function used as a test for each element in the set. this is the current DOM element. + * @see {@link https://api.jquery.com/filter/} + * @since 1.0 + * @since 1.4 + */ + filter(selector: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): this; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, + * jQuery object, or element. + * + * @param selector A string containing a selector expression to match elements against. + * An element or a jQuery object to match elements against. + * @see {@link https://api.jquery.com/find/} + * @since 1.0 + * @since 1.6 + */ + find(selector: JQuery.Selector | Element | JQuery): JQuery; + /** + * Stop the currently-running animation, remove all queued animations, and complete all animations for + * the matched elements. + * + * @param queue The name of the queue in which to stop animations. + * @see {@link https://api.jquery.com/finish/} + * @since 1.9 + */ + finish(queue?: string): this; + /** + * Reduce the set of matched elements to the first in the set. + * + * @see {@link https://api.jquery.com/first/} + * @since 1.4 + */ + first(): this; + /** + * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focus/} + * @since 1.4.3 + */ + focus(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focus/} + * @since 1.0 + */ + focus(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "focusin" event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focusin/} + * @since 1.4.3 + */ + focusin(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "focusin" event. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focusin/} + * @since 1.4 + */ + focusin(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "focusout" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focusout/} + * @since 1.4.3 + */ + focusout(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "focusout" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/focusout/} + * @since 1.4 + */ + focusout(handler?: JQuery.EventHandler | false): this; + /** + * Retrieve one of the elements matched by the jQuery object. + * + * @param index A zero-based integer indicating which element to retrieve. + * @see {@link https://api.jquery.com/get/} + * @since 1.0 + */ + get(index: number): TElement; + /** + * Retrieve the elements matched by the jQuery object. + * + * @see {@link https://api.jquery.com/get/} + * @since 1.0 + */ + get(): TElement[]; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + * A DOM element to match elements against. + * @see {@link https://api.jquery.com/has/} + * @since 1.4 + */ + has(selector: string | Element): this; + /** + * Determine whether any of the matched elements are assigned the given class. + * + * @param className The class name to search for. + * @see {@link https://api.jquery.com/hasClass/} + * @since 1.2 + */ + hasClass(className: string): boolean; + /** + * Set the CSS height of every matched element. + * + * @param value An integer representing the number of pixels, or an integer with an optional unit of measure + * appended (as a string). + * A function returning the height to set. Receives the index position of the element in the set and + * the old height as arguments. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/height/} + * @since 1.0 + * @since 1.4.1 + */ + height(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; + /** + * Get the current computed height for the first element in the set of matched elements. + * + * @see {@link https://api.jquery.com/height/} + * @since 1.0 + */ + height(): number; + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/hide/} + * @since 1.4.3 + */ + hide(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing_complete A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/hide/} + * @since 1.0 + * @since 1.4.3 + */ + hide(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; + /** + * Hide the matched elements. + * + * @param duration_complete_options A string or number determining how long the animation will run. + * A function to call once the animation is complete, called once per matched element. + * A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/hide/} + * @since 1.0 + */ + hide(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and + * leaves the elements. + * + * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. + * @param handlerOut A function to execute when the mouse pointer leaves the element. + * @see {@link https://api.jquery.com/hover/} + * @since 1.0 + * @since 1.4 + */ + hover(handlerInOut: (this: TElement, eventObject: JQuery.Event) => void | false, + handlerOut?: (this: TElement, eventObject: JQuery.Event) => void | false): this; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param htmlString A string of HTML to set as the content of each matched element. + * A function returning the HTML content to set. Receives the index position of the element in the set + * and the old HTML value as arguments. jQuery empties the element before calling the function; use the + * oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/html/} + * @since 1.0 + * @since 1.4 + */ + html(htmlString: JQuery.htmlString | ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString)): this; + /** + * Get the HTML contents of the first element in the set of matched elements. + * + * @see {@link https://api.jquery.com/html/} + * @since 1.0 + */ + html(): string; + /** + * Search for a given element from among the matched elements. + * + * @param element The DOM element or first element within the jQuery object to look for. + * A selector representing a jQuery collection in which to look for an element. + * @see {@link https://api.jquery.com/index/} + * @since 1.0 + * @since 1.4 + */ + index(element?: Element | JQuery | JQuery.Selector): number; + /** + * Set the CSS inner height of each element in the set of matched elements. + * + * @param value A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string). + * A function returning the inner height (including padding but not border) to set. Receives the index + * position of the element in the set and the old inner height as arguments. Within the function, this + * refers to the current element in the set. + * @see {@link https://api.jquery.com/innerHeight/} + * @since 1.8.0 + */ + innerHeight(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; + /** + * Get the current computed height for the first element in the set of matched elements, including + * padding but not border. + * + * @see {@link https://api.jquery.com/innerHeight/} + * @since 1.2.6 + */ + innerHeight(): number; + /** + * Set the CSS inner width of each element in the set of matched elements. + * + * @param value A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string). + * A function returning the inner width (including padding but not border) to set. Receives the index + * position of the element in the set and the old inner width as arguments. Within the function, this + * refers to the current element in the set. + * @see {@link https://api.jquery.com/innerWidth/} + * @since 1.8.0 + */ + innerWidth(value: string | number | ((this: TElement, index: number, width: number) => string | number)): this; + /** + * Get the current computed inner width for the first element in the set of matched elements, including + * padding but not border. + * + * @see {@link https://api.jquery.com/innerWidth/} + * @since 1.2.6 + */ + innerWidth(): number; + /** + * Insert every element in the set of matched elements after the target. + * + * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements + * will be inserted after the element(s) specified by this parameter. + * @see {@link https://api.jquery.com/insertAfter/} + * @since 1.0 + */ + insertAfter(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Insert every element in the set of matched elements before the target. + * + * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements + * will be inserted before the element(s) specified by this parameter. + * @see {@link https://api.jquery.com/insertBefore/} + * @since 1.0 + */ + insertBefore(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return + * true if at least one of these elements matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + * A function used as a test for every element in the set. It accepts two arguments, index, which is + * the element's index in the jQuery collection, and element, which is the DOM element. Within the + * function, this refers to the current DOM element. + * An existing jQuery object to match the current set of elements against. + * One or more elements to match the current set of elements against. + * @see {@link https://api.jquery.com/is/} + * @since 1.0 + * @since 1.6 + */ + is(selector: JQuery.Selector | ((this: TElement, index: number, element: TElement) => boolean) | JQuery | Element | Element[]): boolean; + /** + * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keydown/} + * @since 1.4.3 + */ + keydown(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keydown/} + * @since 1.0 + */ + keydown(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keypress/} + * @since 1.4.3 + */ + keypress(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keypress/} + * @since 1.0 + */ + keypress(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keyup/} + * @since 1.4.3 + */ + keyup(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/keyup/} + * @since 1.0 + */ + keyup(handler?: JQuery.EventHandler | false): this; + /** + * Reduce the set of matched elements to the final one in the set. + * + * @see {@link https://api.jquery.com/last/} + * @since 1.4 + */ + last(): this; + /** + * Load data from the server and place the returned HTML into the matched element. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param complete A callback function that is executed when the request completes. + * @see {@link https://api.jquery.com/load/} + * @since 1.0 + */ + load(url: string, + data: string | JQuery.PlainObject, + complete: (this: TElement, responseText: string, textStatus: string, jqXHR: JQuery.jqXHR) => void): this; + /** + * Load data from the server and place the returned HTML into the matched element. + * + * @param url A string containing the URL to which the request is sent. + * @param complete_data A callback function that is executed when the request completes. + * A plain object or string that is sent to the server with the request. + * @see {@link https://api.jquery.com/load/} + * @since 1.0 + */ + load(url: string, + complete_data?: ((this: TElement, responseText: string, textStatus: string, jqXHR: JQuery.jqXHR) => void) | string | JQuery.PlainObject): this; + /** + * Pass each element in the current matched set through a function, producing a new jQuery object + * containing the return values. + * + * @param callback A function object that will be invoked for each element in the current set. + * @see {@link https://api.jquery.com/map/} + * @since 1.2 + */ + map(callback: (this: TElement, index: number, domElement: TElement) => any | any[] | null | undefined): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mousedown/} + * @since 1.4.3 + */ + mousedown(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mousedown/} + * @since 1.0 + */ + mousedown(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mouseenter/} + * @since 1.4.3 + */ + mouseenter(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mouseenter/} + * @since 1.0 + */ + mouseenter(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mouseleave/} + * @since 1.4.3 + */ + mouseleave(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mouseleave/} + * @since 1.0 + */ + mouseleave(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mousemove/} + * @since 1.4.3 + */ + mousemove(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mousemove/} + * @since 1.0 + */ + mousemove(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mouseout/} + * @since 1.4.3 + */ + mouseout(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mouseout/} + * @since 1.0 + */ + mouseout(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mouseover/} + * @since 1.4.3 + */ + mouseover(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mouseover/} + * @since 1.0 + */ + mouseover(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mouseup/} + * @since 1.4.3 + */ + mouseup(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/mouseup/} + * @since 1.0 + */ + mouseup(handler?: JQuery.EventHandler | false): this; + /** + * Get the immediately following sibling of each element in the set of matched elements. If a selector + * is provided, it retrieves the next sibling only if it matches that selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/next/} + * @since 1.0 + */ + next(selector?: JQuery.Selector): this; + /** + * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/nextAll/} + * @since 1.2 + */ + nextAll(selector?: string): this; + /** + * Get all following siblings of each element up to but not including the element matched by the + * selector, DOM node, or jQuery object passed. + * + * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. + * A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/nextUntil/} + * @since 1.4 + * @since 1.6 + */ + nextUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; + /** + * Remove elements from the set of matched elements. + * + * @param selector A string containing a selector expression, a DOM element, or an array of elements to match against the set. + * A function used as a test for each element in the set. It accepts two arguments, index, which is the + * element's index in the jQuery collection, and element, which is the DOM element. Within the + * function, this refers to the current DOM element. + * An existing jQuery object to match the current set of elements against. + * @see {@link https://api.jquery.com/not/} + * @since 1.0 + * @since 1.4 + */ + not(selector: JQuery.Selector | JQuery.TypeOrArray | ((this: TElement, index: number, element: TElement) => boolean) | JQuery): this; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as + * "click", "keydown.myPlugin", or ".myPlugin". + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/off/} + * @since 1.7 + */ + off(events: string, selector: string, handler: JQuery.EventHandler | false): this; + /** + * Remove an event handler. + * + * @param events An object where the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent handler functions previously attached for the event(s). + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @see {@link https://api.jquery.com/off/} + * @since 1.7 + */ + off(events: JQuery.PlainObject | false>, selector: string): this; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as + * "click", "keydown.myPlugin", or ".myPlugin". + * @param selector_handler A selector which should match the one originally passed to .on() when attaching event handlers. + * A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/off/} + * @since 1.7 + */ + off(events: string, selector_handler?: string | JQuery.EventHandler | false): this; + /** + * Remove an event handler. + * + * @param events A jQuery.Event object. + * An object where the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent handler functions previously attached for the event(s). + * @see {@link https://api.jquery.com/off/} + * @since 1.7 + */ + off(events?: JQuery.Event | JQuery.PlainObject | false>): this; + /** + * Set the current coordinates of every element in the set of matched elements, relative to the document. + * + * @param coordinates An object containing the properties top and left, which are numbers indicating the new top and left + * coordinates for the elements. + * A function to return the coordinates to set. Receives the index of the element in the collection as + * the first argument and the current coordinates as the second argument. The function should return an + * object with the new top and left properties. + * @see {@link https://api.jquery.com/offset/} + * @since 1.4 + */ + offset(coordinates: JQuery.Coordinates | ((this: TElement, index: number, coords: JQuery.Coordinates) => JQuery.Coordinates)): this; + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the document. + * + * @see {@link https://api.jquery.com/offset/} + * @since 1.2 + */ + offset(): JQuery.Coordinates; + /** + * Get the closest ancestor element that is positioned. + * + * @see {@link https://api.jquery.com/offsetParent/} + * @since 1.2.6 + */ + offsetParent(): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see {@link https://api.jquery.com/on/} + * @since 1.7 + */ + on(events: string, selector: string | null, data: TData, handler: JQuery.EventHandler | false): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see {@link https://api.jquery.com/on/} + * @since 1.7 + */ + on(events: JQuery.PlainObject | false>, selector: string | null, data: TData): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector_data A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see {@link https://api.jquery.com/on/} + * @since 1.7 + */ + on(events: string, selector_data: string | null | TData, handler: JQuery.EventHandler | false): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see {@link https://api.jquery.com/on/} + * @since 1.7 + */ + on(events: string, handler: JQuery.EventHandler | false): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector_data A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * Data to be passed to the handler in event.data when an event occurs. + * @see {@link https://api.jquery.com/on/} + * @since 1.7 + */ + on(events: JQuery.PlainObject | false>, selector_data?: string | null | TData): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see {@link https://api.jquery.com/one/} + * @since 1.7 + */ + one(events: string, selector: string | null, data: TData, handler: JQuery.EventHandler | false): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector_data A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see {@link https://api.jquery.com/one/} + * @since 1.7 + */ + one(events: string, selector_data: string | null | TData, handler: JQuery.EventHandler | false): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see {@link https://api.jquery.com/one/} + * @since 1.7 + */ + one(events: JQuery.PlainObject | false>, selector: string | null, data: TData): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see {@link https://api.jquery.com/one/} + * @since 1.7 + */ + one(events: string, handler: JQuery.EventHandler | false): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector_data A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * Data to be passed to the handler in event.data when an event occurs. + * @see {@link https://api.jquery.com/one/} + * @since 1.7 + */ + one(events: JQuery.PlainObject | false>, selector_data?: string | null | TData): this; + /** + * Set the CSS outer height of each element in the set of matched elements. + * + * @param value A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string). + * @see {@link https://api.jquery.com/outerHeight/} + * @since 1.8.0 + */ + outerHeight(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; + /** + * Get the current computed outer height (including padding, border, and optionally margin) for the + * first element in the set of matched elements. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + * @see {@link https://api.jquery.com/outerHeight/} + * @since 1.2.6 + */ + outerHeight(includeMargin?: boolean): number; + /** + * Set the CSS outer width of each element in the set of matched elements. + * + * @param value A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string). + * A function returning the outer width to set. Receives the index position of the element in the set + * and the old outer width as arguments. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/outerWidth/} + * @since 1.8.0 + */ + outerWidth(value: string | number | ((this: TElement, index: number, width: number) => string | number)): this; + /** + * Get the current computed outer width (including padding, border, and optionally margin) for the + * first element in the set of matched elements. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + * @see {@link https://api.jquery.com/outerWidth/} + * @since 1.2.6 + */ + outerWidth(includeMargin?: boolean): number; + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/parent/} + * @since 1.0 + */ + parent(selector?: JQuery.Selector): this; + /** + * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/parents/} + * @since 1.0 + */ + parents(selector?: JQuery.Selector): this; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including + * the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. + * A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/parentsUntil/} + * @since 1.4 + * @since 1.6 + */ + parentsUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + * + * @see {@link https://api.jquery.com/position/} + * @since 1.2 + */ + position(): JQuery.Coordinates; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert at the beginning of each element in the set of matched elements. + * @see {@link https://api.jquery.com/prepend/} + * @since 1.0 + */ + prepend(...contents: Array | JQuery>): this; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at + * the beginning of each element in the set of matched elements. Receives the index position of the + * element in the set and the old HTML value of the element as arguments. Within the function, this + * refers to the current element in the set. + * @see {@link https://api.jquery.com/prepend/} + * @since 1.4 + */ + prepend(fn: (this: TElement, elementOfArray: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Insert every element in the set of matched elements to the beginning of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements + * will be inserted at the beginning of the element(s) specified by this parameter. + * @see {@link https://api.jquery.com/prependTo/} + * @since 1.0 + */ + prependTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Get the immediately preceding sibling of each element in the set of matched elements. If a selector + * is provided, it retrieves the previous sibling only if it matches that selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/prev/} + * @since 1.0 + */ + prev(selector?: JQuery.Selector): this; + /** + * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/prevAll/} + * @since 1.2 + */ + prevAll(selector?: JQuery.Selector): this; + /** + * Get all preceding siblings of each element up to but not including the element matched by the + * selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. + * A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/prevUntil/} + * @since 1.4 + * @since 1.6 + */ + prevUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, + * queued or not, have finished. + * + * @param type The type of queue that needs to be observed. + * @param target Object onto which the promise methods have to be attached + * @see {@link https://api.jquery.com/promise/} + * @since 1.6 + */ + promise(type: string, target: T): T & JQuery.Promise; + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, + * queued or not, have finished. + * + * @param target Object onto which the promise methods have to be attached + * @see {@link https://api.jquery.com/promise/} + * @since 1.6 + */ + promise(target: T): T & JQuery.Promise; + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, + * queued or not, have finished. + * + * @param type The type of queue that needs to be observed. + * @see {@link https://api.jquery.com/promise/} + * @since 1.6 + */ + promise(type?: string): JQuery.Promise; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param value A function returning the value to set. Receives the index position of the element in the set and the + * old property value as arguments. Within the function, the keyword this refers to the current element. + * @see {@link https://api.jquery.com/prop/} + * @since 1.6 + */ + prop(propertyName: string, value: (this: TElement, index: number, oldPropertyValue: any) => any): this; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param value A value to set for the property. + * @see {@link https://api.jquery.com/prop/} + * @since 1.6 + */ + // tslint:disable-next-line:unified-signatures + prop(propertyName: string, value: any): this; + /** + * Set one or more properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + * @see {@link https://api.jquery.com/prop/} + * @since 1.6 + */ + prop(properties: JQuery.PlainObject): this; + /** + * Get the value of a property for the first element in the set of matched elements. + * + * @param propertyName The name of the property to get. + * @see {@link https://api.jquery.com/prop/} + * @since 1.6 + */ + prop(propertyName: string): any | undefined; + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @param name The name of a jQuery method that generated the array of elements. + * @param args The arguments that were passed in to the jQuery method (for serialization). + * @see {@link https://api.jquery.com/pushStack/} + * @since 1.3 + */ + pushStack(elements: ArrayLike, name: string, args: any[]): JQuery; + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @see {@link https://api.jquery.com/pushStack/} + * @since 1.0 + */ + pushStack(elements: ArrayLike): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. + * An array of functions to replace the current queue contents. + * @see {@link https://api.jquery.com/queue/} + * @since 1.2 + */ + queue(queueName: string, newQueue: JQuery.TypeOrArray>): this; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. + * An array of functions to replace the current queue contents. + * @see {@link https://api.jquery.com/queue/} + * @since 1.2 + */ + queue(newQueue: JQuery.TypeOrArray>): this; + /** + * Show the queue of functions to be executed on the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/queue/} + * @since 1.2 + */ + queue(queueName?: string): JQuery.Queue; + /** + * Specify a function to execute when the DOM is fully loaded. + * + * @param handler A function to execute after the DOM is ready. + * @see {@link https://api.jquery.com/ready/} + * @since 1.0 + */ + ready(handler: ($: JQueryStatic) => void): this; + /** + * Remove the set of matched elements from the DOM. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + * @see {@link https://api.jquery.com/remove/} + * @since 1.0 + */ + remove(selector?: string): this; + /** + * Remove an attribute from each element in the set of matched elements. + * + * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. + * @see {@link https://api.jquery.com/removeAttr/} + * @since 1.0 + */ + removeAttr(attributeName: string): this; + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param className One or more space-separated classes to be removed from the class attribute of each matched element. + * A function returning one or more space-separated class names to be removed. Receives the index + * position of the element in the set and the old class value as arguments. + * @see {@link https://api.jquery.com/removeClass/} + * @since 1.0 + * @since 1.4 + */ + removeClass(className?: string | ((this: TElement, index: number, className: string) => string)): this; + /** + * Remove a previously-stored piece of data. + * + * @param name A string naming the piece of data to delete. + * An array or space-separated string naming the pieces of data to delete. + * @see {@link https://api.jquery.com/removeData/} + * @since 1.2.3 + * @since 1.7 + */ + removeData(name?: JQuery.TypeOrArray): this; + /** + * Remove a property for the set of matched elements. + * + * @param propertyName The name of the property to remove. + * @see {@link https://api.jquery.com/removeProp/} + * @since 1.6 + */ + removeProp(propertyName: string): this; + /** + * Replace each target element with the set of matched elements. + * + * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. + * @see {@link https://api.jquery.com/replaceAll/} + * @since 1.2 + */ + replaceAll(target: JQuery.Selector | JQuery | JQuery.TypeOrArray): this; + /** + * Replace each element in the set of matched elements with the provided new content and return the set + * of elements that was removed. + * + * @param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. + * A function that returns content with which to replace the set of matched elements. + * @see {@link https://api.jquery.com/replaceWith/} + * @since 1.2 + * @since 1.4 + */ + replaceWith(newContent: JQuery.htmlString | JQuery.TypeOrArray | JQuery | ((this: TElement) => any)): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/resize/} + * @since 1.4.3 + */ + resize(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/resize/} + * @since 1.0 + */ + resize(handler?: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/scroll/} + * @since 1.4.3 + */ + scroll(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/scroll/} + * @since 1.0 + */ + scroll(handler?: JQuery.EventHandler | false): this; + /** + * Set the current horizontal position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + * @see {@link https://api.jquery.com/scrollLeft/} + * @since 1.2.6 + */ + scrollLeft(value: number): this; + /** + * Get the current horizontal position of the scroll bar for the first element in the set of matched elements. + * + * @see {@link https://api.jquery.com/scrollLeft/} + * @since 1.2.6 + */ + scrollLeft(): number; + /** + * Set the current vertical position of the scroll bar for each of the set of matched elements. + * + * @param value A number indicating the new position to set the scroll bar to. + * @see {@link https://api.jquery.com/scrollTop/} + * @since 1.2.6 + */ + scrollTop(value: number): this; + /** + * Get the current vertical position of the scroll bar for the first element in the set of matched + * elements or set the vertical position of the scroll bar for every matched element. + * + * @see {@link https://api.jquery.com/scrollTop/} + * @since 1.2.6 + */ + scrollTop(): number; + /** + * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/select/} + * @since 1.4.3 + */ + select(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/select/} + * @since 1.0 + */ + select(handler?: JQuery.EventHandler | false): this; + /** + * Encode a set of form elements as a string for submission. + * + * @see {@link https://api.jquery.com/serialize/} + * @since 1.0 + */ + serialize(): string; + /** + * Encode a set of form elements as an array of names and values. + * + * @see {@link https://api.jquery.com/serializeArray/} + * @since 1.2 + */ + serializeArray(): JQuery.NameValuePair[]; + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/show/} + * @since 1.4.3 + */ + show(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing_complete A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/show/} + * @since 1.0 + * @since 1.4.3 + */ + show(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; + /** + * Display the matched elements. + * + * @param duration_complete_options A string or number determining how long the animation will run. + * A function to call once the animation is complete, called once per matched element. + * A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/show/} + * @since 1.0 + */ + show(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @see {@link https://api.jquery.com/siblings/} + * @since 1.0 + */ + siblings(selector?: JQuery.Selector): this; + /** + * Reduce the set of matched elements to a subset specified by a range of indices. + * + * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, + * it indicates an offset from the end of the set. + * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, + * it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. + * @see {@link https://api.jquery.com/slice/} + * @since 1.1.4 + */ + slice(start: number, end?: number): this; + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/slideDown/} + * @since 1.4.3 + */ + slideDown(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display the matched elements with a sliding motion. + * + * @param duration_easing A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/slideDown/} + * @since 1.0 + * @since 1.4.3 + */ + slideDown(duration_easing: JQuery.Duration | string, complete?: (this: TElement) => void): this; + /** + * Display the matched elements with a sliding motion. + * + * @param duration_easing_complete_options A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/slideDown/} + * @since 1.0 + * @since 1.4.3 + */ + slideDown(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/slideToggle/} + * @since 1.4.3 + */ + slideToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration_easing A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/slideToggle/} + * @since 1.0 + * @since 1.4.3 + */ + slideToggle(duration_easing: JQuery.Duration | string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration_easing_complete_options A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/slideToggle/} + * @since 1.0 + * @since 1.4.3 + */ + slideToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/slideUp/} + * @since 1.4.3 + */ + slideUp(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Hide the matched elements with a sliding motion. + * + * @param duration_easing A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/slideUp/} + * @since 1.0 + * @since 1.4.3 + */ + slideUp(duration_easing: JQuery.Duration | string, complete?: (this: TElement) => void): this; + /** + * Hide the matched elements with a sliding motion. + * + * @param duration_easing_complete_options A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * A map of additional options to pass to the method. + * @see {@link https://api.jquery.com/slideUp/} + * @since 1.0 + * @since 1.4.3 + */ + slideUp(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Stop the currently-running animation on the matched elements. + * + * @param queue The name of the queue in which to stop animations. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + * @see {@link https://api.jquery.com/stop/} + * @since 1.7 + */ + stop(queue: string, clearQueue?: boolean, jumpToEnd?: boolean): this; + /** + * Stop the currently-running animation on the matched elements. + * + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + * @see {@link https://api.jquery.com/stop/} + * @since 1.2 + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): this; + /** + * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/submit/} + * @since 1.4.3 + */ + submit(eventData: TData, handler: JQuery.EventHandler | false): this; + /** + * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. + * + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/submit/} + * @since 1.0 + */ + submit(handler?: JQuery.EventHandler | false): this; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will + * be converted to a String representation. + * A function returning the text content to set. Receives the index position of the element in the set + * and the old text value as arguments. + * @see {@link https://api.jquery.com/text/} + * @since 1.0 + * @since 1.4 + */ + text(text: string | number | boolean | ((this: TElement, index: number, text: string) => string | number | boolean)): this; + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + * + * @see {@link https://api.jquery.com/text/} + * @since 1.0 + */ + text(): string; + /** + * Retrieve all the elements contained in the jQuery set, as an array. + * + * @see {@link https://api.jquery.com/toArray/} + * @since 1.4 + */ + toArray(): TElement[]; + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/toggle/} + * @since 1.4.3 + */ + toggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/toggle/} + * @since 1.0 + */ + toggle(duration: JQuery.Duration, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements. + * + * @param options A map of additional options to pass to the method. + * Use true to show the element or false to hide it. + * @see {@link https://api.jquery.com/toggle/} + * @since 1.0 + * @since 1.3 + */ + toggle(options?: JQuery.EffectsOptions | boolean): this; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on + * either the class's presence or the value of the state argument. + * + * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. + * A function that returns class names to be toggled in the class attribute of each element in the + * matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. + * @param state A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + * @see {@link https://api.jquery.com/toggleClass/} + * @since 1.0 + * @since 1.3 + * @since 1.4 + */ + toggleClass(className: string | ((this: TElement, index: number, className: string, state: boolean) => string), + state?: boolean): this; + /** + * + * + * @param state A boolean value to determine whether the class should be added or removed. + * @see {@link https://api.jquery.com/toggleClass/} + * @since 1.4 + * @deprecated 3.0 + */ + toggleClass(state?: boolean): this; + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * A jQuery.Event object. + * @param extraParameters Additional parameters to pass along to the event handler. + * @see {@link https://api.jquery.com/trigger/} + * @since 1.0 + * @since 1.3 + */ + trigger(eventType: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject): this; + /** + * Execute all handlers attached to an element for an event. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * A jQuery.Event object. + * @param extraParameters Additional parameters to pass along to the event handler. + * @see {@link https://api.jquery.com/triggerHandler/} + * @since 1.2 + * @since 1.3 + */ + triggerHandler(eventType: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject): undefined | any; + /** + * Remove a previously-attached event handler from the elements. + * + * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/unbind/} + * @since 1.0 + * @since 1.4.3 + * @deprecated 3.0 + */ + unbind(event: string, handler: JQuery.EventHandler | false | false): this; + /** + * Remove a previously-attached event handler from the elements. + * + * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * A jQuery.Event object. + * @see {@link https://api.jquery.com/unbind/} + * @since 1.0 + * @deprecated 3.0 + */ + unbind(event?: string | JQuery.Event): this; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a + * specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" + * @param handler A function to execute each time the event is triggered. + * @see {@link https://api.jquery.com/undelegate/} + * @since 1.4.2 + * @deprecated 3.0 + */ + undelegate(selector: JQuery.Selector, eventType: string, handler: JQuery.EventHandler | false): this; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a + * specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param eventTypes A string containing a JavaScript event type, such as "click" or "keydown" + * An object of one or more event types and previously bound functions to unbind from them. + * @see {@link https://api.jquery.com/undelegate/} + * @since 1.4.2 + * @since 1.4.3 + * @deprecated 3.0 + */ + undelegate(selector: JQuery.Selector, eventTypes: string | JQuery.PlainObject | false>): this; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a + * specific set of root elements. + * + * @param namespace A selector which will be used to filter the event results. + * @see {@link https://api.jquery.com/undelegate/} + * @since 1.4.2 + * @since 1.6 + * @deprecated 3.0 + */ + undelegate(namespace?: string): this; + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + * + * @param selector A selector to check the parent element against. If an element's parent does not match the selector, + * the element won't be unwrapped. + * @see {@link https://api.jquery.com/unwrap/} + * @since 1.4 + * @since 3.0 + */ + unwrap(selector?: string): this; + /** + * Set the value of each element in the set of matched elements. + * + * @param value A string of text, a number, or an array of strings corresponding to the value of each matched + * element to set as selected/checked. + * A function returning the value to set. this is the current element. Receives the index position of + * the element in the set and the old value as arguments. + * @see {@link https://api.jquery.com/val/} + * @since 1.0 + * @since 1.4 + */ + val(value: string | number | string[] | ((this: TElement, index: number, value: string) => string)): this; + /** + * Get the current value of the first element in the set of matched elements. + * + * @see {@link https://api.jquery.com/val/} + * @since 1.0 + */ + val(): string | number | string[] | undefined; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure + * appended (as a string). + * A function returning the width to set. Receives the index position of the element in the set and the + * old width as arguments. Within the function, this refers to the current element in the set. + * @see {@link https://api.jquery.com/width/} + * @since 1.0 + * @since 1.4.1 + */ + width(value: string | number | ((this: TElement, index: number, value: number) => string | number)): this; + /** + * Get the current computed width for the first element in the set of matched elements. + * + * @see {@link https://api.jquery.com/width/} + * @since 1.0 + */ + width(): number; + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the + * matched elements. When you pass a jQuery collection containing more than one element, or a selector + * matching more than one element, the first element will be used. + * A callback function returning the HTML content or jQuery object to wrap around the matched elements. + * Receives the index position of the element in the set as an argument. Within the function, this + * refers to the current element in the set. + * @see {@link https://api.jquery.com/wrap/} + * @since 1.0 + * @since 1.4 + */ + wrap(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery)): this; + /** + * Wrap an HTML structure around all elements in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + * A callback function returning the HTML content or jQuery object to wrap around all the matched + * elements. Within the function, this refers to the first element in the set. Prior to jQuery 3.0, the + * callback was incorrectly called for every element in the set and received the index position of the + * element in the set as an argument. + * @see {@link https://api.jquery.com/wrapAll/} + * @since 1.2 + * @since 1.4 + */ + wrapAll(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement) => string | JQuery)): this; + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap + * around the content of the matched elements. + * A callback function which generates a structure to wrap around the content of the matched elements. + * Receives the index position of the element in the set as an argument. Within the function, this + * refers to the current element in the set. + * @see {@link https://api.jquery.com/wrapInner/} + * @since 1.2 + * @since 1.4 + */ + wrapInner(wrappingElement: JQuery.htmlString | JQuery.Selector | JQuery | Element | ((this: TElement, index: number) => string)): this; } -/** - * Allows jQuery Promises to interop with non-jQuery promises - */ -interface JQueryGenericPromise { - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.then/#deferred-then-doneFilter-failFilter-progressFilter} - */ - then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; +interface JQuery extends ArrayLike, Iterable { } +interface JQueryStatic { + Event: JQuery.Event; /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize + * CSS property naming, or create custom properties. * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.then/#deferred-then-doneFilter-failFilter-progressFilter} + * @see {@link https://api.jquery.com/jQuery.cssHooks/} + * @since 1.4.3 */ - then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; + cssHooks: JQuery.PlainObject>; + /** + * An object containing all CSS properties that may be used without a unit. The .css() method uses this + * object to see if it may append px to unitless values. + * + * @see {@link https://api.jquery.com/jQuery.cssNumber/} + * @since 1.4.3 + */ + cssNumber: JQuery.PlainObject; + readonly fn: JQuery; + fx: { + /** + * The rate (in milliseconds) at which animations fire. + * + * @see {@link https://api.jquery.com/jQuery.fx.interval/} + * @since 1.4.3 + * @deprecated 3.0 + */ + interval: number; + /** + * Globally disable all animations. + * + * @see {@link https://api.jquery.com/jQuery.fx.off/} + * @since 1.3 + */ + off: boolean; + step: JQuery.PlainObject>; + }; + /** + * A Promise-like object (or "thenable") that resolves when the document is ready. + * + * @see {@link https://api.jquery.com/jQuery.ready/} + * @since 1.8 + */ + ready: JQuery.Thenable; + /** + * A collection of properties that represent the presence of different browser features or bugs. + * Intended for jQuery's internal use; specific properties may be removed when they are no longer + * needed internally to improve page startup performance. For your own project's feature-detection + * needs, we strongly recommend the use of an external library such as Modernizr instead of dependency + * on properties in jQuery.support. + * + * @see {@link https://api.jquery.com/jQuery.support/} + * @since 1.3 + * @deprecated 1.9 + */ + support: JQuery.PlainObject; + valHooks: JQuery.PlainObject>; + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. + * A string defining a single, standalone, HTML element (e.g.
or
). + * @param ownerDocument_attributes A document in which the new elements will be created. + * An object of attributes, events, and methods to call on the newly-created element. + * @see {@link https://api.jquery.com/jQuery/} + * @since 1.0 + * @since 1.4 + */ + (html: JQuery.htmlString, ownerDocument_attributes: Document | JQuery.PlainObject): JQuery; + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param selector A string containing a selector expression + * @param context A DOM Element, Document, or jQuery to use as context + * @see {@link https://api.jquery.com/jQuery/} + * @since 1.0 + */ + (selector: JQuery.Selector, context: Element | Document | JQuery): JQuery; + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * Binds a function to be executed when the DOM has finished loading. + * + * @param selector_object_callback A string containing a selector expression + * A DOM element to wrap in a jQuery object. + * An array containing a set of DOM elements to wrap in a jQuery object. + * A plain object to wrap in a jQuery object. + * An existing jQuery object to clone. + * The function to execute when the DOM is ready. + * @see {@link https://api.jquery.com/jQuery/} + * @since 1.0 + * @since 1.4 + */ + (selector_object_callback?: JQuery.Selector | JQuery.TypeOrArray | JQuery.PlainObject | JQuery | (($: JQueryStatic) => void)): JQuery; + /** + * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. + * + * @param flags An optional list of space-separated flags that change how the callback list behaves. + * @see {@link https://api.jquery.com/jQuery.Callbacks/} + * @since 1.7 + */ + Callbacks(flags?: string): JQuery.Callbacks; + /** + * A factory function that returns a chainable utility object with methods to register multiple + * callbacks into callback queues, invoke callback queues, and relay the success or failure state of + * any synchronous or asynchronous function. + * + * @param beforeStart A function that is called just before the constructor returns. + * @see {@link https://api.jquery.com/jQuery.Deferred/} + * @since 1.5 + */ + Deferred(beforeStart?: (this: JQuery.Deferred, + deferred: JQuery.Deferred) => void): JQuery.Deferred; + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param url A string containing the URL to which the request is sent. + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can + * be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. + * @see {@link https://api.jquery.com/jQuery.ajax/} + * @since 1.5 + */ + ajax(url: string, settings?: JQuery.AjaxSettings): JQuery.jqXHR; + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can + * be set for any option with $.ajaxSetup(). + * @see {@link https://api.jquery.com/jQuery.ajax/} + * @since 1.0 + */ + ajax(settings?: JQuery.AjaxSettings): JQuery.jqXHR; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they + * are processed by $.ajax(). + * + * @param dataTypes An optional string containing one or more space-separated dataTypes + * @param handler A handler to set default values for future Ajax requests. + * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} + * @since 1.5 + */ + ajaxPrefilter(dataTypes: string, + handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they + * are processed by $.ajax(). + * + * @param handler A handler to set default values for future Ajax requests. + * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} + * @since 1.5 + */ + ajaxPrefilter(handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; + /** + * Set default values for future Ajax requests. Its use is not recommended. + * + * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. + * @see {@link https://api.jquery.com/jQuery.ajaxSetup/} + * @since 1.1 + */ + ajaxSetup(options: JQuery.AjaxSettings): JQuery.AjaxSettings; + /** + * Creates an object that handles the actual transmission of Ajax data. + * + * @param dataType A string identifying the data type to use + * @param handler A handler to return the new transport object to use with the data type provided in the first argument. + * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} + * @since 1.5 + */ + ajaxTransport(dataType: string, + handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void; + /** + * Check to see if a DOM element is a descendant of another DOM element. + * + * @param container The DOM element that may contain the other element. + * @param contained The DOM element that may be contained by (a descendant of) the other element. + * @see {@link https://api.jquery.com/jQuery.contains/} + * @since 1.4 + */ + contains(container: Element, contained: Element): boolean; + css(elem: Element, unknown: any): any; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or + * the full data store for the element. + * + * @param element The DOM element to query for the data. + * @param key Name of the data stored. + * @param undefined + * @see {@link https://api.jquery.com/jQuery.data/} + * @since 1.2.3 + */ + // tslint:disable-next-line:unified-signatures + data(element: Element, key: string, undefined: undefined): any; + /** + * Store arbitrary data associated with the specified element. Returns the value that was set. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + * @param value The new data value; this can be any Javascript type except undefined. + * @see {@link https://api.jquery.com/jQuery.data/} + * @since 1.2.3 + */ + data(element: Element, key: string, value: T): T; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or + * the full data store for the element. + * + * @param element The DOM element to query for the data. + * @param key Name of the data stored. + * @see {@link https://api.jquery.com/jQuery.data/} + * @since 1.2.3 + * @since 1.4 + */ + data(element: Element, key?: string): any; + /** + * Execute the next function on the queue for the matched element. + * + * @param element A DOM element from which to remove and execute a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/jQuery.dequeue/} + * @since 1.3 + */ + dequeue(element: Element, queueName?: string): void; + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. + * Arrays and array-like objects with a length property (such as a function's arguments object) are + * iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param array The array to iterate over. + * @param callback The function that will be executed on every object. + * @see {@link https://api.jquery.com/jQuery.each/} + * @since 1.0 + */ + each(array: ArrayLike, callback: (indexInArray: number, value: T) => false | any): ArrayLike; + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. + * Arrays and array-like objects with a length property (such as a function's arguments object) are + * iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param obj The object to iterate over. + * @param callback The function that will be executed on every object. + * @see {@link https://api.jquery.com/jQuery.each/} + * @since 1.0 + */ + each(obj: T, callback: (propertyName: K, valueOfProperty: T[K]) => false | any): T; + /** + * Takes a string and throws an exception containing it. + * + * @param message The message to send out. + * @see {@link https://api.jquery.com/jQuery.error/} + * @since 1.4.1 + */ + error(message: string): never; + /** + * Escapes any character that has a special meaning in a CSS selector. + * + * @param selector A string containing a selector expression to escape. + * @see {@link https://api.jquery.com/jQuery.escapeSelector/} + * @since 3.0 + */ + escapeSelector(selector: JQuery.Selector): JQuery.Selector; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.1.4 + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.1.4 + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.1.4 + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.1.4 + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W): T & U & V & W; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.1.4 + */ + extend(deep: true, target: T, object1: U, object2: V): T & U & V; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.1.4 + */ + extend(deep: true, target: T, object1: U): T & U; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.1.4 + */ + extend(deep: true, target: T, ...objects: U[]): T & U; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.0 + */ + extend(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.0 + */ + extend(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.0 + */ + extend(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.0 + */ + extend(target: T, object1: U, object2: V, object3: W): T & U & V & W; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.0 + */ + extend(target: T, object1: U, object2: V): T & U & V; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.0 + */ + extend(target: T, object1: U): T & U; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @see {@link https://api.jquery.com/jQuery.extend/} + * @since 1.0 + */ + extend(target: T, ...objects: U[]): T & U; + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but + * you can use null or jQuery.noop as a placeholder. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see {@link https://api.jquery.com/jQuery.get/} + * @since 1.0 + */ + get(url: string, + data: JQuery.PlainObject | string, + success: JQuery.jqXHR.DoneCallback | null, + dataType?: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but + * you can use null or jQuery.noop as a placeholder. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see {@link https://api.jquery.com/jQuery.get/} + * @since 1.0 + */ + get(url: string, + success: JQuery.jqXHR.DoneCallback | null, + dataType: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but + * you can use null or jQuery.noop as a placeholder. + * A plain object or string that is sent to the server with the request. + * @see {@link https://api.jquery.com/jQuery.get/} + * @since 1.0 + */ + get(url: string, + success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param url_settings A string containing the URL to which the request is sent. + * A set of key/value pairs that configure the Ajax request. All properties except for url are + * optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a + * complete list of all settings. The type option will automatically be set to GET. + * @see {@link https://api.jquery.com/jQuery.get/} + * @since 1.0 + * @since 1.12 + * @since 2.2 + */ + get(url_settings?: string | JQuery.AjaxSettings): JQuery.jqXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @see {@link https://api.jquery.com/jQuery.getJSON/} + * @since 1.0 + */ + getJSON(url: string, + data: JQuery.PlainObject | string, + success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param success_data A callback function that is executed if the request succeeds. + * A plain object or string that is sent to the server with the request. + * @see {@link https://api.jquery.com/jQuery.getJSON/} + * @since 1.0 + */ + getJSON(url: string, + success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; + /** + * Load a JavaScript file from the server using a GET HTTP request, then execute it. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @see {@link https://api.jquery.com/jQuery.getScript/} + * @since 1.0 + */ + getScript(url: string, + success?: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; + /** + * Execute some JavaScript code globally. + * + * @param code The JavaScript code to execute. + * @see {@link https://api.jquery.com/jQuery.globalEval/} + * @since 1.0.4 + */ + globalEval(code: string): void; + /** + * Finds the elements of an array which satisfy a filter function. The original array is not affected. + * + * @param array The array-like object to search through. + * @param fn 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. + * @see {@link https://api.jquery.com/jQuery.grep/} + * @since 1.0 + */ + grep(array: ArrayLike, + fn: (elementOfArray: T, indexInArray: number) => boolean, + invert?: boolean): T[]; + /** + * Determine whether an element has any jQuery data associated with it. + * + * @param element A DOM element to be checked for data. + * @see {@link https://api.jquery.com/jQuery.hasData/} + * @since 1.5 + */ + hasData(element: Element): boolean; + /** + * Holds or releases the execution of jQuery's ready event. + * + * @param hold Indicates whether the ready hold is being requested or released + * @see {@link https://api.jquery.com/jQuery.holdReady/} + * @since 1.6 + */ + holdReady(hold: boolean): void; + /** + * Modify and filter HTML strings passed through jQuery manipulation methods. + * + * @param html The HTML string on which to operate. + * @see {@link https://api.jquery.com/jQuery.htmlPrefilter/} + * @since 1.12/2.2 + */ + htmlPrefilter(html: string): string; + /** + * Search for a specified value within an array and return its index (or -1 if not found). + * + * @param value The value to search for. + * @param array An array through which to search. + * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array. + * @see {@link https://api.jquery.com/jQuery.inArray/} + * @since 1.2 + */ + inArray(value: T, array: T[], fromIndex?: number): number; + /** + * Determine whether the argument is an array. + * + * @param obj Object to test whether or not it is an array. + * @see {@link https://api.jquery.com/jQuery.isArray/} + * @since 1.3 + */ + isArray(obj: any): obj is any[]; + /** + * Check to see if an object is empty (contains no enumerable properties). + * + * @param obj The object that will be checked to see if it's empty. + * @see {@link https://api.jquery.com/jQuery.isEmptyObject/} + * @since 1.4 + */ + isEmptyObject(obj: any): boolean; + /** + * Determine if the argument passed is a JavaScript function object. + * + * @param obj Object to test whether or not it is a function. + * @see {@link https://api.jquery.com/jQuery.isFunction/} + * @since 1.2 + */ + isFunction(obj: any): obj is Function; + /** + * Determines whether its argument represents a JavaScript number. + * + * @param value The value to be tested. + * @see {@link https://api.jquery.com/jQuery.isNumeric/} + * @since 1.7 + */ + isNumeric(value: any): value is number; + /** + * Check to see if an object is a plain object (created using "{}" or "new Object"). + * + * @param obj The object that will be checked to see if it's a plain object. + * @see {@link https://api.jquery.com/jQuery.isPlainObject/} + * @since 1.4 + */ + isPlainObject(obj: any): obj is JQuery.PlainObject; + /** + * Determine whether the argument is a window. + * + * @param obj Object to test whether or not it is a window. + * @see {@link https://api.jquery.com/jQuery.isWindow/} + * @since 1.4.3 + */ + isWindow(obj: any): obj is Window; + /** + * Check to see if a DOM node is within an XML document (or is an XML document). + * + * @param node The DOM node that will be checked to see if it's in an XML document. + * @see {@link https://api.jquery.com/jQuery.isXMLDoc/} + * @since 1.1.4 + */ + isXMLDoc(node: Node): boolean; + /** + * Convert an array-like object into a true JavaScript array. + * + * @param obj Any object to turn into a native Array. + * @see {@link https://api.jquery.com/jQuery.makeArray/} + * @since 1.2 + */ + makeArray(obj: ArrayLike): T[]; + /** + * Translate all items in an array or object to new array of items. + * + * @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. A returned array will be + * flattened into the resulting array. Within the function, this refers to the global (window) object. + * @see {@link https://api.jquery.com/jQuery.map/} + * @since 1.0 + */ + map(array: T[], callback: (elementOfArray: T, indexInArray: number) => R): R[]; + /** + * Translate all items in an array or object to new array of items. + * + * @param obj The 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 key of the 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. + * @see {@link https://api.jquery.com/jQuery.map/} + * @since 1.6 + */ + map(obj: T, callback: (propertyOfObject: T[K], key: K) => R): R[]; + /** + * Merge the contents of two arrays together into the first array. + * + * @param first The first array-like object to merge, the elements of second added. + * @param second The second array-like object to merge into the first, unaltered. + * @see {@link https://api.jquery.com/jQuery.merge/} + * @since 1.0 + */ + merge(first: ArrayLike, second: ArrayLike): Array; + /** + * Relinquish jQuery's control of the $ variable. + * + * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). + * @see {@link https://api.jquery.com/jQuery.noConflict/} + * @since 1.0 + */ + noConflict(removeAll?: boolean): JQueryStatic; + /** + * An empty function. + * + * @see {@link https://api.jquery.com/jQuery.noop/} + * @since 1.4 + */ + noop(): undefined; + /** + * Return a number representing the current time. + * + * @see {@link https://api.jquery.com/jQuery.now/} + * @since 1.4.3 + */ + now(): number; + /** + * Create a serialized representation of an array, a plain object, or a jQuery object suitable for use + * in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input + * elements with name/value properties. + * + * @param obj An array, a plain object, or a jQuery object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + * @see {@link https://api.jquery.com/jQuery.param/} + * @since 1.2 + * @since 1.4 + */ + param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string; + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context Document element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + * @see {@link https://api.jquery.com/jQuery.parseHTML/} + * @since 1.8 + */ + parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): Node[]; + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context_keepScripts Document element to serve as the context in which the HTML fragment will be created + * A Boolean indicating whether to include scripts passed in the HTML string + * @see {@link https://api.jquery.com/jQuery.parseHTML/} + * @since 1.8 + */ + parseHTML(data: string, context_keepScripts?: Document | null | undefined | boolean): Node[]; + /** + * Takes a well-formed JSON string and returns the resulting JavaScript value. + * + * @param json The JSON string to parse. + * @see {@link https://api.jquery.com/jQuery.parseJSON/} + * @since 1.4.1 + * @deprecated 3.0 + */ + parseJSON(json: string): any; + /** + * Parses a string into an XML document. + * + * @param data a well-formed XML string to be parsed + * @see {@link https://api.jquery.com/jQuery.parseXML/} + * @since 1.5 + */ + parseXML(data: string): XMLDocument; + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but + * can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see {@link https://api.jquery.com/jQuery.post/} + * @since 1.0 + */ + post(url: string, + data: JQuery.PlainObject | string, + success: JQuery.jqXHR.DoneCallback | null, + dataType?: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but + * can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see {@link https://api.jquery.com/jQuery.post/} + * @since 1.0 + */ + post(url: string, + success: JQuery.jqXHR.DoneCallback | null, + dataType: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but + * can be null in that case. + * A plain object or string that is sent to the server with the request. + * @see {@link https://api.jquery.com/jQuery.post/} + * @since 1.0 + */ + post(url: string, + success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP POST request. + * + * @param url_settings A string containing the URL to which the request is sent. + * A set of key/value pairs that configure the Ajax request. All properties except for url are + * optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a + * complete list of all settings. Type will automatically be set to POST. + * @see {@link https://api.jquery.com/jQuery.post/} + * @since 1.0 + * @since 1.12 + * @since 2.2 + */ + post(url_settings?: string | JQuery.AjaxSettings): JQuery.jqXHR; + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param fn The function whose context will be changed. + * @param context The object to which the context (this) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + * @see {@link https://api.jquery.com/jQuery.proxy/} + * @since 1.4 + * @since 1.6 + */ + proxy(fn: Function, context: object, ...additionalArguments: any[]): Function; + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param context The object to which the context of the function should be set. + * @param name The name of the function whose context will be changed (should be a property of the context object). + * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. + * @see {@link https://api.jquery.com/jQuery.proxy/} + * @since 1.4 + * @since 1.6 + */ + proxy(context: T, name: keyof T, ...additionalArguments: any[]): Function; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element where the array of queued functions is attached. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue The new function to add to the queue. + * An array of functions to replace the current queue contents. + * @see {@link https://api.jquery.com/jQuery.queue/} + * @since 1.3 + */ + queue(element: Element, queueName: string, newQueue: JQuery.TypeOrArray>): JQuery; + /** + * Show the queue of functions to be executed on the matched element. + * + * @param element A DOM element to inspect for an attached queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see {@link https://api.jquery.com/jQuery.queue/} + * @since 1.3 + */ + queue(element: Element, queueName?: string): JQuery.Queue; + /** + * Handles errors thrown synchronously in functions wrapped in jQuery(). + * + * @param error An error thrown in the function wrapped in jQuery(). + * @see {@link https://api.jquery.com/jQuery.readyException/} + * @since 3.1 + */ + readyException(error: Error): any; + /** + * Remove a previously-stored piece of data. + * + * @param element A DOM element from which to remove data. + * @param name A string naming the piece of data to remove. + * @see {@link https://api.jquery.com/jQuery.removeData/} + * @since 1.2.3 + */ + removeData(element: Element, name?: string): JQuery; + /** + * Creates an object containing a set of properties ready to be used in the definition of custom animations. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/jQuery.speed/} + * @since 1.1 + */ + speed(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): JQuery.EffectsOptions; + /** + * Creates an object containing a set of properties ready to be used in the definition of custom animations. + * + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/jQuery.speed/} + * @since 1.1 + */ + speed(easing: string, complete: (this: TElement) => void): JQuery.EffectsOptions; + /** + * Creates an object containing a set of properties ready to be used in the definition of custom animations. + * + * @param duration A string or number determining how long the animation will run. + * @param easing_complete_settings A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/jQuery.speed/} + * @since 1.0 + * @since 1.1 + */ + speed(duration: JQuery.Duration, + easing_complete_settings: string | ((this: TElement) => void) | JQuery.SpeedSettings): JQuery.EffectsOptions; + /** + * Creates an object containing a set of properties ready to be used in the definition of custom animations. + * + * @param duration_easing_complete_settings A string or number determining how long the animation will run. + * A string indicating which easing function to use for the transition. + * A function to call once the animation is complete, called once per matched element. + * @see {@link https://api.jquery.com/jQuery.speed/} + * @since 1.0 + * @since 1.1 + */ + speed(duration_easing_complete_settings?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.SpeedSettings): JQuery.EffectsOptions; + /** + * Remove the whitespace from the beginning and end of a string. + * + * @param str The string to trim. + * @see {@link https://api.jquery.com/jQuery.trim/} + * @since 1.0 + */ + trim(str: string): string; + /** + * Determine the internal JavaScript [[Class]] of an object. + * + * @param obj Object to get the internal JavaScript [[Class]] of. + * @see {@link https://api.jquery.com/jQuery.type/} + * @since 1.4.3 + */ + type(obj: any): 'array' | 'boolean' | 'date' | 'error' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'string' | 'symbol' | 'undefined'; + /** + * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on + * arrays of DOM elements, not strings or numbers. + * + * @param array The Array of DOM elements. + * @see {@link https://api.jquery.com/jQuery.unique/} + * @since 1.1.3 + * @deprecated 3.0 + */ + unique(array: T[]): T[]; + /** + * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on + * arrays of DOM elements, not strings or numbers. + * + * @param array The Array of DOM elements. + * @see {@link https://api.jquery.com/jQuery.uniqueSort/} + * @since 1.12-2.2 + */ + uniqueSort(array: T[]): T[]; + when(jqxhr1: JQuery.jqXHR, jqxhr2: JQuery.jqXHR, jqxhr3: JQuery.jqXHR): JQuery.Promise<[T | U | V, string, JQuery.jqXHR]>; + when(jqxhr1: JQuery.jqXHR, jqxhr2: JQuery.jqXHR): JQuery.Promise<[T | U, string, JQuery.jqXHR]>; + when(jqxhr1: JQuery.jqXHR): JQuery.Promise>; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually + * Deferred objects that represent asynchronous events. + * + * @param deferreds Zero or more Thenable objects. + * @see {@link https://api.jquery.com/jQuery.when/} + * @since 1.5 + */ + when(...deferreds: any[]): JQuery.Promise; } +declare namespace JQuery { + type TypeOrArray = T | T[]; + + /** + * A string is designated htmlString in jQuery documentation when it is used to represent one or more + * DOM elements, typically to be created and inserted in the document. When passed as an argument of + * the jQuery() function, the string is identified as HTML if it starts with ) and is parsed + * as such until the final > character. Prior to jQuery 1.9, a string was considered to be HTML if it + * contained anywhere within the string. + */ + type htmlString = string; + /** + * A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most + * cases, the DOM document present in all browsers, but can also be an XML document received via Ajax. + */ + type Selector = string; + + /** + * The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain + * object is, in other words, an Object object. It is designated "plain" in jQuery documentation to + * distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and + * host objects such as document, all of which have a typeof value of "object." + */ + interface PlainObject { + [key: string]: T; + } + + // region Ajax + + /** + * @see {@link http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings} + */ + interface AjaxSettings { + /** + * A set of key/value pairs that map a given dataType to its MIME type, which gets sent in the Accept + * request header. This header tells the server what kind of response it will accept in return. + */ + accepts?: PlainObject; + /** + * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need + * synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests + * do not support synchronous operation. Note that synchronous requests may temporarily lock the + * browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: + * false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback + * options instead of the corresponding methods of the jqXHR object such as jqXHR.done(). + */ + async?: boolean; + /** + * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, + * XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and + * settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend + * function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless + * of the type of request. + */ + beforeSend?(this: TContext, jqXHR: jqXHR, settings: AjaxSettings): false | void; + /** + * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache + * to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" + * to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a + * POST is made to a URL that has already been requested by a GET. + */ + cache?: boolean; + /** + * A function to be called when the request finishes (after success and error callbacks are executed). + * The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a + * string categorizing the status of the request ("success", "notmodified", "nocontent", "error", + * "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of + * functions. Each function will be called in turn. This is an Ajax Event. + */ + complete?: TypeOrArray>; + /** + * An object of string/regular-expression pairs that determine how jQuery will parse the response, + * given its content type. + */ + contents?: PlainObject; + /** + * When sending data to the server, use this content type. Default is + * "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly + * pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). + * As of jQuery 1.6 you can pass false to tell jQuery to not set any content type header. Note: The W3C + * XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset + * will not force the browser to change the encoding. Note: For cross-domain requests, setting the + * content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or + * text/plain will trigger the browser to send a preflight OPTIONS request to the server. + */ + contentType?: string | false; + /** + * This object will be the context of all Ajax-related callbacks. By default, the context is an object + * that represents the Ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). + */ + context?: TContext; + /** + * An object containing dataType-to-dataType converters. Each converter's value is a function that + * returns the transformed value of the response. + */ + converters?: PlainObject<((value: any) => any) | true>; + /** + * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of + * crossDomain to true. This allows, for example, server-side redirection to another domain. + */ + crossDomain?: boolean; + /** + * Data to be sent to the server. It is converted to a query string, if not already a string. It's + * appended to the url for GET-requests. See processData option to prevent this automatic processing. + * Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same + * key based on the value of the traditional setting (described below). + */ + data?: PlainObject | string | any[]; + /** + * A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering + * function to sanitize the response. You should return the sanitized data. The function accepts two + * arguments: The raw data returned from the server and the 'dataType' parameter. + */ + dataFilter?(data: string, type: string): any; + /** + * The type of data that you're expecting back from the server. If none is specified, jQuery will try + * to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON + * will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be + * returned as a string). The available types (and the result passed as the first argument to your + * success callback) are: + * + * "xml": Returns a XML document that can be processed via jQuery. + * + * "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM. + * + * "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by + * appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to + * true. Note: This will turn POSTs into GETs for remote-domain requests. + * + * "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests + * are converted to "jsonp" unless the request includes jsonp: false in its request options. The JSON + * data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of + * jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} + * instead. (See json.org for more information on proper JSON formatting.) + * + * "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to + * specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to + * the URL unless the cache option is set to true. + * + * "text": A plain text string. + * + * multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it + * received in the Content-Type header to what you require. For example, if you want a text response to + * be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it + * received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string + * such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from + * jsonp to text, and then from text to xml. + */ + dataType?: 'xml' | 'html' | 'script' | 'json' | 'jsonp' | 'text' | string; + /** + * A function to be called if the request fails. The function receives three arguments: The jqXHR (in + * jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an + * optional exception object, if one occurred. Possible values for the second argument (besides null) + * are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives + * the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery + * 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: + * This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. + */ + error?: TypeOrArray>; + /** + * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to + * prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to + * control various Ajax Events. + */ + global?: boolean; + /** + * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest + * transport. The header X-Requested-With: XMLHttpRequest is always added, but its default + * XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from + * within the beforeSend function. + */ + headers?: PlainObject; + /** + * Allow the request to be successful only if the response has changed since the last request. This is + * done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery + * 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. + */ + ifModified?: boolean; + /** + * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery + * does not recognize it as such by default. The following protocols are currently recognized as local: + * file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so + * once in the $.ajaxSetup() method. + */ + isLocal?: boolean; + /** + * Override the callback function name in a JSONP request. This value will be used instead of + * 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would + * result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false + * prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for + * transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, + * { jsonp: false, jsonpCallback: "callbackName" }. If you don't trust the target of your Ajax + * requests, consider setting the jsonp property to false for security reasons. + */ + jsonp?: string | boolean; + /** + * Specify the callback function name for a JSONP request. This value will be used instead of the + * random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name + * as it'll make it easier to manage the requests and provide callbacks and error handling. You may + * want to specify the callback when you want to enable better browser caching of GET requests. As of + * jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback + * is set to the return value of that function. + */ + jsonpCallback?: string | ((this: TContext) => string); + /** + * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). + */ + method?: string; + /** + * A mime type to override the XHR mime type. + */ + mimeType?: string; + /** + * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + password?: string; + /** + * By default, data passed in to the data option as an object (technically, anything other than a + * string) will be processed and transformed into a query string, fitting to the default content-type + * "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, + * set this option to false. + */ + processData?: boolean; + /** + * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or + * "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. + * Used when the character set on the local page is not the same as the one on the remote script. + */ + scriptCharset?: string; + /** + * An object of numeric HTTP codes and functions to be called when the response has the corresponding + * code. + * + * If the request is successful, the status code functions take the same parameters as the success + * callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. + */ + statusCode?: PlainObject | Ajax.ErrorCallback>; + /** + * A function to be called if the request succeeds. The function gets passed three arguments: The data + * returned from the server, formatted according to the dataType parameter or the dataFilter callback + * function, if specified; a string describing the status; and the jqXHR (in jQuery 1.4.x, + * XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each + * function will be called in turn. This is an Ajax Event. + */ + success?: TypeOrArray>; + /** + * Set a timeout (in milliseconds) for the request. A value of 0 means there will be no timeout. This + * will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the + * $.ajax call is made; if several other requests are in progress and the browser has no connections + * available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and + * below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any + * object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be + * cancelled by a timeout; the script will run even if it arrives after the timeout period. + */ + timeout?: number; + /** + * Set this to true if you wish to use the traditional style of param serialization. + */ + traditional?: boolean; + /** + * An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0. + */ + type?: string; + /** + * A string containing the URL to which the request is sent. + */ + url?: string; + /** + * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + username?: string; + /** + * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), + * the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or + * enhancements to the factory. + */ + xhr?(): XMLHttpRequest; + /** + * An object of fieldName-fieldValue pairs to set on the native XHR object. + * + * In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS + * requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ + * should you require the use of it. + */ + xhrFields?: PlainObject; + } + + namespace Ajax { + type SuccessTextStatus = 'success' | 'notmodified' | 'nocontent'; + type ErrorTextStatus = 'timeout' | 'error' | 'abort' | 'parsererror'; + type TextStatus = SuccessTextStatus | ErrorTextStatus; + + interface SuccessCallback { + (this: TContext, data: any, textStatus: SuccessTextStatus, jqXHR: JQuery.jqXHR): void; + } + + interface ErrorCallback { + (this: TContext, jqXHR: jqXHR, textStatus: ErrorTextStatus | null, errorThrown: string): void; + } + + interface CompleteCallback { + (this: TContext, jqXHR: jqXHR, textStatus: SuccessTextStatus | ErrorTextStatus): void; + } + } + + interface Transport { + send(headers: PlainObject, completeCallback: Transport.SuccessCallback): void; + abort(): void; + } + + namespace Transport { + interface SuccessCallback { + (status: number, statusText: Ajax.TextStatus, responses?: PlainObject, headers?: string): void; + } + } + + /** + * @see {@link http://api.jquery.com/jquery.ajax/#jqXHR} + */ + interface jqXHR extends Pick { + responseJSON: any; + statusCode(map: PlainObject | Ajax.ErrorCallback>): void; + + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + * @see {@link https://api.jquery.com/deferred.always/} + * @since 1.6 + */ + always(alwaysCallback: TypeOrArray>, + ...alwaysCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failFilter A function that is called when the Deferred is rejected. + * @see {@link https://api.jquery.com/deferred.catch/} + * @since 3.0 + */ + catch(failFilter: (reason: any) => UReject | Thenable): this; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + * @see {@link https://api.jquery.com/deferred.done/} + * @since 1.5 + */ + done(doneCallback: TypeOrArray>, + ...doneCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + * @see {@link https://api.jquery.com/deferred.fail/} + * @since 1.5 + */ + fail(failCallback: TypeOrArray, + ...failCallbacks: Array>): this; + /** + * Utility method to filter and/or chain Deferreds. + * + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see {@link https://api.jquery.com/deferred.pipe/} + * @since 1.6 + * @since 1.7 + * @deprecated 1.8 + */ + pipe(doneFilter: ((data: TResolve, textStatus: Ajax.SuccessTextStatus, jqXHR: this) => UResolve | Thenable) | null, + failFilter?: ((jqXHR: this, textStatus: Ajax.ErrorTextStatus, errorThrown: string) => UReject | Thenable) | null): jqXHR; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. + * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates + * progress notifications. + * @see {@link https://api.jquery.com/deferred.progress/} + * @since 1.7 + */ + progress(progressCallback: TypeOrArray, + ...progressCallbacks: Array>): this; + /** + * Return a Deferred's Promise object. + * + * @param target Object onto which the promise methods have to be attached + * @see {@link https://api.jquery.com/deferred.promise/} + * @since 1.5 + */ + promise(target: TTarget): JQuery.Promise & TTarget; + /** + * Return a Deferred's Promise object. + * + * @see {@link https://api.jquery.com/deferred.promise/} + * @since 1.5 + */ + promise(): JQuery.Promise; + /** + * Determine the current state of a Deferred object. + * + * @see {@link https://api.jquery.com/deferred.state/} + * @since 1.7 + */ + state(): 'pending' | 'resolved' | 'rejected'; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see {@link https://api.jquery.com/deferred.then/} + * @since 1.8 + */ + then(doneFilter: ((data: TResolve, textStatus: Ajax.SuccessTextStatus, jqXHR: this) => UResolve | Thenable) | null, + failFilter?: ((jqXHR: this, textStatus: Ajax.ErrorTextStatus, errorThrown: string) => UReject | Thenable) | null): jqXHR; + } + + namespace jqXHR { + interface DoneCallback { + (data: TResolve, textStatus: Ajax.SuccessTextStatus, jqXHR: jqXHR): void; + } + + interface FailCallback { + (jqXHR: this, textStatus: Ajax.ErrorTextStatus | null, errorThrown: string): void; + } + + interface AlwaysCallback { + (data_jqXHR: TResolve | jqXHR, textStatus: Ajax.TextStatus, jqXHR_errorThrown: jqXHR | string): void; + } + + interface ProgressCallback { + (...values: any[]): void; + } + } + + // endregion + + // region Callbacks + + interface Callbacks { + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + * @see {@link https://api.jquery.com/callbacks.add/} + * @since 1.7 + */ + add(callbacks: TypeOrArray): this; + /** + * Disable a callback list from doing anything more. + * + * @see {@link https://api.jquery.com/callbacks.disable/} + * @since 1.7 + */ + disable(): this; + /** + * Determine if the callbacks list has been disabled. + * + * @see {@link https://api.jquery.com/callbacks.disabled/} + * @since 1.7 + */ + disabled(): boolean; + /** + * Remove all of the callbacks from a list. + * + * @see {@link https://api.jquery.com/callbacks.empty/} + * @since 1.7 + */ + empty(): this; + /** + * Call all of the callbacks with the given arguments. + * + * @param args The argument or list of arguments to pass back to the callback list. + * @see {@link https://api.jquery.com/callbacks.fire/} + * @since 1.7 + */ + fire(...args: any[]): this; + /** + * Call all callbacks in a list with the given context and arguments. + * + * @param context A reference to the context in which the callbacks in the list should be fired. + * @param args An argument, or array of arguments, to pass to the callbacks in the list. + * @see {@link https://api.jquery.com/callbacks.fireWith/} + * @since 1.7 + */ + fireWith(context?: object, args?: TypeOrArray): this; + /** + * Determine if the callbacks have already been called at least once. + * + * @see {@link https://api.jquery.com/callbacks.fired/} + * @since 1.7 + */ + fired(): boolean; + /** + * Determine whether or not the list has any callbacks attached. If a callback is provided as an + * argument, determine whether it is in a list. + * + * @param callback The callback to search for. + * @see {@link https://api.jquery.com/callbacks.has/} + * @since 1.7 + */ + has(callback?: Function): boolean; + /** + * Lock a callback list in its current state. + * + * @see {@link https://api.jquery.com/callbacks.lock/} + * @since 1.7 + */ + lock(): this; + /** + * Determine if the callbacks list has been locked. + * + * @see {@link https://api.jquery.com/callbacks.locked/} + * @since 1.7 + */ + locked(): boolean; + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + * @see {@link https://api.jquery.com/callbacks.remove/} + * @since 1.7 + */ + remove(callbacks: TypeOrArray): this; + } + + // endregion + + // region CSS + + interface CSSHook { + get(this: this, elem: TElement, computed: any, extra: any): any; + set(this: this, elem: TElement, value: any): void; + } + + // endregion + + // region Deferred + + /** + * Any object that has a then method. + */ + interface Thenable extends PromiseLike { } + + interface Deferred { + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + * @see {@link https://api.jquery.com/deferred.always/} + * @since 1.6 + */ + always(alwaysCallback: TypeOrArray>, + ...alwaysCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failFilter A function that is called when the Deferred is rejected. + * @see {@link https://api.jquery.com/deferred.catch/} + * @since 3.0 + */ + catch(failFilter: (...reasons: TReject[]) => UReject | Thenable): Deferred; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + * @see {@link https://api.jquery.com/deferred.done/} + * @since 1.5 + */ + done(doneCallback: TypeOrArray>, + ...doneCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + * @see {@link https://api.jquery.com/deferred.fail/} + * @since 1.5 + */ + fail(failCallback: TypeOrArray>, + ...failCallbacks: Array>>): this; + /** + * Call the progressCallbacks on a Deferred object with the given args. + * + * @param args Optional arguments that are passed to the progressCallbacks. + * @see {@link https://api.jquery.com/deferred.notify/} + * @since 1.7 + */ + notify(...args: TNotify[]): this; + /** + * Call the progressCallbacks on a Deferred object with the given context and args. + * + * @param context Context passed to the progressCallbacks as the this object. + * @param args An optional array of arguments that are passed to the progressCallbacks. + * @see {@link https://api.jquery.com/deferred.notifyWith/} + * @since 1.7 + */ + notifyWith(context: object, ...args: TNotify[]): this; + /** + * Utility method to filter and/or chain Deferreds. + * + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see {@link https://api.jquery.com/deferred.pipe/} + * @since 1.6 + * @since 1.7 + * @deprecated 1.8 + */ + pipe(doneFilter: ((...values: TResolve[]) => UResolve | Thenable) | null, + failFilter?: ((...reasons: TReject[]) => UReject | Thenable) | null, + progressFilter?: ((...values: TNotify[]) => TNotify | Thenable) | null): Deferred; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. + * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates + * progress notifications. + * @see {@link https://api.jquery.com/deferred.progress/} + * @since 1.7 + */ + progress(progressCallback: TypeOrArray>, + ...progressCallbacks: Array>>): this; + /** + * Return a Deferred's Promise object. + * + * @param target Object onto which the promise methods have to be attached + * @see {@link https://api.jquery.com/deferred.promise/} + * @since 1.5 + */ + promise(target: TTarget): JQuery.Promise & TTarget; + /** + * Return a Deferred's Promise object. + * + * @see {@link https://api.jquery.com/deferred.promise/} + * @since 1.5 + */ + promise(): JQuery.Promise; + /** + * Reject a Deferred object and call any failCallbacks with the given args. + * + * @param args Optional arguments that are passed to the failCallbacks. + * @see {@link https://api.jquery.com/deferred.reject/} + * @since 1.5 + */ + reject(...args: TReject[]): this; + /** + * Reject a Deferred object and call any failCallbacks with the given context and args. + * + * @param context Context passed to the failCallbacks as the this object. + * @param args An optional array of arguments that are passed to the failCallbacks. + * @see {@link https://api.jquery.com/deferred.rejectWith/} + * @since 1.5 + */ + rejectWith(context: object, ...args: TReject[]): this; + /** + * Resolve a Deferred object and call any doneCallbacks with the given args. + * + * @param args Optional arguments that are passed to the doneCallbacks. + * @see {@link https://api.jquery.com/deferred.resolve/} + * @since 1.5 + */ + resolve(...args: TResolve[]): this; + /** + * Resolve a Deferred object and call any doneCallbacks with the given context and args. + * + * @param context Context passed to the doneCallbacks as the this object. + * @param args An optional array of arguments that are passed to the doneCallbacks. + * @see {@link https://api.jquery.com/deferred.resolveWith/} + * @since 1.5 + */ + resolveWith(context: object, ...args: TResolve[]): this; + /** + * Determine the current state of a Deferred object. + * + * @see {@link https://api.jquery.com/deferred.state/} + * @since 1.7 + */ + state(): 'pending' | 'resolved' | 'rejected'; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see {@link https://api.jquery.com/deferred.then/} + * @since 1.8 + */ + then(doneFilter: ((...values: TResolve[]) => UResolve | Thenable) | null, + failFilter?: ((...reasons: TReject[]) => UReject | Thenable) | null, + progressFilter?: ((...values: TNotify[]) => TNotify | Thenable) | null): Deferred; + } + + namespace Deferred { + interface DoneCallback { + (...values: TResolve[]): void; + } + + interface FailCallback { + (...reasons: TReject[]): void; + } + + interface AlwaysCallback { + (...values_reasons: Array): void; + } + + interface ProgressCallback { + (...values: TNotify[]): void; + } + } + + /** + * This object provides a subset of the methods of the Deferred object (then, done, fail, always, + * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. + * + * @see {@link http://api.jquery.com/Types/#Promise} + */ + interface Promise extends Pick, + 'always' | 'done' | 'fail' | 'progress' | 'promise' | 'state'> { + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failFilter A function that is called when the Deferred is rejected. + * @see {@link https://api.jquery.com/deferred.catch/} + * @since 3.0 + */ + catch(failFilter: (...reasons: TReject[]) => UReject | Thenable): Promise; + /** + * Utility method to filter and/or chain Deferreds. + * + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see {@link https://api.jquery.com/deferred.pipe/} + * @since 1.6 + * @since 1.7 + * @deprecated 1.8 + */ + pipe(doneFilter: ((...values: TResolve[]) => UResolve | Thenable) | null, + failFilter?: ((...reasons: TReject[]) => UReject | Thenable) | null, + progressFilter?: ((...values: TNotify[]) => TNotify | Thenable) | null): Promise; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see {@link https://api.jquery.com/deferred.then/} + * @since 1.8 + */ + then(doneFilter: ((...values: TResolve[]) => UResolve | Thenable) | null, + failFilter?: ((...reasons: TReject[]) => UReject | Thenable) | null, + progressFilter?: ((...values: TNotify[]) => TNotify | Thenable) | null): Promise; + } + + // endregion + + // region Effects + + type Duration = number | 'fast' | 'slow'; + type Queue = { 0: string; } & Array>; + + interface QueueFunction { + (this: TElement, next: () => void): void; + } + + /** + * @see {@link https://api.jquery.com/animate/#animate-properties-options} + */ + interface EffectsOptions { + /** + * A function to be called when the animation on an element completes or stops without completing (its + * Promise object is either resolved or rejected). + */ + always?(this: TElement, animation: JQuery.Promise, jumpedToEnd: boolean): void; + /** + * A function that is called once the animation on an element is complete. + */ + complete?(this: TElement): void; + /** + * A function to be called when the animation on an element completes (its Promise object is resolved). + */ + done?(this: TElement, animation: JQuery.Promise, jumpedToEnd: boolean): void; + /** + * A string or number determining how long the animation will run. + */ + duration?: Duration; + /** + * A string indicating which easing function to use for the transition. + */ + easing?: string; + /** + * A function to be called when the animation on an element fails to complete (its Promise object is rejected). + */ + fail?(this: TElement, animation: JQuery.Promise, jumpedToEnd: boolean): void; + /** + * A function to be called after each step of the animation, only once per animated element regardless + * of the number of animated properties. + */ + progress?(this: TElement, animation: JQuery.Promise, progress: number, remainingMs: number): void; + /** + * A Boolean indicating whether to place the animation in the effects queue. If false, the animation + * will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case + * the animation is added to the queue represented by that string. When a custom queue name is used the + * animation does not automatically start; you must call .dequeue("queuename") to start it. + */ + queue?: boolean | string; + /** + * An object containing one or more of the CSS properties defined by the properties argument and their + * corresponding easing functions. + */ + specialEasing?: PlainObject; + /** + * A function to call when the animation on an element begins. + */ + start?(this: TElement, animation: JQuery.Promise): void; + /** + * A function to be called for each animated property of each animated element. This function provides + * an opportunity to modify the Tween object to change the value of the property before it is set. + */ + step?(this: TElement, now: number, tween: Tween): void; + } + + interface SpeedSettings { + /** + * A string or number determining how long the animation will run. + */ + duration?: Duration; + /** + * A string indicating which easing function to use for the transition. + */ + easing?: string; + /** + * A function to call once the animation is complete. + */ + complete?(this: TElement): void; + } + + // Undocumented + // https://github.com/jquery/api.jquery.com/issues/391 + // https://github.com/jquery/api.jquery.com/issues/61 + class Tween { + easing: string; + elem: TElement; + end: number; + now: number; + options: EffectsOptions; + pos: number; + prop: string; + start: number; + unit: string; + } + + interface AnimationHook { + (fx: JQuery.Tween): void; + } + + // endregion + + // region Events + + class Event { + /** + * The current DOM element within the event bubbling phase. + * + * @see {@link https://api.jquery.com/event.currentTarget/} + * @since 1.3 + */ + currentTarget: TElement; + /** + * An optional object of data passed to an event method when the current executing handler is bound. + * + * @see {@link https://api.jquery.com/event.data/} + * @since 1.1 + */ + data: TData; + /** + * The element where the currently-called jQuery event handler was attached. + * + * @see {@link https://api.jquery.com/event.delegateTarget/} + * @since 1.7 + */ + delegateTarget: TElement; + /** + * Indicates whether the META key was pressed when the event fired. + * + * @see {@link https://api.jquery.com/event.metaKey/} + * @since 1.0.4 + */ + metaKey: boolean; + /** + * The namespace specified when the event was triggered. + * + * @see {@link https://api.jquery.com/event.namespace/} + * @since 1.4.3 + */ + namespace: string; + /** + * The mouse position relative to the left edge of the document. + * + * @see {@link https://api.jquery.com/event.pageX/} + * @since 1.0.4 + */ + pageX: number; + /** + * The mouse position relative to the top edge of the document. + * + * @see {@link https://api.jquery.com/event.pageY/} + * @since 1.0.4 + */ + pageY: number; + /** + * The other DOM element involved in the event, if any. + * + * @see {@link https://api.jquery.com/event.relatedTarget/} + * @since 1.1.4 + */ + relatedTarget: TElement | null; + /** + * The last value returned by an event handler that was triggered by this event, unless the value was undefined. + * + * @see {@link https://api.jquery.com/event.result/} + * @since 1.3 + */ + result: any; + /** + * The DOM element that initiated the event. + * + * @see {@link https://api.jquery.com/event.target/} + * @since 1.0 + */ + target: TElement; + /** + * The difference in milliseconds between the time the browser created the event and January 1, 1970. + * + * @see {@link https://api.jquery.com/event.timeStamp/} + * @since 1.2.6 + */ + timeStamp: number; + /** + * Describes the nature of the event. + * + * @see {@link https://api.jquery.com/event.type/} + * @since 1.0 + */ + type: string; + /** + * For key or mouse events, this property indicates the specific key or button that was pressed. + * + * @see {@link https://api.jquery.com/event.which/} + * @since 1.1.3 + */ + which: number; + + /** + * Returns whether event.preventDefault() was ever called on this event object. + * + * @see {@link https://api.jquery.com/event.isDefaultPrevented/} + * @since 1.3 + */ + isDefaultPrevented(): boolean; + + /** + * Returns whether event.stopImmediatePropagation() was ever called on this event object. + * + * @see {@link https://api.jquery.com/event.isImmediatePropagationStopped/} + * @since 1.3 + */ + isImmediatePropagationStopped(): boolean; + + /** + * Returns whether event.stopPropagation() was ever called on this event object. + * + * @see {@link https://api.jquery.com/event.isPropagationStopped/} + * @since 1.3 + */ + isPropagationStopped(): boolean; + + /** + * If this method is called, the default action of the event will not be triggered. + * + * @see {@link https://api.jquery.com/event.preventDefault/} + * @since 1.0 + */ + preventDefault(): void; + + /** + * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. + * + * @see {@link https://api.jquery.com/event.stopImmediatePropagation/} + * @since 1.3 + */ + stopImmediatePropagation(): void; + + /** + * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. + * + * @see {@link https://api.jquery.com/event.stopPropagation/} + * @since 1.0 + */ + stopPropagation(): void; + } + + interface Event extends Partial> { + originalTarget?: TElement; + originalEvent: _Event; + new(event: string, properties?: T): JQuery.Event & T; + new(properties: T): JQuery.Event & T; + (event: string, properties?: T): JQuery.Event & T; + (properties: T): JQuery.Event & T; + } + + // Extra parameters can be passed from trigger() + interface EventHandler { + (this: TElement, eventObject: JQuery.Event, ...args: any[]): void | false | any; + } + + // Provided for convenience for use with jQuery.Event.which + const enum Mouse { + None = 0, + Left = 1, + Middle = 2, + Right = 3 + } + + // Provided for convenience for use with jQuery.Event.which + const enum Key { + Backspace = 8, + Tab = 9, + Enter = 13, + Shift = 16, + Control = 17, + Alt = 18, + CapsLock = 20, + Escape = 27, + Space = 32, + PageUp = 33, + PageDown = 34, + End = 35, + Home = 36, + ArrowLeft = 37, + ArrowUp = 38, + ArrowRight = 39, + ArrowDown = 40, + + Semicolon = 186, + Colon = 186, + EqualsSign = 187, + Plus = 187, + Comma = 188, + LessThanSign = 188, + Minus = 189, + Underscore = 189, + Period = 190, + GreaterThanSign = 190, + ForwardSlash = 191, + QuestionMark = 191, + Backtick = 192, + Tilde = 192, + OpeningSquareBracket = 219, + OpeningCurlyBrace = 219, + Backslash = 220, + Pipe = 220, + ClosingSquareBracket = 221, + ClosingCurlyBrace = 221, + SingleQuote = 222, + DoubleQuote = 222, + + Pause = 19, + PrintScreen = 44, + Insert = 45, + Delete = 46, + Num0 = 48, + Num1 = 49, + Num2 = 50, + Num3 = 51, + Num4 = 52, + Num5 = 53, + Num6 = 54, + Num7 = 55, + Num8 = 56, + Num9 = 57, + A = 65, + B = 66, + C = 67, + D = 68, + E = 69, + F = 70, + G = 71, + H = 72, + I = 73, + J = 74, + K = 75, + L = 76, + M = 77, + N = 78, + O = 79, + P = 80, + Q = 81, + R = 82, + S = 83, + T = 84, + U = 85, + V = 86, + W = 87, + X = 88, + Y = 89, + Z = 90, + MetaLeft = 91, + MetaRight = 92, + ContextMenu = 93, + Numpad0 = 96, + Numpad1 = 97, + Numpad2 = 98, + Numpad3 = 99, + Numpad4 = 100, + Numpad5 = 101, + Numpad6 = 102, + Numpad7 = 103, + Numpad8 = 104, + Numpad9 = 105, + NumpadMultiply = 106, + NumpadAdd = 107, + NumpadSubtract = 109, + NumpadDecimal = 110, + NumpadDivide = 111, + F1 = 112, + F2 = 113, + F3 = 114, + F4 = 115, + F5 = 116, + F6 = 117, + F7 = 118, + F8 = 119, + F9 = 120, + F10 = 121, + F11 = 122, + F12 = 123, + NumLock = 144, + ScrollLock = 145 + } + + // endregion + + interface NameValuePair { + name: string; + value: string; + } + + interface Coordinates { + left: number; + top: number; + } + + interface ValHook { + get?(elem: TElement): any; + set?(elem: TElement, value: any): any; + } +} + +// region Legacy types + +interface JQueryCallback extends JQuery.Callbacks { } +interface JQueryDeferred extends JQuery.Deferred { } +interface JQueryEventObject extends JQuery.Event { } +interface JQueryEventConstructor extends JQuery.Event { } +interface JQueryDeferred extends JQuery.Deferred { } +interface JQueryAjaxSettings extends JQuery.AjaxSettings { } +interface JQueryAnimationOptions extends JQuery.EffectsOptions { } +interface JQueryCoordinates extends JQuery.Coordinates { } +interface JQueryGenericPromise extends JQuery.Thenable { } +interface JQueryXHR extends JQuery.jqXHR { } +interface JQueryPromise extends JQuery.Promise { } +interface JQuerySerializeArrayElement extends JQuery.NameValuePair { } + /** - * Interface for the JQuery promise/deferred callbacks + * @deprecated 1.9 + */ +interface JQuerySupport extends JQuery.PlainObject { } + +// Legacy types that are not represented in the current type definitions are marked deprecated. + +/** + * @deprecated */ interface JQueryPromiseCallback { (value?: T, ...args: any[]): void; } - -interface JQueryPromiseOperator { - (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; -} - /** - * Interface for the JQuery promise, part of callbacks - * @see {@link https://api.jquery.com/category/deferred-object/} + * @deprecated */ -interface JQueryPromise extends JQueryGenericPromise { +interface JQueryParam { /** - * Determine the current state of a Deferred object. - * @see {@link https://api.jquery.com/deferred.state/} - */ - state(): string; - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. * - * @param alwaysCallback1 A function, or array of functions, that is called when the Deferred is resolved or rejected. - * @param alwaysCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. - * @see {@link https://api.jquery.com/deferred.always/} + * @param obj An array or object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. */ - always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallback1 A function, or array of functions, that are called when the Deferred is resolved. - * @param doneCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. - * @see {@link https://api.jquery.com/deferred.done/} - */ - done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallback1 A function, or array of functions, that are called when the Deferred is rejected. - * @param failCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.fail/} - */ - fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallback1 A function, or array of functions, to be called when the Deferred generates progress notifications. - * @param progressCallbackN Optional additional functions, or arrays of functions, to be called when the Deferred generates progress notifications. - * @see {@link https://api.jquery.com/deferred.progress/} - */ - progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - - // Deprecated - given no typings - pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; - - /** - * Return a Deferred's Promise object. - * - * @param target Object onto which the promise methods have to be attached - * @see {@link https://api.jquery.com/deferred.promise/} - */ - promise(target?: any): JQueryPromise; + (obj: any, traditional?: boolean): string; } - /** - * Interface for the JQuery deferred, part of callbacks - * @see {@link https://api.jquery.com/category/deferred-object/} - */ -interface JQueryDeferred extends JQueryGenericPromise { - /** - * Determine the current state of a Deferred object. - * @see {@link https://api.jquery.com/deferred.state/} - */ - state(): string; - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. - * - * @param alwaysCallback1 A function, or array of functions, that is called when the Deferred is resolved or rejected. - * @param alwaysCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. - * @see {@link https://api.jquery.com/deferred.always/} - */ - always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallback1 A function, or array of functions, that are called when the Deferred is resolved. - * @param doneCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. - * @see {@link https://api.jquery.com/deferred.done/} - */ - done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallback1 A function, or array of functions, that are called when the Deferred is rejected. - * @param failCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.fail/} - */ - fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallback1 A function, or array of functions, to be called when the Deferred generates progress notifications. - * @param progressCallbackN Optional additional functions, or arrays of functions, to be called when the Deferred generates progress notifications. - * @see {@link https://api.jquery.com/deferred.progress/} - */ - progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - - /** - * Call the progressCallbacks on a Deferred object with the given args. - * - * @param args Optional arguments that are passed to the progressCallbacks. - * @see {@link https://api.jquery.com/deferred.notify/} - */ - notify(value?: any, ...args: any[]): JQueryDeferred; - - /** - * Call the progressCallbacks on a Deferred object with the given context and args. - * - * @param context Context passed to the progressCallbacks as the this object. - * @param args Optional arguments that are passed to the progressCallbacks. - * @see {@link https://api.jquery.com/deferred.notifyWith/} - */ - notifyWith(context: any, args?: any[]): JQueryDeferred; - - /** - * Reject a Deferred object and call any failCallbacks with the given args. - * - * @param args Optional arguments that are passed to the failCallbacks. - * @see {@link https://api.jquery.com/deferred.reject/} - */ - reject(value?: any, ...args: any[]): JQueryDeferred; - /** - * Reject a Deferred object and call any failCallbacks with the given context and args. - * - * @param context Context passed to the failCallbacks as the this object. - * @param args An optional array of arguments that are passed to the failCallbacks. - * @see {@link https://api.jquery.com/deferred.rejectWith/} - */ - rejectWith(context: any, args?: any[]): JQueryDeferred; - - /** - * Resolve a Deferred object and call any doneCallbacks with the given args. - * - * @param value First argument passed to doneCallbacks. - * @param args Optional subsequent arguments that are passed to the doneCallbacks. - * @see {@link https://api.jquery.com/deferred.resolve/} - */ - resolve(value?: T, ...args: any[]): JQueryDeferred; - - /** - * Resolve a Deferred object and call any doneCallbacks with the given context and args. - * - * @param context Context passed to the doneCallbacks as the this object. - * @param args An optional array of arguments that are passed to the doneCallbacks. - * @see {@link https://api.jquery.com/deferred.resolveWith/} - */ - resolveWith(context: any, args?: T[]): JQueryDeferred; - - /** - * Return a Deferred's Promise object. - * - * @param target Object onto which the promise methods have to be attached - * @see {@link https://api.jquery.com/deferred.promise/} - */ - promise(target?: any): JQueryPromise; - - // Deprecated - given no typings - pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; -} - -/** - * Interface of the JQuery extension of the W3C event object - * @see {@link https://api.jquery.com/category/events/event-object/} + * @deprecated */ interface BaseJQueryEventObject extends Event { /** @@ -601,14 +4558,18 @@ interface BaseJQueryEventObject extends Event { */ metaKey: boolean; } - +/** + * @deprecated + */ interface JQueryInputEventObject extends BaseJQueryEventObject { altKey: boolean; ctrlKey: boolean; metaKey: boolean; shiftKey: boolean; } - +/** + * @deprecated + */ interface JQueryMouseEventObject extends JQueryInputEventObject { button: number; clientX: number; @@ -620,3198 +4581,35 @@ interface JQueryMouseEventObject extends JQueryInputEventObject { screenX: number; screenY: number; } - +/** + * @deprecated + */ interface JQueryKeyEventObject extends JQueryInputEventObject { char: any; charCode: number; key: any; keyCode: number; } - -interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ -} - /** - * A collection of properties that represent the presence of different browser features or bugs. - * - * Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally - * to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the - * use of an external library such as {@link http://modernizr.com/|Modernizr} instead of dependency on properties - * in jQuery.support. - * - * @deprecated since version 1.9 + * @deprecated */ -interface JQuerySupport { - ajax?: boolean; - boxModel?: boolean; - changeBubbles?: boolean; - checkClone?: boolean; - checkOn?: boolean; - cors?: boolean; - cssFloat?: boolean; - hrefNormalized?: boolean; - htmlSerialize?: boolean; - leadingWhitespace?: boolean; - noCloneChecked?: boolean; - noCloneEvent?: boolean; - opacity?: boolean; - optDisabled?: boolean; - optSelected?: boolean; - scriptEval? (): boolean; - style?: boolean; - submitBubbles?: boolean; - tbody?: boolean; +interface JQueryPromiseOperator { + (callback1: JQuery.TypeOrArray>, + ...callbacksN: Array>>): JQueryPromise; } - -interface JQueryParam { - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * - * @param obj An array or object to serialize. - */ - (obj: any): string; - - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * - * @param obj An array or object to serialize. - * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. - */ - (obj: any, traditional: boolean): string; -} - /** - * The interface used to construct jQuery events (with $.Event). It is - * defined separately instead of inline in JQueryStatic to allow - * overriding the construction function with specific strings - * returning specific event objects. + * @deprecated */ -interface JQueryEventConstructor { - (name: string, eventProperties?: any): JQueryEventObject; - new (name: string, eventProperties?: any): JQueryEventObject; -} - -/** - * The interface used to specify coordinates. - */ -interface JQueryCoordinates { - left: number; - top: number; -} - -/** - * Elements in the array returned by serializeArray() - */ -interface JQuerySerializeArrayElement { - name: string; - value: string; -} - -/** - * @see {@link https://api.jquery.com/animate/} - */ -interface JQueryAnimationOptions { - /** - * A string or number determining how long the animation will run. - */ - duration?: any; - /** - * A string indicating which easing function to use for the transition. - */ - easing?: string; - /** - * A function to call once the animation is complete. - */ - complete?: Function; - /** - * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. - */ - step?: (now: number, tween: any) => any; - /** - * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) - */ - progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; - /** - * A function to call when the animation begins. (version added: 1.8) - */ - start?: (animation: JQueryPromise) => any; - /** - * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) - */ - done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; - /** - * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) - */ - fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; - /** - * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) - */ - always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; - /** - * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. - */ - queue?: any; - /** - * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) - */ - specialEasing?: Object; -} - interface JQueryEasingFunction { - ( percent: number ): number; + (percent: number): number; } - +/** + * @deprecated + */ interface JQueryEasingFunctions { - [ name: string ]: JQueryEasingFunction; + [name: string]: JQueryEasingFunction; linear: JQueryEasingFunction; swing: JQueryEasingFunction; } -/** - * Static members of jQuery (those on $ and jQuery themselves) - * - * @see {@link https://api.jquery.com/Types/#jQuery} - */ -interface JQueryStatic { - - /** - * Perform an asynchronous HTTP (Ajax) request. - * - * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). - * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings} - */ - ajax(settings: JQueryAjaxSettings): JQueryXHR; - /** - * Perform an asynchronous HTTP (Ajax) request. - * - * @param url A string containing the URL to which the request is sent. - * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). - * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-url-settings} - */ - ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; - - /** - * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). - * - * @param dataTypes An optional string containing one or more space-separated dataTypes - * @param handler A handler to set default values for future Ajax requests. - * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} - */ - ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - /** - * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). - * - * @param handler A handler to set default values for future Ajax requests. - * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} - */ - ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - - /** - * Creates an object that handles the actual transmission of Ajax data. - * - * @param dataType A string identifying the data type to use. - * @param handler A handler to return the new transport object to use with the data type provided in the first argument. - * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} - */ - ajaxTransport(dataType: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - - ajaxSettings: JQueryAjaxSettings; - - /** - * Set default values for future Ajax requests. Its use is not recommended. - * - * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. - * @see {@link https://api.jquery.com/jQuery.ajaxSetup/} - */ - ajaxSetup(options: JQueryAjaxSettings): void; - - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). - * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-url-data-success-dataType} - */ - get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). - * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-url-data-success-dataType} - */ - get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param settings The JQueryAjaxSettings to be used for the request - * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-settings} - */ - get(settings : JQueryAjaxSettings): JQueryXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - * @see {@link https://api.jquery.com/jQuery.getJSON/} - */ - getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. - * @see {@link https://api.jquery.com/jQuery.getJSON/} - */ - getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; - /** - * Load a JavaScript file from the server using a GET HTTP request, then execute it. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - * @see {@link https://api.jquery.com/jQuery.getScript/} - */ - getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; - - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * - * @see {@link https://api.jquery.com/jQuery.param/} - */ - param: JQueryParam; - - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-url-data-success-dataType} - */ - post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-url-data-success-dataType} - */ - post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param settings The JQueryAjaxSettings to be used for the request - * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-settings} - */ - post(settings : JQueryAjaxSettings): JQueryXHR; - /** - * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. - * - * @param flags An optional list of space-separated flags that change how the callback list behaves. - * @see {@link https://api.jquery.com/jQuery.Callbacks/} - */ - Callbacks(flags?: string): JQueryCallback; - - /** - * Holds or releases the execution of jQuery's ready event. - * - * @param hold Indicates whether the ready hold is being requested or released - * @see {@link https://api.jquery.com/jQuery.holdReady/} - */ - holdReady(hold: boolean): void; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param selector A string containing a selector expression - * @param context A DOM Element, Document, or jQuery to use as context - * @see {@link https://api.jquery.com/jQuery/#jQuery-selector-context} - */ - (selector: string, context?: Element|JQuery): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param element A DOM element to wrap in a jQuery object. - * @see {@link https://api.jquery.com/jQuery/#jQuery-element} - */ - (element: Element): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. - * @see {@link https://api.jquery.com/jQuery/#jQuery-elementArray} - */ - (elementArray: Element[]): JQuery; - - /** - * Binds a function to be executed when the DOM has finished loading. - * - * @param callback A function to execute after the DOM is ready. - * @see {@link https://api.jquery.com/jQuery/#jQuery-callback} - */ - (callback: (jQueryAlias?: JQueryStatic) => any): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param object A plain object to wrap in a jQuery object. - * @see {@link https://api.jquery.com/jQuery/#jQuery-object} - */ - (object: {}): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param object An existing jQuery object to clone. - * @see {@link https://api.jquery.com/jQuery/#jQuery-object} - */ - (object: JQuery): JQuery; - - /** - * Specify a function to execute when the DOM is fully loaded. - * @see {@link https://api.jquery.com/jQuery/#jQuery} - */ - (): JQuery; - - /** - * Creates DOM elements on the fly from the provided string of raw HTML. - * - * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. - * @param ownerDocument A document in which the new elements will be created. - * @see {@link https://api.jquery.com/jQuery/#jQuery-html-ownerDocument} - */ - (html: string, ownerDocument?: Document): JQuery; - - /** - * Creates DOM elements on the fly from the provided string of raw HTML. - * - * @param html A string defining a single, standalone, HTML element (e.g.
or
). - * @param attributes An object of attributes, events, and methods to call on the newly-created element. - * @see {@link https://api.jquery.com/jQuery/#jQuery-html-attributes} - */ - (html: string, attributes: Object): JQuery; - - /** - * Relinquish jQuery's control of the $ variable. - * - * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). - * @see {@link https://api.jquery.com/jQuery.noConflict/} - */ - noConflict(removeAll?: boolean): JQueryStatic; - - /** - * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. - * - * @param deferreds One or more Deferred objects, or plain JavaScript objects. - * @see {@link https://api.jquery.com/jQuery.when/} - */ - when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; - - /** - * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. - * @see {@link https://api.jquery.com/jQuery.cssHooks/} - */ - cssHooks: { [key: string]: any; }; - - /** - * An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values. - * @see {@link https://api.jquery.com/jQuery.cssNumber/} - */ - cssNumber: any; - - /** - * Store arbitrary data associated with the specified element. Returns the value that was set. - * - * @param element The DOM element to associate with the data. - * @param key A string naming the piece of data to set. - * @param value The new data value. - * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element-key-value} - */ - data(element: Element, key: string, value: T): T; - /** - * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. - * - * @param element The DOM element to associate with the data. - * @param key A string naming the piece of data to set. - * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element-key} - */ - data(element: Element, key: string): any; - /** - * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. - * - * @param element The DOM element to associate with the data. - * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element} - */ - data(element: Element): any; - - /** - * Execute the next function on the queue for the matched element. - * - * @param element A DOM element from which to remove and execute a queued function. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/jQuery.dequeue/} - */ - dequeue(element: Element, queueName?: string): void; - - /** - * Determine whether an element has any jQuery data associated with it. - * - * @param element A DOM element to be checked for data. - * @see {@link https://api.jquery.com/jQuery.hasData/} - */ - hasData(element: Element): boolean; - - /** - * Show the queue of functions to be executed on the matched element. - * - * @param element A DOM element to inspect for an attached queue. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName} - */ - queue(element: Element, queueName?: string): any[]; - /** - * Manipulate the queue of functions to be executed on the matched element. - * - * @param element A DOM element where the array of queued functions is attached. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param newQueue An array of functions to replace the current queue contents. - * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName-newQueue} - */ - queue(element: Element, queueName: string, newQueue: Function[]): JQuery; - /** - * Manipulate the queue of functions to be executed on the matched element. - * - * @param element A DOM element on which to add a queued function. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param callback The new function to add to the queue. - * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName-callback} - */ - queue(element: Element, queueName: string, callback: Function): JQuery; - - /** - * Remove a previously-stored piece of data. - * - * @param element A DOM element from which to remove data. - * @param name A string naming the piece of data to remove. - * @see {@link https://api.jquery.com/jQuery.removeData/} - */ - removeData(element: Element, name?: string): JQuery; - - /** - * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. - * - * @param beforeStart A function that is called just before the constructor returns. - * @see {@link https://api.jquery.com/jQuery.Deferred/} - */ - Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred; - - /** - * Effects - */ - - easing: JQueryEasingFunctions; - - fx: { - tick: () => void; - /** - * The rate (in milliseconds) at which animations fire. - * @see {@link https://api.jquery.com/jQuery.fx.interval/} - */ - interval: number; - stop: () => void; - speeds: { slow: number; fast: number; }; - /** - * Globally disable all animations. - * @see {@link https://api.jquery.com/jQuery.fx.off/} - */ - off: boolean; - step: any; - }; - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param func The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. - * @see {@link https://api.jquery.com/jQuery.proxy/#jQuery-proxy-function-context-additionalArguments} - */ - proxy(func: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param context The object to which the context (this) of the function should be set. - * @param name The name of the function whose context will be changed (should be a property of the context object). - * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. - * @see {@link https://api.jquery.com/jQuery.proxy/#jQuery-proxy-context-name-additionalArguments} - */ - proxy(context: Object, name: string, ...additionalArguments: any[]): any; - - Event: JQueryEventConstructor; - - /** - * Takes a string and throws an exception containing it. - * - * @param message The message to send out. - * @see {@link https://api.jquery.com/jQuery.error/} - */ - error(message: any): JQuery; - - expr: any; - readonly fn: JQuery; - - isReady: boolean; - - // Properties - support: JQuerySupport; - - /** - * Check to see if a DOM element is a descendant of another DOM element. - * - * @param container The DOM element that may contain the other element. - * @param contained The DOM element that may be contained by (a descendant of) the other element. - * @see {@link https://api.jquery.com/jQuery.contains/} - */ - contains(container: Element, contained: Element): boolean; - - /** - * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * - * @param collection The object or array to iterate over. - * @param callback The function that will be executed on every object. Will break the loop by returning false. - * @returns the first argument, the object that is iterated. - * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-array-callback} - */ - each( - collection: T[], - callback: (indexInArray: number, valueOfElement: T) => boolean | void - ): T[]; - - /** - * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * - * @param collection The object or array to iterate over. - * @param callback The function that will be executed on every object. Will break the loop by returning false. - * @returns the first argument, the object that is iterated. - * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-object-callback} - */ - each( - collection: T, - // TODO: `(keyInObject: keyof T, valueOfElement: T[keyof T])`, when TypeScript 2.1 allowed in repository - callback: (keyInObject: string, valueOfElement: any) => boolean | void - ): T; - - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. - * @param object1 An object containing additional properties to merge in. - * @param objectN Additional objects containing properties to merge in. - * @see {@link https://api.jquery.com/jQuery.extend/#jQuery-extend-target-object1-objectN} - */ - extend(target: any, object1?: any, ...objectN: any[]): any; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). - * @param target The object to extend. It will receive the new properties. - * @param object1 An object containing additional properties to merge in. - * @param objectN Additional objects containing properties to merge in. - * @see {@link https://api.jquery.com/jQuery.extend/#jQuery-extend-deep-target-object1-objectN} - */ - extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; - - /** - * Execute some JavaScript code globally. - * - * @param code The JavaScript code to execute. - * @see {@link https://api.jquery.com/jQuery.globalEval/} - */ - globalEval(code: string): any; - - /** - * Finds the elements of an array which satisfy a filter function. The original array is not affected. - * - * @param array The array to search through. - * @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. - * @see {@link https://api.jquery.com/jQuery.grep/} - */ - 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). - * - * @param value The value to search for. - * @param array An array through which to search. - * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array. - * @see {@link https://api.jquery.com/jQuery.inArray/} - */ - inArray(value: T, array: T[], fromIndex?: number): number; - - /** - * Determine whether the argument is an array. - * - * @param obj Object to test whether or not it is an array. - * @see {@link https://api.jquery.com/jQuery.isArray/} - */ - isArray(obj: any): obj is Array; - /** - * Check to see if an object is empty (contains no enumerable properties). - * - * @param obj The object that will be checked to see if it's empty. - * @see {@link https://api.jquery.com/jQuery.isEmptyObject/} - */ - isEmptyObject(obj: any): boolean; - /** - * Determine if the argument passed is a JavaScript function object. - * - * @param obj Object to test whether or not it is a function. - * @see {@link https://api.jquery.com/jQuery.isFunction/} - */ - isFunction(obj: any): obj is Function; - /** - * Determines whether its argument is a number. - * - * @param value The value to be tested. - * @see {@link https://api.jquery.com/jQuery.isNumeric/} - */ - isNumeric(value: any): boolean; - /** - * Check to see if an object is a plain object (created using "{}" or "new Object"). - * - * @param obj The object that will be checked to see if it's a plain object. - * @see {@link https://api.jquery.com/jQuery.isPlainObject/} - */ - isPlainObject(obj: any): boolean; - /** - * Determine whether the argument is a window. - * - * @param obj Object to test whether or not it is a window. - * @see {@link https://api.jquery.com/jQuery.isWindow/} - */ - isWindow(obj: any): obj is Window; - /** - * Check to see if a DOM node is within an XML document (or is an XML document). - * - * @param node The DOM node that will be checked to see if it's in an XML document. - * @see {@link https://api.jquery.com/jQuery.isXMLDoc/} - */ - isXMLDoc(node: Node): boolean; - - /** - * Convert an array-like object into a true JavaScript array. - * - * @param obj Any object to turn into a native Array. - * @see {@link https://api.jquery.com/jQuery.makeArray/} - */ - makeArray(obj: any): any[]; - - /** - * Translate all items in an array or object to new array of items. - * - * @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. - * @see {@link https://api.jquery.com/jQuery.map/#jQuery-map-array-callback} - */ - 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. - * @see {@link https://api.jquery.com/jQuery.map/#jQuery-map-object-callback} - */ - map(arrayOrObject: any, callback: (value?: any, indexOrKey?: any) => any): any; - - /** - * Merge the contents of two arrays together into the first array. - * - * @param first The first array to merge, the elements of second added. - * @param second The second array to merge into the first, unaltered. - * @see {@link https://api.jquery.com/jQuery.merge/} - */ - merge(first: T[], second: T[]): T[]; - - /** - * An empty function. - * @see {@link https://api.jquery.com/jQuery.noop/} - */ - noop(): any; - - /** - * Return a number representing the current time. - * @see {@link https://api.jquery.com/jQuery.now/} - */ - now(): number; - - /** - * Takes a well-formed JSON string and returns the resulting JavaScript object. - * - * @param json The JSON string to parse. - * @see {@link https://api.jquery.com/jQuery.parseJSON/} - */ - parseJSON(json: string): any; - - /** - * Parses a string into an XML document. - * - * @param data a well-formed XML string to be parsed - * @see {@link https://api.jquery.com/jQuery.parseXML/} - */ - parseXML(data: string): XMLDocument; - - /** - * Remove the whitespace from the beginning and end of a string. - * - * @param str Remove the whitespace from the beginning and end of a string. - * @see {@link https://api.jquery.com/jQuery.trim/} - */ - trim(str: string): string; - - /** - * Determine the internal JavaScript [[Class]] of an object. - * - * @param obj Object to get the internal JavaScript [[Class]] of. - * @see {@link https://api.jquery.com/jQuery.type/} - */ - type(obj: any): "array" | "boolean" | "date" | "error" | "function" | "null" | "number" | "object" | "regexp" | "string" | "symbol" | "undefined"; - - /** - * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. - * - * @param array The Array of DOM elements. - * @see {@link https://api.jquery.com/jQuery.unique/} - */ - unique(array: T[]): T[]; - - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context DOM element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - * @see {@link https://api.jquery.com/jQuery.parseHTML/} - */ - parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; - - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context DOM element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - * @see {@link https://api.jquery.com/jQuery.parseHTML/} - */ - parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; -} - -/** - * The jQuery instance members - * - * @see {@link https://api.jquery.com/Types/#jQuery} - */ -interface JQuery { - /** - * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxComplete/} - */ - ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; - /** - * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxError/} - */ - ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; - /** - * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxSend/} - */ - ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; - /** - * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxStart/} - */ - ajaxStart(handler: () => any): JQuery; - /** - * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxStop/} - */ - ajaxStop(handler: () => any): JQuery; - /** - * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxSuccess/} - */ - ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; - - /** - * Load data from the server and place the returned HTML into the matched element. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param complete A callback function that is executed when the request completes. - * @see {@link https://api.jquery.com/load/} - */ - load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; - - /** - * Encode a set of form elements as a string for submission. - * @see {@link https://api.jquery.com/serialize/} - */ - serialize(): string; - /** - * Encode a set of form elements as an array of names and values. - * @see {@link https://api.jquery.com/serializeArray/} - */ - serializeArray(): JQuerySerializeArrayElement[]; - - /** - * Adds the specified class(es) to each of the set of matched elements. - * - * @param className One or more space-separated classes to be added to the class attribute of each matched element. - * @see {@link https://api.jquery.com/addClass/#addClass-className} - */ - addClass(className: string): JQuery; - /** - * Adds the specified class(es) to each of the set of matched elements. - * - * @param func A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/addClass/#addClass-function} - */ - addClass(func: (index: number, className: string) => string): JQuery; - - /** - * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. - * @see {@link https://api.jquery.com/addBack/} - */ - addBack(selector?: string): JQuery; - - /** - * Get the value of an attribute for the first element in the set of matched elements. - * - * @param attributeName The name of the attribute to get. - * @see {@link https://api.jquery.com/attr/#attr-attributeName} - */ - attr(attributeName: string): string; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributeName The name of the attribute to set. - * @param value A value to set for the attribute. If this is `null`, the attribute will be deleted. - * @see {@link https://api.jquery.com/attr/#attr-attributeName-value} - */ - attr(attributeName: string, value: string|number|null): JQuery; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributeName The name of the attribute to set. - * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. - * @see {@link https://api.jquery.com/attr/#attr-attributeName-function} - */ - attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributes An object of attribute-value pairs to set. - * @see {@link https://api.jquery.com/attr/#attr-attributes} - */ - attr(attributes: Object): JQuery; - - /** - * Determine whether any of the matched elements are assigned the given class. - * - * @param className The class name to search for. - * @see {@link https://api.jquery.com/hasClass/} - */ - hasClass(className: string): boolean; - - /** - * Get the HTML contents of the first element in the set of matched elements. - * @see {@link https://api.jquery.com/html/#html} - */ - html(): string; - /** - * Set the HTML contents of each element in the set of matched elements. - * - * @param htmlString A string of HTML to set as the content of each matched element. - * @see {@link https://api.jquery.com/html/#html-htmlString} - */ - html(htmlString: string): JQuery; - /** - * Set the HTML contents of each element in the set of matched elements. - * - * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/html/#html-function} - */ - html(func: (index: number, oldhtml: string) => string): JQuery; - - /** - * Get the value of a property for the first element in the set of matched elements. - * - * @param propertyName The name of the property to get. - * @see {@link https://api.jquery.com/prop/#prop-propertyName} - */ - prop(propertyName: string): any; - /** - * Set one or more properties for the set of matched elements. - * - * @param propertyName The name of the property to set. - * @param value A value to set for the property. - * @see {@link https://api.jquery.com/prop/#prop-propertyName-value} - */ - prop(propertyName: string, value: string|number|boolean): JQuery; - /** - * Set one or more properties for the set of matched elements. - * - * @param properties An object of property-value pairs to set. - * @see {@link https://api.jquery.com/prop/#prop-properties} - */ - prop(properties: Object): JQuery; - /** - * Set one or more properties for the set of matched elements. - * - * @param propertyName The name of the property to set. - * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. - * @see {@link https://api.jquery.com/prop/#prop-propertyName-function} - */ - prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; - - /** - * Remove an attribute from each element in the set of matched elements. - * - * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. - * @see {@link https://api.jquery.com/removeAttr/} - */ - removeAttr(attributeName: string): JQuery; - - /** - * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. - * - * @param className One or more space-separated classes to be removed from the class attribute of each matched element. - * @see {@link https://api.jquery.com/removeClass/#removeClass-className} - */ - removeClass(className?: string): JQuery; - /** - * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. - * - * @param func A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. - * @see {@link https://api.jquery.com/removeClass/#removeClass-function} - */ - removeClass(func: (index: number, className: string) => string): JQuery; - - /** - * Remove a property for the set of matched elements. - * - * @param propertyName The name of the property to remove. - * @see {@link https://api.jquery.com/removeProp/} - */ - removeProp(propertyName: string): JQuery; - - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. - * - * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. - * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. - * @see {@link https://api.jquery.com/toggleClass/#toggleClass-className} - */ - toggleClass(className: string, swtch?: boolean): JQuery; - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. - * - * @param swtch A boolean value to determine whether the class should be added or removed. - * @see {@link https://api.jquery.com/toggleClass/#toggleClass-state} - */ - toggleClass(swtch?: boolean): JQuery; - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. - * - * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. - * @param swtch A boolean value to determine whether the class should be added or removed. - * @see {@link https://api.jquery.com/toggleClass/#toggleClass-function-state} - */ - toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; - - /** - * Get the current value of the first element in the set of matched elements. - * @see {@link https://api.jquery.com/val/#val} - */ - val(): any; - /** - * Set the value of each element in the set of matched elements. - * - * @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked. - * @see {@link https://api.jquery.com/val/#val-value} - */ - val(value: string|string[]|number): JQuery; - /** - * Set the value of each element in the set of matched elements. - * - * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. - * @see {@link https://api.jquery.com/val/#val-function} - */ - val(func: (index: number, value: string) => string): JQuery; - - /** - * Get the value of style properties for the first element in the set of matched elements. - * - * @param propertyName A CSS property. - * @see {@link https://api.jquery.com/css/#css-propertyName} - */ - css(propertyName: string): string; - /** - * Get the value of style properties for the first element in the set of matched elements. - * Results in an object of property-value pairs. - * - * @param propertyNames An array of one or more CSS properties. - * @see {@link https://api.jquery.com/css/#css-propertyNames} - */ - css(propertyNames: string[]): any; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param propertyName A CSS property name. - * @param value A value to set for the property. - * @see {@link https://api.jquery.com/css/#css-propertyName-value} - */ - css(propertyName: string, value: string|number): JQuery; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param propertyName A CSS property name. - * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. - * @see {@link https://api.jquery.com/css/#css-propertyName-function} - */ - css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param properties An object of property-value pairs to set. - * @see {@link https://api.jquery.com/css/#css-properties} - */ - css(properties: Object): JQuery; - - /** - * Get the current computed height for the first element in the set of matched elements. - * @see {@link https://api.jquery.com/height/#height} - */ - height(): number; - /** - * Set the CSS height of every matched element. - * - * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/height/#height-value} - */ - height(value: number|string): JQuery; - /** - * Set the CSS height of every matched element. - * - * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/height/#height-function} - */ - height(func: (index: number, height: number) => number|string): JQuery; - - /** - * Get the current computed height for the first element in the set of matched elements, including padding but not border. - * @see {@link https://api.jquery.com/innerHeight/#innerHeight} - */ - innerHeight(): number; - - /** - * Sets the inner height on elements in the set of matched elements, including padding but not border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/innerHeight/#innerHeight-value} - */ - innerHeight(value: number|string): JQuery; - - /** - * Get the current computed width for the first element in the set of matched elements, including padding but not border. - * @see {@link https://api.jquery.com/innerWidth/#innerWidth} - */ - innerWidth(): number; - - /** - * Sets the inner width on elements in the set of matched elements, including padding but not border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/innerWidth/#innerWidth-value} - */ - innerWidth(value: number|string): JQuery; - - /** - * Get the current coordinates of the first element in the set of matched elements, relative to the document. - * @see {@link https://api.jquery.com/offset/#offset} - */ - offset(): JQueryCoordinates; - /** - * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. - * - * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. - * @see {@link https://api.jquery.com/offset/#offset-coordinates} - */ - offset(coordinates: JQueryCoordinates): JQuery; - /** - * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. - * - * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. - * @see {@link https://api.jquery.com/offset/#offset-function} - */ - offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; - - /** - * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. - * - * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. - * @see {@link https://api.jquery.com/outerHeight/#outerHeight-includeMargin} - */ - outerHeight(includeMargin?: boolean): number; - - /** - * Sets the outer height on elements in the set of matched elements, including padding and border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/outerHeight/#outerHeight-value} - */ - outerHeight(value: number|string): JQuery; - - /** - * Get the current computed width for the first element in the set of matched elements, including padding and border. - * - * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. - * @see {@link https://api.jquery.com/outerWidth/#outerWidth-includeMargin} - */ - outerWidth(includeMargin?: boolean): number; - - /** - * Sets the outer width on elements in the set of matched elements, including padding and border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/outerWidth/#outerWidth-value} - */ - outerWidth(value: number|string): JQuery; - - /** - * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. - * @see {@link https://api.jquery.com/position/} - */ - position(): JQueryCoordinates; - - /** - * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. - * @see {@link https://api.jquery.com/scrollLeft/#scrollLeft} - */ - scrollLeft(): number; - /** - * Set the current horizontal position of the scroll bar for each of the set of matched elements. - * - * @param value An integer indicating the new position to set the scroll bar to. - * @see {@link https://api.jquery.com/scrollLeft/#scrollLeft-value} - */ - scrollLeft(value: number): JQuery; - - /** - * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. - * @see {@link https://api.jquery.com/scrollTop/#scrollTop} - */ - scrollTop(): number; - /** - * Set the current vertical position of the scroll bar for each of the set of matched elements. - * - * @param value An integer indicating the new position to set the scroll bar to. - * @see {@link https://api.jquery.com/scrollTop/#scrollTop-value} - */ - scrollTop(value: number): JQuery; - - /** - * Get the current computed width for the first element in the set of matched elements. - * @see {@link https://api.jquery.com/width/#width} - */ - width(): number; - /** - * Set the CSS width of each element in the set of matched elements. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/width/#width-value} - */ - width(value: number|string): JQuery; - /** - * Set the CSS width of each element in the set of matched elements. - * - * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/width/#width-function} - */ - width(func: (index: number, width: number) => number|string): JQuery; - - /** - * Remove from the queue all items that have not yet been run. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/clearQueue/} - */ - clearQueue(queueName?: string): JQuery; - - /** - * Store arbitrary data associated with the matched elements. - * - * @param key A string naming the piece of data to set. - * @param value The new data value; it can be any JavaScript type including Array or Object. - * @see {@link https://api.jquery.com/data/#data-key-value} - */ - data(key: string, value: any): JQuery; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. - * - * @param key Name of the data stored. - * @see {@link https://api.jquery.com/data/#data-key} - */ - data(key: string): any; - /** - * Store arbitrary data associated with the matched elements. - * - * @param obj An object of key-value pairs of data to update. - * @see {@link https://api.jquery.com/data/#data-obj} - */ - data(obj: { [key: string]: any; }): JQuery; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. - * @see {@link https://api.jquery.com/data/#data} - */ - data(): any; - - /** - * Execute the next function on the queue for the matched elements. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/dequeue/} - */ - dequeue(queueName?: string): JQuery; - - /** - * Remove a previously-stored piece of data. - * - * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. - * @see {@link https://api.jquery.com/removeData/#removeData-name} - */ - removeData(name: string): JQuery; - /** - * Remove a previously-stored piece of data. - * - * @param list An array of strings naming the pieces of data to delete. - * @see {@link https://api.jquery.com/removeData/#removeData-list} - */ - removeData(list: string[]): JQuery; - /** - * Remove all previously-stored piece of data. - * @see {@link https://api.jquery.com/removeData/} - */ - removeData(): JQuery; - - /** - * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. - * - * @param type The type of queue that needs to be observed. (default: fx) - * @param target Object onto which the promise methods have to be attached - * @see {@link https://api.jquery.com/promise/} - */ - promise(type?: string, target?: Object): JQueryPromise; - - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/animate/#animate-properties-duration-easing-complete} - */ - animate(properties: Object, duration?: string|number, complete?: Function): JQuery; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. (default: swing) - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/animate/#animate-properties-duration-easing-complete} - */ - animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/animate/#animate-properties-options} - */ - animate(properties: Object, options: JQueryAnimationOptions): JQuery; - - /** - * Set a timer to delay execution of subsequent items in the queue. - * - * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/delay/} - */ - delay(duration: number, queueName?: string): JQuery; - - /** - * Display the matched elements by fading them to opaque. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeIn/#fadeIn-duration-complete} - */ - fadeIn(duration?: number|string, complete?: Function): JQuery; - /** - * Display the matched elements by fading them to opaque. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeIn/#fadeIn-duration-easing-complete} - */ - fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display the matched elements by fading them to opaque. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/fadeIn/#fadeIn-options} - */ - fadeIn(options: JQueryAnimationOptions): JQuery; - - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeOut/#fadeOut-duration-complete} - */ - fadeOut(duration?: number|string, complete?: Function): JQuery; - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeOut/#fadeOut-duration-easing-complete} - */ - fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Hide the matched elements by fading them to transparent. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/fadeOut/#fadeOut-options} - */ - fadeOut(options: JQueryAnimationOptions): JQuery; - - /** - * Adjust the opacity of the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param opacity A number between 0 and 1 denoting the target opacity. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeTo/#fadeTo-duration-opacity-complete} - */ - fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; - /** - * Adjust the opacity of the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param opacity A number between 0 and 1 denoting the target opacity. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeTo/#fadeTo-duration-opacity-easing-complete} - */ - fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; - - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-duration-easing-complete} - */ - fadeToggle(duration?: number|string, complete?: Function): JQuery; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-duration-easing-complete} - */ - fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-options} - */ - fadeToggle(options: JQueryAnimationOptions): JQuery; - - /** - * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. - * - * @param queue The name of the queue in which to stop animations. - * @see {@link https://api.jquery.com/finish/} - */ - finish(queue?: string): JQuery; - - /** - * Hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/hide/#hide} - */ - hide(duration?: number|string, complete?: Function): JQuery; - /** - * Hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/hide/#hide-duration-easing-complete} - */ - hide(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Hide the matched elements. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/hide/#hide-options} - */ - hide(options: JQueryAnimationOptions): JQuery; - - /** - * Display the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/show/#show} - */ - show(duration?: number|string, complete?: Function): JQuery; - /** - * Display the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/show/#show-duration-easing-complete} - */ - show(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display the matched elements. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/show/#show-options} - */ - show(options: JQueryAnimationOptions): JQuery; - - /** - * Display the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideDown/#slideDown-duration-complete} - */ - slideDown(duration?: number|string, complete?: Function): JQuery; - /** - * Display the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideDown/#slideDown-duration-easing-complete} - */ - slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display the matched elements with a sliding motion. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/slideDown/#slideDown-options} - */ - slideDown(options: JQueryAnimationOptions): JQuery; - - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideToggle/#slideToggle-duration-complete} - */ - slideToggle(duration?: number|string, complete?: Function): JQuery; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideToggle/#slideToggle-duration-easing-complete} - */ - slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/slideToggle/#slideToggle-options} - */ - slideToggle(options: JQueryAnimationOptions): JQuery; - - /** - * Hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideUp/#slideUp-duration-complete} - */ - slideUp(duration?: number|string, complete?: Function): JQuery; - /** - * Hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideUp/#slideUp-duration-easing-complete} - */ - slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Hide the matched elements with a sliding motion. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/slideUp/#slideUp-options} - */ - slideUp(options: JQueryAnimationOptions): JQuery; - - /** - * Stop the currently-running animation on the matched elements. - * - * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. - * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. - * @see {@link https://api.jquery.com/stop/#stop-clearQueue-jumpToEnd} - */ - stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; - /** - * Stop the currently-running animation on the matched elements. - * - * @param queue The name of the queue in which to stop animations. - * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. - * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. - * @see {@link https://api.jquery.com/stop/#stop-queue-clearQueue-jumpToEnd} - */ - stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; - - /** - * Display or hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/toggle/#toggle-duration-complete} - */ - toggle(duration?: number|string, complete?: Function): JQuery; - /** - * Display or hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/toggle/#toggle-duration-easing-complete} - */ - toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display or hide the matched elements. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/toggle/#toggle-options} - */ - toggle(options: JQueryAnimationOptions): JQuery; - /** - * Display or hide the matched elements. - * - * @param showOrHide A Boolean indicating whether to show or hide the elements. - * @see {@link https://api.jquery.com/toggle/#toggle-display} - */ - toggle(showOrHide: boolean): JQuery; - - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler} - */ - bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler} - */ - bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param eventData An object containing data that will be passed to the event handler. - * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. - * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-preventBubble} - */ - bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. - * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-preventBubble} - */ - bind(eventType: string, preventBubble: boolean): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param events An object containing one or more DOM event types and functions to execute for them. - * @see {@link https://api.jquery.com/bind/#bind-events} - */ - bind(events: any): JQuery; - - /** - * Trigger the "blur" event on an element - * @see {@link https://api.jquery.com/blur/#blur} - */ - blur(): JQuery; - /** - * Bind an event handler to the "blur" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/blur/#blur-handler} - */ - blur(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "blur" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/blur/#blur-eventData-handler} - */ - blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "change" event on an element. - * @see {@link https://api.jquery.com/change/#change} - */ - change(): JQuery; - /** - * Bind an event handler to the "change" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/change/#change-handler} - */ - change(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "change" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/change/#change-eventData-handler} - */ - change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "click" event on an element. - * @see {@link https://api.jquery.com/click/#click} - */ - click(): JQuery; - /** - * Bind an event handler to the "click" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/click/#click-handler} - */ - click(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "click" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/click/#click-eventData-handler} - */ - click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "contextmenu" event on an element. - * @see {@link https://api.jquery.com/contextmenu/#contextmenu} - */ - contextmenu(): JQuery; - /** - * Bind an event handler to the "contextmenu" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/contextmenu/#contextmenu-handler} - */ - 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. - * @see {@link https://api.jquery.com/contextmenu/#contextmenu-eventData-handler} - */ - contextmenu(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "dblclick" event on an element. - * @see {@link https://api.jquery.com/dblclick/#dblclick} - */ - dblclick(): JQuery; - /** - * Bind an event handler to the "dblclick" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/dblclick/#dblclick-handler} - */ - dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "dblclick" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/dblclick/#dblclick-eventData-handler} - */ - dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. - * @see {@link https://api.jquery.com/delegate/#delegate-selector-eventType-handler} - */ - delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. - * @see {@link https://api.jquery.com/delegate/#delegate-selector-eventType-eventData-handler} - */ - delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "focus" event on an element. - * @see {@link https://api.jquery.com/focus/#focus} - */ - focus(): JQuery; - /** - * Bind an event handler to the "focus" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focus/#focus-handler} - */ - focus(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "focus" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focus/#focus-eventData-handler} - */ - focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "focusin" event on an element. - * @see {@link https://api.jquery.com/focusin/#focusin} - */ - focusin(): JQuery; - /** - * Bind an event handler to the "focusin" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusin/#focusin-handler} - */ - focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "focusin" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusin/#focusin-eventData-handler} - */ - focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "focusout" event on an element. - * @see {@link https://api.jquery.com/focusout/#focusout} - */ - focusout(): JQuery; - /** - * Bind an event handler to the "focusout" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusout/#focusout-handler} - */ - focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "focusout" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusout/#focusout-eventData-handler} - */ - focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. - * - * @param handlerIn A function to execute when the mouse pointer enters the element. - * @param handlerOut A function to execute when the mouse pointer leaves the element. - * @see {@link https://api.jquery.com/hover/#hover-handlerIn-handlerOut} - */ - hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. - * - * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. - * @see {@link https://api.jquery.com/hover/#hover-handlerInOut} - */ - hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "keydown" event on an element. - * @see {@link https://api.jquery.com/keydown/#keydown} - */ - keydown(): JQuery; - /** - * Bind an event handler to the "keydown" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keydown/#keydown-handler} - */ - keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - /** - * Bind an event handler to the "keydown" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keydown/#keydown-eventData-handler} - */ - keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; - - /** - * Trigger the "keypress" event on an element. - * @see {@link https://api.jquery.com/keypress/#keypress} - */ - keypress(): JQuery; - /** - * Bind an event handler to the "keypress" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keypress/#keypress-handler} - */ - keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - /** - * Bind an event handler to the "keypress" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keypress/#keypress-eventData-handler} - */ - keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; - - /** - * Trigger the "keyup" event on an element. - * @see {@link https://api.jquery.com/keyup/#keyup} - */ - keyup(): JQuery; - /** - * Bind an event handler to the "keyup" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keyup/#keyup-handler} - */ - keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - /** - * Bind an event handler to the "keyup" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keyup/#keyup-eventData-handler} - */ - keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; - - /** - * Bind an event handler to the "load" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/load/} - */ - load(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "load" 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. - * @see {@link https://api.jquery.com/load/} - */ - load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "mousedown" event on an element. - * @see {@link https://api.jquery.com/mousedown/#mousedown} - */ - mousedown(): JQuery; - /** - * Bind an event handler to the "mousedown" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mousedown/#mousedown-handler} - */ - mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mousedown" 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. - * @see {@link https://api.jquery.com/mousedown/#mousedown-eventData-handler} - */ - mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseenter" event on an element. - * @see {@link https://api.jquery.com/mouseenter/#mouseenter} - */ - mouseenter(): JQuery; - /** - * Bind an event handler to be fired when the mouse enters an element. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseenter/#mouseenter-handler} - */ - mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to be fired when the mouse enters an element. - * - * @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. - * @see {@link https://api.jquery.com/mouseenter/#mouseenter-eventData-handler} - */ - mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseleave" event on an element. - * @see {@link https://api.jquery.com/mouseleave/#mouseleave} - */ - mouseleave(): JQuery; - /** - * Bind an event handler to be fired when the mouse leaves an element. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseleave/#mouseleave-handler} - */ - mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to be fired when the mouse leaves an element. - * - * @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. - * @see {@link https://api.jquery.com/mouseleave/#mouseleave-eventData-handler} - */ - mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mousemove" event on an element. - * @see {@link https://api.jquery.com/mousemove/#mousemove} - */ - mousemove(): JQuery; - /** - * Bind an event handler to the "mousemove" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mousemove/#mousemove-handler} - */ - mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mousemove" 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. - * @see {@link https://api.jquery.com/mousemove/#mousemove-eventData-handler} - */ - mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseout" event on an element. - * @see {@link https://api.jquery.com/mouseout/#mouseout} - */ - mouseout(): JQuery; - /** - * Bind an event handler to the "mouseout" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseout/#mouseout-handler} - */ - mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mouseout" 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. - * @see {@link https://api.jquery.com/mouseout/#mouseout-eventData-handler} - */ - mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseover" event on an element. - * @see {@link https://api.jquery.com/mouseover/#mouseover} - */ - mouseover(): JQuery; - /** - * Bind an event handler to the "mouseover" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseover/#mouseover-handler} - */ - mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mouseover" 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. - * @see {@link https://api.jquery.com/mouseover/#mouseover-eventData-handler} - */ - mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseup" event on an element. - * @see {@link https://api.jquery.com/mouseup/#mouseup} - */ - mouseup(): JQuery; - /** - * Bind an event handler to the "mouseup" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseup/#mouseup-handler} - */ - mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mouseup" 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. - * @see {@link https://api.jquery.com/mouseup/#mouseup-eventData-handler} - */ - mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Remove an event handler. - * @see {@link https://api.jquery.com/off/#off} - */ - off(): JQuery; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". - * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. - * @param handler A handler function previously attached for the event(s), or the special value false. - * @see {@link https://api.jquery.com/off/#off-events-selector-handler} - */ - off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". - * @param handler A handler function previously attached for the event(s), or the special value false. Takes handler with extra args that can be attached with on(). - * @see {@link https://api.jquery.com/off/#off-events-selector-handler} - */ - off(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". - * @param handler A handler function previously attached for the event(s), or the special value false. - * @see {@link https://api.jquery.com/off/#off-events-selector-handler} - */ - off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove an event handler. - * - * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). - * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. - * @see {@link https://api.jquery.com/off/#off-events-selector} - */ - off(events: { [key: string]: any; }, selector?: string): JQuery; - - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). - * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} - */ - on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} - */ - on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} - */ - on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} - */ - on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/on/#on-events-selector-data} - */ - on(events: { [key: string]: (eventObject: JQueryEventObject, ...args: any[]) => any; }, selector?: string, data?: any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/on/#on-events-selector-data} - */ - on(events: { [key: string]: (eventObject: JQueryEventObject, ...args: any[]) => any; }, data?: any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. - * @param handler A function to execute at the time the event is triggered. - * @see {@link https://api.jquery.com/one/#one-events-data-handler} - */ - one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. - * @param data An object containing data that will be passed to the event handler. - * @param handler A function to execute at the time the event is triggered. - * @see {@link https://api.jquery.com/one/#one-events-data-handler} - */ - one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - * @see {@link https://api.jquery.com/one/#one-events-selector-data-handler} - */ - one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - * @see {@link https://api.jquery.com/one/#one-events-selector-data-handler} - */ - one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/one/#one-events-selector-data} - */ - one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/one/#one-events-selector-data} - */ - one(events: { [key: string]: any; }, data?: any): JQuery; - - - /** - * Specify a function to execute when the DOM is fully loaded. - * - * @param handler A function to execute after the DOM is ready. - * @see {@link https://api.jquery.com/ready/} - */ - ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery; - - /** - * Trigger the "resize" event on an element. - * @see {@link https://api.jquery.com/resize/#resize} - */ - resize(): JQuery; - /** - * Bind an event handler to the "resize" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/resize/#resize-handler} - */ - resize(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "resize" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/resize/#resize-eventData-handler} - */ - resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "scroll" event on an element. - * @see {@link https://api.jquery.com/scroll/#scroll} - */ - scroll(): JQuery; - /** - * Bind an event handler to the "scroll" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/scroll/#scroll-handler} - */ - scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "scroll" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/scroll/#scroll-eventData-handler} - */ - scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "select" event on an element. - * @see {@link https://api.jquery.com/select/#select} - */ - select(): JQuery; - /** - * Bind an event handler to the "select" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/select/#select-handler} - */ - select(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "select" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/select/#select-eventData-handler} - */ - select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "submit" event on an element. - * @see {@link https://api.jquery.com/submit/#submit} - */ - submit(): JQuery; - /** - * Bind an event handler to the "submit" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/submit/#submit-handler} - */ - submit(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "submit" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/submit/#submit-eventData-handler} - */ - submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Execute all handlers and behaviors attached to the matched elements for the given event type. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param extraParameters Additional parameters to pass along to the event handler. - * @see {@link https://api.jquery.com/trigger/#trigger-eventType-extraParameters} - */ - trigger(eventType: string, extraParameters?: any[]|Object): JQuery; - /** - * Execute all handlers and behaviors attached to the matched elements for the given event type. - * - * @param event A jQuery.Event object. - * @param extraParameters Additional parameters to pass along to the event handler. - * @see {@link https://api.jquery.com/trigger/#trigger-event-extraParameters} - */ - trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; - - /** - * Execute all handlers attached to an element for an event. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param extraParameters An array of additional parameters to pass along to the event handler. - * @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-eventType-extraParameters} - */ - triggerHandler(eventType: string, ...extraParameters: any[]): Object; - - /** - * Execute all handlers attached to an element for an event. - * - * @param event A jQuery.Event object. - * @param extraParameters An array of additional parameters to pass along to the event handler. - * @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-event-extraParameters} - */ - triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object; - - /** - * Remove a previously-attached event handler from the elements. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param handler The function that is to be no longer executed. - * @see {@link https://api.jquery.com/unbind/#unbind-eventType-handler} - */ - unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove a previously-attached event handler from the elements. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). - * @see {@link https://api.jquery.com/unbind/#unbind-eventType-false} - */ - unbind(eventType: string, fls: boolean): JQuery; - /** - * Remove a previously-attached event handler from the elements. - * - * @param evt A JavaScript event object as passed to an event handler. - * @see {@link https://api.jquery.com/unbind/#unbind-event} - */ - unbind(evt: any): JQuery; - - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * @see {@link https://api.jquery.com/undelegate/#undelegate} - */ - undelegate(): JQuery; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * - * @param selector A selector which will be used to filter the event results. - * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" - * @param handler A function to execute at the time the event is triggered. - * @see {@link https://api.jquery.com/undelegate/#undelegate-selector-eventType} - */ - undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * - * @param selector A selector which will be used to filter the event results. - * @param events An object of one or more event types and previously bound functions to unbind from them. - * @see {@link https://api.jquery.com/undelegate/#undelegate-selector-events} - */ - undelegate(selector: string, events: Object): JQuery; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * - * @param namespace A string containing a namespace to unbind all events from. - * @see {@link https://api.jquery.com/undelegate/#undelegate-namespace} - */ - undelegate(namespace: string): JQuery; - - /** - * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/unload/#unload-handler} - */ - unload(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) - * - * @param eventData A plain object of data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/unload/#unload-eventData-handler} - */ - unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) - * @see {@link https://api.jquery.com/context/} - */ - context: Element; - - jquery: string; - - /** - * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/error/#error-handler} - */ - error(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) - * - * @param eventData A plain object of data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/error/#error-eventData-handler} - */ - error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Add a collection of DOM elements onto the jQuery stack. - * - * @param elements An array of elements to push onto the stack and make into a new jQuery object. - * @see {@link https://api.jquery.com/pushStack/#pushStack-elements} - */ - pushStack(elements: any[]): JQuery; - /** - * Add a collection of DOM elements onto the jQuery stack. - * - * @param elements An array of elements to push onto the stack and make into a new jQuery object. - * @param name The name of a jQuery method that generated the array of elements. - * @param arguments The arguments that were passed in to the jQuery method (for serialization). - * @see {@link https://api.jquery.com/pushStack/#pushStack-elements-name-arguments} - */ - pushStack(elements: any[], name: string, arguments: any[]): JQuery; - - /** - * Insert content, specified by the parameter, 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. - * @see {@link https://api.jquery.com/after/#after-content-content} - */ - 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. - * - * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/after/#after-function} - */ - after(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Insert content, specified by the parameter, to 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. - * @see {@link https://api.jquery.com/append/#append-content-content} - */ - 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. - * - * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/append/#append-function} - */ - append(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Insert every element in the set of matched elements to the end of the target. - * - * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/appendTo/} - */ - appendTo(target: JQuery|any[]|Element|string): JQuery; - - /** - * Insert content, specified by the parameter, 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. - * @see {@link https://api.jquery.com/before/#before-content-content} - */ - 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. - * - * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/before/#before-function} - */ - before(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Create a deep copy of the set of matched elements. - * - * @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. - * @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). - * @see {@link https://api.jquery.com/clone/} - */ - clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; - - /** - * Remove the set of matched elements from the DOM. - * - * @param selector A selector expression that filters the set of matched elements to be removed. - * @see {@link https://api.jquery.com/detach/} - */ - detach(selector?: string): JQuery; - - /** - * Remove all child nodes of the set of matched elements from the DOM. - * @see {@link https://api.jquery.com/empty/} - */ - empty(): JQuery; - - /** - * Insert every element in the set of matched elements after the target. - * - * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/insertAfter/} - */ - insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; - - /** - * Insert every element in the set of matched elements before the target. - * - * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/insertBefore/} - */ - insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; - - /** - * Insert content, specified by the parameter, to 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. - * @see {@link https://api.jquery.com/prepend/#prepend-content-content} - */ - 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. - * - * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/prepend/#prepend-function} - */ - prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Insert every element in the set of matched elements to the beginning of the target. - * - * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/prependTo/} - */ - prependTo(target: JQuery|any[]|Element|string): JQuery; - - /** - * Remove the set of matched elements from the DOM. - * - * @param selector A selector expression that filters the set of matched elements to be removed. - * @see {@link https://api.jquery.com/remove/} - */ - remove(selector?: string): JQuery; - - /** - * Replace each target element with the set of matched elements. - * - * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. - * @see {@link https://api.jquery.com/replaceAll/} - */ - replaceAll(target: JQuery|any[]|Element|string): JQuery; - - /** - * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. - * - * @param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. - * @see {@link https://api.jquery.com/replaceWith/#replaceWith-newContent} - */ - replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; - /** - * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. - * - * @param func A function that returns content with which to replace the set of matched elements. - * @see {@link https://api.jquery.com/replaceWith/#replaceWith-function} - */ - replaceWith(func: () => Element|JQuery): JQuery; - - /** - * Get the combined text contents of each element in the set of matched elements, including their descendants. - * @see {@link https://api.jquery.com/text/#text} - */ - text(): string; - /** - * Set the content of each element in the set of matched elements to the specified text. - * - * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. - * @see {@link https://api.jquery.com/text/#text-text} - */ - text(text: string|number|boolean): JQuery; - /** - * Set the content of each element in the set of matched elements to the specified text. - * - * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. - * @see {@link https://api.jquery.com/text/#text-function} - */ - text(func: (index: number, text: string) => string): JQuery; - - /** - * Retrieve all the elements contained in the jQuery set, as an array. - * @name toArray - * @see {@link https://api.jquery.com/toArray/} - */ - toArray(): HTMLElement[]; - - /** - * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. - * @see {@link https://api.jquery.com/unwrap/} - */ - unwrap(): JQuery; - - /** - * Wrap an HTML structure around each element in the set of matched elements. - * - * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. - * @see {@link https://api.jquery.com/wrap/#wrap-wrappingElement} - */ - wrap(wrappingElement: JQuery|Element|string): JQuery; - /** - * Wrap an HTML structure around each element in the set of matched elements. - * - * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/wrap/#wrap-function} - */ - wrap(func: (index: number) => string|JQuery): JQuery; - - /** - * Wrap an HTML structure around all elements in the set of matched elements. - * - * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. - * @see {@link https://api.jquery.com/wrapAll/#wrapAll-wrappingElement} - */ - wrapAll(wrappingElement: JQuery|Element|string): JQuery; - /** - * Wrap an HTML structure around all elements in the set of matched elements. - * - * @param func A callback function returning the HTML content or jQuery object to wrap around all the matched elements. Within the function, this refers to the first element in the set. - * @see {@link https://api.jquery.com/wrapAll/#wrapAll-function} - */ - wrapAll(func: (index: number) => string): JQuery; - - /** - * Wrap an HTML structure around the content of each element in the set of matched elements. - * - * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. - * @see {@link https://api.jquery.com/wrapInner/#wrapInner-wrappingElement} - */ - wrapInner(wrappingElement: JQuery|Element|string): JQuery; - /** - * Wrap an HTML structure around the content of each element in the set of matched elements. - * - * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/wrapInner/#wrapInner-function} - */ - wrapInner(func: (index: number) => string): JQuery; - - /** - * Iterate over a jQuery object, executing a function for each matched element. - * - * @param func A function to execute for each matched element. Can stop the loop by returning false. - * @see {@link https://api.jquery.com/each/} - */ - each(func: (index: number, elem: Element) => boolean | void): JQuery; - - /** - * Retrieve one of the elements matched by the jQuery object. - * - * @param index A zero-based integer indicating which element to retrieve. - * @see {@link https://api.jquery.com/get/#get-index} - */ - get(index: number): HTMLElement; - /** - * Retrieve the elements matched by the jQuery object. - * @alias toArray - * @see {@link https://api.jquery.com/get/#get} - */ - get(): HTMLElement[]; - - /** - * Search for a given element from among the matched elements. - * @see {@link https://api.jquery.com/index/#index} - */ - index(): number; - /** - * Search for a given element from among the matched elements. - * - * @param selector A selector representing a jQuery collection in which to look for an element. - * @see {@link https://api.jquery.com/index/#index-selector} - */ - index(selector: string|JQuery|Element): number; - - /** - * The number of elements in the jQuery object. - * @see {@link https://api.jquery.com/length/} - */ - length: number; - /** - * A selector representing selector passed to jQuery(), if any, when creating the original set. - * version deprecated: 1.7, removed: 1.9 - * @see {@link https://api.jquery.com/selector/} - */ - selector: string; - [index: number]: HTMLElement; - - /** - * Add elements to the set of matched elements. - * - * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. - * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. - * @see {@link https://api.jquery.com/add/#add-selector} - */ - add(selector: string, context?: Element): JQuery; - /** - * Add elements to the set of matched elements. - * - * @param elements One or more elements to add to the set of matched elements. - * @see {@link https://api.jquery.com/add/#add-elements} - */ - add(...elements: Element[]): JQuery; - /** - * Add elements to the set of matched elements. - * - * @param html An HTML fragment to add to the set of matched elements. - * @see {@link https://api.jquery.com/add/#add-html} - */ - add(html: string): JQuery; - /** - * Add elements to the set of matched elements. - * - * @param obj An existing jQuery object to add to the set of matched elements. - * @see {@link https://api.jquery.com/add/#add-selection} - */ - add(obj: JQuery): JQuery; - - /** - * Get the children of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/children/} - */ - children(selector?: string): JQuery; - - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/closest/#closest-selector} - */ - closest(selector: string): JQuery; - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param selector A string containing a selector expression to match elements against. - * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. - * @see {@link https://api.jquery.com/closest/#closest-selector-context} - */ - closest(selector: string, context?: Element): JQuery; - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param obj A jQuery object to match elements against. - * @see {@link https://api.jquery.com/closest/#closest-selection} - */ - closest(obj: JQuery): JQuery; - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param element An element to match elements against. - * @see {@link https://api.jquery.com/closest/#closest-element} - */ - closest(element: Element): JQuery; - - /** - * Get an array of all the elements and selectors matched against the current element up through the DOM tree. - * - * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). - * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. - * @see {@link https://api.jquery.com/closest/#closest-selectors-context} - */ - closest(selectors: any, context?: Element): any[]; - - /** - * Get the children of each element in the set of matched elements, including text and comment nodes. - * @see {@link https://api.jquery.com/contents/} - */ - contents(): JQuery; - - /** - * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. - * @see {@link https://api.jquery.com/end/} - */ - end(): JQuery; - - /** - * Reduce the set of matched elements to the one at the specified index. - * - * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. - * @see {@link https://api.jquery.com/eq/} - */ - eq(index: number): JQuery; - - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param selector A string containing a selector expression to match the current set of elements against. - * @see {@link https://api.jquery.com/filter/#filter-selector} - */ - filter(selector: string): JQuery; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param func A function used as a test for each element in the set. this is the current DOM element. - * @see {@link https://api.jquery.com/filter/#filter-function} - */ - filter(func: (index: number, element: Element) => boolean): JQuery; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param element An element to match the current set of elements against. - * @see {@link https://api.jquery.com/filter/#filter-elements} - */ - filter(element: Element): JQuery; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param obj An existing jQuery object to match the current set of elements against. - * @see {@link https://api.jquery.com/filter/#filter-selection} - */ - filter(obj: JQuery): JQuery; - - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/find/#find-selector} - */ - find(selector: string): JQuery; - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * - * @param element An element to match elements against. - * @see {@link https://api.jquery.com/find/#find-element} - */ - find(element: Element): JQuery; - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * - * @param obj A jQuery object to match elements against. - * @see {@link https://api.jquery.com/find/#find-element} - */ - find(obj: JQuery): JQuery; - - /** - * Reduce the set of matched elements to the first in the set. - * @see {@link https://api.jquery.com/first/} - */ - first(): JQuery; - - /** - * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/has/#has-selector} - */ - has(selector: string): JQuery; - /** - * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. - * - * @param contained A DOM element to match elements against. - * @see {@link https://api.jquery.com/has/#has-contained} - */ - has(contained: Element): JQuery; - - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/is/#is-selector} - */ - is(selector: string): boolean; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. - * @see {@link https://api.jquery.com/is/#is-function} - */ - is(func: (index: number, element: Element) => boolean): boolean; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param obj An existing jQuery object to match the current set of elements against. - * @see {@link https://api.jquery.com/is/#is-selection} - */ - is(obj: JQuery): boolean; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param elements One or more elements to match the current set of elements against. - * @see {@link https://api.jquery.com/is/#is-elements} - */ - is(elements: any): boolean; - - /** - * Reduce the set of matched elements to the final one in the set. - * @see {@link https://api.jquery.com/last/} - */ - last(): JQuery; - - /** - * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. - * - * @param callback A function object that will be invoked for each element in the current set. - * @see {@link https://api.jquery.com/map/} - */ - map(callback: (index: number, domElement: Element) => any): JQuery; - - /** - * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/next/} - */ - next(selector?: string): JQuery; - - /** - * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/nextAll/} - */ - nextAll(selector?: string): JQuery; - - /** - * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * - * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/nextUntil/#nextUntil-selector-filter} - */ - nextUntil(selector?: string, filter?: string): JQuery; - /** - * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * - * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/nextUntil/#nextUntil-element-filter} - */ - nextUntil(element?: Element, filter?: string): JQuery; - /** - * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * - * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/nextUntil/#nextUntil-element-filter} - */ - nextUntil(obj?: JQuery, filter?: string): JQuery; - - /** - * Remove elements from the set of matched elements. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/not/#not-selector} - */ - not(selector: string): JQuery; - /** - * Remove elements from the set of matched elements. - * - * @param func A function used as a test for each element in the set. this is the current DOM element. - * @see {@link https://api.jquery.com/not/#not-function} - */ - not(func: (index: number, element: Element) => boolean): JQuery; - /** - * Remove elements from the set of matched elements. - * - * @param elements One or more DOM elements to remove from the matched set. - * @see {@link https://api.jquery.com/not/#not-selection} - */ - not(elements: Element|Element[]): JQuery; - /** - * Remove elements from the set of matched elements. - * - * @param obj An existing jQuery object to match the current set of elements against. - * @see {@link https://api.jquery.com/not/#not-selection} - */ - not(obj: JQuery): JQuery; - - /** - * Get the closest ancestor element that is positioned. - * @see {@link https://api.jquery.com/offsetParent/} - */ - offsetParent(): JQuery; - - /** - * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parent/} - */ - parent(selector?: string): JQuery; - - /** - * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parents/} - */ - parents(selector?: string): JQuery; - - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-selector-filter} - */ - parentsUntil(selector?: string, filter?: string): JQuery; - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-element-filter} - */ - parentsUntil(element?: Element, filter?: string): JQuery; - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-element-filter} - */ - parentsUntil(obj?: JQuery, filter?: string): JQuery; - - /** - * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prev/} - */ - prev(selector?: string): JQuery; - - /** - * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prevAll/} - */ - prevAll(selector?: string): JQuery; - - /** - * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prevUntil/#prevUntil-selector-filter} - */ - prevUntil(selector?: string, filter?: string): JQuery; - /** - * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prevUntil/#prevUntil-element-filter} - */ - prevUntil(element?: Element, filter?: string): JQuery; - /** - * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prevUntil/#prevUntil-element-filter} - */ - prevUntil(obj?: JQuery, filter?: string): JQuery; - - /** - * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/siblings/} - */ - siblings(selector?: string): JQuery; - - /** - * Reduce the set of matched elements to a subset specified by a range of indices. - * - * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. - * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. - * @see {@link https://api.jquery.com/slice/} - */ - slice(start: number, end?: number): JQuery; - - /** - * Show the queue of functions to be executed on the matched elements. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/queue/#queue-queueName} - */ - queue(queueName?: string): any[]; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param newQueue An array of functions to replace the current queue contents. - * @see {@link https://api.jquery.com/queue/#queue-queueName-newQueue} - */ - queue(newQueue: Function[]): JQuery; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. - * @see {@link https://api.jquery.com/queue/#queue-queueName-callback} - */ - queue(callback: Function): JQuery; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param newQueue An array of functions to replace the current queue contents. - * @see {@link https://api.jquery.com/queue/#queue-queueName-newQueue} - */ - queue(queueName: string, newQueue: Function[]): JQuery; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. - * @see {@link https://api.jquery.com/queue/#queue-queueName-callback} - */ - queue(queueName: string, callback: Function): JQuery; - - /** - * Merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods. - * - * @param object An object to merge onto the jQuery prototype. - * @see {@link https://api.jquery.com/jQuery.fn.extend/#jQuery-fn-extend-object} - */ - extend(object: { [method: string]: (...args: any[]) => any; }): JQuery; -} -declare module "jquery" { - export = $; -} -declare var jQuery: JQueryStatic; -declare var $: JQueryStatic; +// endregion diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index d2d58aa2a2..062b89f655 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -1,3552 +1,138 @@ - - -function test_add() { - $("p").add("div").addClass("widget"); - var pdiv = $("p").add("div"); - - $('li').add('p').css('background-color', 'red'); - $('li').add(document.getElementsByTagName('p')[0]) - .css('background-coailor', 'red'); - $('li').add('

new paragraph

') - .css('background-color', 'red'); - $("div").css("border", "2px solid red") - .add("p") - .css("background", "yellow"); - $("p").add("span").css("background", "yellow"); - $("p").clone().add("Again").appendTo(document.body); - $("p").add(document.getElementById("a")).css("background", "yellow"); - var collection = $("p"); - - collection = collection.add(document.getElementById("a")); - collection.css("background", "yellow"); -} - -function test_addClass() { - $("p").addClass("myClass yourClass"); - $("p").removeClass("myClass noClass").addClass("yourClass"); - $("ul li:last").addClass(function (index) { - return "item-" + index; - }); - $("p:last").addClass("selected"); - $("p:last").addClass("selected highlight"); - $("div").addClass(function (index, currentClass) { - var addedClass: string; - if (currentClass === "red") { - addedClass = "green"; - $("p").text("There is one green div"); +function JQuery() { + function iterable() { + for (const a of $('div')) { + a.textContent = 'myDiv'; } - return addedClass; - }); -} + } -function test_after() { - $('.inner').after('

Test

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

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

').addClass('foo') - .filter('p').attr('id', 'bar').html('hello') - .end() - .appendTo('body'); - $('p').after(function () { - return '
' + this.className + '
'; - }); - var $newdiv1 = $('
'), - newdiv2 = document.createElement('div'), - existingdiv1 = document.getElementById('foo'); - $('p').first().after($newdiv1, [newdiv2, existingdiv1]); - $("p").after(document.createTextNode("Hello")); - $("p").after($("b")); -} + function arrayLike() { + $('div')[0] === new HTMLElement(); + } -function test_ajax() { - $.ajax({ - url: "test.html", - context: document.body - }).done(function () { - $(this).addClass("done"); - }); - $.ajax({ - statusCode: { - 404: function () { - alert("page not found"); - } + function on() { + function false_handler_shorthand() { + $().on('events', false); } - }); - $.ajax({ - url: "http://fiddle.jshell.net/favicon.png", - beforeSend: function (xhr) { - xhr.overrideMimeType("text/plain; charset=x-user-defined"); - } - }).done(function (data) { - if (console && console.log) { - console.log("Sample of data:", data.slice(0, 100)); - } - }); - $.ajax({ - url: 'ajax/test.html', - success: function (data) { - $('.result').html(data); - alert('Load was performed.'); - }, - error: function (jqXHR, textStatus, errorThrown) { - alert('Load failed. responseJSON=' + jqXHR.responseJSON); - } - }); - var _super = jQuery.ajaxSettings.xhr; - jQuery.ajaxSettings.xhr = function () { - var xhr = _super(), - getAllResponseHeaders = xhr.getAllResponseHeaders; - xhr.getAllResponseHeaders = function () { - if (getAllResponseHeaders()) { - return getAllResponseHeaders(); - } - - var allHeaders = ""; - var headersFieldNames = ["Cache-Control", "Content-Language", "Content-Type", - "Expires", "Last-Modified", "Pragma"]; - $(headersFieldNames).each(function (i, header_name) { - if (xhr.getResponseHeader(header_name)) { - allHeaders += header_name + ": " + xhr.getResponseHeader(header_name) + "\n"; - } + function typed_event_data() { + $('#myElement').on('custom', 45, (event, data) => { + event.data === 23; }); - return allHeaders; - }; - - return xhr; - }; - $.ajax({ - type: "POST", - url: "some.php", - data: { name: "John", location: "Boston" } - }).done(function (msg) { - alert("Data Saved: " + msg); - }); - $.ajax({ - method: "POST", - url: "some.php", - data: { name: "John", location: "Boston" } - }); - $.ajax({ - url: "test.html", - cache: false - }).done(function (html) { - $("#results").append(html); - }); - var xmlDocument = []; - var xmlRequest = $.ajax({ - url: "page.php", - processData: false, - data: xmlDocument - }); - var handleResponse; - xmlRequest.done(handleResponse); - - var menuId = $("ul.nav").first().attr("id"); - var request = $.ajax({ - url: "script.php", - type: "POST", - data: { id: menuId }, - dataType: "html" - }); - request.done(function (msg) { - $("#log").html(msg); - }); - request.fail(function (jqXHR, textStatus) { - alert("Request failed: " + textStatus); - }); - - $.ajax({ - type: "GET", - url: "test.js", - dataType: "script" - }); - - // Test the jqXHR object returned by $.ajax() as of 1.5 - // More details: http://api.jquery.com/jQuery.ajax/#jqXHR - - // done method - $.ajax({ - url: "test.js" - }).done((data, textStatus, jqXHR) => { - console.log(data, textStatus, jqXHR); - }); - - // then method can change promise type through promise chaining - var chainedValuePromise : JQueryPromise; - chainedValuePromise = $.ajax({ - url: "test.js" - }).then(() => $.when(1)); - - // fail method - $.ajax({ - url: "test.js" - }).fail((jqXHR, textStatus, errorThrown) => { - console.log(jqXHR, textStatus, errorThrown); - }); - - // always method with successful request - $.ajax({ - url: "test.js" - }).always((data, textStatus, jqXHR) => { - console.log(data, textStatus, jqXHR); - }); - - // always method with failed request - $.ajax({ - url: "test.js" - }).always((jqXHR, textStatus, errorThrown) => { - console.log(jqXHR, textStatus, errorThrown); - }); - - // then method (as of 1.8) - $.ajax({ - url: "test.js" - }).then((data, textStatus, jqXHR) => { - console.log(data, textStatus, jqXHR); - }, (jqXHR, textStatus, errorThrown) => { - console.log(jqXHR, textStatus, errorThrown); - }); - - // generic then method - var p: JQueryPromise = $.ajax({ url: "test.js" }) - .then(() => "Hello") - .then((x) => x.length); - - // jqXHR object - var jqXHR = $.ajax({ - url: "test.js" - }); - jqXHR.abort('aborting because I can'); - - //Test the promise exposed by the jqXHR object - - // done method - $.ajax({ - url: "test.js" - }).promise().done((data, textStatus, jqXHR) => { - console.log(data, textStatus, jqXHR); - }); - - // fail method - $.ajax({ - url: "test.js" - }).promise().fail((jqXHR, textStatus, errorThrown) => { - console.log(jqXHR, textStatus, errorThrown); - }); - - // always method with successful request - $.ajax({ - url: "test.js" - }).promise().always((data, textStatus, jqXHR) => { - console.log(data, textStatus, jqXHR); - }); - - // always method with failed request - $.ajax({ - url: "test.js" - }).promise().always((jqXHR, textStatus, errorThrown) => { - console.log(jqXHR, textStatus, errorThrown); - }); - - // then method (as of 1.8) - $.ajax({ - url: "test.js" - }).promise().then((data, textStatus, jqXHR) => { - console.log(data, textStatus, jqXHR); - }, (jqXHR, textStatus, errorThrown) => { - console.log(jqXHR, textStatus, errorThrown); - }); - - // generic then method - var p: JQueryPromise = $.ajax({ url: "test.js" }).promise() - .then(() => "Hello") - .then((x) => x.length); -} - -function test_ajaxComplete() { - $('.log').ajaxComplete(function () { - $(this).text('Triggered ajaxComplete handler.'); - }); - $('.trigger').click(function () { - $('.result').load('ajax/test.html'); - }); - $('.log').ajaxComplete(function (e, xhr, settings) { - if (settings.url == 'ajax/test.html') { - $(this).text('Triggered ajaxComplete handler. The result is ' + xhr.responseText); } - }); - $("#msg").ajaxComplete(function (event, request, settings) { - $(this).append("
  • Request Complete.
  • "); - }); + } } -function test_ajaxError() { - $("div.log").ajaxError(function () { - $(this).text("Triggered ajaxError handler."); - }); - $("button.trigger").click(function () { - $("div.result").load("ajax/missing.html"); - }); - $("div.log").ajaxError(function (e, jqxhr, settings, exception) { - if (settings.url == "ajax/missing.html") { - $(this).text("Triggered ajaxError handler."); +function JQueryStatic() { + function type_annotation() { + const jq: JQueryStatic = $; + } + + function Callbacks() { + const cb = $.Callbacks(); + + cb.add(console.log); + } + + function Event() { + function constructor() { + const e = $.Event('click'); + e.stopPropagation(); } - }); - $("#msg").ajaxError(function (event, request, settings) { - $(this).append("
  • Error requesting page " + settings.url + "
  • "); - }); -} -function test_ajaxPrefilter() { - var currentRequests = {}; - $.ajaxPrefilter(function (options, originalOptions, jqXHR) { - if (options.abortOnRetry) { - if (currentRequests[options.url]) { - currentRequests[options.url].abort(); + function type_guard(e: object) { + if (e instanceof JQuery.Event) { + e.isDefaultPrevented() === true; } - currentRequests[options.url] = jqXHR; } - }); - $.ajaxPrefilter(function (options) { - if (options.crossDomain) { - options.url = "http://mydomain.net/proxy/" + encodeURIComponent(options.url); - options.crossDomain = false; + + function mixin() { + const e = $.Event('keydown', { + mySpecialKeyCode: JQuery.Key.CapsLock, + }); + + e.mySpecialKeyCode === JQuery.Key.NumLock; } - }); - $.ajaxPrefilter("json script", function (options, originalOptions, jqXHR) { + } - }); - var isActuallyScript; - $.ajaxPrefilter(function (options) { - if (isActuallyScript(options.url)) { - return "script"; + function each() { + function arrayLike() { + $.each({ length: 3 }, (index, val) => { + index === 3; + }); } - }); -} + } -function test_ajaxSend() { - $('.log').ajaxSend(function () { - $(this).text('Triggered ajaxSend handler.'); - }); - $('.trigger').click(function () { - $('.result').load('ajax/test.html'); - }); - $('.log').ajaxSend(function (e, jqxhr, settings) { - if (settings.url == 'ajax/test.html') { - $(this).text('Triggered ajaxSend handler.'); - } - }); - $("#msg").ajaxSend(function (evt, request, settings) { - $(this).append("
  • Starting request at " + settings.url + "
  • "); - }); -} - -function test_ajaxSetup() { - $.ajaxSetup({ - url: 'ping.php' - }); - $.ajax({ - data: { 'name': 'Dan' } - }); - $.ajaxSetup({ - url: "/xmlhttp/", - global: false, - type: "POST" - }); -} - -function test_ajaxStart() { - $('.log').ajaxStart(function () { - $(this).text('Triggered ajaxStart handler.'); - }); - $('.trigger').click(function () { - $('.result').load('ajax/test.html'); - }); - $("#loading").ajaxStart(function () { - $(this).show(); - }); -} - -function test_ajaxStop() { - $('.log').ajaxStop(function () { - $(this).text('Triggered ajaxStop handler.'); - }); - $('.trigger').click(function () { - $('.result').load('ajax/test.html'); - }); - $("#loading").ajaxStop(function () { - $(this).hide(); - }); -} - -function test_ajaxSuccess() { - $('.log').ajaxSuccess(function () { - $(this).text('Triggered ajaxSuccess handler.'); - }); - $('.trigger').click(function () { - $('.result').load('ajax/test.html'); - }); - $('.log').ajaxSuccess(function (e, xhr, settings) { - if (settings.url == 'ajax/test.html') { - $(this).text('Triggered ajaxSuccess handler. The ajax response was:' + xhr.responseText); - } - }); - $("#msg").ajaxSuccess(function (evt, request, settings) { - $(this).append("
  • Successful Request!
  • "); - }); -} - -function test_allSelector() { - var elementCount = $("*").css("border", "3px solid red").length; - $("body").prepend("

    " + elementCount + " elements found

    "); - var elementCount2 = $("#test").find("*").css("border", "3px solid red").length; - $("body").prepend("

    " + elementCount2 + " elements found

    "); -} - -function test_animate() { - $('#clickme').click(function () { - $('#book').animate({ - opacity: 0.25, - left: '+=50', - height: 'toggle' - }, 5000, function () { - }); - }); - $('li').animate({ - opacity: .5, - height: '50%' - }, { - step: function (now, fx) { - var data = fx.elem.id + ' ' + fx.prop + ': ' + now; - $('body').append('
    ' + data + '
    '); - } - }); - $('#clickme').click(function () { - $('#book').animate({ - width: ['toggle', 'swing'], - height: ['toggle', 'swing'], - opacity: 'toggle' - }, 5000, 'linear', function () { - $(this).after('
    Animation complete.
    '); - }); - }); - $('#clickme').click(function () { - $('#book').animate({ - width: 'toggle', - height: 'toggle' - }, { - duration: 5000, - specialEasing: { - width: 'linear', - height: 'easeOutBounce' - }, - complete: function () { - $(this).after('
    Animation complete.
    '); + function isArray() { + function type_guard(obj: object) { + if ($.isArray(obj)) { + console.log(obj[0]); } - }); - }); - $("#go").click(function () { - $("#block").animate({ - width: "70%", - opacity: 0.4, - marginLeft: "0.6in", - fontSize: "3em", - borderWidth: "10px" - }, 1500); - }); - $("#right").click(function () { - $(".block").animate({ "left": "+=50px" }, "slow"); - }); - $("#left").click(function () { - $(".block").animate({ "left": "-=50px" }, "slow"); - }); - $("#go1").click(function () { - $("#block1").animate({ width: "90%" }, { queue: false, duration: 3000 }) - .animate({ fontSize: "24px" }, 1500) - .animate({ borderRightWidth: "15px" }, 1500); - }); - $("#go2").click(function () { - $("#block2").animate({ width: "90%" }, 1000) - .animate({ fontSize: "24px" }, 1000) - .animate({ borderLeftWidth: "15px" }, 1000); - }); - $("#go3").click(function () { - $("#go1").add("#go2").click(); - }); - $("#go4").click(function () { - $("div").css({ width: "", fontSize: "", borderWidth: "" }); - }); - $("#go").click(function () { - $(".block:first").animate({ - left: 100 - }, { - duration: 1000, - step: function (now, fx) { - $(".block:gt(0)").css("left", now); + } + } + + function isFunction() { + function type_guard(obj: object) { + if ($.isFunction(obj)) { + obj(); } - }); - }); - $("p").animate({ - height: "toggle", opacity: "toggle" - }, "slow"); - $("p").animate({ - left: 50, opacity: 1 - }, 500); - $("p").animate({ - left: "50px", opacity: 1 - }, { duration: 500, queue: false }); - $("p").animate({ - opacity: "show" - }, "slow", "easein"); - $("p").animate({ - height: "toggle", opacity: "toggle" - }, { duration: "slow" }); - $("p").animate({ - opacity: "show" - }, { duration: "slow", easing: "easein" }); - $("p").animate({ - height: 200, width: 400, opacity: 0.5 - }, 1000, "linear", function () { - alert("all done"); - }); -} - -function test_animatedSelector() { - $("#run").click(function () { - $("div:animated").toggleClass("colored"); - }); - function animateIt() { - $("#mover").slideToggle("slow", animateIt); - } - animateIt(); -} - -function test_slideToggle() { - $("button").click(function () { - $("p").slideToggle("slow"); - }); - - $("#aa").click(function () { - $("div:not(.still)").slideToggle("slow", function () { - var n = parseInt($("span").text(), 10); - $("span").text(n + 1); - }); - }); -} - -function test_toggle() { - $(".target").toggle(); - - $("#clickme").click(function () { - $("#book").toggle("slow", function () { - // Animation complete. - }); - }); - - $("#foo").toggle(true); - - $("button").click(function () { - $("p").toggle(); - }); - - $("button").click(function () { - $("p").toggle("slow"); - }); - - var flip = 0; - $("button").click(function () { - $("p").toggle(flip++ % 2 === 0); - }); -} - -function test_append() { - $('.inner').append('

    Test

    '); - $('.container').append($('h2')).append(document.createDocumentFragment()); - - var $newdiv1 = $('
    '), - newdiv2 = document.createElement('div'), - existingdiv1 = document.getElementById('foo'); - - $('body').append($newdiv1, [newdiv2, existingdiv1]); -} - -function test_appendTo() { - $('

    Test

    ').appendTo('.inner'); - $('h2').appendTo($('.container')); -} - -function test_attr() { - var title = $("em").attr("title"); - $("em").attr("title", null); // Delete an attribute. - $("div").text(title); - $('#greatphoto').attr('alt', 'Beijing Brush Seller'); - $('#greatphoto') - .attr('title', 'Photo by Kelly Clark'); - $('#greatphoto').attr({ - alt: 'Beijing Brush Seller', - title: 'photo by Kelly Clark' - }); - $('#greatphoto').attr('title', function (i, val) { - return val + ' - photo by Kelly Clark' - }); - $("div").attr("id", function (arr) { - return "div-id" + arr; - }) - .each(function () { - $("span", this).html("(ID = '" + this.id + "')"); - }); - $("img").attr("src", function () { - return "/images/" + this.title; - }); -} - -function test_attributeSelectors() { - $('a[hreflang|="en"]').css('border', '3px dotted green'); - $('input[name*="man"]').val('has man in it!'); - $('input[name~="man"]').val('mr. man is in it!'); - $('input[name$="letter"]').val('a letter'); - $('input[value="Hot Fuzz"]').next().text(" Hot Fuzz"); - $('input[name!="newsletter"]').next().append('; not newsletter'); - $('input[name^="news"]').val('news here!'); -} - -function test_before() { - $('.inner').before('

    Test

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

    "); - var $newdiv1 = $('
    '), - newdiv2 = document.createElement('div'), - existingdiv1 = document.getElementById('foo'); - $('p').first().before($newdiv1, [newdiv2, existingdiv1]); -} - -function test_bind() { - $('#foo').bind('click', function () { - alert('User clicked on "foo."'); - }); - $('#foo').bind('mouseenter mouseleave', function () { - $(this).toggleClass('entered'); - }); - $('#foo').bind({ - click: function () { }, - mouseenter: function () { } - }); - $('#foo').bind('click', function () { - alert($(this).text()); - }); - $(document).ready(function () { - $('#foo').bind('click', function (event) { - alert('The mouse cursor is at (' - + event.pageX + ', ' + event.pageY + ')'); - }); - }); - var message = 'Spoon!'; - $('#foo').bind('click', function () { - alert(message); - }); - message = 'Not in the face!'; - $('#bar').bind('click', function () { - alert(message); - }); - var message = 'Spoon!'; - $('#foo').bind('click', { msg: message }, function (event) { - alert(event.data.msg); - }); - message = 'Not in the face!'; - $('#bar').bind('click', { msg: message }, function (event) { - alert(event.data.msg); - }); - $("p").bind("click", function (event) { - var str = "( " + event.pageX + ", " + event.pageY + " )"; - $("span").text("Click happened! " + str); - }); - $("p").bind("dblclick", function () { - $("span").text("Double-click happened in " + this.nodeName); - }); - $("p").bind("mouseenter mouseleave", function (event) { - $(this).toggleClass("over"); - }); - $("p").bind("click", function () { - alert($(this).text()); - }); - function handler(event) { - alert(event.data.foo); - } - $("p").bind("click", { foo: "bar" }, handler) - $("form").bind("submit", function () { return false; }) - $("form").bind("submit", function (event) { - event.preventDefault(); - }); - $("form").bind("submit", function (event) { - event.stopPropagation(); - }); - $("p").bind("myCustomEvent", function (e, myName?, myValue?) { - $(this).text(myName + ", hi there!"); - $("span").stop().css("opacity", 1) - .text("myName = " + myName) - .fadeIn(30).fadeOut(1000); - }); - $("button").click(function () { - $("p").trigger("myCustomEvent", ["John"]); - }); - $("div.test").bind({ - click: function () { - $(this).addClass("active"); - }, - mouseenter: function () { - $(this).addClass("inside"); - }, - mouseleave: function () { - $(this).removeClass("inside"); } - }); -} + } -function test_unbind() { - $("#foo").unbind(); - - $("#foo").unbind("click"); - - var handler = function () { - alert("The quick brown fox jumps over the lazy dog."); - }; - $("#foo").bind("click", handler); - $("#foo").unbind("click", handler); - - $("#foo").bind("click", function () { - alert("The quick brown fox jumps over the lazy dog."); - }); - - // Will NOT work - $("#foo").unbind("click", function () { - alert("The quick brown fox jumps over the lazy dog."); - }); - - $("#foo").bind("click.myEvents", handler); - - $("#foo").unbind("click"); - - $("#foo").unbind("click.myEvents"); - - $("#foo").unbind(".myEvents"); - - var timesClicked = 0; - $("#foo").bind("click", function (event) { - alert("The quick brown fox jumps over the lazy dog."); - timesClicked++; - if (timesClicked >= 3) { - $(this).unbind(event); + function isNumeric() { + function type_guard(obj: boolean) { + if ($.isNumeric(obj)) { + obj.toFixed(); + } } - }); - - function aClick() { - $("div").show().fadeOut("slow"); } - $("#bind").click(function () { - $("#theone") - .bind("click", aClick) - .text("Can Click!"); - }); - $("#unbind").click(function () { - $("#theone") - .unbind("click", aClick) - .text("Does nothing..."); - }); - $("p").unbind(); - - $("p").unbind("click"); - - var foo = function () { - // Code to handle some kind of event - }; - - $("p").bind("click", foo); // ... Now foo will be called when paragraphs are clicked ... - - $("p").unbind("click", foo); // ... foo will no longer be called. -} - -function test_blur() { - $('#target').blur(function () { - alert('Handler for .blur() called.'); - }); - $('#other').click(function () { - $('#target').blur(); - - }); - $("p").blur(); -} - -interface JQueryStatic { Topic; } -function test_callbacks() { - function fn1(value) { - console.log(value); + function isPlainObject() { + function type_guard(obj: object) { + if ($.isPlainObject(obj)) { + obj['key'] = true; + } + } } - function fn2(value) { - fn1("fn2 says:" + value); - return false; - } - var callbacks = $.Callbacks(); - var callbacks2 = $.Callbacks("once"); - callbacks.add(fn1); - callbacks.fire("foo!"); - callbacks.add(fn2); - callbacks.fire("bar!"); - callbacks.remove(fn2); - callbacks.fire("foobar"); - var topics = {}; - jQuery.Topic = function (id) { - var callbacks, - method, - topic = id && topics[id]; - if (!topic) { - callbacks = jQuery.Callbacks(); - topic = { - publish: callbacks.fire, - subscribe: callbacks.add, - unsubscribe: callbacks.remove + function isWindow() { + function type_guard(obj: object) { + if ($.isWindow(obj)) { + obj.location.href === 'href'; + } + } + } + + function map() { + function object() { + const testObj = { + myProp: true, + name: 'Rogers', }; - if (id) { - topics[id] = topic; - } - } - return topic; - }; - $.Topic("mailArrived").subscribe(fn1); - $.Topic("mailArrived").subscribe(fn2); - $.Topic("mailSent").subscribe(fn1); - $.Topic("mailArrived").publish("hello world!"); - $.Topic("mailSent").publish("woo! mail!"); - $.Topic("mailArrived").subscribe(fn1); - var dfd = $.Deferred(); - var topic = $.Topic("mailArrived"); - dfd.done(topic.publish); - dfd.resolve("its been published!"); -} - -function test_callbacksFunctions() { - var foo = function (value) { - console.log('foo:' + value); - } - var bar = function (value) { - console.log('bar:' + value); - } - var callbacks = $.Callbacks(); - callbacks.add(foo); - callbacks.fire('hello'); - callbacks.add(bar); - callbacks.fire('world'); - callbacks.disable(); - - // Test the disabled state of the list - console.log(callbacks.disabled()); - // Outputs: true - - callbacks.empty(); - callbacks.fire('hello'); - console.log(callbacks.fired()); - callbacks.fireWith(window, ['foo', 'bar']); - var foo2 = function (value1, value2) { - console.log('Received:' + value1 + ',' + value2); - }; - console.log(callbacks.has(foo2)); - callbacks.lock(); - console.log(callbacks.locked()); - callbacks.remove(foo); -} - -function test_change() { - $('.target').change(function () { - alert('Handler for .change() called.'); - }); - $('#other').click(function () { - $('.target').change(); - }); - $("input[type='text']").change(function () { }); - $("input[type='text']").change(); -} - -function test_children() { - $('ul.level-2').children().css('background-color', 'red'); - $("#container").click(function (e) { - $("*").removeClass("hilite"); - var $kids = $(e.target).children(); - var len = $kids.addClass("hilite").length; - - $("#results span:first").text(len); - //$("#results span:last").text(e.target.tagName); - - e.preventDefault(); - return false; - }); - $("div").children(".selected").css("color", "blue"); -} - -function test_clearQueue() { - $("#start").click(function () { - var myDiv = $("div"); - myDiv.show("slow"); - myDiv.animate({ left: '+=200' }, 5000); - myDiv.queue(function () { - var _this = $(this); - _this.addClass("newcolor"); - _this.dequeue(); - }); - myDiv.animate({ left: '-=200' }, 1500); - myDiv.queue(function () { - var _this = $(this); - _this.removeClass("newcolor"); - _this.dequeue(); - }); - myDiv.slideUp(); - - }); - $("#stop").click(function () { - var myDiv = $("div"); - myDiv.clearQueue(); - myDiv.stop(); - }); -} - -function test_click() { - $("#target").click(function () { - alert("Handler for .click() called."); - }); - $("#other").click(function () { - $("#target").click(); - }); - $("p").click(function () { - $(this).slideUp(); - }); - $("p").click(); -} - -function test_submit() { - $("#target").submit(function () { - alert("Handler for .submit() called."); - }); - $("#target").submit(); -} - -function test_trigger() { - - $("#foo").on("click", function () { - alert($(this).text()); - }); - $("#foo").trigger("click"); - - $("#foo").on("custom", function (event, param1?, param2?) { - alert(param1 + "\n" + param2); - }); - $("#foo").trigger("custom", ["Custom", "Event"]); - - $("button:first").click(function () { - update($("span:first")); - }); - - $("button:last").click(function () { - $("button:first").trigger("click"); - update($("span:last")); - }); - - function update(j) { - var n = parseInt(j.text(), 10); - j.text(n + 1); - } - - $("form:first").trigger("submit"); - - var event = jQuery.Event("submit"); - $("form:first").trigger(event); - if (event.isDefaultPrevented()) { - // Perform an action... - } - - $("p") - .click(function (event, a, b) { - // When a normal click fires, a and b are undefined - // for a trigger like below a refers to "foo" and b refers to "bar" - }) - .trigger("click", ["foo", "bar"]); - - var event = jQuery.Event("logged"); - (event).user = "foo"; - (event).pass = "bar"; - $("body").trigger(event); - - // Adapted from jQuery documentation which may be wrong on this occasion - var event2 = jQuery.Event("logged"); - $("body").trigger(event2, { - type: "logged", - user: "foo", - pass: "bar" - }); -} - -function test_clone() { - $('.hello').clone().appendTo('.goodbye'); - var $elem = $('#elem').data({ "arr": [1] }), - $clone = $elem.clone(true) - .data("arr", $.extend([], $elem.data("arr"))); - $("b").clone().prependTo("p"); - $('#copy').append($('#orig .elem') - .clone() - .children('a') - .prepend('foo - ') - .parent() - .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")); - $("span").prependTo("#foo"); -} - -function test_closest() { - $('li.item-a').closest('ul') - .css('background-color', 'red'); - $('li.item-a').closest('li') - .css('background-color', 'red'); - var listItemII = document.getElementById('ii'); - $('li.item-a').closest('ul', listItemII) - .css('background-color', 'red'); - $('li.item-a').closest('#one', listItemII) - .css('background-color', 'green'); - $(document).bind("click", function (e) { - $(e.target).closest("li").toggleClass("hilight"); - }); - var $listElements = $("li").css("color", "blue"); - $(document).bind("click", function (e) { - //$(e.target).closest($listElements).toggleClass("hilight"); - }); -} - -function test_contains() { - jQuery.contains(document.documentElement, document.body); - jQuery.contains(document.body, document.documentElement); -} - -function test_contents() { - $('.container').contents().filter(function () { - return this.nodeType == 3; - }) - .wrap('

    ') - .end() - .filter('br') - .remove(); - $("#frameDemo").contents().find("a").css("background-color", "#BADA55"); -} - -function test_context() { - $("ul") - .append("
  • " + $("ul").context + "
  • ") - .append("
  • " + $("ul", document.body).context.nodeName + "
  • "); -} - -function test_css() { - $("div").click(function () { - var color = $(this).css("background-color"); - $("#result").html("That div is " + color + "."); - }); - $('div.example').css('width', function (index) { - return index * 50; - }); - $("p").mouseover(function () { - $(this).css("color", "red"); - }); - $("#box").one("click", function () { - $(this).css("width", "+=200"); - }); - var words = $("p:first").text().split(" "); - var text = words.join(" "); - $("p:first").html("" + text + ""); - $("span").click(function () { - $(this).css("background-color", "yellow"); - }); - $("p").hover(function () { - $(this).css({ 'background-color': 'yellow', 'font-weight': 'bolder' }); - }, function () { - var cssObj = { - 'background-color': '#ddd', - 'font-weight': '', - 'color': 'rgb(0,40,244)' - } - $(this).css(cssObj); - }); - $("div").click(function () { - $(this).css({ - width: function (index, value) { - return parseFloat(value) * 1.2; - }, - height: function (index, value) { - return parseFloat(value) * 1.2; - } - }); - }); - var dims = $("#box").css([ "width", "height", "backgroundColor" ]); -} - -function test_cssHooks() { - if (!$.cssHooks) { - throw ("jQuery 1.4.3 or above is required for this plugin to work"); - } - $.cssHooks["someCSSProp"] = { - get: function (elem, computed, extra) { }, - set: function (elem, value) { } - }; - function styleSupport(prop) { - var vendorProp, supportedProp, - capProp = prop.charAt(0).toUpperCase() + prop.slice(1), - prefixes = ["Moz", "Webkit", "O", "ms"], - div = document.createElement("div"); - - if (prop in div.style) { - supportedProp = prop; - } else { - for (var i = 0; i < prefixes.length; i++) { - vendorProp = prefixes[i] + capProp; - if (vendorProp in div.style) { - supportedProp = vendorProp; - break; + const results = $.map(testObj, (propertyOfObject, key) => { + switch (key) { + case 'myProp': + return 1; + case 'name': + return false; } - } - } - div = null; - $.support[prop] = supportedProp; - return supportedProp; - } - styleSupport("borderRadius"); - - $.cssNumber["someCSSProp"] = true; - $.fx.step["someCSSProp"] = function (fx) { - $.cssHooks["someCSSProp"].set(fx.elem, fx.now + fx.unit); - }; -} - -function test_data() { - $('body').data('foo', 52); - $('body').data('bar', { myType: 'test', count: 40 }); - $('body').data('foo'); - $('body').data(); - $("div").data("test", { first: 16, last: "pizza!" }); - $("span:first").text($("div").data("test").first); - $("span:last").text($("div").data("test").last); - alert($('body').data('foo')); - alert($('body').data()); - alert($("body").data("foo")); - $("body").data("bar", "foobar"); - alert($("body").data("bar")); - $("div").data("role") === "page"; - $("div").data("lastValue") === 43; - $("div").data("hidden") === true; - $("div").data("options").name === "John"; - var value; - switch ($("button").index(this)) { - case 0: - value = $("div").data("blah"); - break; - case 1: - $("div").data("blah", "hello"); - value = "Stored!"; - break; - case 2: - $("div").data("blah", 86); - value = "Stored!"; - break; - case 3: - $("div").removeData("blah"); - value = "Removed!"; - break; - } - $("span").text("" + value); - jQuery.data(document.body, 'foo', 52); - jQuery.data(document.body, 'bar', 'test'); - var div = $("div")[0]; - jQuery.data(div, "test", { first: 16, last: "pizza!" }); - $("span:first").text(jQuery.data(div, "test").first); - $("span:last").text(jQuery.data(div, "test").last); - $.data(document.getElementById("id"), "", 8).toFixed(2); - $.data(document.getElementById("id"), "", "8").toUpperCase(); -} - -function test_removeData() { - $("span:eq(0)").text("" + $("div").data("test1")); - $("div").data("test1", "VALUE-1"); - $("div").data("test2", "VALUE-2"); - $("span:eq(1)").text("" + $("div").data("test1")); - $("div").removeData("test1"); - $("span:eq(2)").text("" + $("div").data("test1")); - $("span:eq(3)").text("" + $("div").data("test2")); -} - -function test_jQuery_removeData() { - var div = $("div")[0]; - $("span:eq(0)").text("" + $("div").data("test1")); - jQuery.data(div, "test1", "VALUE-1"); - jQuery.data(div, "test2", "VALUE-2"); - $("span:eq(1)").text("" + jQuery.data(div, "test1")); - jQuery.removeData(div, "test1"); - $("span:eq(2)").text("" + jQuery.data(div, "test1")); - $("span:eq(3)").text("" + jQuery.data(div, "test2")); -} - -function test_removeDataAll() { - var el = $("div"); - el.data("test1", "VALUE-1"); - el.data("test2", "VALUE-2"); - el.removeData(); -} - -function test_dblclick() { - $('#target').dblclick(function () { - alert('Handler for .dblclick() called.'); - }); - $('#other').click(function () { - $('#target').dblclick(); - }); - $("p").dblclick(function () { alert("Hello World!"); }); - var divdbl = $("div:first"); - divdbl.dblclick(function () { - divdbl.toggleClass('dbl'); - }); - $('#target').dblclick(); -} - -function test_delay() { - $('#foo').slideUp(300).delay(800).fadeIn(400); - $("button").click(function () { - $("div.first").slideUp(300).delay(800).fadeIn(400); - $("div.second").slideUp(300).fadeIn(400); - }); -} - -function test_delegate() { - $("table").delegate("td", "click", function () { - $(this).toggleClass("chosen"); - }); - $("table").on("click", "td", function () { - $(this).toggleClass("chosen"); - }); - $("body").delegate("p", "click", function () { - $(this).after("

    Another paragraph!

    "); - }); - $("body").delegate("p", "click", function () { - alert($(this).text()); - }); - $("body").delegate("a", "click", function () { return false; }); - $("body").delegate("a", "click", function (event) { - event.preventDefault(); - }); - $("body").delegate("p", "myCustomEvent", function (e, myName?, myValue?) { - $(this).text("Hi there!"); - $("span").stop().css("opacity", 1) - .text("myName = " + myName) - .fadeIn(30).fadeOut(1000); - }); - $("button").click(function () { - $("p").trigger("myCustomEvent"); - }); -} - -function test_undelegate() { - function aClick() { - $("div").show().fadeOut("slow"); - } - $("#bind").click(function () { - $("body") - .delegate("#theone", "click", aClick) - .find("#theone").text("Can Click!"); - }); - $("#unbind").click(function () { - $("body") - .undelegate("#theone", "click", aClick) - .find("#theone").text("Does nothing..."); - }); - - $("p").undelegate(); - - $("p").undelegate("click"); - - var foo = function () { - // Code to handle some kind of event - }; - - // ... Now foo will be called when paragraphs are clicked ... - $("body").delegate("p", "click", foo); - - // ... foo will no longer be called. - $("body").undelegate("p", "click", foo); - - var foo = function () { - // Code to handle some kind of event - }; - - // Delegate events under the ".whatever" namespace - $("form").delegate(":button", "click.whatever", foo); - - $("form").delegate("input[type='text'] ", "keypress.whatever", foo); - - // Unbind all events delegated under the ".whatever" namespace - $("form").undelegate(".whatever"); -} - -function test_dequeue() { - $("button").click(function () { - $("div").animate({ left: '+=200px' }, 2000); - $("div").animate({ top: '0px' }, 600); - $("div").queue(function () { - $(this).toggleClass("red"); - $(this).dequeue(); - }); - $("div").animate({ left: '10px', top: '30px' }, 700); - }); -} - -function test_queue() { - - $("#show").click(function () { - var n = jQuery.queue($("div")[0], "fx"); - $("span").text("Queue length is: " + n.length); - }); - - function runIt() { - $("div") - .show("slow") - .animate({ - left: "+=200" - }, 2000) - .slideToggle(1000) - .slideToggle("fast") - .animate({ - left: "-=200" - }, 1500) - .hide("slow") - .show(1200) - .slideUp("normal", runIt); - } - - runIt(); - - $(document.body).click(function () { - var divs = $("div") - .show("slow") - .animate({ left: "+=200" }, 2000); - jQuery.queue(divs[0], "fx", function () { - $(this).addClass("newcolor"); - jQuery.dequeue(this); - }); - divs.animate({ left: "-=200" }, 500); - jQuery.queue(divs[0], "fx", function () { - $(this).removeClass("newcolor"); - jQuery.dequeue(this); - }); - divs.slideUp(); - }); - - $("#start").click(function () { - var divs = $("div") - .show("slow") - .animate({ left: "+=200" }, 5000); - jQuery.queue(divs[0], "fx", function () { - $(this).addClass("newcolor"); - jQuery.dequeue(this); - }); - divs.animate({ left: "-=200" }, 1500); - jQuery.queue(divs[0], "fx", function () { - $(this).removeClass("newcolor"); - jQuery.dequeue(this); - }); - divs.slideUp(); - }); - $("#stop").click(function () { - jQuery.queue($("div")[0], "fx", []); - $("div").stop(); - }); -} - -function test_detach() { - $("p").click(function () { - $(this).toggleClass("off"); - }); - var p; - $("button").click(function () { - if (p) { - p.appendTo("body"); - p = null; - } else { - p = $("p").detach(); - } - }); -} - -function test_each() { - var numArray: number[]; - numArray = $.each([1, 2, 3, 4], function (index: number, value: number) { - alert(index + ': ' + value); - }); - numArray = $.each([1, 2, 3, 4], function (index: number, value: number) { - alert(index + ': ' + value); - return value < 2; - }); - - var res: {one: number, 2: string}; - res = $.each({ one: 1, 2: "two" }, function(key: string, value: any) { - alert(key + ': ' + value); - }); - res = $.each({ one: 1, 2: "two" }, function(key: string, value: any) { - alert(key + ': ' + value); - return key === "2"; - }); - - var map = { - 'flammable': 'inflammable', - 'duh': 'no duh' - }; - $.each(map, function (key, value) { - alert(key + ': ' + value); - }); - var arr = ["one", "two", "three", "four", "five"]; - var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 }; - jQuery.each(arr, function () { - $("#" + this).text("Mine is " + this + "."); - return (this != "three"); - }); - jQuery.each(obj, function (i, val) { - $("#" + i).append(document.createTextNode(" - " + val)); - }); - $.each(['a', 'b', 'c'], function (i, l) { - alert("Index #" + i + ": " + l); - }); - $.each({ name: "John", lang: "JS" }, function (k, v) { - alert("Key: " + k + ", Value: " + v); - }); - $.each([{a: 1}, {a: 2}, {a: 3}], function (i, o) { - alert("Index #" + i + ": " + o.a); - }); - $('li').each(function (index) { - alert(index + ': ' + $(this).text()); - }); - $(document.body).click(function () { - $("div").each(function (i) { - if (this.style.color != "blue") { - this.style.color = "blue"; - } else { - this.style.color = ""; - } - }); - }); - $("span").click(function () { - $("li").each(function () { - $(this).toggleClass("example"); - }); - }); - $("button").click(function () { - $("div").each(function (index, domEle) { - // domEle == this - $(domEle).css("backgroundColor", "yellow"); - if ($(this).is("#stop")) { - $("span").text("Stopped at div index #" + index); - return false; - } - }); - }); -} - -function test_empty() { - $('.hello').empty(); -} - -function test_end() { - $('ul.first').find('.foo').css('background-color', 'red') - .end().find('.bar').css('background-color', 'green'); - $('ul.first').find('.foo') - .css('background-color', 'red') - .end().find('.bar') - .css('background-color', 'green') - .end(); -} - -function test_eq() { - $('li').eq(2).css('background-color', 'red'); - $('li').eq(-2).css('background-color', 'red'); - $('li').eq(5).css('background-color', 'red'); - $("body").find("div").eq(2).addClass("blue"); -} - -function test_error() { - $('#book') - .error(function () { - alert('Handler for .error() called.') - }) - .attr("src", "missing.png"); - $("img") - .error(function () { - $(this).hide(); - }) - .attr("src", "missing.png"); - jQuery.error("Oups"); - jQuery.error = (message?: string) => { - console.error(message); return this; - }; -} - -function test_eventParams() { - $("p").click(function (event) { - event.currentTarget === this; - }); - $(".box").on("click", "button", function (event) { - $(event.delegateTarget).css("background-color", "red"); - }); - $("a").click(function (event) { - event.isDefaultPrevented(); - event.preventDefault(); - event.isDefaultPrevented(); - }); - function immediatePropStopped(e) { - var msg = ""; - if (e.isImmediatePropagationStopped()) { - msg = "called" - } else { - msg = "not called"; - } - $("#stop-log").append("
    " + msg + "
    "); - } - $("button").click(function (event) { - immediatePropStopped(event); - event.stopImmediatePropagation(); - immediatePropStopped(event); - }); - function propStopped(e) { - var msg = ""; - if (e.isPropagationStopped()) { - msg = "called"; - } else { - msg = "not called"; - } - $("#stop-log").append("
    " + msg + "
    "); - } - $("button").click(function (event) { - propStopped(event); - event.stopPropagation(); - propStopped(event); - }); - $("p").bind("test.something", function (event) { - alert(event.namespace); - }); - $("button").click(function (event) { - $("p").trigger("test.something"); - }); - $(document).bind('mousemove', function (e) { - $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY); - }); - $("a").click(function (event) { - event.preventDefault(); - $('
    ') - .append('default ' + event.type + ' prevented') - .appendTo('#log'); - }); - $("a").mouseout(function (event) { - alert(event.relatedTarget.nodeName); - }); - $("button").click(function (event) { - return "hey"; - }); - $("button").click(function (event) { - $("p").html(event.result); - }); - $("p").click(function (event) { - event.stopImmediatePropagation(); - }); - $("p").click(function (event) { - $(this).css("background-color", "#f00"); - }); - $("div").click(function (event) { - $(this).css("background-color", "#f00"); - }); - $("p").click(function (event) { - event.stopPropagation(); - }); - $("body").click(function (event) { - //bugfix, duplicate identifier. see: http://stackoverflow.com/questions/14824143/duplicate-identifier-nodename-in-jquery-d-ts - //$("#log").html("clicked: " + event.target.nodeName); - }); - $('#whichkey').bind('keydown', function (e) { - $('#log').html(e.type + ': ' + e.which); - }); - $('#whichkey').bind('mousedown', function (e) { - $('#log').html(e.type + ': ' + e.which); - }); - $(window).on('mousewheel', (e) => { - var delta = (e.originalEvent).deltaY; - }); - $( "p" ).click(function( event ) { - alert( event.currentTarget === this ); // true - }); -} - -function test_extend() { - var object1 = { - apple: 0, - banana: { weight: 52, price: 100 }, - cherry: 97 - }; - var object2 = { - banana: { price: 200 }, - durian: 100 - }; - $.extend(object1, object2); - var printObj = typeof JSON != "undefined" ? JSON.stringify : function (obj) { - var arr = []; - $.each(obj, function (key, val) { - var next = key + ": "; - next += $.isPlainObject(val) ? printObj(val) : val; - arr.push(next); - }); - return "{ " + arr.join(", ") + " }"; - }; - $("#log").append(printObj(object1)); - - var defaults = { validate: false, limit: 5, name: "foo" }; - var options = { validate: true, name: "bar" }; - var settings: typeof defaults = $.extend({}, defaults, options); -} - -function test_fadeIn() { - $('#clickme').click(function () { - $('#book').fadeIn('slow', function () { }); - }); - $(document.body).click(function () { - $("div:hidden:first").fadeIn("slow"); - }); - $("a").click(function () { - $("div").fadeIn(3000, function () { - $("span").fadeIn(100); - }); - return false; - }); -} - -function test_fadeOut() { - $('#clickme').click(function () { - $('#book').fadeOut('slow', function () { }); - }); - $("p").click(function () { - $("p").fadeOut("slow"); - }); - $("span").click(function () { - $(this).fadeOut(1000, function () { - $("div").text("'" + $(this).text() + "' has faded!"); - $(this).remove(); - }); - }); - $("span").hover(function () { - $(this).addClass("hilite"); - }, function () { - $(this).removeClass("hilite"); - }); - $("#btn1").click(function () { - function complete() { - $("
    ").text(this.id).appendTo("#log"); - } - $("#box1").fadeOut(1600, "linear", complete); - $("#box2").fadeOut(1600, complete); - }); - $("#btn2").click(function () { - $("div").show(); - $("#log").empty(); - }); -} - -function test_fadeTo() { - $('#clickme').click(function () { - $('#book').fadeTo('slow', 0.5, function () { }); - }); - $("p:first").click(function () { - $(this).fadeTo("slow", 0.33); - }); - $("div").click(function () { - $(this).fadeTo("fast", Math.random()); - }); - var getPos = function (n) { - return (Math.floor(n) * 90) + "px"; - }; - $("p").each(function (n) { - var r = Math.floor(Math.random() * 3); - var tmp = $(this).text(); - $(this).text($("p:eq(" + r + ")").text()); - $("p:eq(" + r + ")").text(tmp); - $(this).css("left", getPos(n)); - }); - $("div").each(function (n) { - $(this).css("left", getPos(n)); - }) - .css("cursor", "pointer") - .click(function () { - $(this).fadeTo(250, 0.25, function () { - $(this).css("cursor", "") - .prev().css({ - "font-weight": "bolder", - "font-style": "italic" - }); - }); - }); -} - -function test_fadeToggle() { - $("button:first").click(function () { - $("p:first").fadeToggle("slow", "linear"); - }); - $("button:last").click(function () { - $("p:last").fadeToggle("fast", function () { - $("#log").append("
    finished
    "); - }); - }); -} - -function test_filter() { - $('li').filter(':even').css('background-color', 'red'); - $('li').filter(function (index) { - return index % 3 === 2; - }).css('background-color', 'red'); - $("div").css("background", "#b4b0da") - .filter(function (index) { - return index === 1 || $(this).attr("id") === "fourth"; - }) - .css("border", "3px double red"); - $("div").filter(document.getElementById("unique")); - $("div").filter($("#unique")); -} - -function test_find() { - $('li.item-ii').find('li').css('background-color', 'red'); - var item1 = $('li.item-1')[0]; - $('li.item-ii').find(item1).css('background-color', 'red'); - var $spans = $('span'); - $("p").find($spans).css('color', 'red'); - var newText = $("p").text().split(" ").join(" "); - newText = "" + newText + ""; - $("p").html(newText) - .find('span') - .hover(function () { - $(this).addClass("hilite"); - }, - function () { - $(this).removeClass("hilite"); - }) - .end() - .find(":contains('t')") - .css({ "font-style": "italic", "font-weight": "bolder" }); -} - -function test_finish() { - $(".box").finish(); -} - -function test_first() { - $('li').first().css('background-color', 'red'); -} - -function test_focus() { - $('#target').focus(function () { - alert('Handler for .focus() called.'); - }); - $('#other').click(function () { - $('#target').focus(); - }); - $("input").focus(function () { - $(this).next("span").css('display', 'inline').fadeOut(1000); - }); - $("input[type=text]").focus(function () { - $(this).blur(); - }); - $(document).ready(function () { - $("#login").focus(); - }); -} - -function test_focusin() { - $("p").focusin(function () { - $(this).find("span").css('display', 'inline').fadeOut(1000); - }); -} - -function test_focusout() { - var fo = 0, b = 0; - $("p").focusout(function () { - fo++; - $("#fo") - .text("focusout fired: " + fo + "x"); - }).blur(function () { - b++; - $("#b") - .text("blur fired: " + b + "x"); - }); -} - -function test_easing() { - const easing = jQuery.easing; - - function test_easing_function( name: string, fn: JQueryEasingFunction ) { - const step = Math.pow( 2, -3 ); // use power of 2 to prevent floating point rounding error - for( let i = 0; i <= 1; i += step ) { - console.log( `$.easing.${name}(${i}): ${fn.call(easing, i)}` ); - } - } - - test_easing_function( "linear", easing.linear ); - test_easing_function( "swing", easing.swing ); -} - -function test_fx() { - jQuery.fx.interval = 100; - $("input").click(function () { - $("div").toggle(3000); - }); - var toggleFx = function () { - $.fx.off = !$.fx.off; - }; - toggleFx(); - $("button").click(toggleFx) - $("input").click(function () { - $("div").toggle("slow"); - }); -} - -function test_get() { - $.get('ajax/test.html', function (data) { - $('.result').html(data); - alert('Load was performed.'); - }); - var jqxhr = $.get("example.php", function () { - alert("success"); - }) - .done(function () { alert("second success"); }) - .fail(function () { alert("error"); }); - - $.get("test.php"); - $.get("test.php", { name: "John", time: "2pm" }); - $.get("test.php", { 'choices[]': ["Jon", "Susan"] }); - $.get("test.php", function (data) { - alert("Data Loaded: " + data); - }); - $.get("test.cgi", { name: "John", time: "2pm" }, - function (data) { - alert("Data Loaded: " + data); - }); - $.get("test.php", - function (data) { - $('body').append("Name: " + data.name) - .append("Time: " + data.time); - }, "json"); - alert($('li').get()); - $('li').get(0); - $('li')[0]; - alert($('li').get(-1)); - function disp(divs) { - var a = []; - for (var i = 0; i < divs.length; i++) { - a.push(divs[i].innerHTML); - } - $("span").text(a.join(" ")); - } - disp($("div").get().reverse()); - $("*", document.body).click(function (e) { - e.stopPropagation(); - var domEl = $(this).get(0); - $("span:first").text("Clicked on - " + domEl.tagName); - }); -} - -function test_getJSON() { - $.getJSON('ajax/test.json', function (data) { - var items = []; - $.each(data, function (key, val) { - items.push('
  • ' + val + '
  • '); - }); - $('
      ', { - 'class': 'my-new-list', - html: items.join('') - }).appendTo('body'); - }); - var jqxhr = $.getJSON("example.json", function () { - alert("success"); - }) - .done(function () { alert("second success"); }) - .fail(function () { alert("error"); }); - $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?", - { - tags: "mount rainier", - tagmode: "any", - format: "json" - }, - function (data) { - $.each(data.items, function (i, item) { - $("").attr("src", item.media.m).appendTo("#images"); - if (i === "3") return false; - }); - }); - $.getJSON("test.js", function (json) { - alert("JSON Data: " + json.users[3].name); - }); - $.getJSON("test.js", { name: "John", time: "2pm" }, function (json) { - alert("JSON Data: " + json.users[3].name); - }); -} - -function test_getScript() { - $.getScript("ajax/test.js", function (data, textStatus, jqxhr) { - console.log(data); - console.log(textStatus); - console.log(jqxhr.status); - console.log('Load was performed.'); - }); - $.getScript("ajax/test.js") - .done(function (script, textStatus) { - console.log(textStatus); - }) - .fail(function (jqxhr, settings, exception) { - $("div.log").text("Triggered ajaxError handler."); - }); - $("div.log").ajaxError(function (e, jqxhr, settings, exception) { - if (settings.dataType == 'script') { - $(this).text("Triggered ajaxError handler."); - } - }); - $.ajaxSetup({ - cache: true - }); - $.getScript("/scripts/jquery.color.js", function () { - $("#go").click(function () { - $(".block").animate({ backgroundColor: "pink" }, 1000) - .delay(500) - .animate({ backgroundColor: "blue" }, 1000); - }); - }); -} - -function test_jQueryget() { - console.log($("li").get(0)); - console.log($("li")[0]); - console.log($("li").get(-1)); - $("*", document.body).click(function (event) { - event.stopPropagation(); - var domElement = $(this).get(0); - $("span:first").text("Clicked on - " + domElement.nodeName); - }); - - function display(divs) { - var a = []; - for (var i = 0; i < divs.length; i++) { - a.push(divs[i].innerHTML); - } - $("span").text(a.join(" ")); - } - display($("div").get().reverse()); -} - -function test_globalEval() { - jQuery.globalEval("var newVar = true;"); -} - -function test_grep() { - var arr = [1, 9, 3, 8, 6, 1, 5, 9, 4, 7, 3, 8, 6, 9, 1]; - $("div").text(arr.join(", ")); - arr = jQuery.grep(arr, function (n, i) { - return (n != 5 && i > 4); - }); - $("p").text(arr.join(", ")); - var arr2 = jQuery.grep(arr, function (a) { return a != 9; }); - $("span").text(arr.join(", ")); - $.grep([0, 1, 2], function (n, i) { - return n > 0; - }, true); - var arr3 = $.grep(["a", "b", "c"], function (n, i) { return n !== "b"; }); -} - -function test_has() { - $('li').has('ul').css('background-color', 'red'); - $("ul").append("
    • " + ($("ul").has("li").length ? "Yes" : "No") + "
    • "); - $("ul").has("li").addClass("full"); -} - -function test_hasClass() { - $('#mydiv').hasClass('foo'); - $("div#result1").append($("p:first").hasClass("selected").toString()); - $("div#result2").append($("p:last").hasClass("selected").toString()); - $("div#result3").append($("p").hasClass("selected").toString()); -} - -function test_hasData() { - var $p = jQuery("p"), p = $p[0]; - $p.append(jQuery.hasData(p) + " "); - $.data(p, "testing", 123); - $p.append(jQuery.hasData(p) + " "); - $.removeData(p, "testing"); - $p.append(jQuery.hasData(p) + " "); - $p.on('click', function () { }); - $p.append(jQuery.hasData(p) + " "); - $p.off('click'); - $p.append(jQuery.hasData(p) + " "); -} - -function test_jQuery_proxy() { - - function test1() { - var me = { - type: "zombie", - test: function (event?) { - // Without proxy, `this` would refer to the event target - // use event.target to reference that element. - var element = event.target; - $(element).css("background-color", "red"); - - // With proxy, `this` refers to the me object encapsulating - // this function. - $("#log").append("Hello " + this.type + "
      "); - $("#test").off("click", this.test); - } - }; - - var you = { - type: "person", - test: function (event?) { - $("#log").append(this.type + " "); - } - }; - - // Execute you.test() in the context of the `you` object - // no matter where it is called - // i.e. the `this` keyword will refer to `you` - var youClick = $.proxy(you.test, you); - - // attach click handlers to #test - $("#test") - // this === "zombie"; handler unbound after first click - .on("click", $.proxy(me.test, me)) - - // this === "person" - .on("click", youClick) - - // this === "zombie" - .on("click", $.proxy(you.test, me)) - - // this === "