diff --git a/ChangeLog.txt b/ChangeLog.txt
index 174ae16..426bd8e 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,6 +1,15 @@
Note: This is an Azure Storage only package. The all up Azure node sdk still has the old storage bits in there. In a future release, those storage bits will be removed and an npm dependency to this storage node sdk will
be taken. This is a CTP v1 release and the changes described below indicate the changes from the Azure node SDK 0.9.8 available here - https://github.com/Azure/azure-sdk-for-node.
+2016.01 Version 0.8.0
+
+ALL
+* Preview release of the TypeScript definition file at "lib/azure-storage.d.ts".
+
+BLOB
+* Added the blob result to the callback of BlobService.commitBlocks.
+* Added the speed summary to the downloading APIs.
+
2015.12 Version 0.7.0
ALL
diff --git a/lib/azure-storage.d.ts b/lib/azure-storage.d.ts
new file mode 100644
index 0000000..d3c1297
--- /dev/null
+++ b/lib/azure-storage.d.ts
@@ -0,0 +1,8313 @@
+//
+// Copyright (c) Microsoft and contributors. 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
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+///
+
+declare module "azure-storage" {
+ import * as events from 'events';
+ import * as url from 'url';
+ import * as stream from 'stream';
+
+ interface Map {
+ [index: string]: T;
+ }
+
+ interface SharedKeyGenerateSignatureArgs {
+ /** The resource type, if the resource is a blob or container. Null if the resource is a queue or table. */
+ resourceType?: string;
+ /** The table name, if the resource is a table. Null if the resource is a blob orqueue. */
+ tableName?: string;
+ /** The optional header values to set for a blob returned wth this SAS. */
+ headers?: {
+ /** The value of the Cache-Control response header to be returned when this SAS is used. */
+ CacheControl?: string;
+ /** The value of the Content-Type response header to be returned when this SAS is used. */
+ ContentType?: string;
+ /** The value of the Content-Encoding response header to be returned when this SAS is used. */
+ ContentEncoding?: string;
+ /** The value of the Content-Language response header to be returned when this SAS is used. */
+ ContentLanguage?: string;
+ /** The value of the Content-Disposition response header to be returned when this SAS is used. */
+ ContentDisposition: string;
+ };
+ }
+
+ interface SharedKeyGenerateQueryStringArgs extends SharedKeyGenerateSignatureArgs {
+ /** The query string, if additional parameters are desired. */
+ queryString?: string;
+ }
+
+ interface TableAccessPolicy extends azurestorage.common.AccessPolicy {
+ StartPk?: string;
+ EndPk?: string;
+ StartRk?: string;
+ EndRk?: string;
+ }
+
+ module azurestorage {
+ export interface StorageHost {
+ primaryHost: string;
+ secondaryHost?: string;
+ }
+
+ module services {
+ module blob {
+ // ###########################
+ // ./services/blob/blobservice
+ // ###########################
+ module blobservice {
+ export class BlobService extends StorageServiceClient {
+ singleBlobPutThresholdInBytes: number;
+ parallelOperationThreadCount: number;
+
+ /**
+ * Creates a new BlobService object.
+ * If no connection string or storageaccount and storageaccesskey are provided,
+ * the AZURE_STORAGE_CONNECTION_STRING or AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used.
+ * @class
+ * The BlobService class is used to perform operations on the Microsoft Azure Blob Service.
+ * The Blob Service provides storage for binary large objects, and provides
+ * functions for working with data stored in blobs as either streams or pages of data.
+ *
+ * For more information on the Blob Service, as well as task focused information on using it in a Node.js application, see
+ * [How to Use the Blob Service from Node.js](http://azure.microsoft.com/en-us/documentation/articles/storage-nodejs-how-to-use-blob-storage/).
+ * The following defaults can be set on the blob service.
+ * singleBlobPutThresholdInBytes The default maximum size, in bytes, of a blob before it must be separated into blocks.
+ * defaultTimeoutIntervalInMs The default timeout interval, in milliseconds, to use for request made via the Blob service.
+ * defaultMaximumExecutionTimeInMs The default maximum execution time across all potential retries, for requests made via the Blob service.
+ * defaultLocationMode The default location mode for requests made via the Blob service.
+ * parallelOperationThreadCount The number of parallel operations that may be performed when uploading a blob that is greater than
+ * the value specified by the singleBlobPutThresholdInBytes property in size.
+ * useNagleAlgorithm Determines whether the Nagle algorithm is used for requests made via the Blob service; true to use the
+ * Nagle algorithm; otherwise, false. The default value is false.
+ * @constructor
+ * @extends {StorageServiceClient}
+ *
+ * @param {string} [storageAccountOrConnectionString] The storage account or the connection string.
+ * @param {string} [storageAccessKey] The storage access key.
+ * @param {string|object} [host] The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @param {string} [sasToken] The Shared Access Signature token.
+ */
+ constructor(storageAccountOrConnectionString: string, storageAccessKey?: string, host?: string|StorageHost, sasToken?: string);
+
+ /**
+ * Gets the service stats for a storage account’s Blob service.
+ *
+ * @this {BlobService}
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs; otherwise, `result` will contain the stats and
+ * `response` will contain information related to this operation.
+ */
+ getServiceStats(optionsOrCallback: any, callback: any): void;
+ /**
+ * Gets the properties of a storage account’s Blob service, including Azure Storage Analytics.
+ *
+ * @this {BlobService}
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs; otherwise, `result` will contain the properties
+ * and `response` will contain information related to this operation.
+ */
+ getServiceProperties(optionsOrCallback: any, callback: any): void;
+ /**
+ * Sets the properties of a storage account’s Blob service, including Azure Storage Analytics.
+ * You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
+ *
+ * @this {BlobService}
+ * @param {object} serviceProperties The service properties.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise, `response`
+ * will contain information related to this operation.
+ */
+ setServiceProperties(serviceProperties: any, optionsOrCallback: any, callback: any): void;
+ /**
+ * Lists a segment containing a collection of container items under the specified account.
+ *
+ * @this {BlobService}
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.maxResults] Specifies the maximum number of containers to return per call to Azure storage.
+ * @param {string} [options.include] Include this parameter to specify that the container's metadata be returned as part of the response body. (allowed values: '', 'metadata')
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of containers and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listContainersSegmented(currentToken: any, optionsOrCallback: any, callback: any): void;
+ /**
+ * Lists a segment containing a collection of container items whose names begin with the specified prefix under the specified account.
+ *
+ * @this {BlobService}
+ * @param {string} prefix The prefix of the container name.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {string} [options.prefix] Filters the results to return only containers whose name begins with the specified prefix.
+ * @param {int} [options.maxResults] Specifies the maximum number of containers to return per call to Azure storage.
+ * @param {string} [options.include] Include this parameter to specify that the container's metadata be returned as part of the response body. (allowed values: '', 'metadata')
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of containers and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listContainersSegmentedWithPrefix(prefix: any, currentToken: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Checks whether or not a container exists on the service.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the container exists, or false if the container does not exist.
+ * `response` will contain information related to this operation.
+ */
+ doesContainerExist(container: string, options: common.RequestOptions, callback: ErrorOrResult): void;
+
+
+ /**
+ * Checks whether or not a container exists on the service.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the container exists, or false if the container does not exist.
+ * `response` will contain information related to this operation.
+ */
+ doesContainerExist(container: string, callback: ErrorOrResult): void;
+
+ /**
+ * Creates a new container under the specified account.
+ * If a container with the same name already exists, the operation fails.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the container information.
+ * `response` will contain information related to this operation.
+ */
+ createContainer(container: string, callback: ErrorOrResult): void;
+
+
+ /**
+ * Creates a new container under the specified account.
+ * If a container with the same name already exists, the operation fails.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {string} [options.publicAccessLevel] Specifies whether data in the container may be accessed publicly and the level of access.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the container information.
+ * `response` will contain information related to this operation.
+ */
+ createContainer(container: string, options: BlobService.CreateContainerOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Creates a new container under the specified account if the container does not exists.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the container was created, or false if the container
+ * already exists.
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * blobService.createContainerIfNotExists('taskcontainer', {publicAccessLevel : 'blob'}, function(error) {
+ * if(!error) {
+ * // Container created or exists, and is public
+ * }
+ * });
+ */
+ createContainerIfNotExists(container: string, callback: ErrorOrResult): void;
+
+ /**
+ * Creates a new container under the specified account if the container does not exists.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {string} [options.publicAccessLevel] Specifies whether data in the container may be accessed publicly and the level of access.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the container was created, or false if the container
+ * already exists.
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * blobService.createContainerIfNotExists('taskcontainer', {publicAccessLevel : 'blob'}, function(error) {
+ * if(!error) {
+ * // Container created or exists, and is public
+ * }
+ * });
+ */
+ createContainerIfNotExists(container: string, options: BlobService.CreateContainerOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Retrieves a container and its properties from a specified account.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the container.
+ * `response` will contain information related to this operation.
+ */
+ getContainerProperties(container: string, callback: ErrorOrResult): void;
+
+ /**
+ * Retrieves a container and its properties from a specified account.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {string} [options.leaseId] The container lease identifier.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the container.
+ * `response` will contain information related to this operation.
+ */
+ getContainerProperties(container: string, options: BlobService.ContainerOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Returns all user-defined metadata for the container.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the container.
+ * `response` will contain information related to this operation.
+ */
+ getContainerMetadata(container: string, callback: ErrorOrResult): void;
+
+ /**
+ * Returns all user-defined metadata for the container.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The container lease identifier.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the container.
+ * `response` will contain information related to this operation.
+ */
+ getContainerMetadata(container: string, options: BlobService.ContainerOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Sets the container's metadata.
+ *
+ * Calling the Set Container Metadata operation overwrites all existing metadata that is associated with the container.
+ * It's not possible to modify an individual name/value pair.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} metadata The metadata key/value pairs.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ setContainerMetadata(container: string, metadata: Map, callback: ErrorOrResult): void;
+
+ /**
+ * Sets the container's metadata.
+ *
+ * Calling the Set Container Metadata operation overwrites all existing metadata that is associated with the container.
+ * It's not possible to modify an individual name/value pair.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} metadata The metadata key/value pairs.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The container lease identifier.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {object} [options.accessConditions] See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ setContainerMetadata(container: string, metadata: Map, options: BlobService.ContainerOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Gets the container's ACL.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the container.
+ * `response` will contain information related to this operation.
+ */
+ getContainerAcl(container: string, callback: ErrorOrResult): void;
+
+ /**
+ * Gets the container's ACL.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The container lease identifier.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the container.
+ * `response` will contain information related to this operation.
+ */
+ getContainerAcl(container: string, options: BlobService.ContainerOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Updates the container's ACL.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} signedIdentifiers The signed identifiers. Signed identifiers must be in an array.
+ * @param {object} [options] The request options.
+ * @param {string} [options.publicAccessLevel] Specifies whether data in the container may be accessed publicly and the level of access.
+ * @param {string} [options.leaseId] The container lease identifier.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the container.
+ * `response` will contain information related to this operation.
+ */
+ setContainerAcl(container: string, signedIdentifiers: common.SignedIdentifier[], options: BlobService.ContainerAclOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Marks the specified container for deletion.
+ * The container and any blobs contained within it are later deleted during garbage collection.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ deleteContainer(container: string, callback: ErrorOrResponse): void;
+
+ /**
+ * Marks the specified container for deletion.
+ * The container and any blobs contained within it are later deleted during garbage collection.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The container lease identifier.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ deleteContainer(container: string, options: BlobService.ContainerOptions, callback: ErrorOrResponse): void;
+
+ /**
+ * Marks the specified container for deletion if it exists.
+ * The container and any blobs contained within it are later deleted during garbage collection.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the container exists and was deleted, or false if the container
+ * did not exist.
+ * `response` will contain information related to this operation.
+ */
+ deleteContainerIfExists(container: string, callback: ErrorOrResult): void;
+
+ /**
+ * Marks the specified container for deletion if it exists.
+ * The container and any blobs contained within it are later deleted during garbage collection.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The container lease identifier.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the container exists and was deleted, or false if the container
+ * did not exist.
+ * `response` will contain information related to this operation.
+ */
+ deleteContainerIfExists(container: string, options: BlobService.ContainerOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Lists a segment containing a collection of blob items in the container.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of blobs and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listBlobsSegmented(container: string, currentToken: common.ContinuationToken, callback: ErrorOrResult): void;
+
+ /**
+ * Lists a segment containing a collection of blob items in the container.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The request options.
+ * @param {string} [options.delimiter] Delimiter, i.e. '/', for specifying folder hierarchy.
+ * @param {int} [options.maxResults] Specifies the maximum number of blobs to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000)
+ * @param {string} [options.include] Specifies that the response should include one or more of the following subsets: '', 'metadata', 'snapshots', 'uncommittedblobs'). Multiple values can be added separated with a comma (,)
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of blobs and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listBlobsSegmented(container: string, currentToken: common.ContinuationToken, options: BlobService.ListBlobsSegmentedRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Lists a segment containing a collection of blob items whose names begin with the specified prefix in the container.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} prefix The prefix of the blob name.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the entries of blobs and the continuation token for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listBlobsSegmentedWithPrefix(container: string, prefix: string, currentToken: common.ContinuationToken, callback: ErrorOrResult): void;
+
+ /**
+ * Lists a segment containing a collection of blob items whose names begin with the specified prefix in the container.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} prefix The prefix of the blob name.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The request options.
+ * @param {string} [options.delimiter] Delimiter, i.e. '/', for specifying folder hierarchy.
+ * @param {int} [options.maxResults] Specifies the maximum number of blobs to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000)
+ * @param {string} [options.include] Specifies that the response should include one or more of the following subsets: '', 'metadata', 'snapshots', 'uncommittedblobs'). Multiple values can be added separated with a comma (,)
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs]The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the entries of blobs and the continuation token for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listBlobsSegmentedWithPrefix(container: string, prefix: string, currentToken: common.ContinuationToken, options: BlobService.ListBlobsSegmentedRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Acquires a new lease. If container and blob are specified, acquires a blob lease. Otherwise, if only container is specified and blob is null, acquires a container lease.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the lease information.
+ * `response` will contain information related to this operation.
+ */
+ acquireLease(container: string, blob: string, callback: ErrorOrResult): void;
+
+ /**
+ * Acquires a new lease. If container and blob are specified, acquires a blob lease. Otherwise, if only container is specified and blob is null, acquires a container lease.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseDuration] The lease duration in seconds. A non-infinite lease can be between 15 and 60 seconds. Default is never to expire.
+ * @param {string} [options.proposedLeaseId] The proposed lease identifier. Must be a GUID.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the lease information.
+ * `response` will contain information related to this operation.
+ */
+ acquireLease(container: string, blob: string, options: BlobService.AcquireLeaseRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Renews an existing lease. If container and blob are specified, renews the blob lease. Otherwise, if only container is specified and blob is null, renews the container lease.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} leaseId The lease identifier. Must be a GUID.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the lease information.
+ * `response` will contain information related to this operation.
+ */
+ renewLease(container: string, blob: string, leaseId: string, callback: ErrorOrResult): void;
+
+ /**
+ * Renews an existing lease. If container and blob are specified, renews the blob lease. Otherwise, if only container is specified and blob is null, renews the container lease.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} leaseId The lease identifier. Must be a GUID.
+ * @param {object} [options] The request options.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the lease information.
+ * `response` will contain information related to this operation.
+ */
+ renewLease(container: string, blob: string, leaseId: string, options: BlobService.LeaseRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Changes the lease ID of an active lease. If container and blob are specified, changes the blob lease. Otherwise, if only container is specified and blob is null, changes the
+ * container lease.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} leaseId The current lease identifier.
+ * @param {string} proposedLeaseId The proposed lease identifier. Must be a GUID.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the lease information.
+ * `response` will contain information related to this operation.
+ */
+ changeLease(container: string, blob: string, leaseId: string, proposedLeaseId: string, callback: ErrorOrResult): void;
+
+ /**
+ * Changes the lease ID of an active lease. If container and blob are specified, changes the blob lease. Otherwise, if only container is specified and blob is null, changes the
+ * container lease.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} leaseId The current lease identifier.
+ * @param {string} proposedLeaseId The proposed lease identifier. Must be a GUID.
+ * @param {object} [options] The request options.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the lease information.
+ * `response` will contain information related to this operation.
+ */
+ changeLease(container: string, blob: string, leaseId: string, proposedLeaseId: string, options: BlobService.LeaseRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Releases the lease. If container and blob are specified, releases the blob lease. Otherwise, if only container is specified and blob is null, releases the container lease.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} leaseId The lease identifier.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the lease information.
+ * `response` will contain information related to this operation.
+ */
+ releaseLease(container: string, blob: string, leaseId: string, callback: ErrorOrResult): void;
+
+ /**
+ * Releases the lease. If container and blob are specified, releases the blob lease. Otherwise, if only container is specified and blob is null, releases the container lease.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} leaseId The lease identifier.
+ * @param {object} [options] The request options.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the lease information.
+ * `response` will contain information related to this operation.
+ */
+ releaseLease(container: string, blob: string, leaseId: string, options: BlobService.LeaseRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Breaks the lease but ensures that another client cannot acquire a new lease until the current lease period has expired. If container and blob are specified, breaks the blob lease.
+ * Otherwise, if only container is specified and blob is null, breaks the container lease.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the lease information.
+ * `response` will contain information related to this operation.
+ */
+ breakLease(container: string, blob: string, callback: ErrorOrResult): void;
+
+ /**
+ * Breaks the lease but ensures that another client cannot acquire a new lease until the current lease period has expired. If container and blob are specified, breaks the blob lease.
+ * Otherwise, if only container is specified and blob is null, breaks the container lease.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {int} [options.leaseBreakPeriod] The lease break period, between 0 and 60 seconds. If unspecified, a fixed-duration lease breaks after
+ * the remaining lease period elapses, and an infinite lease breaks immediately.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the lease information.
+ * `response` will contain information related to this operation.
+ */
+ breakLease(container: string, blob: string, options: BlobService.BreakLeaseRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Returns all user-defined metadata, standard HTTP properties, and system properties for the blob.
+ * It does not return or modify the content of the blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the blob.
+ * `response` will contain information related to this operation.
+ */
+ getBlobProperties(container: string, blob: string, callback: ErrorOrResult): void;
+
+ /**
+ * Returns all user-defined metadata, standard HTTP properties, and system properties for the blob.
+ * It does not return or modify the content of the blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the blob.
+ * `response` will contain information related to this operation.
+ */
+ getBlobProperties(container: string, blob: string, optionsOrCallback: BlobService.BlobRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Returns all user-defined metadata for the specified blob or snapshot.
+ * It does not modify or return the content of the blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the blob.
+ * `response` will contain information related to this operation.
+ */
+ getBlobMetadata(container: string, blob: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Clears user-defined properties for the specified blob or snapshot.
+ * It does not modify or return the content of the blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the blob.
+ * `response` will contain information related to this operation.
+ */
+ setBlobProperties(container: string, blob: string, callback: ErrorOrResult<{ container: string; blob: string; etag: string; lastModified: string; requestId: string; }>): void;
+
+ /**
+ * Sets user-defined properties for the specified blob or snapshot.
+ * It does not modify or return the content of the blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition. (x-ms-blob-content-disposition)
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the blob.
+ * `response` will contain information related to this operation.
+ */
+ setBlobProperties(container: string, blob: string, optionsOrCallback: BlobService.SetBlobPropertiesRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Sets user-defined metadata for the specified blob or snapshot as one or more name-value pairs
+ * It does not modify or return the content of the blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} metadata The metadata key/value pairs.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information on the blob.
+ * `response` will contain information related to this operation.
+ */
+ setBlobMetadata(container: string, blob: string, metadata: Map, callback: ErrorOrResult): void;
+
+ /**
+ * Sets user-defined metadata for the specified blob or snapshot as one or more name-value pairs
+ * It does not modify or return the content of the blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} metadata The metadata key/value pairs.
+ * @param {object} [options] The request options.
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information on the blob.
+ * `response` will contain information related to this operation.
+ */
+ setBlobMetadata(container: string, blob: string, metadata: Map, options: BlobService.BlobRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Downloads a blob into a file.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} localFileName The local path to the file to be downloaded.
+ * @param {object} [options] The request options.
+ * @param {SpeedSummary} [options.speedSummary] The upload tracker objects.
+ * @param {int} [options.parallelOperationThreadCount] Parallel operation thread count
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {string} [options.rangeStart] Return only the bytes of the blob in the specified range.
+ * @param {string} [options.rangeEnd] Return only the bytes of the blob in the specified range.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions.
+ * @param {boolean} [options.disableContentMD5Validation] When set to true, MD5 validation will be disabled when downloading blobs.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the blob information.
+ * `response` will contain information related to this operation.
+ * @return {SpeedSummary}
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * blobService.getBlobToLocalFile('taskcontainer', 'task1', 'task1-download.txt', function(error, serverBlob) {
+ * if(!error) {
+ * // Blob available in serverBlob.blob variable
+ * }
+ */
+ getBlobToLocalFile(container: string, blob: string, localFileName: any, optionsOrCallback: any, callback: any): common.streams.speedsummary.SpeedSummary;;
+ /**
+ * Provides a stream to read from a blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {string} [options.rangeStart] Return only the bytes of the blob in the specified range.
+ * @param {string} [options.rangeEnd] Return only the bytes of the blob in the specified range.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions.
+ * @param {boolean} [options.disableContentMD5Validation] When set to true, MD5 validation will be disabled when downloading blobs.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the blob information.
+ * `response` will contain information related to this operation.
+ * @return {Stream}
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * var writable = fs.createWriteStream(destinationFileNameTarget);
+ * blobService.createReadStream(containerName, blobName).pipe(writable);
+ */
+ createReadStream(container: string, blob: string, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Downloads a blob into a stream.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {Stream} writeStream The write stream.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the blob information.
+ * `response` will contain information related to this operation.
+ * @return {SpeedSummary}
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * blobService.getBlobToStream('taskcontainer', 'task1', fs.createWriteStream('task1-download.txt'), function(error, serverBlob) {
+ * if(!error) {
+ * // Blob available in serverBlob.blob variable
+ * }
+ * });
+ */
+ getBlobToStream(container: string, blob: string, writeStream: stream.Writable, callback: ErrorOrResult): common.streams.speedsummary.SpeedSummary;
+
+ /**
+ * Downloads a blob into a stream.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {Stream} writeStream The write stream.
+ * @param {object} [options] The request options.
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {string} [options.rangeStart] Return only the bytes of the blob in the specified range.
+ * @param {string} [options.rangeEnd] Return only the bytes of the blob in the specified range.
+ * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions.
+ * @param {boolean} [options.disableContentMD5Validation] When set to true, MD5 validation will be disabled when downloading blobs.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the blob information.
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * blobService.getBlobToStream('taskcontainer', 'task1', fs.createWriteStream('task1-download.txt'), function(error, serverBlob) {
+ * if(!error) {
+ * // Blob available in serverBlob.blob variable
+ * }
+ * });
+ */
+ getBlobToStream(container: string, blob: string, writeStream: stream.Writable, options: BlobService.GetBlobRequestOptions, callback: ErrorOrResult): common.streams.speedsummary.SpeedSummary;
+
+ /**
+ * Downloads a blob into a text string.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {string} [options.rangeStart] Return only the bytes of the blob in the specified range.
+ * @param {string} [options.rangeEnd] Return only the bytes of the blob in the specified range.
+ * @param {boolean} [options.disableContentMD5Validation] When set to true, MD5 validation will be disabled when downloading blobs.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {BlobService~blobToText} callback `error` will contain information
+ * if an error occurs; otherwise `text` will contain the blob contents,
+ * and `blockBlob` will contain
+ * the blob information.
+ * `response` will contain information related to this operation.
+ */
+ getBlobToText(container: string, blob: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection.
+ * If a blob has snapshots, you must delete them when deleting the blob. Using the deleteSnapshots option, you can choose either to delete both the blob and its snapshots,
+ * or to delete only the snapshots but not the blob itself. If the blob has snapshots, you must include the deleteSnapshots option or the blob service will return an error
+ * and nothing will be deleted.
+ * If you are deleting a specific snapshot using the snapshotId option, the deleteSnapshots option must NOT be included.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; `response` will contain information related to this operation.
+ */
+ deleteBlob(container: string, blob: string, callback: ErrorOrResponse): void;
+
+ /**
+ * Marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection.
+ * If a blob has snapshots, you must delete them when deleting the blob. Using the deleteSnapshots option, you can choose either to delete both the blob and its snapshots,
+ * or to delete only the snapshots but not the blob itself. If the blob has snapshots, you must include the deleteSnapshots option or the blob service will return an error
+ * and nothing will be deleted.
+ * If you are deleting a specific snapshot using the snapshotId option, the deleteSnapshots option must NOT be included.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.deleteSnapshots] The snapshot delete option. See azure.BlobUtilities.SnapshotDeleteOptions.*.
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; `response` will contain information related to this operation.
+ */
+ deleteBlob(container: string, blob: string, options: BlobService.DeleteBlobRequestOptions, callback: ErrorOrResponse): void;
+
+ /**
+ * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted during garbage collection.
+ * If a blob has snapshots, you must delete them when deleting the blob. Using the deleteSnapshots option, you can choose either to delete both the blob and its snapshots,
+ * or to delete only the snapshots but not the blob itself. If the blob has snapshots, you must include the deleteSnapshots option or the blob service will return an error
+ * and nothing will be deleted.
+ * If you are deleting a specific snapshot using the snapshotId option, the deleteSnapshots option must NOT be included.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the blob was deleted, or false if the blob
+ * does not exist.
+ * `response` will contain information related to this operation.
+ */
+ deleteBlobIfExists(container: string, blob: string, callback: ErrorOrResult): void;
+
+ /**
+ * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted during garbage collection.
+ * If a blob has snapshots, you must delete them when deleting the blob. Using the deleteSnapshots option, you can choose either to delete both the blob and its snapshots,
+ * or to delete only the snapshots but not the blob itself. If the blob has snapshots, you must include the deleteSnapshots option or the blob service will return an error
+ * and nothing will be deleted.
+ * If you are deleting a specific snapshot using the snapshotId option, the deleteSnapshots option must NOT be included.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.deleteSnapshots] The snapshot delete option. See azure.BlobUtilities.SnapshotDeleteOptions.*.
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the blob was deleted, or false if the blob
+ * does not exist.
+ * `response` will contain information related to this operation.
+ */
+ deleteBlobIfExists(container: string, blob: string, options: BlobService.DeleteBlobRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Checks whether or not a blob exists on the service.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `errorOrResult` will
+ * be true if the blob exists, or false if the blob does not exist.
+ * `response` will contain information related to this operation.
+ */
+ doesBlobExist(container: string, blob: string, callback: ErrorOrResult): void;
+
+ /**
+ * Checks whether or not a blob exists on the service.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `errorOrResult` will
+ * be true if the blob exists, or false if the blob does not exist.
+ * `response` will contain information related to this operation.
+ */
+ doesBlobExist(container: string, blob: string, options: common.RequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Creates a read-only snapshot of a blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the ID of the snapshot.
+ * `response` will contain information related to this operation.
+ */
+ createBlobSnapshot(container: string, blob: string, optionsOrCallback: any, callback: ErrorOrResult): void;
+
+ /**
+ * Starts to copy a blob to a destination within the storage account. The Copy Blob operation copies the entire committed blob.
+ *
+ * @this {BlobService}
+ * @param {string} sourceUri The source blob URI.
+ * @param {string} targetContainer The target container name.
+ * @param {string} targetBlob The target blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.snapshotId] The source blob snapshot identifier.
+ * @param {object} [options.metadata] The target blob metadata key/value pairs.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {string} [options.sourceLeaseId] The source blob lease identifier.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {object} [options.sourceAccessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the blob information.
+ * `response` will contain information related to this operation.
+ */
+ startCopyBlob(sourceUri: string, targetcontainer: string, targetblob: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Abort a blob copy operation.
+ *
+ * @this {BlobService}
+ * @param {string} container The destination container name.
+ * @param {string} blob The destination blob name.
+ * @param {string} copyId The copy operation identifier.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the blob information.
+ * `response` will contain information related to this operation.
+ */
+ abortCopyBlob(container: string, blob: string, copyId: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Retrieves a shared access signature token.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} [blob] The blob name.
+ * @param {object} sharedAccessPolicy The shared access policy.
+ * @param {string} [sharedAccessPolicy.Id] The signed identifier.
+ * @param {object} [sharedAccessPolicy.AccessPolicy.Permissions] The permission type.
+ * @param {date|string} [sharedAccessPolicy.AccessPolicy.Start] The time at which the Shared Access Signature becomes valid (The UTC value will be used).
+ * @param {date|string} sharedAccessPolicy.AccessPolicy.Expiry The time at which the Shared Access Signature becomes expired (The UTC value will be used).
+ * @param {object} [headers] The optional header values to set for a blob returned wth this SAS.
+ * @param {string} [headers.cacheControl] The optional value of the Cache-Control response header to be returned when this SAS is used.
+ * @param {string} [headers.contentType] The optional value of the Content-Type response header to be returned when this SAS is used.
+ * @param {string} [headers.contentEncoding] The optional value of the Content-Encoding response header to be returned when this SAS is used.
+ * @param {string} [headers.contentLanguage] The optional value of the Content-Language response header to be returned when this SAS is used.
+ * @param {string} [headers.contentDisposition] The optional value of the Content-Disposition response header to be returned when this SAS is used.
+ * @return {string} The shared access signature. Note this does not contain the leading "?".
+ */
+ generateSharedAccessSignature(container: string, blob: string, sharedAccessPolicy: any, headers: any): any;
+
+ /**
+ * Retrieves a shared access signature token.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} [blob] The blob name.
+ * @param {object} sharedAccessPolicy The shared access policy.
+ * @param {string} [sharedAccessPolicy.Id] The signed identifier.
+ * @param {object} [sharedAccessPolicy.AccessPolicy.Permissions] The permission type.
+ * @param {date|string} [sharedAccessPolicy.AccessPolicy.Start] The time at which the Shared Access Signature becomes valid (The UTC value will be used).
+ * @param {date|string} sharedAccessPolicy.AccessPolicy.Expiry The time at which the Shared Access Signature becomes expired (The UTC value will be used).
+ * @param {string} [sasVersion] An optional string indicating the desired SAS version to use. Value must be 2012-02-12 or later.
+ * @param {object} [headers] The optional header values to set for a blob returned wth this SAS.
+ * @param {string} [headers.cacheControl] The optional value of the Cache-Control response header to be returned when this SAS is used.
+ * @param {string} [headers.contentType] The optional value of the Content-Type response header to be returned when this SAS is used.
+ * @param {string} [headers.contentEncoding] The optional value of the Content-Encoding response header to be returned when this SAS is used.
+ * @param {string} [headers.contentLanguage] The optional value of the Content-Language response header to be returned when this SAS is used.
+ * @param {string} [headers.contentDisposition] The optional value of the Content-Disposition response header to be returned when this SAS is used.
+ * @return {string} The shared access signature query string. Note this string does not contain the leading "?".
+ */
+ generateSharedAccessSignatureWithVersion(container: string, blob: string, sharedAccessPolicy: any, sasVersion: any, headers: any): any;
+
+ /**
+ * Retrieves a blob or container URL.
+ *
+ * @param {string} container The container name.
+ * @param {string} [blob] The blob name.
+ * @param {string} [sasToken] The Shared Access Signature token.
+ * @param {boolean} [primary] A boolean representing whether to use the primary or the secondary endpoint.
+ * @return {string} The formatted URL string.
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * //create a SAS that expires in an hour
+ * var sasToken = blobService.generateSharedAccessSignature(containerName, blobName, { AccessPolicy: { Expiry: azure.date.minutesFromNow(60); } });
+ * var sasUrl = blobService.getUrl(containerName, blobName, sasToken, true);
+ */
+ getUrl(container: string, blob: string, sasToken: any, primary: any): url.Url;
+
+ createPageBlob(container: string, blob: string, length: number, callback: Function): any;
+
+ createPageBlob(container: string, blob: string, length: number, options: BlobService.CreatePageBlobOptions, callback: Function): any;
+
+ /**
+ * Uploads a page blob from file.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param (string) localFileName The local path to the file to be uploaded.
+ * @param {object} [options] The request options.
+ * @param {SpeedSummary} [options.speedSummary] The upload tracker objects.
+ * @param {int} [options.parallelOperationThreadCount] Parallel operation thread count
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads.
+ * The default value is false for page blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition. (x-ms-blob-content-disposition)
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ createPageBlobFromLocalFile(container: string, blob: string, localFileName: any, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Uploads a page blob from a stream.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param (Stream) stream Stream to the data to store.
+ * @param {int} streamLength The length of the stream to upload.
+ * @param {object} [options] The request options.
+ * @param {SpeedSummary} [options.speedSummary] The download tracker objects;
+ * @param {int} [options.parallelOperationThreadCount] Parallel operation thread count
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads.
+ * The default value is false for page blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition. (x-ms-blob-content-disposition)
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ createPageBlobFromStream(container: string, blob: string, stream: any, streamLength: any, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Provides a stream to write to a page blob. Assumes that the blob exists.
+ * If it does not, please create the blob using createPageBlob before calling this method or use createWriteStreamNewPageBlob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {int} [options.parallelOperationThreadCount] Parallel operation thread count
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads.
+ * The default value is false for page blobs and true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition. (x-ms-blob-content-disposition)
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback The callback function.
+ * @return {Stream}
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * blobService.createPageBlob(containerName, blobName, 1024, function (err) {
+ * // Pipe file to a blob
+ * var stream = fs.createReadStream(fileNameTarget).pipe(blobService.createWriteStreamToExistingPageBlob(containerName, blobName));
+ * });
+ */
+ createWriteStreamToExistingPageBlob(container: string, blob: string, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Provides a stream to write to a page blob. Creates the blob before writing data.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} length The blob length.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {int} [options.parallelOperationThreadCount] Parallel operation thread count
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads.
+ * The default value is false for page blobs and true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition. (x-ms-blob-content-disposition)
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback The callback function.
+ * @return {Stream}
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * blobService.createPageBlob(containerName, blobName, 1024, function (err) {
+ * // Pipe file to a blob
+ * var stream = fs.createReadStream(fileNameTarget).pipe(blobService.createWriteStreamToNewPageBlob(containerName, blobName));
+ * });
+ */
+ createWriteStreamToNewPageBlob(container: string, blob: string, length: any, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Updates a page blob from a stream.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {Stream} readStream The read stream.
+ * @param {int} rangeStart The range start.
+ * @param {int} rangeEnd The range end.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentMD5] An optional hash value used to ensure transactional integrity for the page.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the blob information.
+ * `response` will contain information related to this operation.
+ */
+ createPagesFromStream(container: string, blob: string, readStream: any, rangeStart: number, rangeEnd: number, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Lists page ranges. Lists all of the page ranges by default, or only the page ranges over a specific range of bytes if rangeStart and rangeEnd are specified.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {int} [options.rangeStart] The range start.
+ * @param {int} [options.rangeEnd] The range end.
+ * @param {string} [options.snapshotId] The snapshot identifier.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the page range information.
+ * `response` will contain information related to this operation.
+ */
+ listPageRanges(container: string, blob: string, optionsOrCallback: any, callback: ErrorOrResult): void;
+
+ /**
+ * Clears a range of pages.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {int} rangeStart The range start.
+ * @param {int} rangeEnd The range end.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ clearPageRange(container: string, blob: string, rangeStart: number, rangeEnd: number, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Resizes a page blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {String} size The size of the page blob, in bytes.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The blob lease identifier.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the blob.
+ * `response` will contain information related to this operation.
+ */
+ resizePageBlob(container: string, blob: string, size: number, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Sets the page blob's sequence number.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {SequenceNumberAction} sequenceNumberAction A value indicating the operation to perform on the sequence number.
+ * The allowed values are defined in azure.BlobUtilities.SequenceNumberAction.
+ * @param {string} sequenceNumber The sequence number. The value of the sequence number must be between 0 and 2^63 - 1.
+ * Set this parameter to null if this operation is an increment action.
+ * @param {object} [options] The request options.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the blob.
+ * `response` will contain information related to this operation.
+ */
+ setPageBlobSequenceNumber(container: string, blob: string, sequenceNumberAction: any, sequenceNumber: number, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Creates a new block blob or updates the content of an existing block blob.
+ * Updating an existing block blob overwrites any existing metadata on the blob.
+ * Partial updates are not supported with Put Blob; The content of the existing blob is overwritten with the content of the new blob.
+ * To perform a partial update of the content of a block blob, use the Put Block List operation.
+ * Calling Put Blob to create a page blob only initializes the blob. To add content to a page blob, call the Put Page operation.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} localFileName The local path to the file to be uploaded.
+ * @param {object} [options] The request options.
+ * @param {string} [options.blockIdPrefix] The prefix to be used to generate the block id.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {int} [options.parallelOperationThreadCount] Parallel operation thread count
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ createBlockBlobFromLocalFile(container: string, blob: string, localFileName: string, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Uploads a block blob from a stream.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param (Stream) stream Stream to the data to store.
+ * @param {int} streamLength The length of the stream to upload.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ createBlockBlobFromStream(container: string, blob: string, stream: stream.Readable, streamLength: number, callback: ErrorOrResult): common.streams.speedsummary.SpeedSummary;
+
+ /**
+ * Uploads a block blob from a stream.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param (Stream) stream Stream to the data to store.
+ * @param {int} streamLength The length of the stream to upload.
+ * @param {object} [options] The request options.
+ * @param {SpeedSummary} [options.speedSummary] The download tracker objects.
+ * @param {string} [options.blockIdPrefix] The prefix to be used to generate the block id.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {int} [options.parallelOperationThreadCount] Parallel operation thread count
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ createBlockBlobFromStream(container: string, blob: string, stream: stream.Readable, streamLength: number, options: BlobService.CreateBlobRequestOptions, callback: ErrorOrResult): common.streams.speedsummary.SpeedSummary;
+
+ /**
+ * Uploads a block blob from a text string.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string|object} text The blob text, as a string or in a Buffer.
+ * @param {object} [options] The request options.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the blob.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ createBlockBlobFromText(container: string, blob: string, text: string | Buffer, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Provides a stream to write to a block blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {string} [options.blockIdPrefix] The prefix to be used to generate the block id.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {int} [options.parallelOperationThreadCount] Parallel operation thread count
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads.
+ * The default value is false for page blobs and true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.position] The blob's content disposition. (x-ms-blob-content-disposition)
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback The callback function.
+ * @return {Stream}
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * var stream = fs.createReadStream(fileNameTarget).pipe(blobService.createWriteStreamToBlockBlob(containerName, blobName, { blockIdPrefix: 'block' }));
+ */
+ createWriteStreamToBlockBlob(container: string, blob: string, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Creates a new block to be committed as part of a blob.
+ *
+ * @this {BlobService}
+ * @param {string} blockId The block identifier.
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {Stream} readStream The read stream.
+ * @param {int} streamLength The stream length.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {string} [options.contentMD5] The blob’s MD5 hash.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ createBlockFromStream(blockId: any, container: string, blob: string, readStream: any, streamLength: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Creates a new block to be committed as part of a blob.
+ *
+ * @this {BlobService}
+ * @param {string} blockId The block identifier.
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string|buffer} content The block content.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {string} [options.contentMD5] The blob’s MD5 hash.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ createBlockFromText(blockId: any, container: string, blob: string, content: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Writes a blob by specifying the list of block IDs that make up the blob.
+ * In order to be written as part of a blob, a block must have been successfully written to the server in a prior
+ * createBlock operation.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} blockList The block identifiers.
+ * @param {object} [options] The request options.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition. (x-ms-blob-content-disposition)
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the blocklist information.
+ * `response` will contain information related to this operation.
+ */
+ commitBlocks(container: string, blob: string, blockList: string[], optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Retrieves the list of blocks that have been uploaded as part of a block blob.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {BlockListFilter} blocklisttype The type of block list to retrieve.
+ * @param {object} [options] The request options.
+ * @param {string} [options.snapshotId] The source blob snapshot identifier.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the blocklist information.
+ * `response` will contain information related to this operation.
+ */
+ listBlocks(container: string, blob: string, blocklisttype: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Generate a random block id prefix
+ */
+ generateBlockIdPrefix(): any;
+
+ /**
+ * Get a block id according to prefix and block number
+ */
+ getBlockId(prefix: any, number: any): string;
+
+ /**
+ * Creates an empty append blob. If the blob already exists on the service, it will be overwritten.
+ * To avoid overwriting and instead throw an error if the blob exists, please pass in an accessConditions parameter in the options object.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition. (x-ms-blob-content-disposition)
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * Use options.accessConditions = require('azure-storage').AccessCondition.generateIfNotExistsCondition()
+ * to avoid overwriting and instead throw an error if the blob exists.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ createOrReplaceAppendBlob(container: string, blob: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Creates a new append blob from a local file. If the blob already exists on the service, it will be overwritten.
+ * To avoid overwriting and instead throw an error if the blob exists, please pass in an accessConditions parameter in the options object.
+ * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks.
+ * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you.
+ * If you want to append data to an already existing blob, please look at appendFromLocalFile.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} localFileName The local path to the file to be uploaded.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.absorbConditionalErrorsOnRetry] Specifies whether to absorb the conditional error on retry.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * Use options.accessConditions = require('azure-storage').AccessCondition.generateIfNotExistsCondition()
+ * to avoid overwriting and instead throw an error if the blob exists.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ createAppendBlobFromLocalFile(container: string, blob: string, localFileName: string, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Uploads an append blob from a stream. If the blob already exists on the service, it will be overwritten.
+ * To avoid overwriting and instead throw an error if the blob exists, please pass in an accessConditions parameter in the options object.
+ * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks.
+ * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you.
+ * If you want to append data to an already existing blob, please look at appendFromStream.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param (Stream) stream Stream to the data to store.
+ * @param {int} streamLength The length of the stream to upload.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.absorbConditionalErrorsOnRetry] Specifies whether to absorb the conditional error on retry.
+ * @param {SpeedSummary} [options.speedSummary] The download tracker objects.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * Use options.accessConditions = require('azure-storage').AccessCondition.generateIfNotExistsCondition()
+ * to avoid overwriting and instead throw an error if the blob exists.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ createAppendBlobFromStream(container: string, blob: string, stream: any, streamLength: number, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Uploads an append blob from a text string. If the blob already exists on the service, it will be overwritten.
+ * To avoid overwriting and instead throw an error if the blob exists, please pass in an accessConditions parameter in the options object.
+ * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks.
+ * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you.
+ * If you want to append data to an already existing blob, please look at appendFromText.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string|object} text The blob text, as a string or in a Buffer.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.absorbConditionalErrorsOnRetry] Specifies whether to absorb the conditional error on retry.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * Use options.accessConditions = require('azure-storage').AccessCondition.generateIfNotExistsCondition()
+ * to avoid overwriting and instead throw an error if the blob exists.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the blob.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ createAppendBlobFromText(container: string, blob: string, text: string | Buffer, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Provides a stream to write to a new append blob. If the blob already exists on the service, it will be overwritten.
+ * To avoid overwriting and instead throw an error if the blob exists, please pass in an accessConditions parameter in the options object.
+ * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks.
+ * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.absorbConditionalErrorsOnRetry] Specifies whether to absorb the conditional error on retry.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads.
+ * The default value is false for page blobs and true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.position] The blob's content disposition. (x-ms-blob-content-disposition)
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * Use options.accessConditions = require('azure-storage').AccessCondition.generateIfNotExistsCondition()
+ * to avoid overwriting and instead throw an error if the blob exists.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback The callback function.
+ * @return {Stream}
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * var stream = fs.createReadStream(fileNameTarget).pipe(blobService.createWriteStreamToAppendBlob(containerName, blobName));
+ */
+ createWriteStreamToNewAppendBlob(container: string, blob: string, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Provides a stream to write to an existing append blob. Assumes that the blob exists.
+ * If it does not, please create the blob using createAppendBlob before calling this method or use createWriteStreamToNewAppendBlob.
+ * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks.
+ * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.absorbConditionalErrorsOnRetry] Specifies whether to absorb the conditional error on retry.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads.
+ * The default value is false for page blobs and true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.position] The blob's content disposition. (x-ms-blob-content-disposition)
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback The callback function.
+ * @return {Stream}
+ * @example
+ * var azure = require('azure-storage');
+ * var blobService = azure.createBlobService();
+ * var stream = fs.createReadStream(fileNameTarget).pipe(blobService.createWriteStreamToAppendBlob(containerName, blobName));
+ */
+ createWriteStreamToExistingAppendBlob(container: string, blob: string, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Appends to an append blob from a local file. Assumes the blob already exists on the service.
+ * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks.
+ * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string} localFileName The local path to the file to be uploaded.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.absorbConditionalErrorsOnRetry] Specifies whether to absorb the conditional error on retry.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ appendFromLocalFile(container: string, blob: string, localFileName: string, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Appends to an append blob from a stream. Assumes the blob already exists on the service.
+ * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks.
+ * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param (Stream) stream Stream to the data to store.
+ * @param {int} streamLength The length of the stream to upload.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.absorbConditionalErrorsOnRetry] Specifies whether to absorb the conditional error on retry.
+ * @param {SpeedSummary} [options.speedSummary] The download tracker objects.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ appendFromStream(container: string, blob: string, stream: any, streamLength: number, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Appends to an append blob from a text string. Assumes the blob already exists on the service.
+ * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks.
+ * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string|object} text The blob text, as a string or in a Buffer.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.absorbConditionalErrorsOnRetry] Specifies whether to absorb the conditional error on retry.
+ * @param {string} [options.leaseId] The lease identifier.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the blob. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the blob.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the blob content.
+ * @param {string} [options.cacheControl] The Blob service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The blob's content disposition.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * Use options.accessConditions = require('azure-storage').AccessCondition.generateIfNotExistsCondition()
+ * to avoid overwriting and instead throw an error if the blob exists.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the blob.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ appendFromText(container: string, blob: string, text: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Creates a new block from a read stream to be appended to an append blob.
+ * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks.
+ * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {Stream} readStream The read stream.
+ * @param {int} streamLength The stream length.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.absorbConditionalErrorsOnRetry] Specifies whether to absorb the conditional error on retry.
+ * @param {int} [options.maxBlobSize] The max length in bytes allowed for the append blob to grow to.
+ * @param {int} [options.appendPosition] The number indicating the byte offset to check for. The append will succeed only if the end position of the blob is equal to this number.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {string} [options.contentMD5] The blob’s MD5 hash.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ appendBlockFromStream(container: string, blob: string, readStream: any, streamLength: number, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Creates a new block from a text to be appended to an append blob.
+ * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks.
+ * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you.
+ *
+ * @this {BlobService}
+ * @param {string} container The container name.
+ * @param {string} blob The blob name.
+ * @param {string|object} content The block text, as a string or in a Buffer.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.absorbConditionalErrorsOnRetry] Specifies whether to absorb the conditional error on retry.
+ * @param {int} [options.maxBlobSize] The max length in bytes allowed for the append blob to grow to.
+ * @param {int} [options.appendPosition] The number indicating the byte offset to check for. The append will succeed only if the end position of the blob is equal to this number.
+ * @param {string} [options.leaseId] The target blob lease identifier.
+ * @param {string} [options.contentMD5] The blob’s MD5 hash.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ appendBlockFromText(container: string, blob: string, content: string | Buffer, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * The callback for {BlobService~getBlobToText}.
+ * @typedef {function} BlobService~blobToText
+ * @param {object} error If an error occurs, the error information.
+ * @param {string} text The text returned from the blob.
+ * @param {object} blockBlob Information about the blob.
+ * @param {object} response Information related to this operation.
+ */
+ static SpeedSummary: common.streams.speedsummary.SpeedSummary;
+ }
+ export module BlobService {
+ export interface CreateContainerOptions extends common.RequestOptions {
+ metadata?: Map;
+ publicAccessLevel?: string;
+ }
+
+ export interface ConditionalRequestOption {
+ accessConditions?: { [key: string]: string };
+ }
+
+ export interface ContainerOptions extends common.RequestOptions, ConditionalRequestOption {
+ leaseId?: string;
+ }
+
+ export interface ContainerAclOptions extends ContainerOptions {
+ publicAccessLevel?: string;
+ }
+
+ export interface LeaseRequestOptions extends common.RequestOptions, ConditionalRequestOption {
+ }
+
+ export interface AcquireLeaseRequestOptions extends LeaseRequestOptions {
+ leaseDuration?: number;
+ proposedLeaseId?: string;
+ }
+
+ export interface BreakLeaseRequestOptions extends LeaseRequestOptions {
+ leaseBreakPeriod?: number;
+ }
+
+ export interface ListBlobsSegmentedRequestOptions extends common.RequestOptions {
+ /**
+ * {string} Delimiter, i.e. '/', for specifying folder hierarchy.
+ */
+ delimiter?: string;
+ /**
+ * {int} Specifies the maximum number of blobs to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000)
+ */
+ maxResults?: number;
+
+ /**
+ * {string} Specifies that the response should include one or more of the following subsets: '', 'metadata', 'snapshots', 'uncommittedblobs'). Multiple values can be added separated with a comma (,)
+ */
+ include?: string;
+ }
+
+ export interface LeaseResult {
+ container: string;
+ blob: string;
+ id: string;
+ time: number;
+ etag: string;
+ lastModified: string;
+ }
+
+ export interface ListBlobsResult {
+ entries: ListBlobItem[];
+ continuationToken?: common.ContinuationToken;
+ }
+
+ export interface ListBlobItem {
+ name: string;
+ properties?: {
+ 'last-modified': string;
+ etag: string;
+ 'content-length': string;
+ 'content-type': string;
+ 'content-encoding': string;
+ 'content-language': string;
+ 'content-md5': string;
+ 'cache-control': string;
+ 'content-disposition': string;
+ blobtype: string;
+ leasestatus: string;
+ leasestate: string;
+ }
+ metadata?: Map;
+ }
+
+ export interface ContainerAclResult extends ContainerResult {
+ signedIdentifiers: common.SignedIdentifier[]
+ }
+
+ export interface ContainerResult {
+ name: string;
+ publicAccessLevel: string;
+ etag: string;
+ lastModified: string;
+ metadata?: { [key: string]: string; };
+ requestId?: string;
+ leaseDuration?: string;
+ leaseStatus?: string;
+ leaseState?: string;
+ }
+
+ export interface BlobResult {
+ name: string;
+ containerName: string;
+ metadata?: { [key: string]: string; };
+ etag: string;
+ lastModified: string;
+ contentType: string;
+ contentMD5: string;
+ contentLength: string;
+ blobType: string;
+ requestId: string;
+ leaseStatus: string;
+ leaseState: string;
+ leaseDuration?: string;
+ leaseId?: string;
+ contentEncoding?: string;
+ contentLanguage?: string;
+ cacheControl?: string;
+ contentDisposition?: string;
+ sequenceNumber?: string;
+ contentRange?: string;
+ copyStatus?: string;
+ copyCompletionTime?: string;
+ copyStatusDescription?: string;
+ copyId?: string;
+ copyProgress?: string;
+
+ // TODO: not yet implemented
+ copySource?: string;
+ }
+
+ export interface CreatePageBlobOptions {
+ metadata?: Object;
+ leaseId?: string;
+ contentType?: string;
+ contentEncoding?: string;
+ contentLanguage?: string;
+ contentMD5?: string;
+ cacheControl?: string;
+ contentDisposition?: string;
+ sequenceNumber?: string;
+ accessConditions?: Object;
+ locationMode?: StorageUtilities.LocationMode;
+ timeoutIntervalInMs?: number;
+ maximumExecutionTimeInMs?: number;
+ useNagleAlgorithm?: boolean;
+ }
+
+ export interface BlobRequestOptions extends common.RequestOptions, ConditionalRequestOption {
+ snapshotId?: string; // TODO: Not valid for most write requests...
+ leaseId?: string;
+ }
+
+ export interface AppendBlobRequestOptions extends common.RequestOptions, ConditionalRequestOption {
+ absorbConditionalErrorsOnRetry?: boolean;
+ maxBlobSize?: number;
+ appendPosition?: number;
+ }
+
+ export interface SetBlobPropertiesRequestOptions extends BlobRequestOptions {
+ contentType?: string;
+ contentEncoding?: string;
+ contentLanguage?: string;
+ contentMD5?: string;
+ cacheControl?: string;
+ contentDisposition?: string;
+ }
+
+ export interface GetBlobRequestOptions extends BlobRequestOptions {
+ speedSummary?: common.streams.speedsummary.SpeedSummary;
+ parallelOperationThreadCount?: number;
+ rangeStart?: number;
+ rangeEnd?: number;
+ useTransactionalMD5?: boolean;
+ disableContentMD5Validation?: boolean;
+ }
+
+ export interface DeleteBlobRequestOptions extends BlobRequestOptions {
+ deleteSnapshots?: string;
+ }
+
+ export interface CreateBlobRequestOptions extends BlobRequestOptions {
+ speedSummary?: common.streams.speedsummary.SpeedSummary;
+ parallelOperationThreadCount?: number;
+ useTransactionalMD5?: boolean;
+ blockIdPrefix?: string;
+ metadata?: {[k: string]: string};
+ storeBlobContentMD5?: boolean;
+ contentType?: string;
+ contentEncoding?: string;
+ contentLanguage?: string;
+ contentMD5?: string;
+ cacheControl?: string;
+ contentDisposition?: string;
+ }
+
+ export interface ListPageRangesRequestOptions extends common.RequestOptions {
+ rangeStart?: number;
+ rangeEnd?: number;
+ }
+ }
+ }
+
+ // ###########################
+ // ./services/blob/blobutilities
+ // ###########################
+ module blobutilities {
+ export var BlobUtilities: {
+ SharedAccessPermissions: {
+ READ: string;
+ WRITE: string;
+ DELETE: string;
+ LIST: string;
+ };
+ AccessConditions: {
+ DATE_MODIFIED_SINCE: string;
+ DATE_UNMODIFIED_SINCE: string;
+ ETAG_MATCH: string;
+ ETAG_NONE_MATCH: string;
+ };
+ BlobListingDetails: {
+ SNAPSHOTS: string;
+ METADATA: string;
+ UNCOMMITTED_BLOBS: string;
+ };
+ SnapshotDeleteOptions: {
+ SNAPSHOTS_ONLY: string;
+ BLOB_AND_SNAPSHOTS: string;
+ };
+ BlockListFilter: {
+ ALL: string;
+ COMMITTED: string;
+ UNCOMMITTED: string;
+ };
+ BlobContainerPublicAccessType: {
+ OFF: string;
+ CONTAINER: string;
+ BLOB: string;
+ };
+ SequenceNumberAction: {
+ MAX: string;
+ UPDATE: string;
+ INCREMENT: string;
+ };
+ };
+ }
+ }
+
+ module queue {
+ export class QueueService extends StorageServiceClient {
+ /**
+ * @property {boolean} QueueService#encodeMessage
+ * @defaultvalue {boolean} true
+ * A flag indicating whether the message should be base-64 encoded. Default is true.
+ */
+ encodeMessage: boolean;
+
+ /**
+ * Creates a new QueueService object.
+ *
+ * The QueueService class is used to perform operations on the Microsoft Azure Queue Service.
+ *
+ * For more information on using the Queue Service, as well as task focused information on using it from a Node.js application, see
+ * [How to Use the Queue Service from Node.js](http://azure.microsoft.com/en-us/documentation/articles/storage-nodejs-how-to-use-queues/).
+ * The following defaults can be set on the Queue service.
+ * encodeMessage A flag indicating whether the message should be base-64 encoded. Default is true.
+ * defaultTimeoutIntervalInMs The default timeout interval, in milliseconds, to use for request made via the Queue service.
+ * defaultMaximumExecutionTimeInMs The default maximum execution time across all potential retries, for requests made via the Queue service.
+ * defaultLocationMode The default location mode for requests made via the Queue service.
+ * useNagleAlgorithm Determines whether the Nagle algorithm is used for requests made via the Queue service; true to use the
+ * Nagle algorithm; otherwise, false. The default value is false.
+ * If no connection string or storageaccount and storageaccesskey are provided,
+ * the AZURE_STORAGE_CONNECTION_STRING or AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used.
+ * @augments {StorageServiceClient}
+ * @constructor QueueService
+ * @param {string} [storageAccountOrConnectionString] The storage account or the connection string.
+ * @param {string} [storageAccessKey] The storage access key.
+ * @param {string|object} [host] The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @param {string} [sasToken] The Shared Access Signature token.
+ */
+ constructor(storageAccountOrConnectionString?: string, storageAccessKey?: string, host?: string|StorageHost, sasToken?: string);
+
+
+ /**
+ * Gets the service stats for a storage account’s Queue service.
+ *
+ * @function QueueService#getServiceStats
+ *
+ * @this {QueueService}
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise, `result`
+ * will contain the stats and `response`
+ * will contain information related to this operation.
+ */
+ getServiceStats(options: common.RequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Gets the service stats for a storage account’s Queue service.
+ *
+ * @function QueueService#getServiceStats
+ *
+ * @this {QueueService}
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise, `result`
+ * will contain the stats and `response`
+ * will contain information related to this operation.
+ */
+ getServiceStats(callback: ErrorOrResult): void;
+
+ /**
+ * Gets the properties of a storage account’s Queue service, including Microsoft Azure Storage Analytics.
+ *
+ * @this {QueueService}
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise, `errorOrResult`
+ * will contain the properties and `response`
+ * will contain information related to this operation.
+ */
+ getServiceProperties(options: common.RequestOptions, callback?: ErrorOrResult): void;
+
+ /**
+ * Gets the properties of a storage account’s Queue service, including Microsoft Azure Storage Analytics.
+ *
+ * @this {QueueService}
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise, `errorOrResult`
+ * will contain the properties and `response`
+ * will contain information related to this operation.
+ */
+ getServiceProperties(callback?: ErrorOrResult): void;
+
+ /**
+ * Sets the properties of a storage account’s Queue service, including Microsoft Azure Storage Analytics.
+ * You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
+ *
+ * @this {QueueService}
+ * @param {object} serviceProperties The service properties.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise, `response`
+ * will contain information related to this operation.
+ */
+ setServiceProperties(serviceProperties: common.models.ServicePropertiesResult.ServiceProperties, options: common.RequestOptions, callback?: ErrorOrResponse): void;
+
+ /**
+ * Sets the properties of a storage account’s Queue service, including Microsoft Azure Storage Analytics.
+ * You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
+ *
+ * @this {QueueService}
+ * @param {object} serviceProperties The service properties.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise, `response`
+ * will contain information related to this operation.
+ */
+ setServiceProperties(serviceProperties: common.models.ServicePropertiesResult.ServiceProperties, callback?: ErrorOrResponse): void;
+
+ /**
+ * Lists a segment containing a collection of queue items whose names begin with the specified prefix under the given account.
+ *
+ * @this {QueueService}
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The request options.
+ * @param {int} [options.maxResults] Specifies the maximum number of queues to return per call to Azure storage. This does NOT affect list size returned by this function. (maximum: 5000)
+ * @param {string} [options.include] Include this parameter to specify that the queue's metadata be returned as part of the response body. (allowed values: '', 'metadata')
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of queues and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listQueuesSegmented(currentToken: common.ContinuationToken, options: QueueService.ListQueuesRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Lists a segment containing a collection of queue items whose names begin with the specified prefix under the given account.
+ *
+ * @function QueueService#listQueuesSegmented
+ *
+ * @this {QueueService}
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of queues and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listQueuesSegmented(currentToken: common.ContinuationToken, callback: ErrorOrResult): void;
+
+ /**
+ * Lists a segment containing a collection of queue items under the given account.
+ *
+ * @function QueueService#listQueuesSegmentedWithPrefix
+ *
+ * @this {QueueService}
+ * @param {string} prefix The prefix of the queue name.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.*
+ * @param {object} [options] The request options.
+ * @param {string} [options.marker] String value that identifies the portion of the list to be returned with the next list operation.
+ * @param {int} [options.maxResults] Specifies the maximum number of queues to return per call to Azure storage. This does NOT affect list size returned by this function. (maximum: 5000)
+ * @param {string} [options.include] Include this parameter to specify that the queue's metadata be returned as part of the response body. (allowed values: '', 'metadata')
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of queues and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listQueuesSegmentedWithPrefix(prefix: string, currentToken: common.ContinuationToken, options: QueueService.ListQueuesRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Lists a segment containing a collection of queue items under the given account.
+ *
+ * @function QueueService#listQueuesSegmentedWithPrefix
+ *
+ * @this {QueueService}
+ * @param {string} prefix The prefix of the queue name.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.*
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of queues and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listQueuesSegmentedWithPrefix(prefix: string, currentToken: common.ContinuationToken, callback: ErrorOrResult): void;
+
+ /**
+ * Checks to see if a queue exists.
+ *
+ * @function QueueService#doesQueueExist
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise, `result`
+ * will be true if the queue exists and false if not,
+ * and `response` will contain information related to this operation.
+ */
+ doesQueueExist(queue: string, options: common.RequestOptions, callback?: ErrorOrResult): void;
+
+ /**
+ * Checks to see if a queue exists.
+ *
+ * @function QueueService#doesQueueExist
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise, `result`
+ * will be true if the queue exists and false if not,
+ * and `response` will contain information related to this operation.
+ */
+ doesQueueExist(queue: string, callback?: ErrorOrResult): void;
+
+ /**
+ * Creates a new queue under the given account.
+ *
+ * @function QueueService#createQueue
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} [options] The request options.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the queue information.
+ * `response` will contain information related to this operation.
+ */
+ createQueue(queue: string, optionsOrCallback: QueueService.CreateQueueRequestOptions, callback?: ErrorOrResult): void;
+
+ /**
+ * Creates a new queue under the given account.
+ *
+ * @function QueueService#createQueue
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the queue information.
+ * `response` will contain information related to this operation.
+ */
+ createQueue(queue: string, callback?: ErrorOrResult): void;
+
+ /**
+ * Creates a new queue under the given account if it doesn't exist.
+ *
+ * @function QueueService#createQueueIfNotExists
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} [options] The request options.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will be true if the
+ * queue was created by this operation and false if not, and
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var queueService = azure.createQueueService();
+ * queueService.createQueueIfNotExists('taskqueue', function(error) {
+ * if(!error) {
+ * // Queue created or exists
+ * }
+ * });
+ */
+ createQueueIfNotExists(queue: string, optionsOrCallback: QueueService.CreateQueueRequestOptions, callback?: ErrorOrResult): void;
+
+ /**
+ * Creates a new queue under the given account if it doesn't exist.
+ *
+ * @function QueueService#createQueueIfNotExists
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will be true if the
+ * queue was created by this operation and false if not, and
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var queueService = azure.createQueueService();
+ * queueService.createQueueIfNotExists('taskqueue', function(error) {
+ * if(!error) {
+ * // Queue created or exists
+ * }
+ * });
+ */
+ createQueueIfNotExists(queue: string, callback?: ErrorOrResult): void;
+
+ /**
+ * Permanently deletes the specified queue.
+ *
+ * @function QueueService#deleteQueue
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information if an error occurs;
+ * `response` will contain information related to this operation.
+ */
+ deleteQueue(queue: string, options: common.RequestOptions, callback: ErrorOrResponse): void;
+
+ /**
+ * Permanently deletes the specified queue.
+ *
+ * @function QueueService#deleteQueue
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {errorOrResponse} callback `error` will contain information if an error occurs;
+ * `response` will contain information related to this operation.
+ */
+ deleteQueue(queue: string, callback: ErrorOrResponse): void;
+
+ /**
+ * Permanently deletes the specified queue if it exists.
+ *
+ * @function QueueService#deleteQueueIfExists
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * 'true' if the queue was deleted and 'false' if the queue did not exist.
+ * `response` will contain information related to this operation.
+ */
+ deleteQueueIfExists(queue: string, options: common.RequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Permanently deletes the specified queue if it exists.
+ *
+ * @function QueueService#deleteQueueIfExists
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * 'true' if the queue was deleted and 'false' if the queue did not exist.
+ * `response` will contain information related to this operation.
+ */
+ deleteQueueIfExists(queue: string, callback: ErrorOrResult): void;
+
+ /**
+ * Returns queue properties, including user-defined metadata.
+ *
+ * @function QueueService#getQueueMetadata
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the queue information.
+ * `response` will contain information related to this operation.
+ */
+ getQueueMetadata(queue: string, options: common.RequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Returns queue properties, including user-defined metadata.
+ *
+ * @function QueueService#getQueueMetadata
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the queue information.
+ * `response` will contain information related to this operation.
+ */
+ getQueueMetadata(queue: string, callback: ErrorOrResult): void;
+
+ /**
+ * Sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs.
+ *
+ * @function QueueService#setQueueMetadata
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} metadata The metadata key/value pairs.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the queue information.
+ * `response` will contain information related to this operation.
+ */
+ setQueueMetadata(queue: string, metadata: { [key: string]: string; }, options: common.RequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs.
+ *
+ * @function QueueService#setQueueMetadata
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} metadata The metadata key/value pairs.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the queue information.
+ * `response` will contain information related to this operation.
+ */
+ setQueueMetadata(queue: string, metadata: { [key: string]: string; }, callback: ErrorOrResult): void;
+
+ /**
+ * Adds a new message to the back of the message queue.
+ * The encoded message can be up to 64KB in size for versions 2011-08-18 and newer, or 8KB in size for previous versions.
+ * Unencoded messages must be in a format that can be included in an XML request with UTF-8 encoding.
+ * Queue messages are encoded by default. See queueService.encodeMessage to set encoding defaults.
+ *
+ * @function QueueService#createMessage
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {string|Buffer} messageText The message text.
+ * @param {object} [options] The request options.
+ * @param {int} [options.messagettl] The time-to-live interval for the message, in seconds. The maximum time-to-live allowed is 7 days. If this parameter is omitted, the default time-to-live is 7 days
+ * @param {int} [options.visibilityTimeout] Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a value smaller than the time-to-live value.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the result.
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var queueService = azure.createQueueService();
+ * queueService.createMessage('taskqueue', 'Hello world!', function(error) {
+ * if(!error) {
+ * // Message inserted
+ * }
+ * });
+ */
+ createMessage(queue: string, messageText: string|Buffer, options: QueueService.CreateMessageRequestOptions, callback?: ErrorOrResult<{ queue: string}>): void;
+
+ /**
+ * Adds a new message to the back of the message queue.
+ * The encoded message can be up to 64KB in size for versions 2011-08-18 and newer, or 8KB in size for previous versions.
+ * Unencoded messages must be in a format that can be included in an XML request with UTF-8 encoding.
+ * Queue messages are encoded by default. See queueService.encodeMessage to set encoding defaults.
+ *
+ * @function QueueService#createMessage
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {string|Buffer} messageText The message text.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the result.
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var queueService = azure.createQueueService();
+ * queueService.createMessage('taskqueue', 'Hello world!', function(error) {
+ * if(!error) {
+ * // Message inserted
+ * }
+ * });
+ */
+ createMessage(queue: string, messageText: string|Buffer, callback?: ErrorOrResult<{ queue: string }>): void;
+
+ /**
+ * Retrieves a message from the queue and makes it invisible to other consumers.
+ *
+ * @function QueueService#getMessages
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} [options] The request options.
+ * @param {int} [options.numOfMessages] A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. By default, a single message is retrieved from the queue with this operation.
+ * @param {bool} [options.peekOnly] Boolean value indicating wether the visibility of the message should be changed or not.
+ * @param {int} [options.visibilityTimeout] Required if not peek only. Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message can be set to a value later than the expiry time.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the message.
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var queueService = azure.createQueueService();
+ * var queueName = 'taskqueue';
+ * queueService.getMessages(queueName, function(error, serverMessages) {
+ * if(!error) {
+ * // Process the message in less than 30 seconds, the message
+ * // text is available in serverMessages[0].messagetext
+ * queueService.deleteMessage(queueName, serverMessages[0].messageid, serverMessages[0].popreceipt, function(error) {
+ * if(!error){
+ * // Message deleted
+ * }
+ * });
+ * }
+ * });
+ */
+ getMessages(queue: string, options: QueueService.GetMessagesRequestOptions, callback?: ErrorOrResult): void;
+
+ /**
+ * Retrieves a message from the queue and makes it invisible to other consumers.
+ *
+ * @function QueueService#getMessages
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the message.
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var queueService = azure.createQueueService();
+ * var queueName = 'taskqueue';
+ * queueService.getMessages(queueName, function(error, serverMessages) {
+ * if(!error) {
+ * // Process the message in less than 30 seconds, the message
+ * // text is available in serverMessages[0].messagetext
+ * queueService.deleteMessage(queueName, serverMessages[0].messageid, serverMessages[0].popreceipt, function(error) {
+ * if(!error){
+ * // Message deleted
+ * }
+ * });
+ * }
+ * });
+ */
+ getMessages(queue: string, callback?: ErrorOrResult): void;
+
+ /**
+ * Retrieves a message from the front of the queue, without changing the message visibility.
+ *
+ * @function QueueService#peekMessages
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} [options] The request options.
+ * @param {int} [options.numOfMessages] A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. By default, a single message is retrieved from the queue with this operation.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the message.
+ * `response` will contain information related to this operation.
+ */
+ peekMessages(queue: string, options: QueueService.PeekMessagesRequestOptions, callback?: ErrorOrResult): void;
+
+ /**
+ * Retrieves a message from the front of the queue, without changing the message visibility.
+ *
+ * @function QueueService#peekMessages
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the message.
+ * `response` will contain information related to this operation.
+ */
+ peekMessages(queue: string, callback?: ErrorOrResult): void;
+
+ /**
+ * Deletes a specified message from the queue.
+ *
+ * @function QueueService#deleteMessage
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {string} messageId The message identifier of the message to delete.
+ * @param {string} popReceipt A valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information if an error occurs;
+ * `response` will contain information related to this operation.
+ */
+ deleteMessage(queue: string, messageId: string, popReceipt: string, options: common.RequestOptions, callback: ErrorOrResponse): void;
+
+ /**
+ * Deletes a specified message from the queue.
+ *
+ * @function QueueService#deleteMessage
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {string} messageId The message identifier of the message to delete.
+ * @param {string} popReceipt A valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation
+ * @param {errorOrResponse} callback `error` will contain information if an error occurs;
+ * `response` will contain information related to this operation.
+ */
+ deleteMessage(queue: string, messageId: string, popReceipt: string, callback: ErrorOrResponse): void;
+
+ /**
+ * Clears all messages from the queue.
+ *
+ * @function QueueService#clearMessages
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ clearMessages(queue: string, options: common.RequestOptions, callback: ErrorOrResponse): void;
+
+ /**
+ * Clears all messages from the queue.
+ *
+ * @function QueueService#clearMessages
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ clearMessages(queue: string, callback: ErrorOrResponse): void;
+
+ /**
+ * Updates the visibility timeout of a message. You can also use this operation to update the contents of a message.
+ * A message must be in a format that can be included in an XML request with UTF-8 encoding, and the encoded message can be up to 64KB in size.
+ *
+ * @function QueueService#updateMessage
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {string} messageId The message identifier of the message to update.
+ * @param {string} popReceipt A valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation
+ * @param {int} visibilityTimeout Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message can be set to a value later than the expiry time.
+ * @param {object} [options] The request options.
+ * @param {object} [options.messageText] The new message text.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the message result information.
+ * `response` will contain information related to this operation.
+ */
+ updateMessage(queue: string, messageId: string, popReceipt: string, visibilityTimeout: number, options: QueueService.UpdateMessageRequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Updates the visibility timeout of a message. You can also use this operation to update the contents of a message.
+ * A message must be in a format that can be included in an XML request with UTF-8 encoding, and the encoded message can be up to 64KB in size.
+ *
+ * @function QueueService#updateMessage
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {string} messageId The message identifier of the message to update.
+ * @param {string} popReceipt A valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation
+ * @param {int} visibilityTimeout Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message can be set to a value later than the expiry time.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the message result information.
+ * `response` will contain information related to this operation.
+ */
+ updateMessage(queue: string, messageId: string, popReceipt: string, visibilityTimeout: number, callback?: ErrorOrResult): void;
+
+ /**
+ * Gets the queue's ACL.
+ *
+ * @function QueueService#getQueueAcl
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the queue.
+ * `response` will contain information related to this operation.
+ */
+ getQueueAcl(queue: string, options: common.RequestOptions, callback: ErrorOrResult): void;
+
+ /**
+ * Gets the queue's ACL.
+ *
+ * @function QueueService#getQueueAcl
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the queue.
+ * `response` will contain information related to this operation.
+ */
+ getQueueAcl(queue: string, callback: ErrorOrResult): void;
+
+ /**
+ * Updates the queue's ACL.
+ *
+ * @function QueueService#setQueueAcl
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} signedIdentifiers The signed identifiers. Signed identifiers must be in an array.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the queue.
+ * `response` will contain information related to this operation.
+ * @example
+ * var azure = require('azure-storage');
+ * var SharedAccessPermissions = azure.QueueUtilities.SharedAccessPermissions;
+ * var queueService = azure.createQueueService();
+ * var sharedAccessPolicy = [
+ * {AccessPolicy: {
+ * Permissions: PROCESS,
+ * Start: startDate,
+ * Expiry: expiryDate
+ * },
+ * Id: processOnly,
+ * },
+ * {AccessPolicy: {
+ * Permissions: SharedAccessPermissions.PROCESS + SharedAccessPermissions.DELETE,
+ * Start: startDate,
+ * Expiry: expiryDate
+ * },
+ * Id: processAndDelete,
+ * }];
+ *
+ * queueService.setQueueAcl(queueName, sharedAccessPolicy, function(error, queueResult, response) {
+ * // do whatever
+ * });
+ */
+ setQueueAcl(queue: string, signedIdentifiers: common.SignedIdentifier[], options: common.RequestOptions, callback?: ErrorOrResult): void;
+
+ /**
+ * Updates the queue's ACL.
+ *
+ * @function QueueService#setQueueAcl
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} signedIdentifiers The signed identifiers. Signed identifiers must be in an array.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the queue.
+ * `response` will contain information related to this operation.
+ * @example
+ * var azure = require('azure-storage');
+ * var SharedAccessPermissions = azure.QueueUtilities.SharedAccessPermissions;
+ * var queueService = azure.createQueueService();
+ * var sharedAccessPolicy = [
+ * {AccessPolicy: {
+ * Permissions: PROCESS,
+ * Start: startDate,
+ * Expiry: expiryDate
+ * },
+ * Id: processOnly,
+ * },
+ * {AccessPolicy: {
+ * Permissions: SharedAccessPermissions.PROCESS + SharedAccessPermissions.DELETE,
+ * Start: startDate,
+ * Expiry: expiryDate
+ * },
+ * Id: processAndDelete,
+ * }];
+ *
+ * queueService.setQueueAcl(queueName, sharedAccessPolicy, function(error, queueResult, response) {
+ * // do whatever
+ * });
+ */
+ setQueueAcl(queue: string, signedIdentifiers: common.SignedIdentifier[], callback?: ErrorOrResult): void;
+
+ /**
+ * Retrieves a shared access signature token.
+ *
+ * @function QueueService#generateSharedAccessSignature
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} sharedAccessPolicy The shared access policy.
+ * @param {string} [sharedAccessPolicy.Id] The signed identifier.
+ * @param {object} [sharedAccessPolicy.AccessPolicy.Permissions] The permission type.
+ * @param {date|string} [sharedAccessPolicy.AccessPolicy.Start] The time at which the Shared Access Signature becomes valid (The UTC value will be used).
+ * @param {date|string} sharedAccessPolicy.AccessPolicy.Expiry The time at which the Shared Access Signature becomes expired (The UTC value will be used).
+ * @return {string} The shared access signature query string. Note this string does not contain the leading "?".
+ */
+ generateSharedAccessSignature(queue: any, sharedAccessPolicy: any): any;
+
+ /**
+ * Retrieves a shared access signature token.
+ *
+ * @function QueueService#generateSharedAccessSignatureWithVersion
+ *
+ * @this {QueueService}
+ * @param {string} queue The queue name.
+ * @param {object} sharedAccessPolicy The shared access policy.
+ * @param {string} [sharedAccessPolicy.Id] The signed identifier.
+ * @param {object} [sharedAccessPolicy.AccessPolicy.Permissions] The permission type.
+ * @param {date|string} [sharedAccessPolicy.AccessPolicy.Start] The time at which the Shared Access Signature becomes valid (The UTC value will be used).
+ * @param {date|string} sharedAccessPolicy.AccessPolicy.Expiry The time at which the Shared Access Signature becomes expired (The UTC value will be used).
+ * @param {string} [sasVersion] An optional string indicating the desired SAS version to use. Value must be 2012-02-12 or later.
+ * @return {string} The shared access signature query string. Note this string does not contain the leading "?".
+ */
+ generateSharedAccessSignatureWithVersion(queue: any, sharedAccessPolicy: any, sasVersion: any): any;
+ }
+
+ module QueueService {
+
+ export interface ListQueueResult {
+ entries: QueueResult[];
+ continuationToken?: common.ContinuationToken;
+ }
+
+ export interface QueueMessageResult {
+ queue?: string;
+ messageid?: string;
+ popreceipt?: string;
+ metadata?: { [key: string]: string };
+ messagetext?: string;
+ timenextvisible?: string;
+ insertiontime?: string;
+ expirationtime?: string;
+ dequeuecount?: string;
+ }
+
+ export interface QueueResult {
+ name: string;
+ metadata?: { [key: string]: string; };
+ approximatemessagecount?: string;
+ signedIdentifiers: common.SignedIdentifier[];
+ }
+
+ export interface CreateQueueRequestOptions extends common.RequestOptions {
+ /** {object} The metadata key/value pairs. */
+ metadata?: { [key: string]: string; };
+ }
+
+ export interface ListQueuesRequestOptions extends common.RequestOptions {
+ /** {string} String value that identifies the portion of the list to be returned with the next list operation. */
+ marker?: string;
+ /** {int} Specifies the maximum number of queues to return per call to Azure storage. This does NOT affect list size returned by this function. (maximum: 5000) */
+ maxResults?: number;
+ /** {string} Include this parameter to specify that the queue's metadata be returned as part of the response body. (allowed values: '', 'metadata') */
+ include?: string;
+ }
+
+ export interface PeekMessagesRequestOptions extends common.RequestOptions {
+ numOfMessages?: number;
+ }
+
+ export interface GetMessagesRequestOptions extends common.RequestOptions {
+ numOfMessages?: number;
+ peekOnly?: boolean;
+ visibilityTimeout?: number;
+ }
+
+ export interface UpdateMessageRequestOptions extends common.RequestOptions {
+ messageText?: string|Buffer;
+ }
+
+ export interface CreateMessageRequestOptions extends common.RequestOptions {
+ /**
+ * {int} The time-to-live interval for the message, in seconds. The maximum time-to-live allowed is 7 days. If this parameter
+ * is omitted, the default time-to-live is 7 days
+ */
+ messagettl?: number;
+ /**
+ * {int} Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or
+ * equal to 0, and cannot be larger than 7 days. The visibility timeout of a message cannot be set to a value later than
+ * the expiry time. visibilitytimeout should be set to a value smaller than the time-to-live value.
+ */
+ visibilityTimeout?: number;
+ }
+ }
+
+ /**
+ * Defines enums for use with the Queue service.
+ * @namespace QueueUtilities
+ */
+ var QueueUtilities: {
+ /**
+ * Permission types.
+ *
+ * @const
+ * @enum {string}
+ */
+ SharedAccessPermissions: {
+ READ: string;
+ ADD: string;
+ UPDATE: string;
+ PROCESS: string;
+ };
+ };
+ }
+
+ module table {
+ export interface TableService extends StorageServiceClient {
+ defaultPayloadFormat: string;
+
+ /**
+ * Gets the service stats for a storage account’s Table service.
+ *
+ * @this {TableService}
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the properties.
+ * `response` will contain information related to this operation.
+ */
+ getServiceStats(options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Gets the service stats for a storage account’s Table service.
+ *
+ * @this {TableService}
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the properties.
+ * `response` will contain information related to this operation.
+ */
+ getServiceStats(callback: ErrorOrResult): any;
+
+ /**
+ * Gets the properties of a storage account’s Table service, including Azure Storage Analytics.
+ *
+ * @this {TableService}
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the properties.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ getServiceProperties(options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Gets the properties of a storage account’s Table service, including Azure Storage Analytics.
+ *
+ * @this {TableService}
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the properties.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ getServiceProperties(callback: ErrorOrResult): any;
+
+ /**
+ * Sets the properties of a storage account’s Table service, including Azure Storage Analytics.
+ * You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
+ *
+ * @this {TableService}
+ * @param {object} serviceProperties The service properties.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information if an error occurs;
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ setServiceProperties(serviceProperties: common.models.ServicePropertiesResult.ServiceProperties, options: common.RequestOptions, callback: ErrorOrResponse): any;
+
+ /**
+ * Sets the properties of a storage account’s Table service, including Azure Storage Analytics.
+ * You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
+ *
+ * @this {TableService}
+ * @param {object} serviceProperties The service properties.
+ * @param {errorOrResponse} callback `error` will contain information if an error occurs;
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ setServiceProperties(serviceProperties: common.models.ServicePropertiesResult.ServiceProperties, callback: ErrorOrResponse): any;
+
+ /**
+ * Lists a segment containing a collection of table items under the specified account.
+ *
+ * @this {TableService}
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The create options or callback function.
+ * @param {int} [options.maxResults] Specifies the maximum number of tables to return per call to Azure ServiceClient.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {string} [options.payloadFormat] The payload format to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of tables and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ listTablesSegmented(currentToken: TableService.ListTablesContinuationToken, options: TableService.ListTablesRequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Lists a segment containing a collection of table items under the specified account.
+ *
+ * @this {TableService}
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of tables and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ listTablesSegmented(currentToken: TableService.ListTablesContinuationToken, callback: ErrorOrResult): any;
+
+ /**
+ * Lists a segment containing a collection of table items under the specified account.
+ *
+ * @this {TableService}
+ * @param {string} prefix The prefix of the table name.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The create options or callback function.
+ * @param {int} [options.maxResults] Specifies the maximum number of tables to return per call to Azure ServiceClient.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {string} [options.payloadFormat] The payload format to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of tables and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ listTablesSegmentedWithPrefix(prefix: string, currentToken: TableService.ListTablesContinuationToken, options: TableService.ListTablesRequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Lists a segment containing a collection of table items under the specified account.
+ *
+ * @this {TableService}
+ * @param {string} prefix The prefix of the table name.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of tables and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ listTablesSegmentedWithPrefix(prefix: string, currentToken: TableService.ListTablesContinuationToken, callback: ErrorOrResult): any;
+
+ /**
+ * Gets the table's ACL.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the ACL information for the table.
+ * `response` will contain information related to this operation.
+ */
+ getTableAcl(table: string, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Gets the table's ACL.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the ACL information for the table.
+ * `response` will contain information related to this operation.
+ */
+ getTableAcl(table: string, callback: ErrorOrResult): any;
+
+ /**
+ * Updates the table's ACL.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} signedIdentifiers The signed identifiers. Signed identifiers must be in an array.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain information for the table.
+ * `response` will contain information related to this operation.
+ */
+ setTableAcl(table: string, signedIdentifiers: common.SignedIdentifier[], options: common.RequestOptions, callback: ErrorOrResult<{
+ TableName: string;
+ signedIdentifiers: common.SignedIdentifier[];
+ }>): any;
+
+ /**
+ * Updates the table's ACL.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} signedIdentifiers The signed identifiers. Signed identifiers must be in an array.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain information for the table.
+ * `response` will contain information related to this operation.
+ */
+ setTableAcl(table: string, signedIdentifiers: common.SignedIdentifier[], callback: ErrorOrResult<{
+ TableName: string;
+ signedIdentifiers: common.SignedIdentifier[];
+ }>): any;
+
+ /**
+ * Retrieves a shared access signature token.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} sharedAccessPolicy The shared access policy.
+ * @param {string} [sharedAccessPolicy.Id] The signed identifier.
+ * @param {object} [sharedAccessPolicy.AccessPolicy.Permissions] The permission type.
+ * @param {date|string} [sharedAccessPolicy.AccessPolicy.Start] The time at which the Shared Access Signature becomes valid (The UTC value will be used).
+ * @param {date|string} sharedAccessPolicy.AccessPolicy.Expiry The time at which the Shared Access Signature becomes expired (The UTC value will be used).
+ * @param {string} [sharedAccessPolicy.AccessPolicy.StartPk] The starting Partition Key for which the SAS will be valid.
+ * @param {string} [sharedAccessPolicy.AccessPolicy.EndPk] The ending Partition Key for which the SAS will be valid.
+ * @param {string} [sharedAccessPolicy.AccessPolicy.StartRk] The starting Row Key for which the SAS will be valid.
+ * @param {string} [sharedAccessPolicy.AccessPolicy.EndRk] The ending Row Key for which the SAS will be valid.
+ * @return {object} An object with the shared access signature.
+ */
+ generateSharedAccessSignature(table: string, sharedAccessPolicy: TableAccessPolicy): string;
+
+ /**
+ * Retrieves a shared access signature token.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} sharedAccessPolicy The shared access policy.
+ * @param {string} [sharedAccessPolicy.Id] The signed identifier.
+ * @param {object} [sharedAccessPolicy.AccessPolicy.Permissions] The permission type.
+ * @param {date|string} [sharedAccessPolicy.AccessPolicy.Start] The time at which the Shared Access Signature becomes valid (The UTC value will be used).
+ * @param {date|string} sharedAccessPolicy.AccessPolicy.Expiry The time at which the Shared Access Signature becomes expired (The UTC value will be used).
+ * @param {string} [sharedAccessPolicy.AccessPolicy.StartPk] The starting Partition Key for which the SAS will be valid.
+ * @param {string} [sharedAccessPolicy.AccessPolicy.EndPk] The ending Partition Key for which the SAS will be valid.
+ * @param {string} [sharedAccessPolicy.AccessPolicy.StartRk] The starting Row Key for which the SAS will be valid.
+ * @param {string} [sharedAccessPolicy.AccessPolicy.EndRk] The ending Row Key for which the SAS will be valid.
+ * @param {string} [sasVersion] An optional string indicating the desired SAS version to use. Value must be 2012-02-12 or later.
+ * @return {object} An object with the shared access signature.
+ */
+ generateSharedAccessSignatureWithVersion(table: string, sharedAccessPolicy: TableAccessPolicy, sasVersion: string): string;
+
+ /**
+ * Checks whether or not a table exists on the service.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain be true if the table exists, or false if the table does not exist.
+ * `response` will contain information related to this operation.
+ */
+ doesTableExist(table: string, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Checks whether or not a table exists on the service.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain be true if the table exists, or false if the table does not exist.
+ * `response` will contain information related to this operation.
+ */
+ doesTableExist(table: string, callback: ErrorOrResult): any;
+
+ /**
+ * Creates a new table within a storage account.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the new table information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ createTable(table: string, options: common.RequestOptions, callback: ErrorOrResult<{
+ TableName: string;
+ isSuccessful?: boolean;
+ }>): any;
+
+ /**
+ * Creates a new table within a storage account.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the new table information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ createTable(table: string, callback: ErrorOrResult<{
+ TableName: string;
+ isSuccessful?: boolean;
+ }>): any;
+
+ /**
+ * Creates a new table within a storage account if it does not exists.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * `result` will be `true` if table was created, false otherwise
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var tableService = azure.createTableService();
+ * tableService.createTableIfNotExists('tasktable', function(error) {
+ * if(!error) {
+ * // Table created or exists
+ * }
+ * });
+ */
+ createTableIfNotExists(table: string, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Creates a new table within a storage account if it does not exists.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * `result` will be `true` if table was created, false otherwise
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var tableService = azure.createTableService();
+ * tableService.createTableIfNotExists('tasktable', function(error) {
+ * if(!error) {
+ * // Table created or exists
+ * }
+ * });
+ */
+ createTableIfNotExists(table: string, callback: ErrorOrResult): any;
+
+ /**
+ * Deletes a table from a storage account.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information if an error occurs;
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ deleteTable(table: string, options: common.RequestOptions, callback: ErrorOrResponse): any;
+
+ /**
+ * Deletes a table from a storage account.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {errorOrResponse} callback `error` will contain information if an error occurs;
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ deleteTable(table: string, callback: ErrorOrResponse): any;
+
+ /**
+ * Deletes a table from a storage account, if it exists.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * `result` will be `true` if table was deleted, false otherwise
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ deleteTableIfExists(table: string, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Deletes a table from a storage account, if it exists.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * `result` will be `true` if table was deleted, false otherwise
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ deleteTableIfExists(table: string, callback: ErrorOrResult): any;
+
+ /**
+ * Queries data in a table. To retrieve a single entity by partition key and row key, use retrieve entity.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {TableQuery} tableQuery The query to perform. Use null, undefined, or new TableQuery() to get all of the entities in the table.
+ * @param {object} currentToken A continuation token returned by a previous listing operation.
+ * Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {string} [options.payloadFormat] The payload format to use for the request.
+ * @param {bool} [options.autoResolveProperties] If true, guess at all property types.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {Function(entity)} [options.entityResolver] The entity resolver. Given a single entity returned by the query, returns a modified object which is added to
+ * the entities array.
+ * @param {TableService~propertyResolver} [options.propertyResolver] The property resolver. Given the partition key, row key, property name, property value,
+ * and the property Edm type if given by the service, returns the Edm type of the property.
+ * @param {TableService~queryResponse} callback `error` will contain information if an error occurs;
+ * otherwise `entities` will contain the entities returned by the query.
+ * If more matching entities exist, and could not be returned,
+ * `queryResultContinuation` will contain a continuation token that can be used
+ * to retrieve the next set of results.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ *
+ * The logic for returning entity types can get complicated. Here is the algorithm used:
+ * ```
+ * var propertyType;
+ *
+ * if (propertyResovler) { // If the caller provides a propertyResolver in the options, use it
+ * propertyType = propertyResolver(partitionKey, rowKey, propertyName, propertyValue, propertyTypeFromService);
+ * } else if (propertyTypeFromService) { // If the service provides us a property type, use it. See below for an explanation of when this will and won't occur.
+ * propertyType = propertyTypeFromService;
+ * } else if (autoResolveProperties) { // If options.autoResolveProperties is set to true
+ * if (javascript type is string) { // See below for an explanation of how and why autoResolveProperties works as it does.
+ * propertyType = 'Edm.String';
+ * } else if (javascript type is boolean) {
+ * propertyType = 'Edm.Boolean';
+ * }
+ * }
+ *
+ * if (propertyType) {
+ * // Set the property type on the property.
+ * } else {
+ * // Property gets no EdmType.
+ * }
+ * ```
+ * Notes:
+ *
+ * * The service only provides a type if JsonFullMetadata or JsonMinimalMetadata is used, and if the type is Int64, Guid, Binary, or DateTime.
+ * * Explanation of autoResolveProperties:
+ * * String gets correctly resolved to 'Edm.String'.
+ * * Int64, Guid, Binary, and DateTime all get resolved to 'Edm.String.' This only happens if JsonNoMetadata is used (otherwise the service will provide the propertyType in a prior step).
+ * * Boolean gets correctly resolved to 'Edm.Boolean'.
+ * * For both Int32 and Double, no type information is returned, even in the case of autoResolveProperties = true. This is due to an
+ * inability to distinguish between the two in certain cases.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var tableService = azure.createTableService();
+ * // tasktable should already exist and have entities
+ *
+ * // returns all entities in tasktable, and a continuation token for the next page of results if necessary
+ * tableService.queryEntities('tasktable', null, null \/*currentToken*\/, function(error, result) {
+ * if(!error) {
+ * var entities = result.entities;
+ * // do stuff with the returned entities if there are any
+ * }
+ * });
+ *
+ * // returns field1 and field2 of the entities in tasktable, and a continuation token for the next page of results if necessary
+ * var tableQuery = new TableQuery().select('field1', 'field2');
+ * tableService.queryEntities('tasktable', tableQuery, null \/*currentToken*\/, function(error, result) {
+ * if(!error) {
+ * var entities = result.entities;
+ * // do stuff with the returned entities if there are any
+ * }
+ * });
+ */
+ queryEntities(table: string, tableQuery: TableQuery, currentToken: TableService.TableContinuationToken, options: TableService.TableEntityRequestOptions, callback: ErrorOrResult>): any;
+
+ /**
+ * Queries data in a table. To retrieve a single entity by partition key and row key, use retrieve entity.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {TableQuery} tableQuery The query to perform. Use null, undefined, or new TableQuery() to get all of the entities in the table.
+ * @param {object} currentToken A continuation token returned by a previous listing operation.
+ * Please use 'null' or 'undefined' if this is the first operation.
+ * @param {TableService~queryResponse} callback `error` will contain information if an error occurs;
+ * otherwise `entities` will contain the entities returned by the query.
+ * If more matching entities exist, and could not be returned,
+ * `queryResultContinuation` will contain a continuation token that can be used
+ * to retrieve the next set of results.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ queryEntities(table: string, tableQuery: TableQuery, currentToken: TableService.TableContinuationToken, callback: ErrorOrResult>): any;
+
+ /**
+ * Retrieves an entity from a table.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {string} partitionKey The partition key.
+ * @param {string} rowKey The row key.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {string} [options.payloadFormat] The payload format to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {TableService~propertyResolver} [options.propertyResolver] The property resolver. Given the partition key, row key, property name, property value,
+ * and the property Edm type if given by the service, returns the Edm type of the property.
+ * @param {Function(entity)} [options.entityResolver] The entity resolver. Given the single entity returned by the query, returns a modified object.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will be the matching entity.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var tableService = azure.createTableService();
+ * tableService.retrieveEntity('tasktable', 'tasksSeattle', '1', function(error, serverEntity) {
+ * if(!error) {
+ * // Entity available in serverEntity variable
+ * }
+ * });
+ */
+ retrieveEntity(table: string, partitionKey: string, rowKey: string, options: TableService.TableEntityRequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Retrieves an entity from a table.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {string} partitionKey The partition key.
+ * @param {string} rowKey The row key.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {string} [options.payloadFormat] The payload format to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {TableService~propertyResolver} [options.propertyResolver] The property resolver. Given the partition key, row key, property name, property value,
+ * and the property Edm type if given by the service, returns the Edm type of the property.
+ * @param {Function(entity)} [options.entityResolver] The entity resolver. Given the single entity returned by the query, returns a modified object.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will be the matching entity.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ retrieveEntity(table: string, partitionKey: string, rowKey: string, callback: ErrorOrResult): any;
+
+ /**
+ * Inserts a new entity into a table.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.echoContent] Whether or not to return the entity upon a successful insert. Default to false.
+ * @param {string} [options.payloadFormat] The payload format to use in the response, if options.echoContent is true.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {TableService~propertyResolver} [options.propertyResolver] The property resolver. Only applied if echoContent is true. Given the partition key, row key, property name,
+ * property value, and the property Edm type if given by the service, returns the Edm type of the property.
+ * @param {Function(entity)} [options.entityResolver] The entity resolver. Only applied if echoContent is true. Given the single entity returned by the insert, returns
+ * a modified object.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var tableService = azure.createTableService();
+ * var task1 = {
+ * PartitionKey : {'_': 'tasksSeattle', '$':'Edm.String'},
+ * RowKey: {'_': '1', '$':'Edm.String'},
+ * Description: {'_': 'Take out the trash', '$':'Edm.String'},
+ * DueDate: {'_': new Date(2011, 12, 14, 12), '$':'Edm.DateTime'}
+ * };
+ * tableService.insertEntity('tasktable', task1, function(error) {
+ * if(!error) {
+ * // Entity inserted
+ * }
+ * });
+ */
+ insertEntity(table: string, entityDescriptor: T, options: TableService.InsertEntityRequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Inserts a new entity into a table.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ insertEntity(table: string, entityDescriptor: T, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Inserts a new entity into a table.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ insertEntity(table: string, entityDescriptor: T, callback: ErrorOrResult): any;
+
+ /**
+ * Inserts or updates a new entity into a table.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ insertOrReplaceEntity(table: string, entityDescriptor: T, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Inserts or updates a new entity into a table.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ insertOrReplaceEntity(table: string, entityDescriptor: T, callback: ErrorOrResult): any;
+
+ /**
+ * Updates an existing entity within a table by replacing it. To update conditionally based on etag, set entity['.metadata']['etag'].
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ updateEntity(table: string, entityDescriptor: T, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Updates an existing entity within a table by replacing it. To update conditionally based on etag, set entity['.metadata']['etag'].
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ updateEntity(table: string, entityDescriptor: T, callback: ErrorOrResult): any;
+
+ /**
+ * Updates an existing entity within a table by merging new property values into the entity. To merge conditionally based on etag, set entity['.metadata']['etag'].
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ mergeEntity(table: string, entityDescriptor: T, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Updates an existing entity within a table by merging new property values into the entity. To merge conditionally based on etag, set entity['.metadata']['etag'].
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ mergeEntity(table: string, entityDescriptor: T, callback: ErrorOrResult): any;
+
+ /**
+ * Inserts or updates an existing entity within a table by merging new property values into the entity.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ insertOrMergeEntity(table: string, entityDescriptor: T, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Inserts or updates an existing entity within a table by merging new property values into the entity.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the entity information.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ insertOrMergeEntity(table: string, entityDescriptor: T, callback: ErrorOrResult): any;
+
+ /**
+ * Deletes an entity within a table. To delete conditionally based on etag, set entity['.metadata']['etag'].
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information if an error occurs;
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ deleteEntity(table: string, entityDescriptor: T, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Deletes an entity within a table. To delete conditionally based on etag, set entity['.metadata']['etag'].
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {object} entityDescriptor The entity descriptor.
+ * @param {errorOrResponse} callback `error` will contain information if an error occurs;
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ deleteEntity(table: string, entityDescriptor: T, callback: ErrorOrResult): any;
+
+ /**
+ * Executes the operations in the batch.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {TableBatch} batch The table batch to execute.
+ * @param {object} [options] The create options or callback function.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain responses for each operation executed in the batch;
+ * `result.entity` will contain the entity information for each operation executed.
+ * `result.response` will contain the response for each operations executed.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ executeBatch(table: string, batch: TableBatch, options: common.RequestOptions, callback: ErrorOrResult): any;
+
+ /**
+ * Executes the operations in the batch.
+ *
+ * @this {TableService}
+ * @param {string} table The table name.
+ * @param {TableBatch} batch The table batch to execute.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain responses for each operation executed in the batch;
+ * `result.entity` will contain the entity information for each operation executed.
+ * `result.response` will contain the response for each operations executed.
+ * `response` will contain information related to this operation.
+ * @return {undefined}
+ */
+ executeBatch(table: string, batch: TableBatch, callback: ErrorOrResult): any;
+ }
+
+ export module TableService {
+ export interface ListTablesRequestOptions extends common.RequestOptions {
+ maxResults?: number;
+ payloadFormat?: string;
+ }
+
+ export interface ListTablesContinuationToken {
+ nextTableName: string;
+ targetLocation?: Constants.StorageLocation;
+ }
+
+ export interface ListTablesResponse {
+ continuationToken: ListTablesContinuationToken;
+ entries: string[];
+ }
+
+ export interface TableContinuationToken {
+ nextPartitionKey: string;
+ nextRowKey: string;
+ targetLocation: Constants.StorageLocation;
+ }
+
+ export interface GetTableAclResult {
+ signedIdentifiers: common.SignedIdentifier[];
+ }
+
+ export interface QueryEntitiesResult {
+ entities: T[];
+ continuationToken?: TableContinuationToken;
+ }
+
+ export interface EntityMetadata {
+ '.metadata': { etag: string; }
+ }
+
+ export interface PropertyResolver {
+ (partitionKey: string, rowKey: string, propertyName: string, propertyValue: Object): string;
+ }
+
+ export interface TableEntityRequestOptions extends common.RequestOptions {
+ payloadFormat?: string;
+ autoResolveProperties?: boolean;
+ propertyResolver?: PropertyResolver;
+ entityResolver?: (entityResult: Object) => Object;
+ }
+
+ export interface InsertEntityRequestOptions extends TableEntityRequestOptions {
+ echoContent: boolean;
+ }
+
+ export interface BatchResponse {
+ statusCode?: number;
+ headers?: Object;
+ body?: Object;
+ isSuccessful?: boolean;
+ }
+
+ export interface BatchResult {
+ entity?: Object;
+ error?: Error;
+ response: BatchResponse;
+ }
+
+ export interface Entity {
+ _: T;
+ $: string;
+ }
+ }
+
+ export var TableService: {
+ /**
+ * Creates a new TableService object.
+ * If no connection string or storageaccount and storageaccesskey are provided,
+ * the AZURE_STORAGE_CONNECTION_STRING or AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used.
+ * @class
+ * The TableService object allows you to peform management operations with the Microsoft Azure Table Service.
+ * The Table Service stores data in rows of key-value pairs. A table is composed of multiple rows, and each row
+ * contains key-value pairs. There is no schema, so each row in a table may store a different set of keys.
+ *
+ * For more information on the Table Service, as well as task focused information on using it from a Node.js application, see
+ * [How to Use the Table Service from Node.js](http://azure.microsoft.com/en-us/documentation/articles/storage-nodejs-how-to-use-table-storage/).
+ * The following defaults can be set on the Table service.
+ * defaultTimeoutIntervalInMs The default timeout interval, in milliseconds, to use for request made via the Table service.
+ * defaultMaximumExecutionTimeInMs The default maximum execution time across all potential retries, for requests made via the Table service.
+ * defaultLocationMode The default location mode for requests made via the Table service.
+ * defaultPayloadFormat The default payload format for requests made via the Table service.
+ * useNagleAlgorithm Determines whether the Nagle algorithm is used for requests made via the Table service.; true to use the
+ * Nagle algorithm; otherwise, false. The default value is false.
+ * @constructor
+ * @extends {StorageServiceClient}
+ *
+ * @param {string} [storageAccountOrConnectionString] The storage account or the connection string.
+ * @param {string} [storageAccessKey] The storage access key.
+ * @param {string|object} [host] The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @param {string} [sasToken] The Shared Access Signature token.
+ */
+ new (storageAccountOrConnectionString?: string, storageAccessKey?: string, host?: string|StorageHost, sasToken?: string): TableService;
+ }
+
+ export module TableUtilities {
+ /**
+ * Permission types.
+ *
+ * @const
+ * @enum {string}
+ */
+ var SharedAccessPermissions: {
+ QUERY: string;
+ ADD: string;
+ UPDATE: string;
+ DELETE: string;
+ };
+
+ /**
+ * Payload Format.
+ *
+ * @const
+ * @enum {string}
+ */
+ var PayloadFormat: {
+ FULL_METADATA: string;
+ MINIMAL_METADATA: string;
+ NO_METADATA: string;
+ };
+
+ /**
+ * Defines the set of Boolean operators for constructing queries.
+ *
+ * @const
+ * @enum {string}
+ */
+ var TableOperators: {
+ AND: string;
+ NOT: string;
+ OR: string;
+ };
+
+ /**
+ * Filter property comparison operators.
+ *
+ * @const
+ * @enum {string}
+ */
+ var QueryComparisons: {
+ EQUAL: string;
+ NOT_EQUAL: string;
+ GREATER_THAN: string;
+ GREATER_THAN_OR_EQUAL: string;
+ LESS_THAN: string;
+ LESS_THAN_OR_EQUAL: string;
+ };
+
+ /**
+ * Edm types.
+ *
+ * @const
+ * @enum {string}
+ */
+ var EdmType: {
+ STRING: string;
+ BINARY: string;
+ INT64: string;
+ INT32: string;
+ DOUBLE: string;
+ DATETIME: string;
+ GUID: string;
+ BOOLEAN: string;
+ };
+
+ /**
+ * A helper to create table entities.
+ *
+ * @example
+ * var entGen = TableUtilities.entityGenerator;
+ * var entity = { PartitionKey: entGen.String('part2'),
+ * RowKey: entGen.String('row1'),
+ * boolValue: entGen.Boolean(true),
+ * intValue: entGen.Int32(42),
+ * dateValue: entGen.DateTime(new Date(Date.UTC(2011, 10, 25))),
+ * };
+ */
+ module entityGenerator {
+ class Entity {
+ _: T;
+ $: string;
+ constructor(value: T, type?: string);
+ }
+ function Int32(value: number|string): Entity;
+ function Int64(value: number|string): Entity;
+ function Binary(value: Buffer|string): Entity;
+ function Boolean(value: boolean|string): Entity;
+ function String(value: string): Entity;
+ function Guid(value: UUID|string|Buffer): Entity;
+ function Double(value: number|string): Entity;
+ function DateTime(value: Date|string): Entity;
+ }
+ }
+
+ export interface TableQuery {
+ /**
+ * Specifies the select clause. If no arguments are given, all fields will be selected.
+ *
+ * @param {array} fields The fields to be selected.
+ * @return {TableQuery} A table query object with the select clause.
+ * @example
+ * var tableQuery = new TableQuery().select('field1', 'field2');
+ */
+ select(...args: string[]): TableQuery;
+
+ /**
+ * Specifies the top clause.
+ *
+ * @param {int} top The number of items to fetch.
+ * @return {TableQuery} A table query object with the top clause.
+ * @example
+ * var tableQuery = new TableQuery().top(10);
+ *
+ * // tasktable should already exist and have entities
+ * tableService.queryEntities('tasktable', tableQuery, null \/*currentToken*\/, function(error, result) {
+ * if(!error) {
+ * var entities = result.entities; // there will be 10 or less entities
+ * // do stuff with the returned entities if there are any
+ * // if result.continuationToken exists, to get the next 10 (or less) entities
+ * // call queryEntities as above, but with the returned token instead of null
+ * }
+ * });
+ */
+ top(top: number): TableQuery;
+
+ /**
+ * Specifies the where clause.
+ *
+ * Valid type specifier strings include: ?string?, ?bool?, ?int32?, ?double?, ?date?, ?guid?, ?int64?, ?binary?
+ * A type must be specified for guid, int64, and binaries or the filter produced will be incorrect.
+ *
+ * @param {string} condition The condition string.
+ * @param {string|array} value Value(s) to insert in question mark (?) parameters.
+ * @return {TableQuery} A table query object with the where clause.
+ * @example
+ * var tableQuery = new TableQuery().where(TableQuery.guidFilter('GuidField', QueryComparisons.EQUAL, guidVal));
+ * OR
+ * var tableQuery = new TableQuery().where('Name == ? or Name <= ?', name1, name2);
+ * OR
+ * var tableQuery = new TableQuery().where('Name == ?string? && Value == ?int64?, name1, int64Val);
+ *
+ * // tasktable should already exist and have entities
+ * tableService.queryEntities('tasktable', tableQuery, null \/*currentToken*\/, function(error, result, response) {
+ * if(!error) {
+ * var entities = result.entities;
+ * // do stuff with the returned entities if there are any
+ * }
+ * });
+ */
+ where(condition: string, ...args: any[]): TableQuery;
+
+ /**
+ * Specifies an AND where condition.
+ *
+ * @param {string} condition The condition string.
+ * @param {array} arguments Any number of arguments to be replaced in the condition by the question mark (?).
+ * @return {TableQuery} A table query object with the and clause.
+ * @example
+ * var tableQuery = new TableQuery()
+ * .where('Name == ? or Name <= ?', 'Person1', 'Person2');
+ * .and('Age >= ?', 18);
+ */
+ and(condition: string, ...args: any[]): TableQuery;
+
+ /**
+ * Specifies an OR where condition.
+ *
+ * @param {string} condition The condition.
+ * @param {array} arguments Any number of arguments to be replaced in the condition by the question mark (?).
+ * @return {TableQuery} A table query object with the or clause.
+ * @example
+ * var tableQuery = new TableQuery()
+ * .where('Name == ? or Name <= ?', 'Person1', 'Person2');
+ * .or('Age >= ?', 18);
+ */
+ or(condition: string, ...args: any[]): TableQuery;
+
+ /**
+ * Returns the query string object for the query.
+ *
+ * @return {object} JSON object representing the query string arguments for the query.
+ */
+ toQueryObject(): Object;
+ }
+
+ export var TableQuery: {
+ new(): TableQuery;
+
+ /**
+ * Generates a property filter condition string for an 'int' value.
+ *
+ * @param {string} propertyName A string containing the name of the property to compare.
+ * @param {string} operation A string containing the comparison operator to use.
+ * See Constants.TableConstants.QueryComparisons for a list of allowed operations.
+ * @param {string|int} value An 'int' containing the value to compare with the property.
+ * @return {string} A string containing the formatted filter condition.
+ * @example
+ * var query = TableQuery.int32Filter('IntField', QueryComparisons.EQUAL, 5);
+ */
+ int32Filter(propertyName: string, operation: string, value: string | number): string;
+
+ /**
+ * Generates a property filter condition string for a 'int64' value.
+ *
+ * @param {string} propertyName A string containing the name of the property to compare.
+ * @param {string} operation A string containing the comparison operator to use.
+ * See Constants.TableConstants.QueryComparisons for a list of allowed operations.
+ * @param {string|int64} value An 'int64' containing the value to compare with the property.
+ * @return {string} A string containing the formatted filter condition.
+ * @example
+ * var query = TableQuery.int64Filter('Int64Field', QueryComparisons.EQUAL, 123);
+ */
+ int64Filter(propertyName: string, operation: string, value: string | number): string;
+
+ /**
+ * Generates a property filter condition string for a 'double' value.
+ *
+ * @param {string} propertyName A string containing the name of the property to compare.
+ * @param {string} operation A string containing the comparison operator to use.
+ * See Constants.TableConstants.QueryComparisons for a list of allowed operations.
+ * @param {string|double}value A 'double' containing the value to compare with the property.
+ * @return {string} A string containing the formatted filter condition.
+ * @example
+ * var query = TableQuery.doubleFilter('DoubleField', QueryComparisons.EQUAL, 123.45);
+ */
+ doubleFilter(propertyName: string, operation: string, value: string | number): string;
+
+ /**
+ * Generates a property filter condition string for a 'boolean' value.
+ *
+ * @param {string} propertyName A string containing the name of the property to compare.
+ * @param {string} operation A string containing the comparison operator to use.
+ * See Constants.TableConstants.QueryComparisons for a list of allowed operations.
+ * @param {string|boolean} value A 'boolean' containing the value to compare with the property.
+ * @return {string} A string containing the formatted filter condition.
+ * @example
+ * var query = TableQuery.booleanFilter('BooleanField', QueryComparisons.EQUAL, false);
+ */
+ booleanFilter(propertyName: string, operation: string, value: boolean | string): string;
+
+ /**
+ * Generates a property filter condition string for a 'datetime' value.
+ *
+ * @param {string} propertyName A string containing the name of the property to compare.
+ * @param {string} operation A string containing the comparison operator to use.
+ * See Constants.TableConstants.QueryComparisons for a list of allowed operations.
+ * @param {string|date} value A 'datetime' containing the value to compare with the property.
+ * @return {string} A string containing the formatted filter condition.
+ * @example
+ * var query = TableQuery.dateFilter('DateTimeField', QueryComparisons.EQUAL, new Date(Date.UTC(2001, 1, 3, 4, 5, 6)));
+ */
+ dateFilter(propertyName: string, operation: string, value: Date | string): string;
+
+ /**
+ * Generates a property filter condition string for a 'guid' value.
+ *
+ * @param {string} propertyName A string containing the name of the property to compare.
+ * @param {string} operation A string containing the comparison operator to use.
+ * See Constants.TableConstants.QueryComparisons for a list of allowed operations.
+ * @param {string|guid} value A 'guid' containing the value to compare with the property.
+ * @return {string} A string containing the formatted filter condition.
+ * @example
+ * var query = TableQuery.guidFilter('GuidField', QueryComparisons.EQUAL, guid.v1());
+ */
+ guidFilter(propertyName: string, operation: string, value: UUID | string): string;
+
+ /**
+ * Generates a property filter condition string for a 'binary' value.
+ *
+ * @param {string} propertyName A string containing the name of the property to compare.
+ * @param {string} operation A string containing the comparison operator to use.
+ * See Constants.TableConstants.QueryComparisons for a list of allowed operations.
+ * @param {string|buffer}value A 'buffer' containing the value to compare with the property.
+ * @return {string} A string containing the formatted filter condition.
+ * @example
+ * var query = TableQuery.binaryFilter('BinaryField', QueryComparisons.EQUAL, new Buffer('hello'));
+ */
+ binaryFilter(propertyName: string, operation: string, value: Buffer | string): string;
+
+ /**
+ * Generates a property filter condition string.
+ *
+ * @param {string} propertyName A string containing the name of the property to compare.
+ * @param {string} operation A string containing the comparison operator to use.
+ * See Constants.TableConstants.QueryComparisons for a list of allowed operations.
+ * @param {string} value A 'string' containing the value to compare with the property.
+ * @return {string} A string containing the formatted filter condition.
+ * @example
+ * var query = TableQuery.stringFilter('StringField', QueryComparisons.EQUAL, 'name');
+ */
+ stringFilter(propertyName: string, operation: string, value: string): string;
+
+ /**
+ * Creates a filter condition using the specified logical operator on two filter conditions.
+ *
+ * @param {string} filterA A string containing the first formatted filter condition.
+ * @param {string} operatorString A string containing the operator to use (AND, OR).
+ * @param {string} filterB A string containing the second formatted filter condition.
+ * @return {string} A string containing the combined filter expression.
+ * @example
+ * var filter1 = TableQuery.stringFilter('Name', QueryComparisons.EQUAL, 'Person');
+ * var filter2 = TableQuery.booleanFilter('Visible', QueryComparisons.EQUAL, true);
+ * var combinedFilter = TableQuery.combineFilters(filter1, TablUtilities.TableOperators.AND, filter2);
+ */
+ combineFilters(filterA: string, operatorString: string, filterB: string): string;
+ };
+
+ export interface TableBatch {
+ operations: any[];
+ pk: string;
+ retrieve: boolean;
+
+ /**
+ * Removes all of the operations from the batch.
+ *
+ * @return {undefined}
+ */
+ clear(): void;
+
+ /**
+ * Returns a boolean value indicating weather there are operations in the batch.
+ *
+ * @return {Boolean} True if there are operations queued up; false otherwise.
+ */
+ hasOperations(): boolean;
+
+ /**
+ * Returns the number of operations in the batch.
+ *
+ * @return {number} The number of operations in the batch.
+ */
+ size(): number;
+
+ /**
+ * Adds a retrieve operation to the batch. Note that this must be the only operation in the batch.
+ *
+ * @param {string} partitionKey The partition key.
+ * @param {string} rowKey The row key.
+ * @param {object} [options] The request options.
+ * @param {string} [options.payloadFormat] The payload format to use for the request.
+ * @param {TableService~propertyResolver} [options.propertyResolver] The property resolver. Given the partition key, row key, property name, property value,
+ * and the property Edm type if given by the service, returns the Edm type of the property.
+ * @param {Function(entity)} [options.entityResolver] The entity resolver. Given the single entity returned by the query, returns a modified object.
+ * @return {undefined}
+ */
+ retrieveEntity(partitionKey: string, rowKey: string, options?: any): void;
+
+ /**
+ * Adds an insert operation to the batch.
+ *
+ * @param {object} entity The entity.
+ * @param {object} [options] The request options.
+ * @param {string} [options.echoContent] Whether or not to return the entity upon a successful insert. Inserts only, default to false.
+ * @param {string} [options.payloadFormat] The payload format to use for the request.
+ * @param {TableService~propertyResolver} [options.propertyResolver] The property resolver. Only applied if echoContent is true. Given the partition key, row key, property name,
+ * property value, and the property Edm type if given by the service, returns the Edm type of the property.
+ * @param {Function(entity)} [options.entityResolver] The entity resolver. Only applied if echoContent is true. Given the single entity returned by the insert, returns
+ * a modified object.
+ * @return {undefined}
+ */
+ insertEntity(entity: Object, options: any): void;
+
+ /**
+ * Adds a delete operation to the batch.
+ *
+ * @param {object} entity The entity.
+ * @return {undefined}
+ */
+ deleteEntity(entity: Object): void;
+
+ /**
+ * Adds a merge operation to the batch.
+ *
+ * @param {object} entity The entity.
+ * @return {undefined}
+ */
+ mergeEntity(entity: Object): void;
+
+ /**
+ * Adds an update operation to the batch.
+ *
+ * @param {object} entity The entity.
+ * @return {undefined}
+ */
+ updateEntity(entity: Object): void;
+
+ /**
+ * Adds an insert or replace operation to the batch.
+ *
+ * @param {object} entity The entity.
+ * @return {undefined}
+ */
+ insertOrReplaceEntity(entity: Object): void;
+
+ /**
+ * Adds an insert or merge operation to the batch.
+ *
+ * @param {object} entity The entity.
+ * @return {undefined}
+ */
+ insertOrMergeEntity(entity: Object): void;
+
+ /**
+ * Adds an operation to the batch after performing checks.
+ *
+ * @param {string} operationType The type of operation to perform. See Constants.TableConstants.Operations
+ * @param {object} entity The entity.
+ * @param {object} [options] The request options.
+ * @return {undefined}
+ */
+ addOperation(operationType: string, entity: any, options?: Object): void;
+
+ /**
+ * Gets an operation from the batch. Returns null if the index does not exist.
+ *
+ * @param {number} index The index in the operations array at which to remove an element.
+ * @return {object} The removed operation.
+ */
+ getOperation(index: any): any;
+
+ /**
+ * Removes an operation from the batch. Returns null if the index does not exist.
+ *
+ * @param {number} index The index in the operations array at which to remove an element.
+ * @return {object} The removed operation.
+ */
+ removeOperation(index: number): Object;
+ }
+
+ export var TableBatch: {
+ new (): TableBatch;
+ };
+ }
+
+ module file {
+ export interface FileService extends StorageServiceClient {
+ singleFileThresholdInBytes: number;
+ parallelOperationThreadCount: number;
+
+ /**
+ * Gets the properties of a storage account's File service, including Azure Storage Analytics.
+ *
+ * @this {FileService}
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs; otherwise, `result` will contain the properties
+ * and `response` will contain information related to this operation.
+ */
+ getServiceProperties(optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Sets the properties of a storage account's File service, including Azure Storage Analytics.
+ * You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
+ *
+ * @this {FileService}
+ * @param {object} serviceProperties The service properties.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise, `response`
+ * will contain information related to this operation.
+ */
+ setServiceProperties(serviceProperties: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Lists a segment containing a collection of share items under the specified account.
+ *
+ * @this {FileService}
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.maxResults] Specifies the maximum number of shares to return per call to Azure storage.
+ * @param {string} [options.include] Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata')
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of shares and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listSharesSegmented(currentToken: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Lists a segment containing a collection of share items whose names begin with the specified prefix under the specified account.
+ *
+ * @this {FileService}
+ * @param {string} prefix The prefix of the share name.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {string} [options.prefix] Filters the results to return only shares whose name begins with the specified prefix.
+ * @param {int} [options.maxResults] Specifies the maximum number of shares to return per call to Azure storage.
+ * @param {string} [options.include] Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata')
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain `entries` and `continuationToken`.
+ * `entries` gives a list of shares and the `continuationToken` is used for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listSharesSegmentedWithPrefix(prefix: any, currentToken: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Checks whether or not a share exists on the service.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the share exists, or false if the share does not exist.
+ * `response` will contain information related to this operation.
+ */
+ doesShareExist(share: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Creates a new share under the specified account.
+ * If a share with the same name already exists, the operation fails.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} [options] The request options.
+ * @param {int} [options.quota] Specifies the maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120).
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the share information.
+ * `response` will contain information related to this operation.
+ */
+ createShare(share: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Creates a new share under the specified account if the share does not exists.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the share was created, or false if the share
+ * already exists.
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var FileService = azure.createFileService();
+ * FileService.createShareIfNotExists('taskshare', function(error) {
+ * if(!error) {
+ * // Share created or already existed
+ * }
+ * });
+ */
+ createShareIfNotExists(share: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Retrieves a share and its properties from a specified account.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the share.
+ * `response` will contain information related to this operation.
+ */
+ getShareProperties(share: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Sets the properties for the specified share.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} [properties] The share properties to set.
+ * @param {string|int} [properties.quota] Specifies the maximum size of the share, in gigabytes.
+ * @param {object} [options] The request options.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the file.
+ * `response` will contain information related to this operation.
+ */
+ setShareProperties(share: string, properties: FileService.ShareProperties, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Gets the share statistics for a share.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs; otherwise, `result` will contain the stats and
+ * `response` will contain information related to this operation.
+ */
+ getShareStats(share: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Returns all user-defined metadata for the share.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the share.
+ * `response` will contain information related to this operation.
+ */
+ getShareMetadata(share: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Sets the share's metadata.
+ *
+ * Calling the Set Share Metadata operation overwrites all existing metadata that is associated with the share.
+ * It's not possible to modify an individual name/value pair.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} metadata The metadata key/value pairs.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ setShareMetadata(share: string, metadata: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Gets the share's ACL.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the share.
+ * `response` will contain information related to this operation.
+ */
+ getShareAcl(share: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Updates the share's ACL.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} signedIdentifiers The signed identifiers. Signed identifiers must be in an array.
+ * @param {object} [options] The request options.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the share.
+ * `response` will contain information related to this operation.
+ */
+ setShareAcl(share: string, signedIdentifiers: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Marks the specified share for deletion.
+ * The share and any files contained within it are later deleted during garbage collection.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ deleteShare(share: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Marks the specified share for deletion if it exists.
+ * The share and any files contained within it are later deleted during garbage collection.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the share exists and was deleted, or false if the share
+ * did not exist.
+ * `response` will contain information related to this operation.
+ */
+ deleteShareIfExists(share: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Checks whether or not a directory exists on the service.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the directory exists, or false if the directory does not exist.
+ * `response` will contain information related to this operation.
+ */
+ doesDirectoryExist(share: string, directory: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Creates a new directory under the specified account.
+ * If a directory with the same name already exists, the operation fails.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the directory information.
+ * `response` will contain information related to this operation.
+ */
+ createDirectory(share: string, directory: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Creates a new directory under the specified account if the directory does not exists.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the directory was created, or false if the directory
+ * already exists.
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var FileService = azure.createFileService();
+ * FileService.createDirectoryIfNotExists('taskshare', taskdirectory', function(error) {
+ * if(!error) {
+ * // Directory created or already existed
+ * }
+ * });
+ */
+ createDirectoryIfNotExists(share: string, directory: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Retrieves a directory and its properties from a specified account.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information for the directory.
+ * `response` will contain information related to this operation.
+ */
+ getDirectoryProperties(share: string, directory: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Marks the specified directory for deletion. The directory must be empty before it can be deleted.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; otherwise
+ * `response` will contain information related to this operation.
+ */
+ deleteDirectory(share: string, directory: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Marks the specified directory for deletion if it exists. The directory must be empty before it can be deleted.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the directory exists and was deleted, or false if the directory
+ * did not exist.
+ * `response` will contain information related to this operation.
+ */
+ deleteDirectoryIfExists(share: string, directory: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Lists a segment containing a collection of file items in the directory.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
+ * @param {object} [options] The request options.
+ * @param {int} [options.maxResults] Specifies the maximum number of files to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000)
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs]The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * entries.files, entries.directories and the continuationToken for the next listing operation.
+ * `response` will contain information related to this operation.
+ */
+ listFilesAndDirectoriesSegmented(share: string, directory: string, currentToken: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Returns all user-defined metadata for the specified directory.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the file.
+ * `response` will contain information related to this operation.
+ */
+ getDirectoryMetadata(share: string, directory: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Sets user-defined metadata for the specified directory as one or more name-value pairs
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {object} metadata The metadata key/value pairs.
+ * @param {object} [options] The request options.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information on the file.
+ * `response` will contain information related to this operation.
+ */
+ setDirectoryMetadata(share: string, directory: string, metadata: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Retrieves a shared access signature token.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} [directory] The directory name. Use '' to refer to the base directory.
+ * @param {string} [file] The file name.
+ * @param {object} sharedAccessPolicy The shared access policy.
+ * @param {string} [sharedAccessPolicy.Id] The signed identifier.
+ * @param {object} [sharedAccessPolicy.AccessPolicy.Permissions] The permission type.
+ * @param {date|string} [sharedAccessPolicy.AccessPolicy.Start] The time at which the Shared Access Signature becomes valid (The UTC value will be used).
+ * @param {date|string} sharedAccessPolicy.AccessPolicy.Expiry The time at which the Shared Access Signature becomes expired (The UTC value will be used).
+ * @param {object} [headers] The optional header values to set for a file returned wth this SAS.
+ * @param {string} [headers.cacheControl] The optional value of the Cache-Control response header to be returned when this SAS is used.
+ * @param {string} [headers.contentType] The optional value of the Content-Type response header to be returned when this SAS is used.
+ * @param {string} [headers.contentEncoding] The optional value of the Content-Encoding response header to be returned when this SAS is used.
+ * @param {string} [headers.contentLanguage] The optional value of the Content-Language response header to be returned when this SAS is used.
+ * @param {string} [headers.contentDisposition] The optional value of the Content-Disposition response header to be returned when this SAS is used.
+ * @return {string} The shared access signature. Note this does not contain the leading "?".
+ */
+ generateSharedAccessSignature(share: string, directory: string, file: string, sharedAccessPolicy: any, headers: any): any;
+
+ /**
+ * Retrieves a shared access signature token.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} [directory] The directory name. Use '' to refer to the base directory.
+ * @param {string} [file] The file name.
+ * @param {object} sharedAccessPolicy The shared access policy.
+ * @param {string} [sharedAccessPolicy.Id] The signed identifier.
+ * @param {object} [sharedAccessPolicy.AccessPolicy.Permissions] The permission type.
+ * @param {date|string} [sharedAccessPolicy.AccessPolicy.Start] The time at which the Shared Access Signature becomes valid (The UTC value will be used).
+ * @param {date|string} sharedAccessPolicy.AccessPolicy.Expiry The time at which the Shared Access Signature becomes expired (The UTC value will be used).
+ * @param {string} [sasVersion] An optional string indicating the desired SAS version to use. Value must be 2012-02-12 or later.
+ * @param {object} [headers] The optional header values to set for a file returned wth this SAS.
+ * @param {string} [headers.cacheControl] The optional value of the Cache-Control response header to be returned when this SAS is used.
+ * @param {string} [headers.contentType] The optional value of the Content-Type response header to be returned when this SAS is used.
+ * @param {string} [headers.contentEncoding] The optional value of the Content-Encoding response header to be returned when this SAS is used.
+ * @param {string} [headers.contentLanguage] The optional value of the Content-Language response header to be returned when this SAS is used.
+ * @param {string} [headers.contentDisposition] The optional value of the Content-Disposition response header to be returned when this SAS is used.
+ * @return {string} The shared access signature query string. Note this string does not contain the leading "?".
+ */
+ generateSharedAccessSignatureWithVersion(share: string, directory: string, file: string, sharedAccessPolicy: any, sasVersion: any, headers: any): any;
+
+ /**
+ * Retrieves a file or directory URL.
+ *
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} [file] The file name. File names may not start or end with the delimiter '/'.
+ * @param {string} [sasToken] The Shared Access Signature token.
+ * @param {boolean} [primary] A boolean representing whether to use the primary or the secondary endpoint.
+ * @return {string} The formatted URL string.
+ * @example
+ * var azure = require('azure-storage');
+ * var FileService = azure.createFileService();
+ * var url = FileService.getUrl(shareName, directoryName, fileName, sasToken, true);
+ */
+ getUrl(share: string, directory: string, file: string, sasToken: any, primary: any): string;
+
+ /**
+ * Returns all user-defined metadata, standard HTTP properties, and system properties for the file.
+ * It does not return or modify the content of the file.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the file.
+ * `response` will contain information related to this operation.
+ */
+ getFileProperties(share: string, directory: string, file: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Returns all user-defined metadata for the specified file.
+ * It does not modify or return the content of the file.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the file.
+ * `response` will contain information related to this operation.
+ */
+ getFileMetadata(share: string, directory: string, file: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Sets user-defined properties for the specified file.
+ * It does not modify or return the content of the file.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {object} [options] The request options.
+ * @param {string} [options.contentType] The MIME content type of the file. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the file.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the file content.
+ * @param {string} [options.cacheControl] The file service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The file's content disposition.
+ * @param {string} [options.contentLength] Resizes a file to the specified size. If the specified byte value is less than the current size of the file,
+ * then all ranges above the specified byte value are cleared.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the file.
+ * `response` will contain information related to this operation.
+ */
+ setFileProperties(share: string, directory: string, file: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Sets user-defined metadata for the specified file as one or more name-value pairs
+ * It does not modify or return the content of the file.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {object} metadata The metadata key/value pairs.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information on the file.
+ * `response` will contain information related to this operation.
+ */
+ setFileMetadata(share: string, directory: string, file: string, metadata: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Resizes a file.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {String} size The size of the file, in bytes.
+ * @param {object} [options] The request options.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * information about the file.
+ * `response` will contain information related to this operation.
+ */
+ resizeFile(share: string, directory: string, file: string, size: number, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Checks whether or not a file exists on the service.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `errorOrResult` will
+ * be true if the file exists, or false if the file does not exist.
+ * `response` will contain information related to this operation.
+ */
+ doesFileExist(share: string, directory: string, file: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Creates a file of the specified length.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {int} length The length of the file in bytes.
+ * @param {object} [options] The request options.
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {string} [options.contentType] The MIME content type of the file. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the file.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the file content.
+ * @param {string} [options.cacheControl] The file service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The file's content disposition. (x-ms-File-content-disposition)
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the directory information.
+ * `response` will contain information related to this operation.
+ */
+ createFile(share: string, directory: string, file: string, length: number, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Marks the specified file for deletion. The file is later deleted during garbage collection.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResponse} callback `error` will contain information
+ * if an error occurs; `response` will contain information related to this operation.
+ */
+ deleteFile(share: string, directory: string, file: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Marks the specified file for deletion if it exists. The file is later deleted during garbage collection.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will
+ * be true if the file was deleted, or false if the file
+ * does not exist.
+ * `response` will contain information related to this operation.
+ */
+ deleteFileIfExists(share: string, directory: string, file: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Downloads a file into a text string.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {object} [options] The request options.
+ * @param {int} [options.rangeStart] The range start.
+ * @param {int} [options.rangeEnd] The range end.
+ * @param {boolean} [options.disableContentMD5Validation] When set to true, MD5 validation will be disabled when downloading files.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {FileService~FileToText} callback `error` will contain information
+ * if an error occurs; otherwise `text` will contain the file contents,
+ * and `file` will contain the file information.
+ * `response` will contain information related to this operation.
+ */
+ getFileToText(share: string, directory: string, file: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Downloads an Azure file into a file.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {string} localFileName The local path to the file to be downloaded.
+ * @param {object} [options] The request options.
+ * @param {string} [options.rangeStart] Return only the bytes of the file in the specified range.
+ * @param {string} [options.rangeEnd] Return only the bytes of the file in the specified range.
+ * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions.
+ * @param {boolean} [options.disableContentMD5Validation] When set to true, MD5 validation will be disabled when downloading files.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the file information.
+ * `response` will contain information related to this operation.
+ * @example
+ * var azure = require('azure-storage');
+ * var FileService = azure.createFileService();
+ * FileService.getFileToLocalFile('taskshare', taskdirectory', 'task1', 'task1-download.txt', function(error, serverFile) {
+ * if(!error) {
+ * // file available in serverFile.file variable
+ * }
+ */
+ getFileToLocalFile(share: string, directory: string, file: string, localFileName: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Provides a stream to read from a file.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {object} [options] The request options.
+ * @param {string} [options.rangeStart] Return only the bytes of the file in the specified range.
+ * @param {string} [options.rangeEnd] Return only the bytes of the file in the specified range.
+ * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions.
+ * @param {boolean} [options.disableContentMD5Validation] When set to true, MD5 validation will be disabled when downloading files.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the file information.
+ * `response` will contain information related to this operation.
+ * @return {Stream}
+ * @example
+ * var azure = require('azure-storage');
+ * var fileService = azure.createFileService();
+ * var writable = fs.createWriteStream(destinationFileNameTarget);
+ * fileService.createReadStream(shareName, directoryName, fileName).pipe(writable);
+ */
+ createReadStream(share: string, directory: string, file: string, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Downloads a file into a stream.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {Stream} writeStream The write stream.
+ * @param {object} [options] The request options.
+ * @param {string} [options.rangeStart] Return only the bytes of the file in the specified range.
+ * @param {string} [options.rangeEnd] Return only the bytes of the file in the specified range.
+ * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions.
+ * @param {boolean} [options.disableContentMD5Validation] When set to true, MD5 validation will be disabled when downloading files.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information if an error occurs;
+ * otherwise `result` will contain the file information.
+ * `response` will contain information related to this operation.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var FileService = azure.createFileService();
+ * FileService.getFileToStream('taskshare', taskdirectory', 'task1', fs.createWriteStream('task1-download.txt'), function(error, serverFile) {
+ * if(!error) {
+ * // file available in serverFile.file variable
+ * }
+ * });
+ */
+ getFileToStream(share: string, directory: string, file: string, writeStream: any, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Lists file ranges. Lists all of the ranges by default, or only the ranges over a specific range of bytes if rangeStart and rangeEnd are specified.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {object} [options] The request options.
+ * @param {int} [options.rangeStart] The range start.
+ * @param {int} [options.rangeEnd] The range end.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the range information.
+ * `response` will contain information related to this operation.
+ */
+ listRanges(share: string, directory: string, file: string, optionsOrCallback: any, callback: ErrorOrResult): void;
+
+ /**
+ * Clears a range. Clears all of the ranges by default, or only the ranges over a specific range of bytes if rangeStart and rangeEnd are specified.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {int} rangeStart The range start.
+ * @param {int} rangeEnd The range end.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the directory information.
+ * `response` will contain information related to this operation.
+ */
+ clearRange(share: string, directory: string, file: string, rangeStart: number, rangeEnd: number, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Updates a range from a stream.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {Stream} readStream The read stream.
+ * @param {int} rangeStart The range start.
+ * @param {int} rangeEnd The range end.
+ * @param {object} [options] The request options.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentMD5] An optional hash value used to ensure transactional integrity for the page.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the file information.
+ * `response` will contain information related to this operation.
+ */
+ createRangesFromStream(share: string, directory: string, file: string, readStream: any, rangeStart: any, rangeEnd: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Uploads a file from a text string.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {string|object} text The file text, as a string or in a Buffer.
+ * @param {object} [options] The request options.
+ * @param {SpeedSummary} [options.speedSummary] The download tracker objects;
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeFileContentMD5] Specifies whether the file's ContentMD5 header should be set on uploads.
+ * The default value is false for files.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the file. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the file.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the file content.
+ * @param {string} [options.cacheControl] The file service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The file's content disposition. (x-ms-File-content-disposition)
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {FileService~FileToText} callback `error` will contain information
+ * if an error occurs; otherwise `text` will contain the file contents,
+ * and `file` will contain the file information.
+ * `response` will contain information related to this operation.
+ */
+ createFileFromText(share: string, directory: string, file: string, text: any, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Uploads a file to storage from a local file.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param (string) localFileName The local path to the file to be uploaded.
+ * @param {object} [options] The request options.
+ * @param {SpeedSummary} [options.speedSummary] The download tracker objects;
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeFileContentMD5] Specifies whether the file's ContentMD5 header should be set on uploads.
+ * The default value is false for files.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the file. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the file.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the file content.
+ * @param {string} [options.cacheControl] The file service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The file's content disposition. (x-ms-File-content-disposition)
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ createFileFromLocalFile(share: string, directory: string, file: string, localFileName: any, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Uploads a file from a stream.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param (Stream) stream Stream to the data to store.
+ * @param {int} streamLength The length of the stream to upload.
+ * @param {object} [options] The request options.
+ * @param {SpeedSummary} [options.speedSummary] The download tracker objects;
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeFileContentMD5] Specifies whether the file's ContentMD5 header should be set on uploads.
+ * The default value is false for files.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the file. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the file.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the file content.
+ * @param {string} [options.cacheControl] The file service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The file's content disposition. (x-ms-File-content-disposition)
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {SpeedSummary}
+ */
+ createFileFromStream(share: string, directory: string, file: string, stream: any, streamLength: number, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Provides a stream to write to a file. Assumes that the file exists.
+ * If it does not, please create the file using createFile before calling this method or use createWriteStreamNewFile.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {object} [options] The request options.
+ * @param {SpeedSummary} [options.speedSummary] The download tracker objects;
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeFileContentMD5] Specifies whether the file's ContentMD5 header should be set on uploads.
+ * The default value is false for files.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the file. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the file.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the file content.
+ * @param {string} [options.cacheControl] The file service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The file's content disposition. (x-ms-File-content-disposition)
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {Stream}
+ * @example
+ * var azure = require('azure-storage');
+ * var FileService = azure.createFileService();
+ * FileService.createFile(shareName, directoryName, fileName, 1024, function (err) {
+ * // Pipe file to a file
+ * var stream = fs.createReadStream(fileNameTarget).pipe(FileService.createWriteStreamToExistingFile(shareName, directoryName, fileName));
+ * });
+ */
+ createWriteStreamToExistingFile(share: string, directory: string, file: string, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Provides a stream to write to a file. Creates the file before writing data.
+ *
+ * @this {FileService}
+ * @param {string} share The share name.
+ * @param {string} directory The directory name. Use '' to refer to the base directory.
+ * @param {string} file The file name. File names may not start or end with the delimiter '/'.
+ * @param {string} length The file length.
+ * @param {object} [options] The request options.
+ * @param {SpeedSummary} [options.speedSummary] The download tracker objects;
+ * @param {object} [options.metadata] The metadata key/value pairs.
+ * @param {bool} [options.storeFileContentMD5] Specifies whether the file's ContentMD5 header should be set on uploads.
+ * The default value is false for files.
+ * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions.
+ * @param {string} [options.contentType] The MIME content type of the file. The default type is application/octet-stream.
+ * @param {string} [options.contentEncoding] The content encodings that have been applied to the file.
+ * @param {string} [options.contentLanguage] The natural languages used by this resource.
+ * @param {string} [options.contentMD5] The MD5 hash of the file content.
+ * @param {string} [options.cacheControl] The file service stores this value but does not use or modify it.
+ * @param {string} [options.contentDisposition] The file's content disposition. (x-ms-File-content-disposition)
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback The callback function.
+ * @return {Stream}
+ * @example
+ * var azure = require('azure-storage');
+ * var FileService = azure.createFileService();
+ * var stream = fs.createReadStream(fileNameTarget).pipe(FileService.createWriteStreamToNewFile(shareName, directoryName, fileName));
+ */
+ createWriteStreamToNewFile(share: string, directory: string, file: string, length: any, optionsOrCallback: any, callback: any): any;
+
+ /**
+ * Starts to copy a file to a destination within the storage account.
+ *
+ * @this {FileService}
+ * @param {string} sourceUri The source file or blob URI.
+ * @param {string} targetShare The target share name.
+ * @param {string} targetDirectory The target directory name.
+ * @param {string} targetFile The target file name.
+ * @param {object} [options] The request options.
+ * @param {object} [options.metadata] The target file metadata key/value pairs.
+ * @param {object} [options.accessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {object} [options.sourceAccessConditions] The access conditions. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the file information.
+ * `response` will contain information related to this operation.
+ */
+ startCopyFile(sourceUri: string, targetshare: string, targetdirectory: string, targetfile: string, optionsOrCallback: any, callback: any): void;
+
+ /**
+ * Abort a file copy operation.
+ *
+ * @this {FileService}
+ * @param {string} share The destination share name.
+ * @param {string} directory The destination directory name.
+ * @param {string} file The destination file name.
+ * @param {string} copyId The copy operation identifier.
+ * @param {object} [options] The request options.
+ * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to.
+ * Please see StorageUtilities.LocationMode for the possible values.
+ * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request.
+ * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ * The maximum execution time interval begins at the time that the client begins building the request. The maximum
+ * execution time is checked intermittently while performing requests, and before executing retries.
+ * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit.
+ * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ * The default value is false.
+ * @param {errorOrResult} callback `error` will contain information
+ * if an error occurs; otherwise `result` will contain
+ * the file information.
+ * `response` will contain information related to this operation.
+ */
+ abortCopyFile(share: string, directory: string, file: string, copyId: any, optionsOrCallback: any, callback: any): void;
+ }
+
+ export module FileService {
+ export interface ListSharesResult {
+ entries: ShareResult[];
+ continuationToken?: common.ContinuationToken
+ }
+
+ export interface ListFilesAndDirectoriesResult {
+ directories: DirectoryResult[];
+ files: FileResult[];
+ continuationToken?: common.ContinuationToken;
+ }
+
+ export interface ShareResult {
+ name: string;
+ etag: string;
+ lastModified: string;
+ metadata?: { [key: string]: string; };
+ requestId?: string;
+ quota?: string;
+ }
+
+ export interface DirectoryResult {
+ name: string;
+ etag: string;
+ lastModified: string;
+ requestId?: string;
+ metadata?: { [key: string]: string; };
+ }
+
+ export interface FileResult {
+ name: string;
+ etag: string;
+ lastModified: string;
+ requestId?: string;
+
+ acceptRanges: string;
+ contentEncoding: string;
+ contentLanguage: string;
+ contentType: string;
+ contentMD5: string;
+ cacheControl: string;
+ contentRange: string;
+ contentLength: string;
+ contentDisposition: string;
+
+ copySource: string;
+ copyStatus: string;
+ copyCompletionTime: string;
+ copyStatusDescription: string;
+ copyId: string;
+ copyProgress: string;
+ }
+
+ export interface ShareProperties {
+ quota: number
+ }
+
+ export interface ListRangeRequestOptions extends common.RequestOptions {
+ rangeStart?: number;
+ rangeEnd?: number;
+ }
+
+ export interface GetFileRequestOptions extends common.RequestOptions {
+ parallelOperationThreadCount?: number;
+ rangeStart?: number;
+ rangeEnd?: number;
+ useTransactionalMD5?: boolean;
+ disableContentMD5Validation?: boolean;
+ }
+
+ export interface ListSharesOptions extends common.RequestOptions {
+ maxResults?: number;
+ include?: string;
+ }
+ }
+
+ export var FileService: {
+ /**
+ * Creates a new FileService object.
+ * If no connection string or storageaccount and storageaccesskey are provided,
+ * the AZURE_STORAGE_CONNECTION_STRING or AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used.
+ * @class
+ * The FileService class is used to perform operations on the Microsoft Azure File Service.
+ * The File Service provides storage for binary large objects, and provides functions for working with data stored in files.
+ *
+ * For more information on the File Service, as well as task focused information on using it in a Node.js application, see
+ * [How to Use the File Service from Node.js](http://azure.microsoft.com/en-us/documentation/articles/storage-nodejs-how-to-use-file-storage/).
+ * The following defaults can be set on the file service.
+ * defaultTimeoutIntervalInMs The default timeout interval, in milliseconds, to use for request made via the file service.
+ * defaultMaximumExecutionTimeInMs The default maximum execution time across all potential retries, for requests made via the file service.
+ * defaultLocationMode The default location mode for requests made via the file service.
+ * parallelOperationThreadCount The number of parallel operations that may be performed when uploading a file.
+ * useNagleAlgorithm Determines whether the Nagle algorithm is used for requests made via the file service; true to use the
+ * Nagle algorithm; otherwise, false. The default value is false.
+ * @constructor
+ * @extends {StorageServiceClient}
+ *
+ * @param {string} [storageAccountOrConnectionString] The storage account or the connection string.
+ * @param {string} [storageAccessKey] The storage access key.
+ * @param {string|object} [host] The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @param {string} [sasToken] The Shared Access Signature token.
+ */
+ new (storageAccountOrConnectionString?: string, storageAccessKey?: string, host?: string|StorageHost, sasToken?: string): FileService;
+ }
+
+ // ###########################
+ // ./services/file/fileutilities
+ // ###########################
+ export module FileUtilities {
+ var ListingDetails: {
+ METADATA: string;
+ };
+
+ var SharePublicAccessType: {
+ OFF: string;
+ SHARE: string;
+ FILE: string;
+ };
+ }
+ }
+ }
+
+ module common {
+ module filters {
+ // ###########################
+ // ./common/filters/retrypolicyfilter
+ // ###########################
+ module retrypolicyfilter {
+ export interface RetryPolicyFilter extends RetryPolicyFilter.IRetryPolicy {
+ retryCount: number;
+ retryInterval: number;
+ /**
+ * Creates a new RetryPolicyFilter instance.
+ * @class
+ * The RetryPolicyFilter allows you to retry operations,
+ * using a custom retry policy. Users are responsible to
+ * define the shouldRetry method.
+ * To apply a filter to service operations, use `withFilter`
+ * and specify the filter to be used when creating a service.
+ * @constructor
+ * @param {number} [retryCount=30000] The client retry count.
+ * @param {number} [retryInterval=3] The client retry interval, in milliseconds.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var retryPolicy = new azure.RetryPolicyFilter();
+ * retryPolicy.retryCount = 3;
+ * retryPolicy.retryInterval = 3000;
+ * retryPolicy.shouldRetry = function(statusCode, retryContext) {
+ *
+ * };
+ * var blobService = azure.createBlobService().withFilter(retryPolicy);
+ */
+ constructor(retryCount?: number, retryInterval?: number);
+ /**
+ * Handles an operation with a retry policy.
+ *
+ * @param {Object} requestOptions The original request options.
+ * @param {function} next The next filter to be handled.
+ * @return {undefined}
+ */
+ handle(requestOptions: any, next: any): void;
+ shouldRetry(statusCode: number, retryData: RetryPolicyFilter.IRetryContext): void;
+ }
+ export module RetryPolicyFilter {
+ /**
+ * Represents the default client retry interval, in milliseconds.
+ */
+ export var DEFAULT_CLIENT_RETRY_INTERVAL: number;
+ /**
+ * Represents the default client retry count.
+ */
+ export var DEFAULT_CLIENT_RETRY_COUNT: number;
+
+ export interface IRetryRequestOptions {
+ retryInterval: number;
+ locationMode: StorageUtilities.LocationMode;
+ currentLocation: Constants.StorageLocation;
+ retryContext: IRetryContext;
+ }
+ export interface IRetryContext {
+ retryCount: number;
+ error: Error;
+ retryInterval: number;
+ locationMode: StorageUtilities.LocationMode;
+ currentLocation: Constants.StorageLocation;
+ }
+ export interface IRetryPolicy {
+ retryInterval: number;
+ shouldRetry(statusCode: number, retryData: IRetryContext): any;
+ handle(requestOptions: any, next: any): any;
+ }
+ }
+ }
+
+ // ###########################
+ // ./common/filters/linearretrypolicyfilter
+ // ###########################
+ module linearretrypolicyfilter {
+ export class LinearRetryPolicyFilter implements RetryPolicyFilter.IRetryPolicy {
+ retryCount: number;
+ retryInterval: number;
+ /**
+ * Creates a new LinearRetryPolicyFilter instance.
+ * @class
+ * The LinearRetryPolicyFilter allows you to retry operations,
+ * using an linear back-off interval between retries.
+ * To apply a filter to service operations, use `withFilter`
+ * and specify the filter to be used when creating a service.
+ * @constructor
+ * @param {number} [retryCount=30000] The client retry count.
+ * @param {number} [retryInterval=3] The client retry interval, in milliseconds.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var retryOperations = new azure.LinearRetryPolicyFilter();
+ * var blobService = azure.createBlobService().withFilter(retryOperations)
+ */
+ constructor(retryCount: number, retryInterval: number);
+ /**
+ * Represents the default client retry interval, in milliseconds.
+ */
+ static DEFAULT_CLIENT_RETRY_INTERVAL: number;
+ /**
+ * Represents the default client retry count.
+ */
+ static DEFAULT_CLIENT_RETRY_COUNT: number;
+ /**
+ * Determines if the operation should be retried and how long to wait until the next retry.
+ *
+ * @param {number} statusCode The HTTP status code.
+ * @param {object} retryData The retry data.
+ * @return {retryInfo} Information about whether the operation qualifies for a retry and the retryInterval.
+ */
+ shouldRetry(statusCode: number, retryData: RetryPolicyFilter.IRetryContext): {
+ retryInterval: number;
+ retryable: boolean;
+ };
+ /**
+ * Handles an operation with a linear retry policy.
+ *
+ * @param {Object} requestOptions The original request options.
+ * @param {function} next The next filter to be handled.
+ * @return {undefined}
+ */
+ handle(requestOptions: any, next: any): void;
+ }
+ }
+
+ // ###########################
+ // ./common/filters/exponentialretrypolicyfilter
+ // ###########################
+ module exponentialretrypolicyfilter {
+ export class ExponentialRetryPolicyFilter implements RetryPolicyFilter.IRetryPolicy {
+ retryCount: number;
+ retryInterval: number;
+ minRetryInterval: number;
+ maxRetryInterval: number;
+ /**
+ * Creates a new 'ExponentialRetryPolicyFilter' instance.
+ * @class
+ * The ExponentialRetryPolicyFilter allows you to retry operations,
+ * using an exponential back-off interval between retries.
+ * To apply a filter to service operations, use `withFilter`
+ * and specify the filter to be used when creating a service.
+ * @constructor
+ * @param {number} [retryCount=3] The client retry count.
+ * @param {number} [retryInterval=30000] The client retry interval, in milliseconds.
+ * @param {number} [minRetryInterval=3000] The minimum retry interval, in milliseconds.
+ * @param {number} [maxRetryInterval=90000] The maximum retry interval, in milliseconds.
+ *
+ * @example
+ * var azure = require('azure-storage');
+ * var retryOperations = new azure.ExponentialRetryPolicyFilter();
+ * var blobService = azure.createBlobService().withFilter(retryOperations)
+ */
+ constructor(retryCount: any, retryInterval: any, minRetryInterval: any, maxRetryInterval: any);
+ /**
+ * Represents the default client retry interval, in milliseconds.
+ */
+ static DEFAULT_CLIENT_RETRY_INTERVAL: number;
+ /**
+ * Represents the default client retry count.
+ */
+ static DEFAULT_CLIENT_RETRY_COUNT: number;
+ /**
+ * Represents the default maximum retry interval, in milliseconds.
+ */
+ static DEFAULT_CLIENT_MAX_RETRY_INTERVAL: number;
+ /**
+ * Represents the default minimum retry interval, in milliseconds.
+ */
+ static DEFAULT_CLIENT_MIN_RETRY_INTERVAL: number;
+ /**
+ * Determines if the operation should be retried and how long to wait until the next retry.
+ *
+ * @param {number} statusCode The HTTP status code.
+ * @param {object} retryData The retry data.
+ * @return {retryInfo} Information about whether the operation qualifies for a retry and the retryInterval.
+ */
+ shouldRetry(statusCode: number, retryData: RetryPolicyFilter.IRetryContext): {
+ retryInterval: number;
+ retryable: boolean;
+ };
+ /**
+ * Handles an operation with an exponential retry policy.
+ *
+ * @param {Object} requestOptions The original request options.
+ * @param {function} next The next filter to be handled.
+ * @return {undefined}
+ */
+ handle(requestOptions: any, next: any): void;
+ }
+ }
+ }
+
+ module util {
+
+ // ###########################
+ // ./common/util/constants
+ // ###########################
+ module constants {
+ export var USER_AGENT_PRODUCT_NAME: string;
+ export var USER_AGENT_PRODUCT_VERSION: string;
+ /**
+ * The number of default concurrent requests for parallel operation.
+ *
+ * @const
+ * @type {string}
+ */
+ export var DEFAULT_PARALLEL_OPERATION_THREAD_COUNT: number;
+ /**
+ * Constant representing a kilobyte (Non-SI version).
+ *
+ * @const
+ * @type {string}
+ */
+ export var KB: number;
+ /**
+ * Constant representing a megabyte (Non-SI version).
+ *
+ * @const
+ * @type {string}
+ */
+ export var MB: number;
+ /**
+ * Constant representing a gigabyte (Non-SI version).
+ *
+ * @const
+ * @type {string}
+ */
+ export var GB: number;
+ /**
+ * Specifies HTTP.
+ *
+ * @const
+ * @type {string}
+ */
+ export var HTTP: string;
+ /**
+ * Specifies HTTPS.
+ *
+ * @const
+ * @type {string}
+ */
+ export var HTTPS: string;
+ /**
+ * Marker for atom metadata.
+ *
+ * @const
+ * @type {string}
+ */
+ export var XML_METADATA_MARKER: string;
+ /**
+ * Marker for atom value.
+ *
+ * @const
+ * @type {string}
+ */
+ export var XML_VALUE_MARKER: string;
+ /**
+ * Specifies the location used to indicate which location the operation can be performed against.
+ *
+ * @const
+ * @enum
+ */
+ export enum RequestLocationMode {
+ PRIMARY_ONLY = 0,
+ SECONDARY_ONLY = 1,
+ PRIMARY_OR_SECONDARY = 2,
+ }
+ /**
+ * Represents a storage service location.
+ *
+ * @const
+ * @enum
+ */
+ export enum StorageLocation {
+ PRIMARY = 0,
+ SECONDARY = 1,
+ }
+ /**
+ * Defines constants for use with shared access policies.
+ */
+ export var AclConstants: {
+ ACCESS_POLICY: string;
+ EXPIRY: string;
+ ID: string;
+ PERMISSION: string;
+ SIGNED_IDENTIFIER_ELEMENT: string;
+ SIGNED_IDENTIFIERS_ELEMENT: string;
+ START: string;
+ };
+ /**
+ * Defines constants for use with service properties.
+ */
+ export var ServicePropertiesConstants: {
+ STORAGE_SERVICE_PROPERTIES_ELEMENT: string;
+ DEFAULT_ANALYTICS_VERSION: string;
+ LOGGING_ELEMENT: string;
+ VERSION_ELEMENT: string;
+ DELETE_ELEMENT: string;
+ READ_ELEMENT: string;
+ WRITE_ELEMENT: string;
+ RETENTION_POLICY_ELEMENT: string;
+ ENABLED_ELEMENT: string;
+ DAYS_ELEMENT: string;
+ HOUR_METRICS_ELEMENT: string;
+ MINUTE_METRICS_ELEMENT: string;
+ CORS_ELEMENT: string;
+ CORS_RULE_ELEMENT: string;
+ ALLOWED_ORIGINS_ELEMENT: string;
+ ALLOWED_METHODS_ELEMENT: string;
+ MAX_AGE_IN_SECONDS_ELEMENT: string;
+ EXPOSED_HEADERS_ELEMENT: string;
+ ALLOWED_HEADERS_ELEMENT: string;
+ INCLUDE_APIS_ELEMENT: string;
+ DEFAULT_SERVICE_VERSION_ELEMENT: string;
+ };
+ /**
+ * Defines constants for use with blob operations.
+ */
+ export var BlobConstants: {
+ LATEST_ELEMENT: string;
+ UNCOMMITTED_ELEMENT: string;
+ BLOCK_LIST_ELEMENT: string;
+ COMMITTED_ELEMENT: string;
+ DEFAULT_WRITE_PAGE_SIZE_IN_BYTES: number;
+ MIN_WRITE_PAGE_SIZE_IN_BYTES: number;
+ DEFAULT_SINGLE_BLOB_PUT_THRESHOLD_IN_BYTES: number;
+ DEFAULT_WRITE_BLOCK_SIZE_IN_BYTES: number;
+ MAX_BLOCK_SIZE: number;
+ MAX_SINGLE_UPLOAD_BLOB_SIZE_IN_BYTES: number;
+ MAX_RANGE_GET_SIZE_WITH_MD5: number;
+ MAX_UPDATE_PAGE_SIZE: number;
+ MAX_QUEUED_WRITE_DISK_BUFFER_SIZE: number;
+ MAX_SINGLE_GET_PAGE_RANGE_SIZE: number;
+ PAGE_SIZE: number;
+ ResourceTypes: {
+ CONTAINER: string;
+ BLOB: string;
+ };
+ PageWriteOptions: {
+ UPDATE: string;
+ CLEAR: string;
+ };
+ BlobTypes: {
+ BLOCK: string;
+ PAGE: string;
+ };
+ LeaseOperation: {
+ ACQUIRE: string;
+ RENEW: string;
+ CHANGE: string;
+ RELEASE: string;
+ BREAK: string;
+ };
+ };
+ /**
+ * Defines constants for use with file operations.
+ */
+ export var FileConstants: {
+ DEFAULT_WRITE_SIZE_IN_BYTES: number;
+ MAX_RANGE_GET_SIZE_WITH_MD5: number;
+ MAX_UPDATE_FILE_SIZE: number;
+ DEFAULT_SINGLE_FILE_GET_THRESHOLD_IN_BYTES: number;
+ MIN_WRITE_FILE_SIZE_IN_BYTES: number;
+ RangeWriteOptions: {
+ UPDATE: string;
+ CLEAR: string;
+ };
+ };
+ /**
+ * Defines constants for use with queue storage.
+ *
+ * @const
+ * @type {string}
+ */
+ export var QueueConstants: {
+ QUEUE_MESSAGE_ELEMENT: string;
+ MESSAGE_TEXT_ELEMENT: string;
+ };
+ /**
+ * Defines constants for use with table storage.
+ *
+ * @const
+ * @type {string}
+ */
+ export var TableConstants: {
+ CHANGESET_DELIMITER: string;
+ BATCH_DELIMITER: string;
+ CONTINUATION_NEXT_ROW_KEY: string;
+ CONTINUATION_NEXT_PARTITION_KEY: string;
+ CONTINUATION_NEXT_TABLE_NAME: string;
+ NEXT_ROW_KEY: string;
+ NEXT_PARTITION_KEY: string;
+ NEXT_TABLE_NAME: string;
+ ODATA_PREFIX: string;
+ ODATA_TYPE_SUFFIX: string;
+ ODATA_METADATA_MARKER: string;
+ ODATA_VALUE_MARKER: string;
+ ODATA_TYPE_MARKER: string;
+ DEFAULT_DATA_SERVICE_VERSION: string;
+ TABLE_NAME: string;
+ TABLE_SERVICE_TABLE_NAME: string;
+ Operations: {
+ RETRIEVE: string;
+ INSERT: string;
+ UPDATE: string;
+ MERGE: string;
+ DELETE: string;
+ INSERT_OR_REPLACE: string;
+ INSERT_OR_MERGE: string;
+ };
+ };
+ /**
+ * Defines constants for use with HTTP headers.
+ */
+ export var HeaderConstants: {
+ ACCEPT_RANGES: string;
+ CONTENT_TRANSFER_ENCODING_HEADER: string;
+ TRANSFER_ENCODING_HEADER: string;
+ SERVER_HEADER: string;
+ LOCATION_HEADER: string;
+ LAST_MODIFIED: string;
+ DATA_SERVICE_VERSION: string;
+ MAX_DATA_SERVICE_VERSION: string;
+ PREFIX_FOR_STORAGE_HEADER: string;
+ CLIENT_REQUEST_ID_HEADER: string;
+ APPROXIMATE_MESSAGES_COUNT: string;
+ AUTHORIZATION: string;
+ BLOB_PUBLIC_ACCESS_HEADER: string;
+ BLOB_TYPE_HEADER: string;
+ TYPE_HEADER: string;
+ BLOCK_BLOB: string;
+ CACHE_CONTROL: string;
+ BLOB_CACHE_CONTROL_HEADER: string;
+ CACHE_CONTROL_HEADER: string;
+ COPY_STATUS: string;
+ COPY_COMPLETION_TIME: string;
+ COPY_STATUS_DESCRIPTION: string;
+ COPY_ID: string;
+ COPY_PROGRESS: string;
+ COPY_ACTION: string;
+ CONTENT_ID: string;
+ CONTENT_ENCODING: string;
+ BLOB_CONTENT_ENCODING_HEADER: string;
+ CONTENT_ENCODING_HEADER: string;
+ CONTENT_LANGUAGE: string;
+ BLOB_CONTENT_LANGUAGE_HEADER: string;
+ CONTENT_LANGUAGE_HEADER: string;
+ CONTENT_LENGTH: string;
+ BLOB_CONTENT_LENGTH_HEADER: string;
+ CONTENT_LENGTH_HEADER: string;
+ CONTENT_DISPOSITION: string;
+ BLOB_CONTENT_DISPOSITION_HEADER: string;
+ CONTENT_DISPOSITION_HEADER: string;
+ CONTENT_MD5: string;
+ BLOB_CONTENT_MD5_HEADER: string;
+ CONTENT_MD5_HEADER: string;
+ CONTENT_RANGE: string;
+ CONTENT_TYPE: string;
+ BLOB_CONTENT_TYPE_HEADER: string;
+ CONTENT_TYPE_HEADER: string;
+ COPY_SOURCE_HEADER: string;
+ DATE: string;
+ DATE_HEADER: string;
+ DELETE_SNAPSHOT_HEADER: string;
+ ETAG: string;
+ IF_MATCH: string;
+ IF_MODIFIED_SINCE: string;
+ IF_NONE_MATCH: string;
+ IF_UNMODIFIED_SINCE: string;
+ INCLUDE_SNAPSHOTS_VALUE: string;
+ JSON_CONTENT_TYPE_VALUE: string;
+ LEASE_ID_HEADER: string;
+ LEASE_BREAK_PERIOD: string;
+ PROPOSED_LEASE_ID: string;
+ LEASE_DURATION: string;
+ SOURCE_LEASE_ID_HEADER: string;
+ LEASE_TIME_HEADER: string;
+ LEASE_STATUS: string;
+ LEASE_STATE: string;
+ PAGE_BLOB: string;
+ PAGE_WRITE: string;
+ FILE_WRITE: string;
+ PREFER: string;
+ PREFER_CONTENT: string;
+ PREFER_NO_CONTENT: string;
+ PREFIX_FOR_STORAGE_METADATA: string;
+ PREFIX_FOR_STORAGE_PROPERTIES: string;
+ RANGE: string;
+ RANGE_GET_CONTENT_MD5: string;
+ RANGE_HEADER_FORMAT: string;
+ REQUEST_ID_HEADER: string;
+ SEQUENCE_NUMBER: string;
+ SEQUENCE_NUMBER_EQUAL: string;
+ SEQUENCE_NUMBER_LESS_THAN: string;
+ SEQUENCE_NUMBER_LESS_THAN_OR_EQUAL: string;
+ SEQUENCE_NUMBER_ACTION: string;
+ SIZE: string;
+ SNAPSHOT_HEADER: string;
+ SNAPSHOTS_ONLY_VALUE: string;
+ SOURCE_IF_MATCH_HEADER: string;
+ SOURCE_IF_MODIFIED_SINCE_HEADER: string;
+ SOURCE_IF_NONE_MATCH_HEADER: string;
+ SOURCE_IF_UNMODIFIED_SINCE_HEADER: string;
+ STORAGE_RANGE_HEADER: string;
+ STORAGE_VERSION_HEADER: string;
+ TARGET_STORAGE_VERSION: string;
+ USER_AGENT: string;
+ POP_RECEIPT_HEADER: string;
+ TIME_NEXT_VISIBLE_HEADER: string;
+ APPROXIMATE_MESSAGE_COUNT_HEADER: string;
+ LEASE_ACTION_HEADER: string;
+ ACCEPT_HEADER: string;
+ ACCEPT_CHARSET_HEADER: string;
+ HOST_HEADER: string;
+ CORRELATION_ID_HEADER: string;
+ GROUP_ID_HEADER: string;
+ };
+ export var QueryStringConstants: {
+ API_VERSION: string;
+ COMP: string;
+ RESTYPE: string;
+ COPY_ID: string;
+ SNAPSHOT: string;
+ TIMEOUT: string;
+ SIGNED_START: string;
+ SIGNED_EXPIRY: string;
+ SIGNED_RESOURCE: string;
+ SIGNED_PERMISSIONS: string;
+ SIGNED_IDENTIFIER: string;
+ SIGNATURE: string;
+ SIGNED_VERSION: string;
+ CACHE_CONTROL: string;
+ CONTENT_TYPE: string;
+ CONTENT_ENCODING: string;
+ CONTENT_LANGUAGE: string;
+ CONTENT_DISPOSITION: string;
+ BLOCK_ID: string;
+ BLOCK_LIST_TYPE: string;
+ PREFIX: string;
+ MARKER: string;
+ MAX_RESULTS: string;
+ DELIMITER: string;
+ INCLUDE: string;
+ PEEK_ONLY: string;
+ NUM_OF_MESSAGES: string;
+ POP_RECEIPT: string;
+ VISIBILITY_TIMEOUT: string;
+ MESSAGE_TTL: string;
+ SELECT: string;
+ FILTER: string;
+ TOP: string;
+ SKIP: string;
+ NEXT_PARTITION_KEY: string;
+ NEXT_ROW_KEY: string;
+ LOCK_ID: string;
+ TABLENAME: string;
+ STARTPK: string;
+ STARTRK: string;
+ ENDPK: string;
+ ENDRK: string;
+ };
+ export var StorageServiceClientConstants: {
+ DEFAULT_PROTOCOL: string;
+ EnvironmentVariables: {
+ AZURE_STORAGE_ACCOUNT: string;
+ AZURE_STORAGE_ACCESS_KEY: string;
+ AZURE_STORAGE_DNS_SUFFIX: string;
+ AZURE_STORAGE_CONNECTION_STRING: string;
+ HTTP_PROXY: string;
+ HTTPS_PROXY: string;
+ EMULATED: string;
+ };
+ DEVSTORE_STORAGE_ACCOUNT: string;
+ DEVSTORE_STORAGE_ACCESS_KEY: string;
+ DEV_STORE_URI: string;
+ DEVSTORE_DEFAULT_PROTOCOL: string;
+ DEVSTORE_BLOB_HOST: string;
+ DEVSTORE_QUEUE_HOST: string;
+ DEVSTORE_TABLE_HOST: string;
+ CLOUD_BLOB_HOST: string;
+ CLOUD_QUEUE_HOST: string;
+ CLOUD_TABLE_HOST: string;
+ CLOUD_FILE_HOST: string;
+ };
+ export module HttpConstants {
+ /**
+ * Http Verbs
+ *
+ * @const
+ * @enum {string}
+ */
+ var HttpVerbs: {
+ PUT: string;
+ GET: string;
+ DELETE: string;
+ POST: string;
+ MERGE: string;
+ HEAD: string;
+ };
+ /**
+ * Response codes.
+ *
+ * @const
+ * @enum {int}
+ */
+ enum HttpResponseCodes {
+ Ok = 200,
+ Created = 201,
+ Accepted = 202,
+ NoContent = 204,
+ PartialContent = 206,
+ BadRequest = 400,
+ Unauthorized = 401,
+ Forbidden = 403,
+ NotFound = 404,
+ Conflict = 409,
+ LengthRequired = 411,
+ PreconditionFailed = 412,
+ }
+ }
+ export var VersionConstants: {
+ AUGUST_2013: string;
+ FEBRUARY_2012: string;
+ };
+ export var BlobErrorCodeStrings: {
+ INVALID_BLOCK_ID: string;
+ BLOB_NOT_FOUND: string;
+ BLOB_ALREADY_EXISTS: string;
+ CONTAINER_ALREADY_EXISTS: string;
+ CONTAINER_NOT_FOUND: string;
+ INVALID_BLOB_OR_BLOCK: string;
+ INVALID_BLOCK_LIST: string;
+ };
+ export var FileErrorCodeStrings: {
+ SHARE_ALREADY_EXISTS: string;
+ SHARE_NOT_FOUND: string;
+ FILE_NOT_FOUND: string;
+ };
+ export var QueueErrorCodeStrings: {
+ QUEUE_NOT_FOUND: string;
+ QUEUE_DISABLED: string;
+ QUEUE_ALREADY_EXISTS: string;
+ QUEUE_NOT_EMPTY: string;
+ QUEUE_BEING_DELETED: string;
+ POP_RECEIPT_MISMATCH: string;
+ INVALID_PARAMETER: string;
+ MESSAGE_NOT_FOUND: string;
+ MESSAGE_TOO_LARGE: string;
+ INVALID_MARKER: string;
+ };
+ export var StorageErrorCodeStrings: {
+ UNSUPPORTED_HTTP_VERB: string;
+ MISSING_CONTENT_LENGTH_HEADER: string;
+ MISSING_REQUIRED_HEADER: string;
+ MISSING_REQUIRED_XML_NODE: string;
+ UNSUPPORTED_HEADER: string;
+ UNSUPPORTED_XML_NODE: string;
+ INVALID_HEADER_VALUE: string;
+ INVALID_XML_NODE_VALUE: string;
+ MISSING_REQUIRED_QUERY_PARAMETER: string;
+ UNSUPPORTED_QUERY_PARAMETER: string;
+ INVALID_QUERY_PARAMETER_VALUE: string;
+ OUT_OF_RANGE_QUERY_PARAMETER_VALUE: string;
+ INVALID_URI: string;
+ INVALID_HTTP_VERB: string;
+ EMPTY_METADATA_KEY: string;
+ REQUEST_BODY_TOO_LARGE: string;
+ INVALID_XML_DOCUMENT: string;
+ INTERNAL_ERROR: string;
+ AUTHENTICATION_FAILED: string;
+ MD5_MISMATCH: string;
+ INVALID_MD5: string;
+ OUT_OF_RANGE_INPUT: string;
+ INVALID_INPUT: string;
+ OPERATION_TIMED_OUT: string;
+ RESOURCE_NOT_FOUND: string;
+ RESOURCE_ALREADY_EXISTS: string;
+ INVALID_METADATA: string;
+ METADATA_TOO_LARGE: string;
+ CONDITION_NOT_MET: string;
+ UPDATE_CONDITION_NOT_SATISFIED: string;
+ INVALID_RANGE: string;
+ CONTAINER_NOT_FOUND: string;
+ CONTAINER_ALREADY_EXISTS: string;
+ CONTAINER_DISABLED: string;
+ CONTAINER_BEING_DELETED: string;
+ SERVER_BUSY: string;
+ };
+ export var TableErrorCodeStrings: {
+ XMETHOD_NOT_USING_POST: string;
+ XMETHOD_INCORRECT_VALUE: string;
+ XMETHOD_INCORRECT_COUNT: string;
+ TABLE_HAS_NO_PROPERTIES: string;
+ DUPLICATE_PROPERTIES_SPECIFIED: string;
+ TABLE_HAS_NO_SUCH_PROPERTY: string;
+ DUPLICATE_KEY_PROPERTY_SPECIFIED: string;
+ TABLE_ALREADY_EXISTS: string;
+ TABLE_NOT_FOUND: string;
+ ENTITY_NOT_FOUND: string;
+ ENTITY_ALREADY_EXISTS: string;
+ PARTITION_KEY_NOT_SPECIFIED: string;
+ OPERATOR_INVALID: string;
+ UPDATE_CONDITION_NOT_SATISFIED: string;
+ PROPERTIES_NEED_VALUE: string;
+ PARTITION_KEY_PROPERTY_CANNOT_BE_UPDATED: string;
+ TOO_MANY_PROPERTIES: string;
+ ENTITY_TOO_LARGE: string;
+ PROPERTY_VALUE_TOO_LARGE: string;
+ INVALID_VALUE_TYPE: string;
+ TABLE_BEING_DELETED: string;
+ TABLE_SERVER_OUT_OF_MEMORY: string;
+ PRIMARY_KEY_PROPERTY_IS_INVALID_TYPE: string;
+ PROPERTY_NAME_TOO_LONG: string;
+ PROPERTY_NAME_INVALID: string;
+ BATCH_OPERATION_NOT_SUPPORTED: string;
+ JSON_FORMAT_NOT_SUPPORTED: string;
+ METHOD_NOT_ALLOWED: string;
+ NOT_IMPLEMENTED: string;
+ };
+ export var ConnectionStringKeys: {
+ USE_DEVELOPMENT_STORAGE_NAME: string;
+ DEVELOPMENT_STORAGE_PROXY_URI_NAME: string;
+ DEFAULT_ENDPOINTS_PROTOCOL_NAME: string;
+ ACCOUNT_NAME_NAME: string;
+ ACCOUNT_KEY_NAME: string;
+ BLOB_ENDPOINT_NAME: string;
+ FILE_ENDPOINT_NAME: string;
+ QUEUE_ENDPOINT_NAME: string;
+ TABLE_ENDPOINT_NAME: string;
+ SHARED_ACCESS_SIGNATURE_NAME: string;
+ BLOB_BASE_DNS_NAME: string;
+ FILE_BASE_DNS_NAME: string;
+ QUEUE_BASE_DNS_NAME: string;
+ TABLE_BASE_DNS_NAME: string;
+ };
+
+ }
+
+ // ###########################
+ // ./common/util/storageutilities
+ // ###########################
+ module storageutilities {
+ /**
+ * Defines constants, enums, and utility functions for use with storage.
+ * @namespace StorageUtilities
+ */
+ /**
+ * Specifies the location mode used to decide which location the request should be sent to.
+ *
+ * @const
+ * @enum {number}
+ * @alias StorageUtilities.LocationMode
+ */
+ export enum LocationMode {
+ /**
+ * The primary location only
+ * @property LocationMode.PRIMARY_ONLY
+ */
+ PRIMARY_ONLY = 0,
+ /**
+ * The primary location first, then the secondary
+ * @property LocationMode.PRIMARY_THEN_SECONDARY
+ */
+ PRIMARY_THEN_SECONDARY = 1,
+ /**
+ * The secondary location only
+ * @property LocationMode.SECONDARY_ONLY
+ */
+ SECONDARY_ONLY = 2,
+ /**
+ * The secondary location first, then the primary
+ * @property LocationMode.SECONDARY_THEN_PRIMARY
+ */
+ SECONDARY_THEN_PRIMARY = 3,
+ }
+ }
+
+
+ // ###########################
+ // ./common/util/sr
+ // ###########################
+ module sr {
+ export var SR: {
+ ANONYMOUS_ACCESS_BLOBSERVICE_ONLY: string;
+ ARGUMENT_NULL_OR_EMPTY: string;
+ ARGUMENT_NULL_OR_UNDEFINED: string;
+ ARGUMENT_OUT_OF_RANGE_ERROR: string;
+ BATCH_ONE_PARTITION_KEY: string;
+ BATCH_ONE_RETRIEVE: string;
+ BATCH_TOO_LARGE: string;
+ HASH_MISMATCH: string;
+ BLOB_INVALID_SEQUENCE_NUMBER: string;
+ BLOB_TYPE_MISMATCH: string;
+ CONTENT_LENGTH_MISMATCH: string;
+ INVALID_DELETE_SNAPSHOT_OPTION: string;
+ CANNOT_CREATE_SAS_WITHOUT_ACCOUNT_KEY: string;
+ CONTENT_TYPE_MISSING: string;
+ EMPTY_BATCH: string;
+ EXCEEDED_SIZE_LIMITATION: string;
+ INCORRECT_ENTITY_KEYS: string;
+ INVALID_BLOB_LENGTH: string;
+ INVALID_FILE_LENGTH: string;
+ INVALID_CONNECTION_STRING: string;
+ INVALID_CONNECTION_STRING_BAD_KEY: string;
+ INVALID_CONNECTION_STRING_DUPLICATE_KEY: string;
+ INVALID_CONNECTION_STRING_EMPTY_KEY: string;
+ INVALID_EDM_TYPE: string;
+ INVALID_HEADERS: string;
+ INVALID_MESSAGE_ID: string;
+ INVALID_PAGE_BLOB_LENGTH: string;
+ INVALID_PAGE_END_OFFSET: string;
+ INVALID_PAGE_START_OFFSET: string;
+ INVALID_FILE_RANGE_FOR_UPDATE: string;
+ INVALID_PAGE_RANGE_FOR_UPDATE: string;
+ INVALID_POP_RECEIPT: string;
+ INVALID_PROPERTY_RESOLVER: string;
+ INVALID_RANGE_FOR_MD5: string;
+ INVALID_SAS_VERSION: string;
+ INVALID_SIGNED_IDENTIFIERS: string;
+ INVALID_STREAM_LENGTH: string;
+ INVALID_STRING_ERROR: string;
+ INVALID_TEXT_LENGTH: string;
+ QUERY_OPERATOR_REQUIRES_WHERE: string;
+ MAXIMUM_EXECUTION_TIMEOUT_EXCEPTION: string;
+ MD5_NOT_PRESENT_ERROR: string;
+ METADATA_KEY_INVALID: string;
+ METADATA_VALUE_INVALID: string;
+ NO_CREDENTIALS_PROVIDED: string;
+ INVALID_TABLE_OPERATION: string;
+ PRIMARY_ONLY_COMMAND: string;
+ SECONDARY_ONLY_COMMAND: string;
+ STORAGE_HOST_LOCATION_REQUIRED: string;
+ STORAGE_HOST_MISSING_LOCATION: string;
+ TYPE_NOT_SUPPORTED: string;
+ NO_LIST_FUNC_PROVIDED: string;
+ };
+ }
+
+ // ###########################
+ // ./common/util/validate
+ // ###########################
+ module validate {
+ /**
+ * Checks if the given value is a valid enumeration or not.
+ *
+ * @param {object} value The value to validate.
+ * @param {object} list The enumeration values.
+ * @return {boolean}
+ */
+ export function isValidEnumValue(value: string, list: string[], callback: Function): any;
+ /**
+ * Creates a anonymous function that check if the given uri is valid or not.
+ *
+ * @param {string} uri The uri to validate.
+ * @return {boolean}
+ */
+ export function isValidUri(uri: any): boolean;
+ /**
+ * Checks if the given host is valid or not.
+ *
+ * @param {string|object} host The host to validate.
+ * @return {boolean}
+ */
+ export function isValidHost(host: string): any;
+ export function isValidHost(host: StorageHost): any;
+ /**
+ * Checks if the given value is a valid UUID or not.
+ *
+ * @param {string|object} uuid The uuid to validate.
+ * @return {boolean}
+ */
+ export function isValidUuid(uuid: string, callback?: Function): any;
+ /**
+ * Creates a anonymous function that check if a given key is base 64 encoded.
+ *
+ * @param {string} key The key to validate.
+ * @return {function}
+ */
+ export function isBase64Encoded(key: any): boolean;
+ /**
+ * Validates a function.
+ *
+ * @param {object} function The function to validate.
+ * @return {function}
+ */
+ export function isValidFunction(functionObject: any, functionName: any): void;
+ /**
+ * Validates a container name.
+ *
+ * @param {string} containerName The container name.
+ * @return {undefined}
+ */
+ export function containerNameIsValid(containerName: string, callback?: Function): boolean;
+ /**
+ * Validates a blob name.
+ *
+ * @param {string} containerName The container name.
+ * @param {string} blobname The blob name.
+ * @return {undefined}
+ */
+ export function blobNameIsValid(containerName: string, blobName: string, callback?: Function): any;
+ /**
+ * Validates a share name.
+ *
+ * @param {string} shareName The share name.
+ * @return {undefined}
+ */
+ export function shareNameIsValid(shareName: string, callback?: Function): boolean;
+ /**
+ * Validates a queue name.
+ *
+ * @param {string} queueName The queue name.
+ * @return {undefined}
+ */
+ export function queueNameIsValid(queueName: string, callback?: Function): boolean;
+ /**
+ * Validates a table name.
+ *
+ * @param {string} table The table name.
+ * @return {undefined}
+ */
+ export function tableNameIsValid(table: string, callback?: Function): boolean;
+ /**
+ * Validates page ranges.
+ *
+ * @param {int} rangeStart The range starting position.
+ * @param {int} rangeEnd The range ending position.
+ * @param {int} writeBlockSizeInBytes The block size.
+ * @return {undefined}
+ */
+ export function pageRangesAreValid(rangeStart: number, rangeEnd: number, writeBlockSizeInBytes: number, callback?: Function): boolean;
+ /**
+ * Validates a blob type.
+ *
+ * @param {string} type The type name.
+ * @return {undefined}
+ */
+ export function blobTypeIsValid(type: string, callback?: Function): any;
+ export class ArgumentValidator {
+ func: string;
+ tableNameIsValid: (tableName: string, callback?: Function) => boolean;
+ containerNameIsValid: (containerName: string, callback?: Function) => boolean;
+ shareNameIsValid: (shareName: string, callback?: Function) => boolean;
+ blobNameIsValid: (containerName: string, blobName: string, callback?: Function) => boolean;
+ pageRangesAreValid: (rangeStart: number, rangeEnd: number, writeBlockSizeInBytes: number, callback?: Function) => boolean;
+ queueNameIsValid: (queueName: string, callback?: Function) => boolean;
+ blobTypeIsValid: (shareName: string, callback?: Function) => boolean;
+ isValidEnumValue: (value: string, list: string[], callback?: Function) => boolean;
+ constructor(functionName: string);
+ string(val: any, name: string): void;
+ stringAllowEmpty(val: any, name: string): void;
+ object(val: any, name: string): void;
+ exists(val: any, name: string): void;
+ function(val: any, name: string): void;
+ value(val: any, name: string): void;
+ nonEmptyArray(val: T[], name: string): void;
+ callback(val: any): void;
+ test(predicate: () => boolean, message: string): void;
+ }
+ export function validateArgs(functionName: string, validationRules: (validator: ArgumentValidator) => void): void;
+ }
+
+ // ###########################
+ // ./common/util/date
+ // ###########################
+ module date {
+ /**
+ * Date/time related helper functions
+ * @module date
+ *
+ */
+ /**
+ * Generates a Date object which is in the given days from now.
+ *
+ * @param {int} days The days timespan.
+ * @return {Date}
+ */
+ export function daysFromNow(days: number): Date;
+ /**
+ * Generates a Date object which is in the given hours from now.
+ *
+ * @param {int} hours The hours timespan.
+ * @return {Date}
+ */
+ export function hoursFromNow(hours: number): Date;
+ /**
+ * Generates a Date object which is in the given minutes from now.
+ *
+ * @param {int} minutes The minutes timespan.
+ * @return {Date}
+ */
+ export function minutesFromNow(minutes: number): Date;
+ /**
+ * Generates a Date object which is in the given seconds from now.
+ *
+ * @param {int} seconds The seconds timespan.
+ * @return {Date}
+ */
+ export function secondsFromNow(seconds: number): Date;
+
+ }
+ }
+
+ module http {
+ // ###########################
+ // ./common/http/webresource
+ // ###########################
+ module webresource {
+ export class WebResource {
+ rawResponse: boolean;
+ queryString: any;
+ path: string;
+ method: string;
+ properties: Map;
+ body: any;
+ headersOnly: boolean;
+ uri: string;
+ headers: Map;
+ /**
+ * Creates a new WebResource object.
+ */
+ constructor();
+ /**
+ * Creates a new put request web resource.
+ *
+ * @function WebResource#put
+ * @static
+ * @param {string} path The path for the put operation.
+ * @return {WebResource} A new webresource with a put operation for the given path.
+ */
+ static put(path?: string): WebResource;
+ /**
+ * Creates a new get request web resource.
+ *
+ * @function WebResource#get
+ * @static
+ * @param {string} path The path for the get operation.
+ * @return {WebResource} A new webresource with a get operation for the given path.
+ */
+ static get(path?: string): WebResource;
+ /**
+ * Creates a new head request web resource.
+ *
+ * @function WebResource#head
+ * @static
+ * @param {string} path The path for the head operation.
+ * @return {WebResource} A new webresource with a head operation for the given path.
+ */
+ static head(path: string): WebResource;
+ /**
+ * Creates a new delete request web resource.
+ *
+ * @function WebResource#del
+ * @static
+ * @param {string} path The path for the delete operation.
+ * @return {WebResource} A new webresource with a delete operation for the given path.
+ */
+ static del(path: string): WebResource;
+ /**
+ * Creates a new post request web resource.
+ *
+ * @function WebResource#post
+ * @static
+ * @param {string} path The path for the post operation.
+ * @return {WebResource} A new webresource with a post operation for the given path.
+ */
+ static post(path: string): WebResource;
+ /**
+ * Creates a new merge request web resource.
+ *
+ * @function WebResource#merge
+ * @static
+ * @param {string} path The path for the merge operation.
+ * @return {WebResource} A new webresource with a merge operation for the given path.
+ */
+ static merge(path: string): WebResource;
+ /**
+ * Specifies a custom property in the web resource.
+ *
+ * @function WebResource#withProperty
+ * @param {string} name The property name.
+ * @param {string} value The property value.
+ * @return {WebResource} The webresource.
+ */
+ withProperty(name: string, value: string): WebResource;
+ /**
+ * Specifies if the response should be parsed or not.
+ *
+ * @function WebResource#withRawResponse
+ * @param {bool} [rawResponse=true] true if the response should not be parsed; false otherwise.
+ * @return {WebResource} The webresource.
+ */
+ withRawResponse(rawResponse?: boolean): WebResource;
+ /**
+ * Specifies if the request only has headers.
+ *
+ * @function WebResource#withHeadersOnly
+ * @param {bool} [headersOnly=true] true if the request only has headers; false otherwise.
+ * @return {WebResource} The webresource.
+ */
+ withHeadersOnly(headersOnly?: boolean): WebResource;
+ /**
+ * Adds an optional query string parameter.
+ *
+ * @function WebResource#withQueryOption
+ * @param {Object} name The name of the query string parameter.
+ * @param {Object} value The value of the query string parameter.
+ * @param {Object} defaultValue The default value for the query string parameter to be used if no value is passed.
+ * @return {Object} The web resource.
+ */
+ withQueryOption(name: any, value: T, defaultValue?: T): WebResource;
+ /**
+ * Adds optional query string parameters.
+ *
+ * Additional arguments will be the needles to search in the haystack.
+ *
+ * @function WebResource#withQueryOptions
+ * @param {Object} object The haystack of query string parameters.
+ * @return {Object} The web resource.
+ */
+ withQueryOptions(object: any, ...queryArgs: any[]): WebResource;
+ /**
+ * Adds an optional header parameter.
+ *
+ * @function WebResource#withHeader
+ * @param {Object} name The name of the header parameter.
+ * @param {Object} value The value of the header parameter.
+ * @return {Object} The web resource.
+ */
+ withHeader(name: string, value: T): WebResource;
+ /**
+ * Adds an optional body.
+ *
+ * @function WebResource#withBody
+ * @param {Object} body The request body.
+ * @return {Object} The web resource.
+ */
+ withBody(body: any): WebResource;
+ /**
+ * Adds optional query string parameters.
+ *
+ * Additional arguments will be the needles to search in the haystack.
+ *
+ * @function WebResource#withHeaders
+ * @param {Object} object The haystack of headers.
+ * @return {Object} The web resource.
+ withHeaders(object: {
+ [x: string]: any;
+ }, ...args: string[]): WebResource;
+ addOptionalMetadataHeaders(metadata: any): WebResource;
+ /**
+ * Determines if a status code corresponds to a valid response according to the WebResource's expected status codes.
+ *
+ * @function WebResource#validResponse
+ * @static
+ * @param {int} statusCode The response status code.
+ * @return true if the response is valid; false otherwise.
+ */
+ static validResponse(statusCode: number): boolean;
+ /**
+ * Hook up the given input stream to a destination output stream if the WebResource method
+ * requires a request body and a body is not already set.
+ *
+ * @function WebResource#pipeInput
+ * @param {Stream} inputStream the stream to pipe from
+ * @param {Stream} outputStream the stream to pipe to
+ *
+ * @return destStream
+ */
+ pipeInput(inputStream: NodeJS.ReadableStream, destStream: NodeJS.WritableStream): NodeJS.WritableStream;
+ }
+ }
+ }
+
+ module diagnostics {
+ // ###########################
+ // ./common/loggerdiagnostics/logger
+ // ###########################
+ module logger {
+ export class Logger {
+ level: string;
+ loggerFunction: (level: string, message: string) => void;
+ constructor(level: any, loggerFunction?: (level: string, message: string) => void);
+ static LogLevels: {
+ EMERGENCY: string;
+ ALERT: string;
+ CRITICAL: string;
+ ERROR: string;
+ WARNING: string;
+ NOTICE: string;
+ INFO: string;
+ DEBUG: string;
+ };
+ log(level: any, msg: any): void;
+ emergency(msg: any): void;
+ critical(msg: any): void;
+ alert(msg: any): void;
+ error(msg: any): void;
+ warn(msg: any): void;
+ notice(msg: any): void;
+ info(msg: any): void;
+ debug(msg: any): void;
+ defaultLoggerFunction(logLevel: string, msg: string): void;
+ }
+ }
+ }
+
+ module streams {
+ // ###########################
+ // ./common/util/speedsummary
+ // ###########################
+ module speedsummary {
+ export interface SpeedSummary {
+ name: string;
+ totalSize: number;
+ completeSize: number;
+ /**
+ * Get running seconds
+ */
+ getElapsedSeconds(humanReadable: boolean): any;
+ /**
+ * Get complete percentage
+ * @param {int} len The number of digits after the decimal point.
+ */
+ getCompletePercent(len: number): any;
+ /**
+ * Get average upload/download speed
+ */
+ getAverageSpeed(humanReadable: boolean): any;
+ /**
+ * Get instant speed
+ */
+ getSpeed(humanReadable: any): any;
+ /**
+ * Increment the complete data size
+ */
+ increment(len: any): number;
+ /**
+ * Get auto increment function
+ */
+ getAutoIncrementFunction(size: any): (error: any, retValue: any) => void;
+ /**
+ * Get total size
+ */
+ getTotalSize(humanReadable: any): any;
+ /**
+ * Get completed data size
+ */
+ getCompleteSize(humanReadable: any): any;
+ }
+ }
+ }
+
+ module models {
+ export interface ServiceStats {
+ GeoReplication?: {
+ Status?: string;
+ LastSyncTime?: Date;
+ };
+ }
+
+ module ServicePropertiesResult {
+ export interface RetentionPolicy {
+ Enabled: boolean;
+ Days: number;
+ }
+ export interface MetricsProperties {
+ Version: string;
+ Enabled: boolean;
+ IncludeAPIs: boolean;
+ RetentionPolicy: RetentionPolicy;
+ }
+ export interface CorsRule {
+ AllowedMethods: string[];
+ AllowedOrigins: string[];
+ AllowedHeaders: string[];
+ ExposedHeaders: string[];
+ MaxAgeInSeconds: number;
+ }
+ export interface LoggingProperties {
+ Version: string;
+ Delete: boolean;
+ Read: boolean;
+ Write: boolean;
+ RetentionPolicy: RetentionPolicy;
+ }
+ export interface ServiceProperties {
+ DefaultServiceVersion?: string;
+ Logging?: LoggingProperties;
+ HourMetrics?: MetricsProperties;
+ MinuteMetrics?: MetricsProperties;
+ Cors?: {
+ CorsRule: CorsRule[];
+ };
+ }
+ export function serialize(servicePropertiesJs: ServiceProperties): any;
+ export function parse(servicePropertiesXml: any): ServiceProperties;
+ }
+ }
+
+ module services {
+ // ###########################
+ // ./common/services/storageserviceclient
+ // ###########################
+ module storageserviceclient {
+ export interface Proxy {
+ host: string;
+ port: number;
+ proxyAuth: string;
+ headers: Map;
+ key: string;
+ ca: string;
+ cert: string;
+ }
+
+ export class StorageServiceClient extends events.EventEmitter {
+ /**
+ * The default location mode for requests made via the service.
+ * @member {StorageUtilities.LocationMode} StorageServiceClient#defaultLocationMode
+ */
+ defaultLocationMode: common.util.storageutilities.LocationMode;
+ /**
+ * The default maximum execution time across all potential retries, for requests made via the service.
+ * @member {int} StorageServiceClient#defaultMaximumExecutionTimeInMs
+ */
+ defaultMaximumExecutionTimeInMs: number;
+ /**
+ * The default timeout interval, in milliseconds, to use for request made via the service.
+ * @member {int} StorageServiceClient#defaultTimeoutIntervalInMs
+ */
+ defaultTimeoutIntervalInMs: number;
+ /**
+ * Determines whether the Nagle algorithm is used for requests made via the Queue service; true to use the
+ * Nagle algorithm; otherwise, false. The default value is false.
+ * @member {bool} StorageServiceClient#useNagleAlgorithm
+ */
+ useNagleAlgorithm: boolean;
+ /** The proxy object specified by caller.
+ * @member {Proxy} StorageServiceClient#proxy
+ */
+ proxy: Proxy;
+ /** The logging settings object.
+ * @member {diagnostics.logger.Logger} StorageServiceClient#logger
+ */
+ logger: diagnostics.logger.Logger;
+
+ /**
+ * Creates a new StorageServiceClient object.
+ *
+ * @constructor StorageServiceClient
+ * @param {string} storageAccount The storage account.
+ * @param {string} storageAccessKey The storage access key.
+ * @param {object} host The host for the service.
+ * @param {bool} usePathStyleUri Boolean value indicating wether to use path style uris.
+ * @param {string} sasToken The Shared Access Signature token.
+ */
+ constructor(storageAccount?: string, storageAccessKey?: string, host?: StorageHost, usePathStyleUri?: boolean, sasToken?: string);
+ /**
+ * Associate a filtering operation with this StorageServiceClient. Filtering operations
+ * can include logging, automatically retrying, etc. Filter operations are objects
+ * that implement a method with the signature:
+ *
+ * "function handle (requestOptions, next)".
+ *
+ * After doing its preprocessing on the request options, the method needs to call
+ * "next" passing a callback with the following signature:
+ * signature:
+ *
+ * "function (returnObject, finalCallback, next)"
+ *
+ * In this callback, and after processing the returnObject (the response from the
+ * request to the server), the callback needs to either invoke next if it exists to
+ * continue processing other filters or simply invoke finalCallback otherwise to end
+ * up the service invocation.
+ *
+ * @function StorageServiceClient#withFilter
+ * @param {Object} filter The new filter object.
+ * @return {StorageServiceClient} A new service client with the filter applied.
+ */
+ withFilter(newFilter: any): StorageServiceClient;
+ /**
+ * Sets proxy object specified by caller.
+ *
+ * @function StorageServiceClient#setProxy
+ * @param {(object|string)} proxy proxy to use for tunneling
+ * {
+ * host: hostname
+ * port: port number
+ * proxyAuth: 'user:password' for basic auth
+ * headers: {...} headers for proxy server
+ * key: key for proxy server
+ * ca: ca for proxy server
+ * cert: cert for proxy server
+ * }
+ * if null or undefined, clears proxy
+ */
+ setProxy(proxy: any): void;
+ }
+ }
+ }
+
+ export interface AccessPolicy {
+ /** The permission type. */
+ Permissions: string;
+ /** The time at which the Shared Access Signature becomes valid. */
+ Start?: Date | string;
+ /** The time at which the Shared Access Signature becomes expired. */
+ Expiry?: Date | string;
+ }
+
+ export interface SignedIdentifier {
+ /** The signed identifier */
+ Id: string;
+ AccessPolicy: AccessPolicy;
+ }
+
+ /**
+ * Common request options for azure storage services
+ */
+ export interface RequestOptions {
+ /**
+ * {LocationMode} Specifies the location mode used to decide which location the request should be sent to.
+ */
+ locationMode?: StorageUtilities.LocationMode;
+ /**
+ * {int} The server timeout interval, in milliseconds, to use for the request.
+ */
+ timeoutIntervalInMs?: number;
+ /**
+ * {int} The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
+ */
+ maximumExecutionTimeInMs?: number;
+ /**
+ * {bool} Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
+ */
+ useNagleAlgorithm?: boolean;
+ }
+
+ export interface ContinuationToken {
+ nextMarker: string;
+ targetLocation?: Constants.StorageLocation;
+ }
+
+ export interface Range {
+ start?: number;
+ end?: number;
+ }
+ }
+
+ /**
+ * Creates a connection string that can be used to create a service which runs on the storage emulator. The emulator must be downloaded separately.
+ *
+ * @param {string} [proxyUri] The proxyUri. By default, http://127.0.0.1
+ * @return {string} A connection string representing the development storage credentials.
+ * @example
+ * var azure = require('azure-storage');
+ * var devStoreCreds = azure.generateDevelopmentStorageCredendentials();
+ * var blobService = azure.createBlobService(devStoreCreds);
+ */
+ export function generateDevelopmentStorageCredendentials(proxyUri: any): string;
+
+ /**
+ * Table client exports
+ * @ignore
+ */
+ export import TableService = services.table.TableService;
+ export import TableQuery = services.table.TableQuery;
+ export import TableBatch = services.table.TableBatch;
+ export import TableUtilities = services.table.TableUtilities;
+
+ /**
+ * Creates a new {@link TableService} object.
+ * If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_CONNECTION_STRING and then the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
+ * environment variables will be used.
+ *
+ * @param {string} [storageAccountOrConnectionString] The storage account or the connection string.
+ * @param {string} [storageAccessKey] The storage access key.
+ * @param {string|object} [host] The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @return {TableService} A new TableService object.
+ *
+ */
+ export function createTableService(storageAccountOrConnectionString: any, storageAccessKey: any, host: any): TableService;
+
+ /**
+ * Creates a new {@link TableService} object using the host Uri and the SAS credentials provided.
+ *
+ * @param {string|object} host The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @param {string} sasToken The Shared Access Signature token.
+ * @return {TableService} A new TableService object with the SAS credentials.
+ */
+ export function createTableServiceWithSas(hostUri: any, sasToken: any): TableService;
+
+ /**
+ * Blob client exports
+ * @ignore
+ */
+ export import BlobService = services.blob.blobservice.BlobService;
+ export import BlobUtilities = services.blob.blobutilities.BlobUtilities;
+
+ /**
+ * Creates a new {@link BlobService} object.
+ * If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_CONNECTION_STRING and then the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
+ * environment variables will be used.
+ *
+ * @param {string} storageAccountOrConnectionString The storage account or the connection string.
+ * @param {string} [storageAccessKey] The storage access key.
+ * @param {string|object} [host] The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @return {BlobService} A new BlobService object.
+ */
+ export function createBlobService(storageAccount: string, storageAccessKey: string, host?: string|StorageHost): BlobService;
+ export function createBlobService(connectionString: string): BlobService;
+ export function createBlobService(): BlobService;
+ /**
+ * Creates a new {@link BlobService} object using the host Uri and the SAS credentials provided.
+ *
+ * @param {string|object} host The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @param {string} sasToken The Shared Access Signature token.
+ * @return {BlobService} A new BlobService object with the SAS credentials.
+ */
+ export function createBlobServiceWithSas(host: string|StorageHost, sasToken: string): BlobService;
+
+ /**
+ * Creates a new {@link BlobService} object using the host uri and anonymous access.
+ *
+ * @param {string|object} host The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @return {BlobService} A new BlobService object with the anonymous credentials.
+ */
+ export function createBlobServiceAnonymous(host?: string|StorageHost): BlobService;
+
+ ///**
+ // * File client exports
+ // * @ignore
+ // */
+ export import FileService = services.file.FileService;
+ export import FileUtilities = services.file.FileUtilities;
+
+ ///**
+ //* Creates a new {@link FileService} object.
+ //* If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_CONNECTION_STRING and then the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
+ //* environment variables will be used.
+ //*
+ //* @param {string} storageAccountOrConnectionString The storage account or the connection string.
+ //* @param {string} [storageAccessKey] The storage access key.
+ //* @param {string|object} [host] The host address. To define primary only, pass a string.
+ //* Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ //* @return {FileService} A new FileService object.
+ //*/
+ export function createFileService(storageAccountOrConnectionString: any, storageAccessKey: any, host: any): FileService;
+
+ /**
+ * Creates a new {@link FileService} object using the host Uri and the SAS credentials provided.
+ *
+ * @param {string|object} host The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @param {string} sasToken The Shared Access Signature token.
+ * @return {FileService} A new FileService object with the SAS credentials.
+ */
+ export function createFileServiceWithSas(hostUri: any, sasToken: any): FileService;
+
+ /**
+ * Queue client exports
+ * @ignore
+ */
+ export import QueueService = services.queue.QueueService;
+ export import QueueUtilities = services.queue.QueueUtilities;
+
+ /**
+ * Creates a new {@link QueueService} object.
+ * If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_CONNECTION_STRING and then the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
+ * environment variables will be used.
+ *
+ * @param {string} [storageAccountOrConnectionString] The storage account or the connection string.
+ * @param {string} [storageAccessKey] The storage access key.
+ * @param {string|object} [host] The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @return {QueueService} A new QueueService object.
+ */
+ export function createQueueService(storageAccountOrConnectionString: any, storageAccessKey: any, host: any): QueueService;
+
+ /**
+ * Creates a new {@link QueueService} object using the host Uri and the SAS credentials provided.
+ *
+ * @param {string|object} host The host address. To define primary only, pass a string.
+ * Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
+ * @param {string} sasToken The Shared Access Signature token.
+ * @return {QueueService} A new QueueService object with the SAS credentials.
+ */
+ export function createQueueServiceWithSas(hostUri: any, sasToken: any): QueueService;
+
+ interface StorageError extends Error {
+ statusCode?: number;
+ requestId?: string;
+ code?: string;
+ }
+
+ interface ServiceResponse {
+ isSuccessful: boolean;
+ statusCode: number;
+ body?: string | Buffer;
+ headers?: Map;
+ md5: string;
+ error?: StorageError | Error;
+ }
+
+ interface ServiceResult {
+ error: StorageError | Error;
+ response: ServiceResponse;
+ contentMD5: string;
+ length?: number;
+ operationEndTime: Date;
+ targetLocation: Constants.StorageLocation;
+ }
+
+ /**
+ * A callback that returns a response object.
+ * @callback errorOrResponse
+ * @param {object} error If an error occurs, will contain information about the error.
+ * @param {object} response Contains information about the response returned for the operation.
+ * For example, HTTP status codes and headers.
+ */
+ interface ErrorOrResponse {
+ (error: Error, response: ServiceResponse): void
+ }
+ /**
+ * A callback that returns result and response objects.
+ * @callback errorOrResult
+ * @param {object} error If an error occurs, will contain information about the error.
+ * @param {object} result The result of the operation.
+ * @param {object} response Contains information about the response returned for the operation.
+ * For example, HTTP status codes and headers.
+ */
+ interface ErrorOrResult {
+ (error: Error, result: TResult, response: ServiceResponse): void
+ }
+
+ export import Constants = common.util.constants;
+ export import StorageUtilities = common.util.storageutilities;
+ export import SR = common.util.sr.SR;
+ export import StorageServiceClient = common.services.storageserviceclient.StorageServiceClient;
+ export import Logger = common.diagnostics.logger.Logger;
+ export import WebResource = common.http.webresource.WebResource;
+ export import Validate = common.util.validate;
+ export import date = common.util.date;
+ export import LinearRetryPolicyFilter = common.filters.linearretrypolicyfilter.LinearRetryPolicyFilter;
+ export import ExponentialRetryPolicyFilter = common.filters.exponentialretrypolicyfilter.ExponentialRetryPolicyFilter;
+ export import RetryPolicyFilter = common.filters.retrypolicyfilter.RetryPolicyFilter;
+ }
+
+ export = azurestorage;
+}
\ No newline at end of file
diff --git a/lib/common/util/constants.js b/lib/common/util/constants.js
index 41e462a..f97f2b3 100644
--- a/lib/common/util/constants.js
+++ b/lib/common/util/constants.js
@@ -31,7 +31,7 @@ var Constants = {
/*
* Specifies the value to use for UserAgent header.
*/
- USER_AGENT_PRODUCT_VERSION: '0.7.0',
+ USER_AGENT_PRODUCT_VERSION: '0.8.0',
/**
* The number of default concurrent requests for parallel operation.
diff --git a/lib/services/blob/blobservice.js b/lib/services/blob/blobservice.js
index aedfbba..3f26dbf 100644
--- a/lib/services/blob/blobservice.js
+++ b/lib/services/blob/blobservice.js
@@ -1506,7 +1506,7 @@ BlobService.prototype.setBlobMetadata = function (container, blob, metadata, opt
* @param {boolean} [options.skipSizeCheck] Skip the size check to perform direct download.
* Set the option to true for small blobs.
* Parallel download and speed summary won't work with this option on.
-* @param {SpeedSummary} [options.speedSummary] The upload tracker objects.
+* @param {SpeedSummary} [options.speedSummary] The download tracker objects.
* @param {int} [options.parallelOperationThreadCount] Parallel operation thread count
* @param {string} [options.snapshotId] The snapshot identifier.
* @param {string} [options.leaseId] The lease identifier.
@@ -1620,6 +1620,7 @@ BlobService.prototype.createReadStream = function (container, blob, optionsOrCal
* @param {boolean} [options.skipSizeCheck] Skip the size check to perform direct download.
* Set the option to true for small blobs.
* Parallel download and speed summary won't work with this option on.
+* @param {SpeedSummary} [options.speedSummary] The download tracker objects.
* @param {string} [options.snapshotId] The snapshot identifier.
* @param {string} [options.leaseId] The lease identifier.
* @param {string} [options.rangeStart] Return only the bytes of the blob in the specified range.
@@ -1639,6 +1640,7 @@ BlobService.prototype.createReadStream = function (container, blob, optionsOrCal
* @param {errorOrResult} callback `error` will contain information if an error occurs;
* otherwise `result` will contain the blob information.
* `response` will contain information related to this operation.
+* @return {SpeedSummary}
*
* @example
* var azure = require('azure-storage');
@@ -1652,7 +1654,8 @@ BlobService.prototype.createReadStream = function (container, blob, optionsOrCal
BlobService.prototype.getBlobToStream = function (container, blob, writeStream, optionsOrCallback, callback) {
var userOptions;
azureutil.normalizeArgs(optionsOrCallback, callback, function (o, c) { userOptions = o; callback = c; });
-
+ userOptions.speedSummary = userOptions.speedSummary || new SpeedSummary(blob);
+
validate.validateArgs('getBlobToStream', function (v) {
v.string(container, 'container');
v.string(blob, 'blob');
@@ -1685,6 +1688,8 @@ BlobService.prototype.getBlobToStream = function (container, blob, writeStream,
} else {
size = properties.contentLength;
}
+ options.speedSummary.totalSize = size;
+
if (size > self.singleBlobPutThresholdInBytes) {
options.contentMD5 = properties.contentMD5;
self._getBlobToRangeStream(container, blob, properties.blobType, writeStream, options, callback);
@@ -3162,7 +3167,7 @@ BlobService.prototype._createBlock = function (blockId, container, blob, content
* The default value is false.
* @param {errorOrResult} callback `error` will contain information
* if an error occurs; otherwise `result` will contain
-* the blocklist information.
+* the blob result with the blocklist information.
* `response` will contain information related to this operation.
*/
BlobService.prototype.commitBlocks = function (container, blob, blockList, optionsOrCallback, callback) {
@@ -3188,13 +3193,15 @@ BlobService.prototype.commitBlocks = function (container, blob, blockList, optio
BlobResult.setPropertiesFromBlob(webResource, options);
var processResponseCallback = function (responseObject, next) {
- responseObject.list = null;
+ responseObject.blobResult = new BlobResult(container, blob);
+ responseObject.blobResult.list = null;
if (!responseObject.error) {
- responseObject.list = blockList;
+ responseObject.blobResult.getPropertiesFromHeaders(responseObject.response.headers);
+ responseObject.blobResult.list = blockList;
}
var finalCallback = function (returnObject) {
- callback(returnObject.error, returnObject.list, returnObject.response);
+ callback(returnObject.error, returnObject.blobResult, returnObject.response);
};
next(responseObject, finalCallback);
@@ -3909,7 +3916,7 @@ BlobService.prototype._createBlobFromLocalFile = function (container, blob, blob
self._uploadBlobFromStream(true, container, blob, blobType, stream, size, options, streamCallback);
}
};
-
+
// Check the file size to determine the upload method: single request or chunks
fs.stat(localFileName, function (error, stat) {
if (error) {
@@ -5172,15 +5179,15 @@ BlobService.prototype._setRangeContentMD5Header = function (webResource, options
};
/**
-* Downloads a blockblob or pageblob into a range stream.
+* Downloads a blockblob, pageblob or appendblob into a range stream.
* @ignore
* @this {BlobService}
* @param {string} container The container name.
* @param {string} blob The blob name.
-* @param {string} blobType The type of blob to create: block blob or page blob.
+* @param {string} blobType The type of blob to download: block blob, page blob or append blob.
* @param {Stream} writeStream The write stream.
* @param {object} [options] The request options.
-* @param {SpeedSummary} [options.speedSummary] The upload tracker objects.
+* @param {SpeedSummary} [options.speedSummary] The download tracker objects.
* @param {int} [options.parallelOperationThreadCount] Parallel operation thread count
* @param {string} [options.snapshotId] The snapshot identifier.
* @param {string} [options.leaseId] The lease identifier.
@@ -5446,6 +5453,7 @@ BlobService.prototype._getBlobToStream = function (container, blob, writeStream,
* @param {boolean} [options.skipSizeCheck] Skip the size check to perform direct download.
* Set the option to true for small blobs.
* Parallel download and speed summary won't work with this option on.
+* @param {SpeedSummary} [options.speedSummary] The download tracker objects.
* @param {string} [options.snapshotId] The snapshot identifier.
* @param {string} [options.leaseId] The lease identifier.
* @param {string} [options.rangeStart] Return only the bytes of the blob in the specified range.
@@ -5465,11 +5473,14 @@ BlobService.prototype._getBlobToStream = function (container, blob, writeStream,
* @param {errorOrResult} callback `error` will contain information if an error occurs;
* otherwise `result` will contain the blob information.
* `response` will contain information related to this operation.
+* @return {SpeedSummary}
+*
*/
BlobService.prototype._getBlobToLocalFile = function (container, blob, localFileName, optionsOrCallback, callback) {
var options;
azureutil.normalizeArgs(optionsOrCallback, callback, function (o, c) { options = o; callback = c; });
-
+ options.speedSummary = options.speedSummary || new SpeedSummary(blob);
+
var writeStream = fs.createWriteStream(localFileName, { 'highWaterMark': BlobConstants.MAX_QUEUED_WRITE_DISK_BUFFER_SIZE });
this.getBlobToStream(container, blob, writeStream, options, function (error, responseBlob, response) {
@@ -5484,12 +5495,13 @@ BlobService.prototype._getBlobToLocalFile = function (container, blob, localFile
fs.unlink(localFileName, function () {
callback(error, responseBlob, response);
});
-
return;
}
}
callback(error, responseBlob, response);
- });
+ });
+
+ return options.speedSummary;
};
/**
diff --git a/lib/services/file/fileservice.js b/lib/services/file/fileservice.js
index 9fef81f..3926a7c 100644
--- a/lib/services/file/fileservice.js
+++ b/lib/services/file/fileservice.js
@@ -2176,6 +2176,7 @@ FileService.prototype.getFileToText = function (share, directory, file, optionsO
* @param {boolean} [options.skipSizeCheck] Skip the size check to perform direct download.
* Set the option to true for small files.
* Parallel download and speed summary won't work with this option on.
+* @param {SpeedSummary} [options.speedSummary] The download tracker objects.
* @param {string} [options.rangeStart] Return only the bytes of the file in the specified range.
* @param {string} [options.rangeEnd] Return only the bytes of the file in the specified range.
* @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions.
@@ -2192,6 +2193,8 @@ FileService.prototype.getFileToText = function (share, directory, file, optionsO
* @param {errorOrResult} callback `error` will contain information if an error occurs;
* otherwise `result` will contain the file information.
* `response` will contain information related to this operation.
+* @return {SpeedSummary}
+*
* @example
* var azure = require('azure-storage');
* var FileService = azure.createFileService();
@@ -2203,6 +2206,7 @@ FileService.prototype.getFileToText = function (share, directory, file, optionsO
FileService.prototype.getFileToLocalFile = function (share, directory, file, localFileName, optionsOrCallback, callback) {
var userOptions;
azureutil.normalizeArgs(optionsOrCallback, callback, function (o, c) { userOptions = o; callback = c; });
+ userOptions.speedSummary = userOptions.speedSummary || new SpeedSummary(file);
validate.validateArgs('getFileToLocalFile', function (v) {
v.string(share, 'share');
@@ -2234,6 +2238,8 @@ FileService.prototype.getFileToLocalFile = function (share, directory, file, loc
}
callback(error, responseFile, response);
});
+
+ return options.speedSummary;
};
/**
@@ -2306,6 +2312,7 @@ FileService.prototype.createReadStream = function (share, directory, file, optio
* @param {boolean} [options.skipSizeCheck] Skip the size check to perform direct download.
* Set the option to true for small files.
* Parallel download and speed summary won't work with this option on.
+* @param {SpeedSummary} [options.speedSummary] The download tracker objects.
* @param {string} [options.rangeStart] Return only the bytes of the file in the specified range.
* @param {string} [options.rangeEnd] Return only the bytes of the file in the specified range.
* @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions.
@@ -2322,6 +2329,8 @@ FileService.prototype.createReadStream = function (share, directory, file, optio
* @param {errorOrResult} callback `error` will contain information if an error occurs;
* otherwise `result` will contain the file information.
* `response` will contain information related to this operation.
+* @return {SpeedSummary}
+*
*
* @example
* var azure = require('azure-storage');
@@ -2335,7 +2344,8 @@ FileService.prototype.createReadStream = function (share, directory, file, optio
FileService.prototype.getFileToStream = function (share, directory, file, writeStream, optionsOrCallback, callback) {
var userOptions;
azureutil.normalizeArgs(optionsOrCallback, callback, function (o, c) { userOptions = o; callback = c; });
-
+ userOptions.speedSummary = userOptions.speedSummary || new SpeedSummary(file);
+
validate.validateArgs('getFileToStream', function (v) {
v.string(share, 'share');
v.stringAllowEmpty(directory, 'directory');
@@ -2368,6 +2378,8 @@ FileService.prototype.getFileToStream = function (share, directory, file, writeS
} else {
size = properties.contentLength;
}
+ options.speedSummary.totalSize = size;
+
if (size > self.singleFileThresholdInBytes) {
options.contentMD5 = properties.contentMD5;
self._getFileToRangeStream(share, directory, file, writeStream, options, callback);
@@ -2585,7 +2597,7 @@ FileService.prototype.createRangesFromStream = function (share, directory, file,
* @param {string} file The file name. File names may not start or end with the delimiter '/'.
* @param {string|object} text The file text, as a string or in a Buffer.
* @param {object} [options] The request options.
-* @param {SpeedSummary} [options.speedSummary] The download tracker objects;
+* @param {SpeedSummary} [options.speedSummary] The upload tracker objects;
* @param {object} [options.metadata] The metadata key/value pairs.
* @param {bool} [options.storeFileContentMD5] Specifies whether the file's ContentMD5 header should be set on uploads.
* The default value is false for files.
diff --git a/package.json b/package.json
index 9e31e97..b49e43a 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "azure-storage",
"author": "Microsoft Corporation",
- "version": "0.7.0",
+ "version": "0.8.0",
"description": "Microsoft Azure Storage Client Library for Node.js",
"tags": [
"azure",
diff --git a/test/services/blob/blobservice-uploaddownload-tests.js b/test/services/blob/blobservice-uploaddownload-tests.js
index 5e23ff8..47bd404 100644
--- a/test/services/blob/blobservice-uploaddownload-tests.js
+++ b/test/services/blob/blobservice-uploaddownload-tests.js
@@ -640,8 +640,14 @@ describe('blob-uploaddownload-tests', function () {
UncommittedBlocks: ['id2']
};
- blobService.commitBlocks(containerName, blobName, blockList, function (error4) {
+ blobService.commitBlocks(containerName, blobName, blockList, function (error4, blob) {
assert.equal(error4, null);
+ assert.equal(blob.container, containerName);
+ assert.equal(blob.blob, blobName);
+ assert.deepEqual(blob.list, blockList);
+ assert.notEqual(blob.etag, null);
+ assert.notEqual(blob.lastModified, null);
+ assert.notEqual(blob.contentMD5, null);
blobService.listBlocks(containerName, blobName, BlobUtilities.BlockListFilter.ALL, function (error5, list) {
assert.equal(error5, null);
@@ -674,8 +680,14 @@ describe('blob-uploaddownload-tests', function () {
LatestBlocks: ['id1'],
};
- blobService.commitBlocks(containerName, blobName, blockList, function (error4) {
+ blobService.commitBlocks(containerName, blobName, blockList, function (error4, blob) {
assert.equal(error4, null);
+ assert.equal(blob.container, containerName);
+ assert.equal(blob.blob, blobName);
+ assert.deepEqual(blob.list, blockList);
+ assert.notEqual(blob.etag, null);
+ assert.notEqual(blob.lastModified, null);
+ assert.notEqual(blob.contentMD5, null);
blobService.listBlocks(containerName, blobName, BlobUtilities.BlockListFilter.ALL, function (error5, list) {
assert.equal(error5, null);
@@ -1250,6 +1262,34 @@ describe('blob-uploaddownload-tests', function () {
});
});
});
+
+ runOrSkip('getBlobToLocalFile should return the SpeedSummary correctly', function (done) {
+ var blobName = testutil.generateId(blobNamesPrefix, blobNames, suite.isMocked);
+ var fileNameSource = testutil.generateId('getBlobToLocalFileSpeedSummary', [], suite.isMocked) + '.test';
+ var fileSize = 97 * 1024 * 1024; // Don't be a multiple of 4MB to cover more scenarios
+ generateTempFile(fileNameSource, fileSize, false, function (fileInfo) {
+ uploadOptions.parallelOperationThreadCount = 5;
+ blobService.createBlockBlobFromLocalFile(containerName, blobName, fileNameSource, uploadOptions, function (error) {
+ assert.equal(error, null);
+
+ var speedSummary;
+ var downloadOptions = {
+ parallelOperationThreadCount : 5
+ };
+
+ speedSummary = blobService.getBlobToLocalFile(containerName, blobName, fileNameSource, downloadOptions, function (error) {
+ assert.equal(speedSummary.getTotalSize(false), fileSize);
+ assert.equal(speedSummary.getCompleteSize(false), fileSize);
+ assert.equal(speedSummary.getCompletePercent(), '100.0');
+
+ try { fs.unlinkSync(fileNameSource); } catch (e) { }
+ done();
+ });
+
+ assert.notEqual(speedSummary, null);
+ });
+ });
+ });
runOrSkip('should have same md5 with range-based downloading to stream', function (done) {
var blobName = testutil.generateId(blobNamesPrefix, blobNames, suite.isMocked);
diff --git a/test/services/file/fileservice-uploaddownload-tests.js b/test/services/file/fileservice-uploaddownload-tests.js
index 1874358..490739c 100644
--- a/test/services/file/fileservice-uploaddownload-tests.js
+++ b/test/services/file/fileservice-uploaddownload-tests.js
@@ -614,6 +614,38 @@ describe('FileUploadDownload', function () {
});
});
+ runOrSkip('should return speedSummary correctly', function(done) {
+ var size = 99*1024*1024; // Do not use a multiple of 4MB size
+ generateTempFile(localLargeFileName, size, false, function (fileInfo) {
+ var uploadOptions = {
+ storeBlobContentMD5: true,
+ parallelOperationThreadCount: 5
+ };
+
+ fileService.createFileFromLocalFile(shareName, directoryName, fileName, localLargeFileName, uploadOptions, function (err) {
+ assert.equal(err, null);
+
+ var speedSummary;
+ var downloadOptions = {
+ useTransactionalMD5: true,
+ parallelOperationThreadCount: 5
+ };
+
+ speedSummary = fileService.getFileToLocalFile(shareName, directoryName, fileName, downloadFileName, downloadOptions, function (err, file) {
+ assert.equal(err, null);
+
+ assert.equal(speedSummary.getTotalSize(false), size);
+ assert.equal(speedSummary.getCompleteSize(false), size);
+ assert.equal(speedSummary.getCompletePercent(), '100.0');
+
+ done();
+ });
+
+ assert.notEqual(speedSummary, null);
+ });
+ });
+ });
+
it('should calculate content md5', function(done) {
fileContentMD5 = writeFile(localFileName, fileText);
fileService.createFileFromLocalFile(shareName, directoryName, fileName, localFileName, {storeFileContentMD5: true}, function (err) {
diff --git a/typings/lib.es6/lib.es6.d.ts b/typings/lib.es6/lib.es6.d.ts
new file mode 100644
index 0000000..02f4613
--- /dev/null
+++ b/typings/lib.es6/lib.es6.d.ts
@@ -0,0 +1,18601 @@
+/*! *****************************************************************************
+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 ON AN *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.
+***************************************************************************** */
+
+///
+
+/////////////////////////////
+/// ECMAScript APIs
+/////////////////////////////
+
+declare var NaN: number;
+declare var Infinity: number;
+
+/**
+ * Evaluates JavaScript code and executes it.
+ * @param x A String value that contains valid JavaScript code.
+ */
+declare function eval(x: string): any;
+
+/**
+ * Converts A string to an integer.
+ * @param s A string to convert into a number.
+ * @param radix A value between 2 and 36 that specifies the base of the number in numString.
+ * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
+ * All other strings are considered decimal.
+ */
+declare function parseInt(s: string, radix?: number): number;
+
+/**
+ * Converts a string to a floating-point number.
+ * @param string A string that contains a floating-point number.
+ */
+declare function parseFloat(string: string): number;
+
+/**
+ * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).
+ * @param number A numeric value.
+ */
+declare function isNaN(number: number): boolean;
+
+/**
+ * Determines whether a supplied number is finite.
+ * @param number Any numeric value.
+ */
+declare function isFinite(number: number): boolean;
+
+/**
+ * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).
+ * @param encodedURI A value representing an encoded URI.
+ */
+declare function decodeURI(encodedURI: string): string;
+
+/**
+ * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).
+ * @param encodedURIComponent A value representing an encoded URI component.
+ */
+declare function decodeURIComponent(encodedURIComponent: string): string;
+
+/**
+ * Encodes a text string as a valid Uniform Resource Identifier (URI)
+ * @param uri A value representing an encoded URI.
+ */
+declare function encodeURI(uri: string): string;
+
+/**
+ * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
+ * @param uriComponent A value representing an encoded URI component.
+ */
+declare function encodeURIComponent(uriComponent: string): string;
+
+interface PropertyDescriptor {
+ configurable?: boolean;
+ enumerable?: boolean;
+ value?: any;
+ writable?: boolean;
+ get? (): any;
+ set? (v: any): void;
+}
+
+interface PropertyDescriptorMap {
+ [s: string]: PropertyDescriptor;
+}
+
+interface Object {
+ /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */
+ constructor: Function;
+
+ /** Returns a string representation of an object. */
+ toString(): string;
+
+ /** Returns a date converted to a string using the current locale. */
+ toLocaleString(): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): Object;
+
+ /**
+ * Determines whether an object has a property with the specified name.
+ * @param v A property name.
+ */
+ hasOwnProperty(v: string): boolean;
+
+ /**
+ * Determines whether an object exists in another object's prototype chain.
+ * @param v Another object whose prototype chain is to be checked.
+ */
+ isPrototypeOf(v: Object): boolean;
+
+ /**
+ * Determines whether a specified property is enumerable.
+ * @param v A property name.
+ */
+ propertyIsEnumerable(v: string): boolean;
+}
+
+interface ObjectConstructor {
+ new (value?: any): Object;
+ (): any;
+ (value: any): any;
+
+ /** A reference to the prototype for a class of objects. */
+ prototype: Object;
+
+ /**
+ * Returns the prototype of an object.
+ * @param o The object that references the prototype.
+ */
+ getPrototypeOf(o: any): any;
+
+ /**
+ * Gets the own property descriptor of the specified object.
+ * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.
+ * @param o Object that contains the property.
+ * @param p Name of the property.
+ */
+ getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor;
+
+ /**
+ * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly
+ * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.
+ * @param o Object that contains the own properties.
+ */
+ getOwnPropertyNames(o: any): string[];
+
+ /**
+ * Creates an object that has the specified prototype, and that optionally contains specified properties.
+ * @param o Object to use as a prototype. May be null
+ * @param properties JavaScript object that contains one or more property descriptors.
+ */
+ create(o: any, properties?: PropertyDescriptorMap): any;
+
+ /**
+ * Adds a property to an object, or modifies attributes of an existing property.
+ * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.
+ * @param p The property name.
+ * @param attributes Descriptor for the property. It can be for a data property or an accessor property.
+ */
+ defineProperty(o: any, p: string, attributes: PropertyDescriptor): any;
+
+ /**
+ * Adds one or more properties to an object, and/or modifies attributes of existing properties.
+ * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
+ * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
+ */
+ defineProperties(o: any, properties: PropertyDescriptorMap): any;
+
+ /**
+ * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
+ * @param o Object on which to lock the attributes.
+ */
+ seal(o: T): T;
+
+ /**
+ * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
+ * @param o Object on which to lock the attributes.
+ */
+ freeze(o: T): T;
+
+ /**
+ * Prevents the addition of new properties to an object.
+ * @param o Object to make non-extensible.
+ */
+ preventExtensions(o: T): T;
+
+ /**
+ * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.
+ * @param o Object to test.
+ */
+ isSealed(o: any): boolean;
+
+ /**
+ * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.
+ * @param o Object to test.
+ */
+ isFrozen(o: any): boolean;
+
+ /**
+ * Returns a value that indicates whether new properties can be added to an object.
+ * @param o Object to test.
+ */
+ isExtensible(o: any): boolean;
+
+ /**
+ * Returns the names of the enumerable properties and methods of an object.
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
+ */
+ keys(o: any): string[];
+}
+
+/**
+ * Provides functionality common to all JavaScript objects.
+ */
+declare var Object: ObjectConstructor;
+
+/**
+ * Creates a new function.
+ */
+interface Function {
+ /**
+ * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.
+ * @param thisArg The object to be used as the this object.
+ * @param argArray A set of arguments to be passed to the function.
+ */
+ apply(thisArg: any, argArray?: any): any;
+
+ /**
+ * Calls a method of an object, substituting another object for the current object.
+ * @param thisArg The object to be used as the current object.
+ * @param argArray A list of arguments to be passed to the method.
+ */
+ call(thisArg: any, ...argArray: any[]): any;
+
+ /**
+ * For a given function, creates a bound function that has the same body as the original function.
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
+ * @param thisArg An object to which the this keyword can refer inside the new function.
+ * @param argArray A list of arguments to be passed to the new function.
+ */
+ bind(thisArg: any, ...argArray: any[]): any;
+
+ prototype: any;
+ length: number;
+
+ // Non-standard extensions
+ arguments: any;
+ caller: Function;
+}
+
+interface FunctionConstructor {
+ /**
+ * Creates a new function.
+ * @param args A list of arguments the function accepts.
+ */
+ new (...args: string[]): Function;
+ (...args: string[]): Function;
+ prototype: Function;
+}
+
+declare var Function: FunctionConstructor;
+
+interface IArguments {
+ [index: number]: any;
+ length: number;
+ callee: Function;
+}
+
+interface String {
+ /** Returns a string representation of a string. */
+ toString(): string;
+
+ /**
+ * Returns the character at the specified index.
+ * @param pos The zero-based index of the desired character.
+ */
+ charAt(pos: number): string;
+
+ /**
+ * Returns the Unicode value of the character at the specified location.
+ * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.
+ */
+ charCodeAt(index: number): number;
+
+ /**
+ * Returns a string that contains the concatenation of two or more strings.
+ * @param strings The strings to append to the end of the string.
+ */
+ concat(...strings: string[]): string;
+
+ /**
+ * Returns the position of the first occurrence of a substring.
+ * @param searchString The substring to search for in the string
+ * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
+ */
+ indexOf(searchString: string, position?: number): number;
+
+ /**
+ * Returns the last occurrence of a substring in the string.
+ * @param searchString The substring to search for.
+ * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.
+ */
+ lastIndexOf(searchString: string, position?: number): number;
+
+ /**
+ * Determines whether two strings are equivalent in the current locale.
+ * @param that String to compare to target string
+ */
+ localeCompare(that: string): number;
+
+ /**
+ * Matches a string with a regular expression, and returns an array containing the results of that search.
+ * @param regexp A variable name or string literal containing the regular expression pattern and flags.
+ */
+ match(regexp: string): RegExpMatchArray;
+
+ /**
+ * Matches a string with a regular expression, and returns an array containing the results of that search.
+ * @param regexp A regular expression object that contains the regular expression pattern and applicable flags.
+ */
+ match(regexp: RegExp): RegExpMatchArray;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A string that represents the regular expression.
+ * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
+ */
+ replace(searchValue: string, replaceValue: string): string;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A string that represents the regular expression.
+ * @param replacer A function that returns the replacement text.
+ */
+ replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags.
+ * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
+ */
+ replace(searchValue: RegExp, replaceValue: string): string;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags
+ * @param replacer A function that returns the replacement text.
+ */
+ replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string;
+
+ /**
+ * Finds the first substring match in a regular expression search.
+ * @param regexp The regular expression pattern and applicable flags.
+ */
+ search(regexp: string): number;
+
+ /**
+ * Finds the first substring match in a regular expression search.
+ * @param regexp The regular expression pattern and applicable flags.
+ */
+ search(regexp: RegExp): number;
+
+ /**
+ * Returns a section of a string.
+ * @param start The index to the beginning of the specified portion of stringObj.
+ * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.
+ * If this value is not specified, the substring continues to the end of stringObj.
+ */
+ slice(start?: number, end?: number): string;
+
+ /**
+ * Split a string into substrings using the specified separator and return them as an array.
+ * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
+ * @param limit A value used to limit the number of elements returned in the array.
+ */
+ split(separator: string, limit?: number): string[];
+
+ /**
+ * Split a string into substrings using the specified separator and return them as an array.
+ * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
+ * @param limit A value used to limit the number of elements returned in the array.
+ */
+ split(separator: RegExp, limit?: number): string[];
+
+ /**
+ * Returns the substring at the specified location within a String object.
+ * @param start The zero-based index number indicating the beginning of the substring.
+ * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.
+ * If end is omitted, the characters from start through the end of the original string are returned.
+ */
+ substring(start: number, end?: number): string;
+
+ /** Converts all the alphabetic characters in a string to lowercase. */
+ toLowerCase(): string;
+
+ /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
+ toLocaleLowerCase(): string;
+
+ /** Converts all the alphabetic characters in a string to uppercase. */
+ toUpperCase(): string;
+
+ /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */
+ toLocaleUpperCase(): string;
+
+ /** Removes the leading and trailing white space and line terminator characters from a string. */
+ trim(): string;
+
+ /** Returns the length of a String object. */
+ length: number;
+
+ // IE extensions
+ /**
+ * Gets a substring beginning at the specified location and having the specified length.
+ * @param from The starting position of the desired substring. The index of the first character in the string is zero.
+ * @param length The number of characters to include in the returned substring.
+ */
+ substr(from: number, length?: number): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): string;
+
+ [index: number]: string;
+}
+
+interface StringConstructor {
+ new (value?: any): String;
+ (value?: any): string;
+ prototype: String;
+ fromCharCode(...codes: number[]): string;
+}
+
+/**
+ * Allows manipulation and formatting of text strings and determination and location of substrings within strings.
+ */
+declare var String: StringConstructor;
+
+interface Boolean {
+ /** Returns the primitive value of the specified object. */
+ valueOf(): boolean;
+}
+
+interface BooleanConstructor {
+ new (value?: any): Boolean;
+ (value?: any): boolean;
+ prototype: Boolean;
+}
+
+declare var Boolean: BooleanConstructor;
+
+interface Number {
+ /**
+ * Returns a string representation of an object.
+ * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.
+ */
+ toString(radix?: number): string;
+
+ /**
+ * Returns a string representing a number in fixed-point notation.
+ * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
+ */
+ toFixed(fractionDigits?: number): string;
+
+ /**
+ * Returns a string containing a number represented in exponential notation.
+ * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
+ */
+ toExponential(fractionDigits?: number): string;
+
+ /**
+ * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
+ * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
+ */
+ toPrecision(precision?: number): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): number;
+}
+
+interface NumberConstructor {
+ new (value?: any): Number;
+ (value?: any): number;
+ prototype: Number;
+
+ /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */
+ MAX_VALUE: number;
+
+ /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */
+ MIN_VALUE: number;
+
+ /**
+ * A value that is not a number.
+ * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.
+ */
+ NaN: number;
+
+ /**
+ * A value that is less than the largest negative number that can be represented in JavaScript.
+ * JavaScript displays NEGATIVE_INFINITY values as -infinity.
+ */
+ NEGATIVE_INFINITY: number;
+
+ /**
+ * A value greater than the largest number that can be represented in JavaScript.
+ * JavaScript displays POSITIVE_INFINITY values as infinity.
+ */
+ POSITIVE_INFINITY: number;
+}
+
+/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */
+declare var Number: NumberConstructor;
+
+interface TemplateStringsArray extends Array {
+ raw: string[];
+}
+
+interface Math {
+ /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
+ E: number;
+ /** The natural logarithm of 10. */
+ LN10: number;
+ /** The natural logarithm of 2. */
+ LN2: number;
+ /** The base-2 logarithm of e. */
+ LOG2E: number;
+ /** The base-10 logarithm of e. */
+ LOG10E: number;
+ /** Pi. This is the ratio of the circumference of a circle to its diameter. */
+ PI: number;
+ /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */
+ SQRT1_2: number;
+ /** The square root of 2. */
+ SQRT2: number;
+ /**
+ * Returns the absolute value of a number (the value without regard to whether it is positive or negative).
+ * For example, the absolute value of -5 is the same as the absolute value of 5.
+ * @param x A numeric expression for which the absolute value is needed.
+ */
+ abs(x: number): number;
+ /**
+ * Returns the arc cosine (or inverse cosine) of a number.
+ * @param x A numeric expression.
+ */
+ acos(x: number): number;
+ /**
+ * Returns the arcsine of a number.
+ * @param x A numeric expression.
+ */
+ asin(x: number): number;
+ /**
+ * Returns the arctangent of a number.
+ * @param x A numeric expression for which the arctangent is needed.
+ */
+ atan(x: number): number;
+ /**
+ * Returns the angle (in radians) from the X axis to a point.
+ * @param y A numeric expression representing the cartesian y-coordinate.
+ * @param x A numeric expression representing the cartesian x-coordinate.
+ */
+ atan2(y: number, x: number): number;
+ /**
+ * Returns the smallest number greater than or equal to its numeric argument.
+ * @param x A numeric expression.
+ */
+ ceil(x: number): number;
+ /**
+ * Returns the cosine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ cos(x: number): number;
+ /**
+ * Returns e (the base of natural logarithms) raised to a power.
+ * @param x A numeric expression representing the power of e.
+ */
+ exp(x: number): number;
+ /**
+ * Returns the greatest number less than or equal to its numeric argument.
+ * @param x A numeric expression.
+ */
+ floor(x: number): number;
+ /**
+ * Returns the natural logarithm (base e) of a number.
+ * @param x A numeric expression.
+ */
+ log(x: number): number;
+ /**
+ * Returns the larger of a set of supplied numeric expressions.
+ * @param values Numeric expressions to be evaluated.
+ */
+ max(...values: number[]): number;
+ /**
+ * Returns the smaller of a set of supplied numeric expressions.
+ * @param values Numeric expressions to be evaluated.
+ */
+ min(...values: number[]): number;
+ /**
+ * Returns the value of a base expression taken to a specified power.
+ * @param x The base value of the expression.
+ * @param y The exponent value of the expression.
+ */
+ pow(x: number, y: number): number;
+ /** Returns a pseudorandom number between 0 and 1. */
+ random(): number;
+ /**
+ * Returns a supplied numeric expression rounded to the nearest number.
+ * @param x The value to be rounded to the nearest number.
+ */
+ round(x: number): number;
+ /**
+ * Returns the sine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ sin(x: number): number;
+ /**
+ * Returns the square root of a number.
+ * @param x A numeric expression.
+ */
+ sqrt(x: number): number;
+ /**
+ * Returns the tangent of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ tan(x: number): number;
+}
+/** An intrinsic object that provides basic mathematics functionality and constants. */
+declare var Math: Math;
+
+/** Enables basic storage and retrieval of dates and times. */
+interface Date {
+ /** Returns a string representation of a date. The format of the string depends on the locale. */
+ toString(): string;
+ /** Returns a date as a string value. */
+ toDateString(): string;
+ /** Returns a time as a string value. */
+ toTimeString(): string;
+ /** Returns a value as a string value appropriate to the host environment's current locale. */
+ toLocaleString(): string;
+ /** Returns a date as a string value appropriate to the host environment's current locale. */
+ toLocaleDateString(): string;
+ /** Returns a time as a string value appropriate to the host environment's current locale. */
+ toLocaleTimeString(): string;
+ /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */
+ valueOf(): number;
+ /** Gets the time value in milliseconds. */
+ getTime(): number;
+ /** Gets the year, using local time. */
+ getFullYear(): number;
+ /** Gets the year using Universal Coordinated Time (UTC). */
+ getUTCFullYear(): number;
+ /** Gets the month, using local time. */
+ getMonth(): number;
+ /** Gets the month of a Date object using Universal Coordinated Time (UTC). */
+ getUTCMonth(): number;
+ /** Gets the day-of-the-month, using local time. */
+ getDate(): number;
+ /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */
+ getUTCDate(): number;
+ /** Gets the day of the week, using local time. */
+ getDay(): number;
+ /** Gets the day of the week using Universal Coordinated Time (UTC). */
+ getUTCDay(): number;
+ /** Gets the hours in a date, using local time. */
+ getHours(): number;
+ /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */
+ getUTCHours(): number;
+ /** Gets the minutes of a Date object, using local time. */
+ getMinutes(): number;
+ /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */
+ getUTCMinutes(): number;
+ /** Gets the seconds of a Date object, using local time. */
+ getSeconds(): number;
+ /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */
+ getUTCSeconds(): number;
+ /** Gets the milliseconds of a Date, using local time. */
+ getMilliseconds(): number;
+ /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */
+ getUTCMilliseconds(): number;
+ /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */
+ getTimezoneOffset(): number;
+ /**
+ * Sets the date and time value in the Date object.
+ * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.
+ */
+ setTime(time: number): number;
+ /**
+ * Sets the milliseconds value in the Date object using local time.
+ * @param ms A numeric value equal to the millisecond value.
+ */
+ setMilliseconds(ms: number): number;
+ /**
+ * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
+ * @param ms A numeric value equal to the millisecond value.
+ */
+ setUTCMilliseconds(ms: number): number;
+
+ /**
+ * Sets the seconds value in the Date object using local time.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setSeconds(sec: number, ms?: number): number;
+ /**
+ * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setUTCSeconds(sec: number, ms?: number): number;
+ /**
+ * Sets the minutes value in the Date object using local time.
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setMinutes(min: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setUTCMinutes(min: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the hour value in the Date object using local time.
+ * @param hours A numeric value equal to the hours value.
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setHours(hours: number, min?: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the hours value in the Date object using Universal Coordinated Time (UTC).
+ * @param hours A numeric value equal to the hours value.
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the numeric day-of-the-month value of the Date object using local time.
+ * @param date A numeric value equal to the day of the month.
+ */
+ setDate(date: number): number;
+ /**
+ * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
+ * @param date A numeric value equal to the day of the month.
+ */
+ setUTCDate(date: number): number;
+ /**
+ * Sets the month value in the Date object using local time.
+ * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
+ * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.
+ */
+ setMonth(month: number, date?: number): number;
+ /**
+ * Sets the month value in the Date object using Universal Coordinated Time (UTC).
+ * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
+ * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.
+ */
+ setUTCMonth(month: number, date?: number): number;
+ /**
+ * Sets the year of the Date object using local time.
+ * @param year A numeric value for the year.
+ * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
+ * @param date A numeric value equal for the day of the month.
+ */
+ setFullYear(year: number, month?: number, date?: number): number;
+ /**
+ * Sets the year value in the Date object using Universal Coordinated Time (UTC).
+ * @param year A numeric value equal to the year.
+ * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
+ * @param date A numeric value equal to the day of the month.
+ */
+ setUTCFullYear(year: number, month?: number, date?: number): number;
+ /** Returns a date converted to a string using Universal Coordinated Time (UTC). */
+ toUTCString(): string;
+ /** Returns a date as a string value in ISO format. */
+ toISOString(): string;
+ /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */
+ toJSON(key?: any): string;
+}
+
+interface DateConstructor {
+ new (): Date;
+ new (value: number): Date;
+ new (value: string): Date;
+ new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
+ (): string;
+ prototype: Date;
+ /**
+ * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
+ * @param s A date string
+ */
+ parse(s: string): number;
+ /**
+ * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
+ * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
+ * @param month The month as an number between 0 and 11 (January to December).
+ * @param date The date as an number between 1 and 31.
+ * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.
+ * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.
+ * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.
+ * @param ms An number from 0 to 999 that specifies the milliseconds.
+ */
+ UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
+ now(): number;
+}
+
+declare var Date: DateConstructor;
+
+interface RegExpMatchArray extends Array {
+ index?: number;
+ input?: string;
+}
+
+interface RegExpExecArray extends Array {
+ index: number;
+ input: string;
+}
+
+interface RegExp {
+ /**
+ * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.
+ * @param string The String object or string literal on which to perform the search.
+ */
+ exec(string: string): RegExpExecArray;
+
+ /**
+ * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.
+ * @param string String on which to perform the search.
+ */
+ test(string: string): boolean;
+
+ /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
+ source: string;
+
+ /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */
+ global: boolean;
+
+ /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */
+ ignoreCase: boolean;
+
+ /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */
+ multiline: boolean;
+
+ lastIndex: number;
+
+ // Non-standard extensions
+ compile(): RegExp;
+}
+
+interface RegExpConstructor {
+ new (pattern: string, flags?: string): RegExp;
+ (pattern: string, flags?: string): RegExp;
+ prototype: RegExp;
+
+ // Non-standard extensions
+ $1: string;
+ $2: string;
+ $3: string;
+ $4: string;
+ $5: string;
+ $6: string;
+ $7: string;
+ $8: string;
+ $9: string;
+ lastMatch: string;
+}
+
+declare var RegExp: RegExpConstructor;
+
+interface Error {
+ name: string;
+ message: string;
+}
+
+interface ErrorConstructor {
+ new (message?: string): Error;
+ (message?: string): Error;
+ prototype: Error;
+}
+
+declare var Error: ErrorConstructor;
+
+interface EvalError extends Error {
+}
+
+interface EvalErrorConstructor {
+ new (message?: string): EvalError;
+ (message?: string): EvalError;
+ prototype: EvalError;
+}
+
+declare var EvalError: EvalErrorConstructor;
+
+interface RangeError extends Error {
+}
+
+interface RangeErrorConstructor {
+ new (message?: string): RangeError;
+ (message?: string): RangeError;
+ prototype: RangeError;
+}
+
+declare var RangeError: RangeErrorConstructor;
+
+interface ReferenceError extends Error {
+}
+
+interface ReferenceErrorConstructor {
+ new (message?: string): ReferenceError;
+ (message?: string): ReferenceError;
+ prototype: ReferenceError;
+}
+
+declare var ReferenceError: ReferenceErrorConstructor;
+
+interface SyntaxError extends Error {
+}
+
+interface SyntaxErrorConstructor {
+ new (message?: string): SyntaxError;
+ (message?: string): SyntaxError;
+ prototype: SyntaxError;
+}
+
+declare var SyntaxError: SyntaxErrorConstructor;
+
+interface TypeError extends Error {
+}
+
+interface TypeErrorConstructor {
+ new (message?: string): TypeError;
+ (message?: string): TypeError;
+ prototype: TypeError;
+}
+
+declare var TypeError: TypeErrorConstructor;
+
+interface URIError extends Error {
+}
+
+interface URIErrorConstructor {
+ new (message?: string): URIError;
+ (message?: string): URIError;
+ prototype: URIError;
+}
+
+declare var URIError: URIErrorConstructor;
+
+interface JSON {
+ /**
+ * Converts a JavaScript Object Notation (JSON) string into an object.
+ * @param text A valid JSON string.
+ * @param reviver A function that transforms the results. This function is called for each member of the object.
+ * If a member contains nested objects, the nested objects are transformed before the parent object is.
+ */
+ parse(text: string, reviver?: (key: any, value: any) => any): any;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ */
+ stringify(value: any): string;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer A function that transforms the results.
+ */
+ stringify(value: any, replacer: (key: string, value: any) => any): string;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer Array that transforms the results.
+ */
+ stringify(value: any, replacer: any[]): string;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer A function that transforms the results.
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
+ */
+ stringify(value: any, replacer: (key: string, value: any) => any, space: string | number): string;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer Array that transforms the results.
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
+ */
+ stringify(value: any, replacer: any[], space: string | number): string;
+}
+/**
+ * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
+ */
+declare var JSON: JSON;
+
+
+/////////////////////////////
+/// ECMAScript Array API (specially handled by compiler)
+/////////////////////////////
+
+interface Array {
+ /**
+ * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
+ */
+ length: number;
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+ toLocaleString(): string;
+ /**
+ * Appends new elements to an array, and returns the new length of the array.
+ * @param items New elements of the Array.
+ */
+ push(...items: T[]): number;
+ /**
+ * Removes the last element from an array and returns it.
+ */
+ pop(): T;
+ /**
+ * Combines two or more arrays.
+ * @param items Additional items to add to the end of array1.
+ */
+ concat(...items: U[]): T[];
+ /**
+ * Combines two or more arrays.
+ * @param items Additional items to add to the end of array1.
+ */
+ concat(...items: T[]): T[];
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): T[];
+ /**
+ * Removes the first element from an array and returns it.
+ */
+ shift(): T;
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): T[];
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: T, b: T) => number): T[];
+
+ /**
+ * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
+ * @param start The zero-based location in the array from which to start removing elements.
+ */
+ splice(start: number): T[];
+
+ /**
+ * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
+ * @param start The zero-based location in the array from which to start removing elements.
+ * @param deleteCount The number of elements to remove.
+ * @param items Elements to insert into the array in place of the deleted elements.
+ */
+ splice(start: number, deleteCount: number, ...items: T[]): T[];
+
+ /**
+ * Inserts new elements at the start of an array.
+ * @param items Elements to insert at the start of the Array.
+ */
+ unshift(...items: T[]): number;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
+ */
+ indexOf(searchElement: T, fromIndex?: number): number;
+
+ /**
+ * Returns the index of the last occurrence of a specified value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
+ */
+ lastIndexOf(searchElement: T, fromIndex?: number): number;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[];
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
+
+ [n: number]: T;
+}
+
+interface ArrayConstructor {
+ new (arrayLength?: number): any[];
+ new (arrayLength: number): T[];
+ new (...items: T[]): T[];
+ (arrayLength?: number): any[];
+ (arrayLength: number): T[];
+ (...items: T[]): T[];
+ isArray(arg: any): arg is Array;
+ prototype: Array;
+}
+
+declare var Array: ArrayConstructor;
+
+interface TypedPropertyDescriptor {
+ enumerable?: boolean;
+ configurable?: boolean;
+ writable?: boolean;
+ value?: T;
+ get?: () => T;
+ set?: (value: T) => void;
+}
+
+declare type ClassDecorator = (target: TFunction) => TFunction | void;
+declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
+declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void;
+declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
+
+declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike;
+
+interface PromiseLike {
+ /**
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
+ * @param onfulfilled The callback to execute when the Promise is resolved.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of which ever callback is executed.
+ */
+ then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike;
+ then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike;
+}
+
+interface ArrayLike {
+ length: number;
+ [n: number]: T;
+}
+
+
+/**
+ * Represents a raw buffer of binary data, which is used to store data for the
+ * different typed arrays. ArrayBuffers cannot be read from or written to directly,
+ * but can be passed to a typed array or DataView Object to interpret the raw
+ * buffer as needed.
+ */
+interface ArrayBuffer {
+ /**
+ * Read-only. The length of the ArrayBuffer (in bytes).
+ */
+ byteLength: number;
+
+ /**
+ * Returns a section of an ArrayBuffer.
+ */
+ slice(begin:number, end?:number): ArrayBuffer;
+}
+
+interface ArrayBufferConstructor {
+ prototype: ArrayBuffer;
+ new (byteLength: number): ArrayBuffer;
+ isView(arg: any): boolean;
+}
+declare var ArrayBuffer: ArrayBufferConstructor;
+
+interface ArrayBufferView {
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+}
+
+interface DataView {
+ buffer: ArrayBuffer;
+ byteLength: number;
+ byteOffset: number;
+ /**
+ * Gets the Float32 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getFloat32(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Float64 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getFloat64(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Int8 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getInt8(byteOffset: number): number;
+
+ /**
+ * Gets the Int16 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getInt16(byteOffset: number, littleEndian?: boolean): number;
+ /**
+ * Gets the Int32 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getInt32(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Uint8 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getUint8(byteOffset: number): number;
+
+ /**
+ * Gets the Uint16 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getUint16(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Uint32 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getUint32(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Stores an Float32 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Float64 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Int8 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ */
+ setInt8(byteOffset: number, value: number): void;
+
+ /**
+ * Stores an Int16 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Int32 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Uint8 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ */
+ setUint8(byteOffset: number, value: number): void;
+
+ /**
+ * Stores an Uint16 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Uint32 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
+}
+
+interface DataViewConstructor {
+ new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView;
+}
+declare var DataView: DataViewConstructor;
+
+/**
+ * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Int8Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Int8Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Int8Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): Int8Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Int8Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Int8Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Int8Array;
+
+ /**
+ * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Int8Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+interface Int8ArrayConstructor {
+ prototype: Int8Array;
+ new (length: number): Int8Array;
+ new (array: ArrayLike): Int8Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Int8Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;
+
+}
+declare var Int8Array: Int8ArrayConstructor;
+
+/**
+ * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Uint8Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Uint8Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): Uint8Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint8Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint8Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Uint8Array;
+
+ /**
+ * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint8Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint8ArrayConstructor {
+ prototype: Uint8Array;
+ new (length: number): Uint8Array;
+ new (array: ArrayLike): Uint8Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint8Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;
+
+}
+declare var Uint8Array: Uint8ArrayConstructor;
+
+/**
+ * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
+ * If the requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8ClampedArray {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Uint8ClampedArray;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Uint8ClampedArray;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): Uint8ClampedArray;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint8ClampedArray;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: Uint8ClampedArray, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint8ClampedArray;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Uint8ClampedArray;
+
+ /**
+ * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint8ClampedArray;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint8ClampedArrayConstructor {
+ prototype: Uint8ClampedArray;
+ new (length: number): Uint8ClampedArray;
+ new (array: ArrayLike): Uint8ClampedArray;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint8ClampedArray;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;
+}
+declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
+
+/**
+ * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int16Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Int16Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Int16Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): Int16Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Int16Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Int16Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Int16Array;
+
+ /**
+ * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Int16Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Int16ArrayConstructor {
+ prototype: Int16Array;
+ new (length: number): Int16Array;
+ new (array: ArrayLike): Int16Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Int16Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;
+
+}
+declare var Int16Array: Int16ArrayConstructor;
+
+/**
+ * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint16Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Uint16Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Uint16Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): Uint16Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint16Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint16Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Uint16Array;
+
+ /**
+ * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint16Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint16ArrayConstructor {
+ prototype: Uint16Array;
+ new (length: number): Uint16Array;
+ new (array: ArrayLike): Uint16Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint16Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;
+
+}
+declare var Uint16Array: Uint16ArrayConstructor;
+/**
+ * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int32Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Int32Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Int32Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): Int32Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Int32Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Int32Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Int32Array;
+
+ /**
+ * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Int32Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Int32ArrayConstructor {
+ prototype: Int32Array;
+ new (length: number): Int32Array;
+ new (array: ArrayLike): Int32Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Int32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;
+}
+declare var Int32Array: Int32ArrayConstructor;
+
+/**
+ * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint32Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Uint32Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Uint32Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): Uint32Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint32Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint32Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Uint32Array;
+
+ /**
+ * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint32Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint32ArrayConstructor {
+ prototype: Uint32Array;
+ new (length: number): Uint32Array;
+ new (array: ArrayLike): Uint32Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;
+}
+declare var Uint32Array: Uint32ArrayConstructor;
+
+/**
+ * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
+ * of bytes could not be allocated an exception is raised.
+ */
+interface Float32Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Float32Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Float32Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): Float32Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Float32Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Float32Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Float32Array;
+
+ /**
+ * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Float32Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Float32ArrayConstructor {
+ prototype: Float32Array;
+ new (length: number): Float32Array;
+ new (array: ArrayLike): Float32Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Float32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;
+
+}
+declare var Float32Array: Float32ArrayConstructor;
+
+/**
+ * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Float64Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Float64Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Float64Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): Float64Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Float64Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Float64Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Float64Array;
+
+ /**
+ * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Float64Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Float64ArrayConstructor {
+ prototype: Float64Array;
+ new (length: number): Float64Array;
+ new (array: ArrayLike): Float64Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Float64Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
+}
+declare var Float64Array: Float64ArrayConstructor;
+declare type PropertyKey = string | number | symbol;
+
+interface Symbol {
+ /** Returns a string representation of an object. */
+ toString(): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): Object;
+
+ [Symbol.toStringTag]: string;
+}
+
+interface SymbolConstructor {
+ /**
+ * A reference to the prototype.
+ */
+ prototype: Symbol;
+
+ /**
+ * Returns a new unique Symbol value.
+ * @param description Description of the new Symbol object.
+ */
+ (description?: string|number): symbol;
+
+ /**
+ * Returns a Symbol object from the global symbol registry matching the given key if found.
+ * Otherwise, returns a new symbol with this key.
+ * @param key key to search for.
+ */
+ for(key: string): symbol;
+
+ /**
+ * Returns a key from the global symbol registry matching the given Symbol if found.
+ * Otherwise, returns a undefined.
+ * @param sym Symbol to find the key for.
+ */
+ keyFor(sym: symbol): string;
+
+ // Well-known Symbols
+
+ /**
+ * A method that determines if a constructor object recognizes an object as one of the
+ * constructor’s instances. Called by the semantics of the instanceof operator.
+ */
+ hasInstance: symbol;
+
+ /**
+ * A Boolean value that if true indicates that an object should flatten to its array elements
+ * by Array.prototype.concat.
+ */
+ isConcatSpreadable: symbol;
+
+ /**
+ * A method that returns the default iterator for an object. Called by the semantics of the
+ * for-of statement.
+ */
+ iterator: symbol;
+
+ /**
+ * A regular expression method that matches the regular expression against a string. Called
+ * by the String.prototype.match method.
+ */
+ match: symbol;
+
+ /**
+ * A regular expression method that replaces matched substrings of a string. Called by the
+ * String.prototype.replace method.
+ */
+ replace: symbol;
+
+ /**
+ * A regular expression method that returns the index within a string that matches the
+ * regular expression. Called by the String.prototype.search method.
+ */
+ search: symbol;
+
+ /**
+ * A function valued property that is the constructor function that is used to create
+ * derived objects.
+ */
+ species: symbol;
+
+ /**
+ * A regular expression method that splits a string at the indices that match the regular
+ * expression. Called by the String.prototype.split method.
+ */
+ split: symbol;
+
+ /**
+ * A method that converts an object to a corresponding primitive value.
+ * Called by the ToPrimitive abstract operation.
+ */
+ toPrimitive: symbol;
+
+ /**
+ * A String value that is used in the creation of the default string description of an object.
+ * Called by the built-in method Object.prototype.toString.
+ */
+ toStringTag: symbol;
+
+ /**
+ * An Object whose own property names are property names that are excluded from the 'with'
+ * environment bindings of the associated objects.
+ */
+ unscopables: symbol;
+}
+declare var Symbol: SymbolConstructor;
+
+interface Object {
+ /**
+ * Determines whether an object has a property with the specified name.
+ * @param v A property name.
+ */
+ hasOwnProperty(v: PropertyKey): boolean;
+
+ /**
+ * Determines whether a specified property is enumerable.
+ * @param v A property name.
+ */
+ propertyIsEnumerable(v: PropertyKey): boolean;
+}
+
+interface ObjectConstructor {
+ /**
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
+ * target object. Returns the target object.
+ * @param target The target object to copy to.
+ * @param sources One or more source objects to copy properties from.
+ */
+ assign(target: any, ...sources: any[]): any;
+
+ /**
+ * Returns an array of all symbol properties found directly on object o.
+ * @param o Object to retrieve the symbols from.
+ */
+ getOwnPropertySymbols(o: any): symbol[];
+
+ /**
+ * Returns true if the values are the same value, false otherwise.
+ * @param value1 The first value.
+ * @param value2 The second value.
+ */
+ is(value1: any, value2: any): boolean;
+
+ /**
+ * Sets the prototype of a specified object o to object proto or null. Returns the object o.
+ * @param o The object to change its prototype.
+ * @param proto The value of the new prototype or null.
+ */
+ setPrototypeOf(o: any, proto: any): any;
+
+ /**
+ * Gets the own property descriptor of the specified object.
+ * An own property descriptor is one that is defined directly on the object and is not
+ * inherited from the object's prototype.
+ * @param o Object that contains the property.
+ * @param p Name of the property.
+ */
+ getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor;
+
+ /**
+ * Adds a property to an object, or modifies attributes of an existing property.
+ * @param o Object on which to add or modify the property. This can be a native JavaScript
+ * object (that is, a user-defined object or a built in object) or a DOM object.
+ * @param p The property name.
+ * @param attributes Descriptor for the property. It can be for a data property or an accessor
+ * property.
+ */
+ defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;
+}
+
+interface Function {
+ /**
+ * Returns the name of the function. Function names are read-only and can not be changed.
+ */
+ name: string;
+
+ /**
+ * Determines whether the given value inherits from this function if this function was used
+ * as a constructor function.
+ *
+ * A constructor function can control which objects are recognized as its instances by
+ * 'instanceof' by overriding this method.
+ */
+ [Symbol.hasInstance](value: any): boolean;
+}
+
+interface NumberConstructor {
+ /**
+ * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
+ * that is representable as a Number value, which is approximately:
+ * 2.2204460492503130808472633361816 x 10−16.
+ */
+ EPSILON: number;
+
+ /**
+ * Returns true if passed value is finite.
+ * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
+ * number. Only finite values of the type number, result in true.
+ * @param number A numeric value.
+ */
+ isFinite(number: number): boolean;
+
+ /**
+ * Returns true if the value passed is an integer, false otherwise.
+ * @param number A numeric value.
+ */
+ isInteger(number: number): boolean;
+
+ /**
+ * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
+ * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
+ * to a number. Only values of the type number, that are also NaN, result in true.
+ * @param number A numeric value.
+ */
+ isNaN(number: number): boolean;
+
+ /**
+ * Returns true if the value passed is a safe integer.
+ * @param number A numeric value.
+ */
+ isSafeInteger(number: number): boolean;
+
+ /**
+ * The value of the largest integer n such that n and n + 1 are both exactly representable as
+ * a Number value.
+ * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
+ */
+ MAX_SAFE_INTEGER: number;
+
+ /**
+ * The value of the smallest integer n such that n and n − 1 are both exactly representable as
+ * a Number value.
+ * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
+ */
+ MIN_SAFE_INTEGER: number;
+
+ /**
+ * Converts a string to a floating-point number.
+ * @param string A string that contains a floating-point number.
+ */
+ parseFloat(string: string): number;
+
+ /**
+ * Converts A string to an integer.
+ * @param s A string to convert into a number.
+ * @param radix A value between 2 and 36 that specifies the base of the number in numString.
+ * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
+ * All other strings are considered decimal.
+ */
+ parseInt(string: string, radix?: number): number;
+}
+
+interface Array {
+ /** Iterator */
+ [Symbol.iterator](): IterableIterator;
+
+ /**
+ * Returns an object whose properties have the value 'true'
+ * when they will be absent when used in a 'with' statement.
+ */
+ [Symbol.unscopables](): {
+ copyWithin: boolean;
+ entries: boolean;
+ fill: boolean;
+ find: boolean;
+ findIndex: boolean;
+ keys: boolean;
+ values: boolean;
+ };
+
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, T]>;
+
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator;
+
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: T, start?: number, end?: number): T[];
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): T[];
+}
+
+interface IArguments {
+ /** Iterator */
+ [Symbol.iterator](): IterableIterator;
+}
+
+interface ArrayConstructor {
+ /**
+ * Creates an array from an array-like object.
+ * @param arrayLike An array-like object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array;
+
+ /**
+ * Creates an array from an iterable object.
+ * @param iterable An iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array