From 80fd9daed79eb612c3c323fa25e1eb01062d56f4 Mon Sep 17 00:00:00 2001 From: tristancaron Date: Mon, 23 Mar 2015 20:23:45 +0100 Subject: [PATCH 001/415] Service Worker Api --- service_worker_api/service_worker_api-test.ts | 188 ++++ service_worker_api/service_worker_api.d.ts | 896 ++++++++++++++++++ 2 files changed, 1084 insertions(+) create mode 100644 service_worker_api/service_worker_api-test.ts create mode 100644 service_worker_api/service_worker_api.d.ts diff --git a/service_worker_api/service_worker_api-test.ts b/service_worker_api/service_worker_api-test.ts new file mode 100644 index 0000000000..67ce58cd40 --- /dev/null +++ b/service_worker_api/service_worker_api-test.ts @@ -0,0 +1,188 @@ +/// + +var OFFLINE_CACHE = "cache_test"; +var OFFLINE_URL = "localhost"; + +self.addEventListener('fetch', function(event: FetchEvent) { + if (event.request.method === 'GET' && + event.request.headers.get('accept').indexOf('text/html') !== -1) { + console.log('Handling fetch event for', event.request.url); + event.respondWith( + self.fetch(event.request).catch(function(e) { + console.error('Fetch failed; returning offline page instead.', e); + return self.caches.open(OFFLINE_CACHE).then(function(cache: Cache) { + return cache.match(OFFLINE_URL); + }); + }) + ); + } +}); + +self.caches.open('v1').then(function(cache: Cache) { + cache.matchAll('/images/').then(function(response: Array) { + response.forEach(function(element, index, array) { + cache.delete(element); + + }); + }); + +}); + +self.addEventListener('install', function(event: InstallEvent) { + event.waitUntil( + self.caches.open('v1').then(function(cache: Cache) { + return cache.add('/sw-test/index.html'); + }) + ); +}); + +self.addEventListener('install', function(event: InstallEvent) { + event.waitUntil( + self.caches.open('v1').then(function(cache) { + return cache.addAll( + '/sw-test/', + '/sw-test/index.html', + '/sw-test/style.css', + '/sw-test/app.js', + '/sw-test/image-list.js', + '/sw-test/star-wars-logo.jpg', + '/sw-test/gallery/', + '/sw-test/gallery/bountyHunters.jpg', + '/sw-test/gallery/myLittleVader.jpg', + '/sw-test/gallery/snowTroopers.jpg' + ); + }) + ); +}); + +self.addEventListener('fetch', function(event: FetchEvent) { + var cachedResponse = self.caches.match(event.request).catch(function() { + return self.fetch(event.request).then(function(response: Response) { + return self.caches.open('v1').then(function(cache) { + cache.put(event.request, response.clone()); + return response; + }); + }); + }).catch(function() { + return self.caches.match('/sw-test/gallery/myLittleVader.jpg'); + }); + + event.respondWith(cachedResponse); +}); + +self.caches.open('v1').then(function(cache) { + cache.match('/images/image.png').then(function(response) { + cache.delete(response); + }); +}); + +self.caches.open('v1').then(function(cache: Cache) { + cache.keys().then(function(response) { + response.forEach(function(element, index, array) { + cache.delete(element); + }); + }); +}); + +self.caches.has('v1').then(function() { + self.caches.delete('v1').then(function() { + + }); +}); + +self.addEventListener('activate', function(event: ExtendableEvent) { + var cacheWhitelist = ['v2']; + + event.waitUntil( + self.caches.keys().then(function(keyList) { + for(var i = 0; i < keyList.length; i++) { + if (cacheWhitelist.indexOf(keyList[i]) === -1) { + return self.caches.delete(keyList[i]); + } + } + }) + ); +}); + +function sendMessage(message) { + return new Promise(function(resolve, reject) { + var messageChannel = new MessageChannel(); + messageChannel.port1.onmessage = function(event) { + if (event.data.error) { + reject(event.data.error); + } else { + resolve(event.data); + } + }; + navigator.serviceWorker.controller.postMessage(message, [messageChannel.port2]); + }); +} + +self.clients.matchAll({type: "test"}).then(function(clients) { + for(var i = 0 ; i < clients.length ; i++) { + if(clients[i].url === 'index.html') { + self.clients.openWindow(clients[i].url); + // or do something else involving the matching client + } + } +}); + +self.addEventListener('activate', function(e: ExtendableEvent) { + e.waitUntil(self.clients.claim()); +}); + +navigator.serviceWorker.register('service-worker.js', {scope: './'}).then(function(registration) { + // At this point, registration has taken place. + // The service worker will not handle requests until this page and any + // other instances of this page (in other tabs, etc.) have been + // closed/reloaded. + var serviceWorker; + if (registration.installing) { + serviceWorker = registration.installing; + } else if (registration.waiting) { + serviceWorker = registration.waiting; + } else if (registration.active) { + serviceWorker = registration.active; + } + if (serviceWorker) { + console.log(serviceWorker.state); + serviceWorker.addEventListener('statechange', function(e) { + console.log(e.target.state); + }); + } +}).catch(function(error) { + // Something went wrong during registration. The service-worker.js file + // might be unavailable or contain a syntax error. + +}); + +navigator.serviceWorker.getRegistration('/app').then(function(registration: ServiceWorkerRegistration) { + +}); + +navigator.serviceWorker.getRegistrations().then(function(registrations: Array) { + +}); + +self.registration.unregister(); + +self.addEventListener('install', function(event: ExtendableEvent) { + event.waitUntil(self.skipWaiting()); +}); + +self.addEventListener('notificationclick', function(event: NotificationEvent) { + console.log('On notification click: ', event.notification.tag); + event.notification.close(); + + // This looks to see if the current is already open and + // focuses if it is + event.waitUntil(self.clients.matchAll({ + type: "window" + }).then(function(clientList) { + for (var i = 0; i < clientList.length; i++) { + var client = clientList[i]; + } + if (self.clients.openWindow) + return self.clients.openWindow('/'); + })); +}); \ No newline at end of file diff --git a/service_worker_api/service_worker_api.d.ts b/service_worker_api/service_worker_api.d.ts new file mode 100644 index 0000000000..f9b2981463 --- /dev/null +++ b/service_worker_api/service_worker_api.d.ts @@ -0,0 +1,896 @@ +// Type definitions for service_worker_api +// Project: https://developer.mozilla.org/fr/docs/Web/API/ServiceWorker_API +// Definitions by: Tristan Caron +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/** + * Provides methods relating to the body of the response/request, allowing you + * to declare what its content type is and how it should be handled. + */ +interface Body { + /** + * Contains a Boolean that indicates whether the body has been read. + * @readonly + */ + bodyUsed: boolean; + + /** + * Takes a Response stream and reads it to completion. + * It returns a promise that resolves with an ArrayBuffer. + */ + arrayBuffer(): Promise; + + /** + * Takes a Response stream and reads it to completion. + * It returns a promise that resolves with a Blob. + */ + blob(): Promise; + + /** + * Takes a Response stream and reads it to completion. + * It returns a promise that resolves with a FormData object. + */ + formData(): Promise; + + /** + * Takes a Response stream and reads it to completion. + * It returns a promise that resolves with a JSON object. + */ + json(): Promise; + + /** + * Takes a Response stream and reads it to completion. + * It returns a promise that resolves with a USVString (text). + */ + text(): Promise; + +} + +/** + * Represents response/request headers, allowing you to query them and take + * different actions depending on the results. + */ +interface Header { + new(): Header; + + /** + * Appends a new value onto an existing header inside a Headers object, or + * adds the header if it does not already exist. + * + * @param name The name of the HTTP header you want to add to the Headers + * object. + * @param value The value of the HTTP header you want to add. + */ + append(name: string, value: string): void; + + /** + * Deletes a header from a Headers object. + * + * @param name The name of the HTTP header you want to delete from the + * Headers object. + */ + delete(name: string): void; + + /** + * Returns the first value of a given header from within a Headers object. + * + * @param name The name of the HTTP header whose value you want to retrieve + * from the Headers object. If the given name is not the name of an + * HTTP header, this method throws a TypeError. + */ + get(name: string): string; + + /** + * Returns an array of all the values of a header within a Headers object + * with a given name. + * + * @param name The name of the HTTP header whose values you want to retrieve + * from the Headers object. If the given name is not the name of an + * HTTP header, this method throws a TypeError. + */ + getAll(name:string): Array; + + /** + * Returns a boolean stating whether a Headers object contains a + * certain header. + * + * @param name The name of the HTTP header you want to test for. If the + * given name is not the name of an HTTP header, this method throws + * a TypeError. + */ + has(name: string): boolean; + + /** + * Sets a new value for an existing header inside a Headers object, or + * adds the header if it does not already exist. + * + * @param name The name of the HTTP header you want to set to a new value. + * If the given name is not the name of an HTTP header, this method throws + * a TypeError. + * @param value The new value you want to set. + */ + set(name: string, value: string): void; +} + +/** + * Represents the response to a request. + */ +interface Response extends Body { + new(): Response; + + /** + * Contains the type of the response (e.g., basic, cors). + * @readonly + */ + type: string; + + /** + * Contains the URL of the response. + * @readonly + */ + url: string; + + /** + * Contains a boolean stating whether this is the final URL of the response. + */ + useFinalURL: boolean; + + /** + * Contains the status code of the response (e.g., 200 for a success). + * @readonly + */ + status: number; + + /** + * Contains a boolean stating whether the response was successful + * (status in the range 200-299) or not. + * @readonly + */ + ok: boolean; + + /** + * Contains the status message corresponding to the status code + * (e.g., OK for 200). + * @readonly + */ + statusText: string; + + /** + * Contains the Headers object associated with the response. + * @readonly + */ + headers: Header; + + /** + * Creates a clone of a Response object. + */ + clone(): Response; + + /** + * Returns a new Response object associated with a network error. + */ + error(): Response; + + /** + * Creates a new response with a different URL. + */ + redirect(): Response; +} + +/** + * Represents a resource request. + */ +interface Request extends Body { + new(): Request; + + /** + * Contains the request's method (GET, POST, etc.). + * @readonly + */ + method: string; + + /** + * Contains the URL of the request. + * @readonly + */ + url: string; + + /** + * Contains the associated Headers object of the request. + * @readonly + */ + headers: Header; + + /** + * Contains the context of the request (e.g., audio, image, iframe, etc.). + * @readonly + */ + context: string; + + /** + * Contains the referrer of the request (e.g., client). + * @readonly + */ + referrer: string; + + /** + * Contains the mode of the request (e.g., cors, no-cors, same-origin). + * @readonly + */ + mode: string; + + /** + * Contains the credentials of the request (e.g., omit, same-origin). + * @readonly + */ + credentials: string; + + /** + * Contains the cache mode of the request (e.g., default, reload, no-cache). + * @readonly + */ + cache: string; + + /** + * Creates a copy of the current Request object. + */ + clone(): Request; +} + +/** + * An CacheOptions object allowing you to set specific control options for the + * matching done in the match operation. + * + * @property [ignoreSearch] A Boolean that specifies whether the matching + * process should ignore the query string in the url. If set to true, + * the ?value=bar part of http://foo.com/?value=bar would be ignored when + * performing a match. It defaults to false. + * + * @property [ignoreMethod] A Boolean that, when set to true, prevents matching + * operations from validating the Request http method (normally only GET + * and HEAD are allowed.) It defaults to false. + * + * @property [ignoreVary] A Boolean that when set to true tells the matching + * operation not to perform VARY header matching — i.e. if the URL matches you + * will get a match regardless of the Response object having a VARY header or + * not. It defaults to false. + * + * @property [cacheName] A DOMString that represents a specific cache to search + * within. Note that this option is ignored by Cache.match(). + */ +interface CacheOptions { + ignoreSearch?: boolean; + ignoreMethod?: boolean; + ignoreVary?: boolean; + cacheName?: string; +} + +/** + * Represents the storage for Request / Response object pairs that are cached as + * part of the ServiceWorker life cycle. + */ +interface Cache { + /** + * Returns a Promise that resolves to the response associated with the first + * matching request in the Cache object. + * + * @param request The Request you are attempting to find in the Cache. + * @param {CacheOptions} options + */ + match(request: Request | string, options?: CacheOptions): Promise; + + /** + * Returns a Promise that resolves to an array of all matching requests in + * the Cache object. + * + * @param request The Request you are attempting to find in the Cache. + * @param {CacheOptions} options + */ + matchAll(request: Request | string, options?: CacheOptions): Promise>; + + /** + * Returns a Promise that resolves to a new Cache entry whose key + * is the request. + * + * @param request The Request you want to add to the cache. + */ + add(request: Request | string): Promise; + + /** + * Returns a Promise that resolves to a new array of Cache entries whose + * keys are the requests. + * + * @param request An array of Request objects you want to add to the cache. + */ + addAll(...request: Array): Promise; + + /** + * Adds additional key/value pairs to the current Cache object. + * + * @param request The Request you want to add to the cache. + * @param response The response you want to match up to the request. + */ + put(request: Request, response: Response): Promise; + + /** + * Finds the Cache entry whose key is the request, and if found, deletes the + * Cache entry and returns a Promise that resolves to true. If no Cache + * entry is found, it returns false. + * + * @param request The Request you are looking to delete. + * @param {CacheOptions} options + */ + delete(request: Request | string, options?: CacheOptions): Promise; + + /** + * Returns a Promise that resolves to an array of Cache keys. + * + * @param request The Request want to return, if a specific key is desired. + * @param {CacheOptions} options + */ + keys(request?: Request, options?: CacheOptions): Promise>; +} + +/** + * Represents the storage for Cache objects. It provides a master directory of + * all the named caches that a ServiceWorker can access and maintains a mapping + * of string names to corresponding Cache objects. + */ +interface CacheStorage { + /** + * Checks if a given Request is a key in any of the Cache objects that the + * CacheStorage object tracks and returns a Promise that resolves + * to that match. + * + * @param request The Request you are looking for a match for in the CacheStorage. + * @param {CacheOptions} options + */ + match(request: Request | string, options?: CacheOptions): Promise; + + /** + * Returns a Promise that resolves to true if a Cache object matching + * the cacheName exists. + * + * @param cacheName The Request you are looking for a match for in the + * CacheStorage. + */ + has(cacheName: string): Promise; + + /** + * Returns a Promise that resolves to the Cache object matching + * the cacheName. + * + * @param cacheName The name of the cache you want to open. + */ + open(cacheName: string): Promise; + + /** + * Finds the Cache object matching the cacheName, and if found, deletes the + * Cache object and returns a Promise that resolves to true. If no + * Cache object is found, it returns false. + * + * @param cacheName The name of the cache you want to delete. + */ + delete(cacheName: string): Promise; + + /** + * Returns a Promise that will resolve with an array containing strings + * corresponding to all of the named Cache objects tracked by the + * CacheStorage. Use this method to iterate over a list of all the + * Cache objects. + */ + keys(): Promise>; +} + +/** + * Represents the scope of a service worker client. A service worker client is + * either a document in a browser context or a SharedWorker, which is controlled + * by an active worker. + */ +interface ServiceWorkerClient { + /** + * Allows a service worker client to send a message to a ServiceWorker. + * + * @param message The message to send to the service worker. + * @param [transfer] A transferable object such as, for example, a reference + * to a port. + */ + postMessage(message: string, transfer?: Object): void; + + /** + * Indicates the type of browsing context of the current client. + * This value can be one of auxiliary, top-level, nested, or none. + * @readonly + */ + frameType: string; + + /** + * Returns the id of the Client object. + * @readonly + */ + id: string; + + /** + * The URL of the current service worker client. + * @readonly + */ + url: string; +} + +interface WindowClient extends ServiceWorkerClient { + /** + * Gives user input focus to the current client. + */ + focus(): Promise; + + /** + * A boolean that indicates whether the current client has focus. + * @readonly + */ + focused: boolean; + + /** + * Indicates the visibility of the current client. This value can be one of + * hidden, visible, prerender, or unloaded. + * @readonly + */ + visibilityState: string; +} + +interface ServiceWorkerClientsMatchOptions { + includeUncontrolled?: boolean; + type?: string; +} + +/** + * Represents a container for a list of Client objects; the main way to access + * the active service worker clients at the current origin. + */ +interface ServiceWorkerClients { + /** + * Gets a list of service worker clients and returns them in a Promise. + * Include the options parameter to return all service worker clients whose + * origin is the same as the associated service worker's origin. If options + * are not included, the method returns only the service worker clients + * controlled by the service worker. + * + * @param options + */ + matchAll(options: ServiceWorkerClientsMatchOptions): Promise>; + + /** + * Opens a service worker Client in a new browser window. + * + * @param url A string representing the URL of the client you want to open + * in the window. + */ + openWindow(url: string): Promise; + + /** + * Allows an active Service Worker to set itself as the active worker for a + * client page when the worker and the page are in the same scope. + */ + claim(): Promise; +} + +/** + * Extends the lifetime of the install and activate events dispatched on the + * ServiceWorkerGlobalScope as part of the service worker lifecycle. This + * ensures that any functional events (like FetchEvent) are not dispatched to + * the ServiceWorker until it upgrades database schemas, deletes outdated cache + * entries, etc. + */ +interface ExtendableEvent extends Event { + /** + * Extends the lifetime of the event. + * It is intended to be called in the install EventHandler for the + * installing worker and on the active EventHandler for the active worker. + * + * @param all + */ + waitUntil(all: any): any; +} + +/** + * The parameter passed into the ServiceWorkerGlobalScope.onfetch handler, + * FetchEvent represents a fetch action that is dispatched on the + * ServiceWorkerGlobalScope of a ServiceWorker. It contains information about + * the request and resulting response, and provides the FetchEvent.respondWith() + * method, which allows us to provide an arbitrary response back to the + * controlled page. + */ +interface FetchEvent extends Event { + /** + * Returns a Boolean that is true if the event was dispatched with the + * user's intention for the page to reload, and false otherwise. Typically, + * pressing the refresh button in a browser is a reload, while clicking a + * link and pressing the back button is not. + * @readonly + */ + isReload: boolean; + + /** + * Returns the Request that triggered the event handler. + * @readonly + */ + request: Request; + + /** + * Returns the Client that the current service worker is controlling. + * @readonly + */ + client: ServiceWorkerClient; + + /** + * Resolves by returning a Response or a network error to Fetch. + * + * @param any + */ + respondWith(any): Response; +} + +/** + * Represents a service worker. Multiple browsing contexts (e.g. pages, workers, + * etc.) can be associated with the same ServiceWorker object. + */ +interface ServiceWorker extends Worker { + /** + * Returns the ServiceWorker serialized script URL defined as part of + * ServiceWorkerRegistration. The URL must be on the same origin as the + * document that registers the ServiceWorker. + * @readonly + */ + scriptURL: string; + + /** + * Returns the state of the service worker. It returns one of the following + * values: installing, installed, activating, activated, or redundant. + * @readonly + */ + state: string; + + /** + * An EventListener property called whenever an event of type statechange + * is fired; it is basically fired anytime the ServiceWorker.state changes. + * + * @param [statechangeevent] + */ + onstatechange: (statechangeevent?: Event) => void; +} + +/** + * The PushSubscription interface provides a subcription's URL endpoint and + * subscription ID. + */ +interface PushSubscription { + /** + * The endpoint associated with the push subscription. + * @readonly + */ + endpoint: any; + + /** + * The subscription ID associated with the push subscription. + * @readonly + */ + subscriptionId: any; +} + +/** + * The PushManager interface provides a way to receive notifications from + * third-party servers as well as request URLs for push notifications. + * This interface has replaced functionality offered by the obsolete + * PushRegistrationManager. + */ +interface PushManager { + /** + * Returns a promise that resolves to a PushSubscription with details of a + * new push subscription. + */ + subscribe(): Promise; + + /** + * Returns a promise that resolves to a PushSubscription details of + * the retrieved push subscription. + */ + getSubscription(): Promise; + + /** + * Returns a promise that resolves to the PushPermissionStatus of the + * requesting webapp, which will be one of granted, denied, or default. + */ + hasPermission(): Promise; +} + +/** + * Represents a service worker registration. + */ +interface ServiceWorkerRegistration extends EventTarget { + /** + * Returns a unique identifier for a service worker registration. + * This must be on the same origin as the document that registers + * the ServiceWorker. + * @readonly + */ + scope: any; + + /** + * Returns a service worker whose state is installing. This is initially + * set to null. + * @readonly + */ + installing: ServiceWorker; + + /** + * Returns a service worker whose state is installed. This is initially + * set to null. + * @readonly + */ + waiting: ServiceWorker; + + /** + * Returns a service worker whose state is either activating or activated. + * This is initially set to null. An active worker will control a + * ServiceWorkerClient if the client's URL falls within the scope of the + * registration (the scope option set when ServiceWorkerContainer.register + * is first called). + * @readonly + */ + active: ServiceWorker; + + /** + * Returns an interface to for managing push subscriptions, including + * subcribing, getting an anctive subscription, and accessing push + * permission status. + * @readonly + */ + pushManager: PushManager; + + /** + * An EventListener property called whenever an event of type updatefound + * is fired; it is fired any time the ServiceWorkerRegistration.installing + * property acquires a new service worker. + */ + onupdatefound: () => void; + + /** + * Allows you to update a service worker. + */ + update(); + + /** + * Unregisters the service worker registration and returns a promise + * (see Promise). The service worker will finish any ongoing operations + * before it is unregistered. + */ + unregister(): Promise; +} + +interface ServiceWorkerRegisterOptions { + scope: string; +} + +/** + * Provides an object representing the service worker as an overall unit in the + * network ecosystem, including facilities to register, unregister and update + * service workers, and access the state of service workers + * and their registrations. + */ +interface ServiceWorkerContainer { + /** + * Returns a ServiceWorker object if its state is activated (the same object + * returned by ServiceWorkerRegistration.active). This property returns null + * if the request is a force refresh (Shift + refresh) or if there is no + * active worker. + * @readonly + */ + controller: ServiceWorker; + + /** + * Defines whether a service worker is ready to control a page or not. + * It returns a Promise that will never reject, which resolves to a + * ServiceWorkerRegistration with an ServiceWorkerRegistration.active worker. + * @readonly + */ + ready: Promise; + + /** + * An event handler fired whenever a controllerchange event occurs — when + * the document's associated ServiceWorkerRegistration acquires a new + * ServiceWorkerRegistration.active worker. + * + * @param [controllerchangeevent] + */ + oncontrollerchange: (controllerchangeevent?: Event) => void; + + /** + * An event handler fired whenever an error event occurs in the associated + * service workers. + * + * @param [errorevent] + */ + onerror: (errorevent?: ErrorEvent) => void; + + /** + * An event handler fired whenever a message event occurs — when incoming + * messages are received to the ServiceWorkerContainer object (e.g. via a + * MessagePort.postMessage() call.) + * + * @param [messageevent] + */ + onmessage: (messageevent?: MessageEvent) => void; + + /** + * Creates or updates a ServiceWorkerRegistration for the given scriptURL. + * + * @param scriptURL The URL of the service worker script. + * @param [options] An options object to provide options upon registration. + * Currently available options are: scope: A USVString representing a URL + * that defines a service worker's registration scope; what range of URLs a + * service worker can control. This is usually a relative URL, and it + * defaults to '/' when not specified. + */ + register(scriptURL: string, options?: ServiceWorkerRegisterOptions): Promise; + + /** + * Gets a ServiceWorkerRegistration object whose scope URL matches the + * provided document URL. If the method can't return a + * ServiceWorkerRegistration, it returns a Promise. + * + * @param [scope] A unique identifier for a service worker registration — the + * scope URL of the registration object you want to return. This is usually + * a relative URL. + */ + getRegistration(scope?: string): Promise; + + /** + * Returns all ServiceWorkerRegistrations associated with a + * ServiceWorkerContainer in an array. If the method can't return + * ServiceWorkerRegistrations, it returns a Promise. + */ + getRegistrations(): Promise>; +} + +/** + * The parameter passed into the oninstall handler, the InstallEvent interface + * represents an install action that is dispatched on the + * ServiceWorkerGlobalScope of a ServiceWorker. As a child of ExtendableEvent, + * it ensures that functional events such as FetchEvent are not dispatched + * during installation. + */ +interface InstallEvent extends ExtendableEvent { + /** + * Returns the ServiceWorker that is currently actively controlling the page. + * @readonly + */ + activeWorker: ServiceWorker; +} + +interface ServiceWorkerGlobalScope { + /** + * Contains the Clients object associated with the service worker. + * @readonly + */ + clients: ServiceWorkerClients; + + /** + * Contains the ServiceWorkerRegistration object that represents the + * service worker's registration. + * @readonly + */ + registration: ServiceWorkerRegistration; + + /** + * An event handler fired whenever an activate event occurs — when a + * ServiceWorkerRegistration acquires a new ServiceWorkerRegistration.active + * worker. + * + * @param [activateevent] + */ + onactivate: (activateevent?: ExtendableEvent) => void; + + /** + * Not defined in the spec yet, but it looks like this will be fired when + * the device is nearly out of storage space, prompting the UA to start + * claiming back some space from web apps that are using client-side storage, + * and the current app is targeted. + * + * @param [beforeevictedevent] + */ + onbeforeevicted: (beforeevictedevent?: Event) => void; + + /** + * Not defined in the spec yet, but it looks like this will be fired when + * the device is out of storage space, and the UA claims back some space + * from the current app. + * + * @param [evictedevent] + */ + onevicted: (evictedevent?: Event) => void; + + /** + * An event handler fired whenever a fetch event occurs — when a fetch() + * is called. + * + * @param [fetchevent] + */ + onfetch: (fetchevent?: FetchEvent) => void; + + /** + * An event handler fired whenever an install event occurs — when a + * ServiceWorkerRegistration acquires a new + * ServiceWorkerRegistration.installing worker. + * + * @param [installevent] + */ + oninstall: (installevent?: InstallEvent) => void; + + /** + * An event handler fired whenever a message event occurs — when incoming + * messages are received. Controlled pages can use the + * MessagePort.postMessage() method to send messages to service workers. + * The service worker can optionally send a response back via the + * MessagePort exposed in event.data.port, corresponding to the controlled + * page. + * + * @param [messageevent] + */ + onmessage: (messageevent?: MessageEvent) => void; + + /** + * An event handler fired whenever a notificationclick event occurs — when + * a user clicks on a displayed notification. + * + * @param [notificationclickevent] + */ + onnotificationclick: (notificationclickevent?: NotificationEvent) => void; + + /** + * An event handler fired whenever a push event occurs — when a server + * push notification is received. + * + * @param [onpushevent] + */ + onpush: (onpushevent?: Event) => void; + + /** + * An event handler fired whenever a pushsubscriptionchange event occurs — + * when a push subscription has been invalidated, or is about to be + * invalidated (e.g. when a push service sets an expiration time). + * + * @param [pushsubscriptionchangeevent] + */ + onpushsubscriptionchange: (pushsubscriptionchangeevent?: Event) => void; + + /** + * Allows the current service worker registration to progress from waiting + * to active state while service worker clients are using it. + */ + skipWaiting(): Promise; + + /** + * TODO GlobalFetch + * @param url + * @param init + */ + fetch(url: string | Request, init?: Object): Promise; +} + +interface Navigator { + /** + * Returns a ServiceWorkerContainer object, which provides access to + * registration, removal, upgrade, and communication with the ServiceWorker + * objects for the associated document. + */ + serviceWorker: ServiceWorkerContainer; +} + +interface Window extends ServiceWorkerGlobalScope { + caches: CacheStorage; +} + +interface NotificationEvent extends Event, ExtendableEvent { + notification: any; +} \ No newline at end of file From 8164f9d8b9123bf8c71f555276ef826d7a0a9d37 Mon Sep 17 00:00:00 2001 From: tristancaron Date: Mon, 23 Mar 2015 20:25:42 +0100 Subject: [PATCH 002/415] Revert "Service Worker Api" This reverts commit 80fd9daed79eb612c3c323fa25e1eb01062d56f4. --- service_worker_api/service_worker_api-test.ts | 188 ---- service_worker_api/service_worker_api.d.ts | 896 ------------------ 2 files changed, 1084 deletions(-) delete mode 100644 service_worker_api/service_worker_api-test.ts delete mode 100644 service_worker_api/service_worker_api.d.ts diff --git a/service_worker_api/service_worker_api-test.ts b/service_worker_api/service_worker_api-test.ts deleted file mode 100644 index 67ce58cd40..0000000000 --- a/service_worker_api/service_worker_api-test.ts +++ /dev/null @@ -1,188 +0,0 @@ -/// - -var OFFLINE_CACHE = "cache_test"; -var OFFLINE_URL = "localhost"; - -self.addEventListener('fetch', function(event: FetchEvent) { - if (event.request.method === 'GET' && - event.request.headers.get('accept').indexOf('text/html') !== -1) { - console.log('Handling fetch event for', event.request.url); - event.respondWith( - self.fetch(event.request).catch(function(e) { - console.error('Fetch failed; returning offline page instead.', e); - return self.caches.open(OFFLINE_CACHE).then(function(cache: Cache) { - return cache.match(OFFLINE_URL); - }); - }) - ); - } -}); - -self.caches.open('v1').then(function(cache: Cache) { - cache.matchAll('/images/').then(function(response: Array) { - response.forEach(function(element, index, array) { - cache.delete(element); - - }); - }); - -}); - -self.addEventListener('install', function(event: InstallEvent) { - event.waitUntil( - self.caches.open('v1').then(function(cache: Cache) { - return cache.add('/sw-test/index.html'); - }) - ); -}); - -self.addEventListener('install', function(event: InstallEvent) { - event.waitUntil( - self.caches.open('v1').then(function(cache) { - return cache.addAll( - '/sw-test/', - '/sw-test/index.html', - '/sw-test/style.css', - '/sw-test/app.js', - '/sw-test/image-list.js', - '/sw-test/star-wars-logo.jpg', - '/sw-test/gallery/', - '/sw-test/gallery/bountyHunters.jpg', - '/sw-test/gallery/myLittleVader.jpg', - '/sw-test/gallery/snowTroopers.jpg' - ); - }) - ); -}); - -self.addEventListener('fetch', function(event: FetchEvent) { - var cachedResponse = self.caches.match(event.request).catch(function() { - return self.fetch(event.request).then(function(response: Response) { - return self.caches.open('v1').then(function(cache) { - cache.put(event.request, response.clone()); - return response; - }); - }); - }).catch(function() { - return self.caches.match('/sw-test/gallery/myLittleVader.jpg'); - }); - - event.respondWith(cachedResponse); -}); - -self.caches.open('v1').then(function(cache) { - cache.match('/images/image.png').then(function(response) { - cache.delete(response); - }); -}); - -self.caches.open('v1').then(function(cache: Cache) { - cache.keys().then(function(response) { - response.forEach(function(element, index, array) { - cache.delete(element); - }); - }); -}); - -self.caches.has('v1').then(function() { - self.caches.delete('v1').then(function() { - - }); -}); - -self.addEventListener('activate', function(event: ExtendableEvent) { - var cacheWhitelist = ['v2']; - - event.waitUntil( - self.caches.keys().then(function(keyList) { - for(var i = 0; i < keyList.length; i++) { - if (cacheWhitelist.indexOf(keyList[i]) === -1) { - return self.caches.delete(keyList[i]); - } - } - }) - ); -}); - -function sendMessage(message) { - return new Promise(function(resolve, reject) { - var messageChannel = new MessageChannel(); - messageChannel.port1.onmessage = function(event) { - if (event.data.error) { - reject(event.data.error); - } else { - resolve(event.data); - } - }; - navigator.serviceWorker.controller.postMessage(message, [messageChannel.port2]); - }); -} - -self.clients.matchAll({type: "test"}).then(function(clients) { - for(var i = 0 ; i < clients.length ; i++) { - if(clients[i].url === 'index.html') { - self.clients.openWindow(clients[i].url); - // or do something else involving the matching client - } - } -}); - -self.addEventListener('activate', function(e: ExtendableEvent) { - e.waitUntil(self.clients.claim()); -}); - -navigator.serviceWorker.register('service-worker.js', {scope: './'}).then(function(registration) { - // At this point, registration has taken place. - // The service worker will not handle requests until this page and any - // other instances of this page (in other tabs, etc.) have been - // closed/reloaded. - var serviceWorker; - if (registration.installing) { - serviceWorker = registration.installing; - } else if (registration.waiting) { - serviceWorker = registration.waiting; - } else if (registration.active) { - serviceWorker = registration.active; - } - if (serviceWorker) { - console.log(serviceWorker.state); - serviceWorker.addEventListener('statechange', function(e) { - console.log(e.target.state); - }); - } -}).catch(function(error) { - // Something went wrong during registration. The service-worker.js file - // might be unavailable or contain a syntax error. - -}); - -navigator.serviceWorker.getRegistration('/app').then(function(registration: ServiceWorkerRegistration) { - -}); - -navigator.serviceWorker.getRegistrations().then(function(registrations: Array) { - -}); - -self.registration.unregister(); - -self.addEventListener('install', function(event: ExtendableEvent) { - event.waitUntil(self.skipWaiting()); -}); - -self.addEventListener('notificationclick', function(event: NotificationEvent) { - console.log('On notification click: ', event.notification.tag); - event.notification.close(); - - // This looks to see if the current is already open and - // focuses if it is - event.waitUntil(self.clients.matchAll({ - type: "window" - }).then(function(clientList) { - for (var i = 0; i < clientList.length; i++) { - var client = clientList[i]; - } - if (self.clients.openWindow) - return self.clients.openWindow('/'); - })); -}); \ No newline at end of file diff --git a/service_worker_api/service_worker_api.d.ts b/service_worker_api/service_worker_api.d.ts deleted file mode 100644 index f9b2981463..0000000000 --- a/service_worker_api/service_worker_api.d.ts +++ /dev/null @@ -1,896 +0,0 @@ -// Type definitions for service_worker_api -// Project: https://developer.mozilla.org/fr/docs/Web/API/ServiceWorker_API -// Definitions by: Tristan Caron -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -/** - * Provides methods relating to the body of the response/request, allowing you - * to declare what its content type is and how it should be handled. - */ -interface Body { - /** - * Contains a Boolean that indicates whether the body has been read. - * @readonly - */ - bodyUsed: boolean; - - /** - * Takes a Response stream and reads it to completion. - * It returns a promise that resolves with an ArrayBuffer. - */ - arrayBuffer(): Promise; - - /** - * Takes a Response stream and reads it to completion. - * It returns a promise that resolves with a Blob. - */ - blob(): Promise; - - /** - * Takes a Response stream and reads it to completion. - * It returns a promise that resolves with a FormData object. - */ - formData(): Promise; - - /** - * Takes a Response stream and reads it to completion. - * It returns a promise that resolves with a JSON object. - */ - json(): Promise; - - /** - * Takes a Response stream and reads it to completion. - * It returns a promise that resolves with a USVString (text). - */ - text(): Promise; - -} - -/** - * Represents response/request headers, allowing you to query them and take - * different actions depending on the results. - */ -interface Header { - new(): Header; - - /** - * Appends a new value onto an existing header inside a Headers object, or - * adds the header if it does not already exist. - * - * @param name The name of the HTTP header you want to add to the Headers - * object. - * @param value The value of the HTTP header you want to add. - */ - append(name: string, value: string): void; - - /** - * Deletes a header from a Headers object. - * - * @param name The name of the HTTP header you want to delete from the - * Headers object. - */ - delete(name: string): void; - - /** - * Returns the first value of a given header from within a Headers object. - * - * @param name The name of the HTTP header whose value you want to retrieve - * from the Headers object. If the given name is not the name of an - * HTTP header, this method throws a TypeError. - */ - get(name: string): string; - - /** - * Returns an array of all the values of a header within a Headers object - * with a given name. - * - * @param name The name of the HTTP header whose values you want to retrieve - * from the Headers object. If the given name is not the name of an - * HTTP header, this method throws a TypeError. - */ - getAll(name:string): Array; - - /** - * Returns a boolean stating whether a Headers object contains a - * certain header. - * - * @param name The name of the HTTP header you want to test for. If the - * given name is not the name of an HTTP header, this method throws - * a TypeError. - */ - has(name: string): boolean; - - /** - * Sets a new value for an existing header inside a Headers object, or - * adds the header if it does not already exist. - * - * @param name The name of the HTTP header you want to set to a new value. - * If the given name is not the name of an HTTP header, this method throws - * a TypeError. - * @param value The new value you want to set. - */ - set(name: string, value: string): void; -} - -/** - * Represents the response to a request. - */ -interface Response extends Body { - new(): Response; - - /** - * Contains the type of the response (e.g., basic, cors). - * @readonly - */ - type: string; - - /** - * Contains the URL of the response. - * @readonly - */ - url: string; - - /** - * Contains a boolean stating whether this is the final URL of the response. - */ - useFinalURL: boolean; - - /** - * Contains the status code of the response (e.g., 200 for a success). - * @readonly - */ - status: number; - - /** - * Contains a boolean stating whether the response was successful - * (status in the range 200-299) or not. - * @readonly - */ - ok: boolean; - - /** - * Contains the status message corresponding to the status code - * (e.g., OK for 200). - * @readonly - */ - statusText: string; - - /** - * Contains the Headers object associated with the response. - * @readonly - */ - headers: Header; - - /** - * Creates a clone of a Response object. - */ - clone(): Response; - - /** - * Returns a new Response object associated with a network error. - */ - error(): Response; - - /** - * Creates a new response with a different URL. - */ - redirect(): Response; -} - -/** - * Represents a resource request. - */ -interface Request extends Body { - new(): Request; - - /** - * Contains the request's method (GET, POST, etc.). - * @readonly - */ - method: string; - - /** - * Contains the URL of the request. - * @readonly - */ - url: string; - - /** - * Contains the associated Headers object of the request. - * @readonly - */ - headers: Header; - - /** - * Contains the context of the request (e.g., audio, image, iframe, etc.). - * @readonly - */ - context: string; - - /** - * Contains the referrer of the request (e.g., client). - * @readonly - */ - referrer: string; - - /** - * Contains the mode of the request (e.g., cors, no-cors, same-origin). - * @readonly - */ - mode: string; - - /** - * Contains the credentials of the request (e.g., omit, same-origin). - * @readonly - */ - credentials: string; - - /** - * Contains the cache mode of the request (e.g., default, reload, no-cache). - * @readonly - */ - cache: string; - - /** - * Creates a copy of the current Request object. - */ - clone(): Request; -} - -/** - * An CacheOptions object allowing you to set specific control options for the - * matching done in the match operation. - * - * @property [ignoreSearch] A Boolean that specifies whether the matching - * process should ignore the query string in the url. If set to true, - * the ?value=bar part of http://foo.com/?value=bar would be ignored when - * performing a match. It defaults to false. - * - * @property [ignoreMethod] A Boolean that, when set to true, prevents matching - * operations from validating the Request http method (normally only GET - * and HEAD are allowed.) It defaults to false. - * - * @property [ignoreVary] A Boolean that when set to true tells the matching - * operation not to perform VARY header matching — i.e. if the URL matches you - * will get a match regardless of the Response object having a VARY header or - * not. It defaults to false. - * - * @property [cacheName] A DOMString that represents a specific cache to search - * within. Note that this option is ignored by Cache.match(). - */ -interface CacheOptions { - ignoreSearch?: boolean; - ignoreMethod?: boolean; - ignoreVary?: boolean; - cacheName?: string; -} - -/** - * Represents the storage for Request / Response object pairs that are cached as - * part of the ServiceWorker life cycle. - */ -interface Cache { - /** - * Returns a Promise that resolves to the response associated with the first - * matching request in the Cache object. - * - * @param request The Request you are attempting to find in the Cache. - * @param {CacheOptions} options - */ - match(request: Request | string, options?: CacheOptions): Promise; - - /** - * Returns a Promise that resolves to an array of all matching requests in - * the Cache object. - * - * @param request The Request you are attempting to find in the Cache. - * @param {CacheOptions} options - */ - matchAll(request: Request | string, options?: CacheOptions): Promise>; - - /** - * Returns a Promise that resolves to a new Cache entry whose key - * is the request. - * - * @param request The Request you want to add to the cache. - */ - add(request: Request | string): Promise; - - /** - * Returns a Promise that resolves to a new array of Cache entries whose - * keys are the requests. - * - * @param request An array of Request objects you want to add to the cache. - */ - addAll(...request: Array): Promise; - - /** - * Adds additional key/value pairs to the current Cache object. - * - * @param request The Request you want to add to the cache. - * @param response The response you want to match up to the request. - */ - put(request: Request, response: Response): Promise; - - /** - * Finds the Cache entry whose key is the request, and if found, deletes the - * Cache entry and returns a Promise that resolves to true. If no Cache - * entry is found, it returns false. - * - * @param request The Request you are looking to delete. - * @param {CacheOptions} options - */ - delete(request: Request | string, options?: CacheOptions): Promise; - - /** - * Returns a Promise that resolves to an array of Cache keys. - * - * @param request The Request want to return, if a specific key is desired. - * @param {CacheOptions} options - */ - keys(request?: Request, options?: CacheOptions): Promise>; -} - -/** - * Represents the storage for Cache objects. It provides a master directory of - * all the named caches that a ServiceWorker can access and maintains a mapping - * of string names to corresponding Cache objects. - */ -interface CacheStorage { - /** - * Checks if a given Request is a key in any of the Cache objects that the - * CacheStorage object tracks and returns a Promise that resolves - * to that match. - * - * @param request The Request you are looking for a match for in the CacheStorage. - * @param {CacheOptions} options - */ - match(request: Request | string, options?: CacheOptions): Promise; - - /** - * Returns a Promise that resolves to true if a Cache object matching - * the cacheName exists. - * - * @param cacheName The Request you are looking for a match for in the - * CacheStorage. - */ - has(cacheName: string): Promise; - - /** - * Returns a Promise that resolves to the Cache object matching - * the cacheName. - * - * @param cacheName The name of the cache you want to open. - */ - open(cacheName: string): Promise; - - /** - * Finds the Cache object matching the cacheName, and if found, deletes the - * Cache object and returns a Promise that resolves to true. If no - * Cache object is found, it returns false. - * - * @param cacheName The name of the cache you want to delete. - */ - delete(cacheName: string): Promise; - - /** - * Returns a Promise that will resolve with an array containing strings - * corresponding to all of the named Cache objects tracked by the - * CacheStorage. Use this method to iterate over a list of all the - * Cache objects. - */ - keys(): Promise>; -} - -/** - * Represents the scope of a service worker client. A service worker client is - * either a document in a browser context or a SharedWorker, which is controlled - * by an active worker. - */ -interface ServiceWorkerClient { - /** - * Allows a service worker client to send a message to a ServiceWorker. - * - * @param message The message to send to the service worker. - * @param [transfer] A transferable object such as, for example, a reference - * to a port. - */ - postMessage(message: string, transfer?: Object): void; - - /** - * Indicates the type of browsing context of the current client. - * This value can be one of auxiliary, top-level, nested, or none. - * @readonly - */ - frameType: string; - - /** - * Returns the id of the Client object. - * @readonly - */ - id: string; - - /** - * The URL of the current service worker client. - * @readonly - */ - url: string; -} - -interface WindowClient extends ServiceWorkerClient { - /** - * Gives user input focus to the current client. - */ - focus(): Promise; - - /** - * A boolean that indicates whether the current client has focus. - * @readonly - */ - focused: boolean; - - /** - * Indicates the visibility of the current client. This value can be one of - * hidden, visible, prerender, or unloaded. - * @readonly - */ - visibilityState: string; -} - -interface ServiceWorkerClientsMatchOptions { - includeUncontrolled?: boolean; - type?: string; -} - -/** - * Represents a container for a list of Client objects; the main way to access - * the active service worker clients at the current origin. - */ -interface ServiceWorkerClients { - /** - * Gets a list of service worker clients and returns them in a Promise. - * Include the options parameter to return all service worker clients whose - * origin is the same as the associated service worker's origin. If options - * are not included, the method returns only the service worker clients - * controlled by the service worker. - * - * @param options - */ - matchAll(options: ServiceWorkerClientsMatchOptions): Promise>; - - /** - * Opens a service worker Client in a new browser window. - * - * @param url A string representing the URL of the client you want to open - * in the window. - */ - openWindow(url: string): Promise; - - /** - * Allows an active Service Worker to set itself as the active worker for a - * client page when the worker and the page are in the same scope. - */ - claim(): Promise; -} - -/** - * Extends the lifetime of the install and activate events dispatched on the - * ServiceWorkerGlobalScope as part of the service worker lifecycle. This - * ensures that any functional events (like FetchEvent) are not dispatched to - * the ServiceWorker until it upgrades database schemas, deletes outdated cache - * entries, etc. - */ -interface ExtendableEvent extends Event { - /** - * Extends the lifetime of the event. - * It is intended to be called in the install EventHandler for the - * installing worker and on the active EventHandler for the active worker. - * - * @param all - */ - waitUntil(all: any): any; -} - -/** - * The parameter passed into the ServiceWorkerGlobalScope.onfetch handler, - * FetchEvent represents a fetch action that is dispatched on the - * ServiceWorkerGlobalScope of a ServiceWorker. It contains information about - * the request and resulting response, and provides the FetchEvent.respondWith() - * method, which allows us to provide an arbitrary response back to the - * controlled page. - */ -interface FetchEvent extends Event { - /** - * Returns a Boolean that is true if the event was dispatched with the - * user's intention for the page to reload, and false otherwise. Typically, - * pressing the refresh button in a browser is a reload, while clicking a - * link and pressing the back button is not. - * @readonly - */ - isReload: boolean; - - /** - * Returns the Request that triggered the event handler. - * @readonly - */ - request: Request; - - /** - * Returns the Client that the current service worker is controlling. - * @readonly - */ - client: ServiceWorkerClient; - - /** - * Resolves by returning a Response or a network error to Fetch. - * - * @param any - */ - respondWith(any): Response; -} - -/** - * Represents a service worker. Multiple browsing contexts (e.g. pages, workers, - * etc.) can be associated with the same ServiceWorker object. - */ -interface ServiceWorker extends Worker { - /** - * Returns the ServiceWorker serialized script URL defined as part of - * ServiceWorkerRegistration. The URL must be on the same origin as the - * document that registers the ServiceWorker. - * @readonly - */ - scriptURL: string; - - /** - * Returns the state of the service worker. It returns one of the following - * values: installing, installed, activating, activated, or redundant. - * @readonly - */ - state: string; - - /** - * An EventListener property called whenever an event of type statechange - * is fired; it is basically fired anytime the ServiceWorker.state changes. - * - * @param [statechangeevent] - */ - onstatechange: (statechangeevent?: Event) => void; -} - -/** - * The PushSubscription interface provides a subcription's URL endpoint and - * subscription ID. - */ -interface PushSubscription { - /** - * The endpoint associated with the push subscription. - * @readonly - */ - endpoint: any; - - /** - * The subscription ID associated with the push subscription. - * @readonly - */ - subscriptionId: any; -} - -/** - * The PushManager interface provides a way to receive notifications from - * third-party servers as well as request URLs for push notifications. - * This interface has replaced functionality offered by the obsolete - * PushRegistrationManager. - */ -interface PushManager { - /** - * Returns a promise that resolves to a PushSubscription with details of a - * new push subscription. - */ - subscribe(): Promise; - - /** - * Returns a promise that resolves to a PushSubscription details of - * the retrieved push subscription. - */ - getSubscription(): Promise; - - /** - * Returns a promise that resolves to the PushPermissionStatus of the - * requesting webapp, which will be one of granted, denied, or default. - */ - hasPermission(): Promise; -} - -/** - * Represents a service worker registration. - */ -interface ServiceWorkerRegistration extends EventTarget { - /** - * Returns a unique identifier for a service worker registration. - * This must be on the same origin as the document that registers - * the ServiceWorker. - * @readonly - */ - scope: any; - - /** - * Returns a service worker whose state is installing. This is initially - * set to null. - * @readonly - */ - installing: ServiceWorker; - - /** - * Returns a service worker whose state is installed. This is initially - * set to null. - * @readonly - */ - waiting: ServiceWorker; - - /** - * Returns a service worker whose state is either activating or activated. - * This is initially set to null. An active worker will control a - * ServiceWorkerClient if the client's URL falls within the scope of the - * registration (the scope option set when ServiceWorkerContainer.register - * is first called). - * @readonly - */ - active: ServiceWorker; - - /** - * Returns an interface to for managing push subscriptions, including - * subcribing, getting an anctive subscription, and accessing push - * permission status. - * @readonly - */ - pushManager: PushManager; - - /** - * An EventListener property called whenever an event of type updatefound - * is fired; it is fired any time the ServiceWorkerRegistration.installing - * property acquires a new service worker. - */ - onupdatefound: () => void; - - /** - * Allows you to update a service worker. - */ - update(); - - /** - * Unregisters the service worker registration and returns a promise - * (see Promise). The service worker will finish any ongoing operations - * before it is unregistered. - */ - unregister(): Promise; -} - -interface ServiceWorkerRegisterOptions { - scope: string; -} - -/** - * Provides an object representing the service worker as an overall unit in the - * network ecosystem, including facilities to register, unregister and update - * service workers, and access the state of service workers - * and their registrations. - */ -interface ServiceWorkerContainer { - /** - * Returns a ServiceWorker object if its state is activated (the same object - * returned by ServiceWorkerRegistration.active). This property returns null - * if the request is a force refresh (Shift + refresh) or if there is no - * active worker. - * @readonly - */ - controller: ServiceWorker; - - /** - * Defines whether a service worker is ready to control a page or not. - * It returns a Promise that will never reject, which resolves to a - * ServiceWorkerRegistration with an ServiceWorkerRegistration.active worker. - * @readonly - */ - ready: Promise; - - /** - * An event handler fired whenever a controllerchange event occurs — when - * the document's associated ServiceWorkerRegistration acquires a new - * ServiceWorkerRegistration.active worker. - * - * @param [controllerchangeevent] - */ - oncontrollerchange: (controllerchangeevent?: Event) => void; - - /** - * An event handler fired whenever an error event occurs in the associated - * service workers. - * - * @param [errorevent] - */ - onerror: (errorevent?: ErrorEvent) => void; - - /** - * An event handler fired whenever a message event occurs — when incoming - * messages are received to the ServiceWorkerContainer object (e.g. via a - * MessagePort.postMessage() call.) - * - * @param [messageevent] - */ - onmessage: (messageevent?: MessageEvent) => void; - - /** - * Creates or updates a ServiceWorkerRegistration for the given scriptURL. - * - * @param scriptURL The URL of the service worker script. - * @param [options] An options object to provide options upon registration. - * Currently available options are: scope: A USVString representing a URL - * that defines a service worker's registration scope; what range of URLs a - * service worker can control. This is usually a relative URL, and it - * defaults to '/' when not specified. - */ - register(scriptURL: string, options?: ServiceWorkerRegisterOptions): Promise; - - /** - * Gets a ServiceWorkerRegistration object whose scope URL matches the - * provided document URL. If the method can't return a - * ServiceWorkerRegistration, it returns a Promise. - * - * @param [scope] A unique identifier for a service worker registration — the - * scope URL of the registration object you want to return. This is usually - * a relative URL. - */ - getRegistration(scope?: string): Promise; - - /** - * Returns all ServiceWorkerRegistrations associated with a - * ServiceWorkerContainer in an array. If the method can't return - * ServiceWorkerRegistrations, it returns a Promise. - */ - getRegistrations(): Promise>; -} - -/** - * The parameter passed into the oninstall handler, the InstallEvent interface - * represents an install action that is dispatched on the - * ServiceWorkerGlobalScope of a ServiceWorker. As a child of ExtendableEvent, - * it ensures that functional events such as FetchEvent are not dispatched - * during installation. - */ -interface InstallEvent extends ExtendableEvent { - /** - * Returns the ServiceWorker that is currently actively controlling the page. - * @readonly - */ - activeWorker: ServiceWorker; -} - -interface ServiceWorkerGlobalScope { - /** - * Contains the Clients object associated with the service worker. - * @readonly - */ - clients: ServiceWorkerClients; - - /** - * Contains the ServiceWorkerRegistration object that represents the - * service worker's registration. - * @readonly - */ - registration: ServiceWorkerRegistration; - - /** - * An event handler fired whenever an activate event occurs — when a - * ServiceWorkerRegistration acquires a new ServiceWorkerRegistration.active - * worker. - * - * @param [activateevent] - */ - onactivate: (activateevent?: ExtendableEvent) => void; - - /** - * Not defined in the spec yet, but it looks like this will be fired when - * the device is nearly out of storage space, prompting the UA to start - * claiming back some space from web apps that are using client-side storage, - * and the current app is targeted. - * - * @param [beforeevictedevent] - */ - onbeforeevicted: (beforeevictedevent?: Event) => void; - - /** - * Not defined in the spec yet, but it looks like this will be fired when - * the device is out of storage space, and the UA claims back some space - * from the current app. - * - * @param [evictedevent] - */ - onevicted: (evictedevent?: Event) => void; - - /** - * An event handler fired whenever a fetch event occurs — when a fetch() - * is called. - * - * @param [fetchevent] - */ - onfetch: (fetchevent?: FetchEvent) => void; - - /** - * An event handler fired whenever an install event occurs — when a - * ServiceWorkerRegistration acquires a new - * ServiceWorkerRegistration.installing worker. - * - * @param [installevent] - */ - oninstall: (installevent?: InstallEvent) => void; - - /** - * An event handler fired whenever a message event occurs — when incoming - * messages are received. Controlled pages can use the - * MessagePort.postMessage() method to send messages to service workers. - * The service worker can optionally send a response back via the - * MessagePort exposed in event.data.port, corresponding to the controlled - * page. - * - * @param [messageevent] - */ - onmessage: (messageevent?: MessageEvent) => void; - - /** - * An event handler fired whenever a notificationclick event occurs — when - * a user clicks on a displayed notification. - * - * @param [notificationclickevent] - */ - onnotificationclick: (notificationclickevent?: NotificationEvent) => void; - - /** - * An event handler fired whenever a push event occurs — when a server - * push notification is received. - * - * @param [onpushevent] - */ - onpush: (onpushevent?: Event) => void; - - /** - * An event handler fired whenever a pushsubscriptionchange event occurs — - * when a push subscription has been invalidated, or is about to be - * invalidated (e.g. when a push service sets an expiration time). - * - * @param [pushsubscriptionchangeevent] - */ - onpushsubscriptionchange: (pushsubscriptionchangeevent?: Event) => void; - - /** - * Allows the current service worker registration to progress from waiting - * to active state while service worker clients are using it. - */ - skipWaiting(): Promise; - - /** - * TODO GlobalFetch - * @param url - * @param init - */ - fetch(url: string | Request, init?: Object): Promise; -} - -interface Navigator { - /** - * Returns a ServiceWorkerContainer object, which provides access to - * registration, removal, upgrade, and communication with the ServiceWorker - * objects for the associated document. - */ - serviceWorker: ServiceWorkerContainer; -} - -interface Window extends ServiceWorkerGlobalScope { - caches: CacheStorage; -} - -interface NotificationEvent extends Event, ExtendableEvent { - notification: any; -} \ No newline at end of file From 9c55d70b9b91c4a7d95a0993313e9e5e8541890a Mon Sep 17 00:00:00 2001 From: tristancaron Date: Mon, 23 Mar 2015 20:26:39 +0100 Subject: [PATCH 003/415] Revert "Revert "Service Worker Api"" This reverts commit 8164f9d8b9123bf8c71f555276ef826d7a0a9d37. --- service_worker_api/service_worker_api-test.ts | 188 ++++ service_worker_api/service_worker_api.d.ts | 896 ++++++++++++++++++ 2 files changed, 1084 insertions(+) create mode 100644 service_worker_api/service_worker_api-test.ts create mode 100644 service_worker_api/service_worker_api.d.ts diff --git a/service_worker_api/service_worker_api-test.ts b/service_worker_api/service_worker_api-test.ts new file mode 100644 index 0000000000..67ce58cd40 --- /dev/null +++ b/service_worker_api/service_worker_api-test.ts @@ -0,0 +1,188 @@ +/// + +var OFFLINE_CACHE = "cache_test"; +var OFFLINE_URL = "localhost"; + +self.addEventListener('fetch', function(event: FetchEvent) { + if (event.request.method === 'GET' && + event.request.headers.get('accept').indexOf('text/html') !== -1) { + console.log('Handling fetch event for', event.request.url); + event.respondWith( + self.fetch(event.request).catch(function(e) { + console.error('Fetch failed; returning offline page instead.', e); + return self.caches.open(OFFLINE_CACHE).then(function(cache: Cache) { + return cache.match(OFFLINE_URL); + }); + }) + ); + } +}); + +self.caches.open('v1').then(function(cache: Cache) { + cache.matchAll('/images/').then(function(response: Array) { + response.forEach(function(element, index, array) { + cache.delete(element); + + }); + }); + +}); + +self.addEventListener('install', function(event: InstallEvent) { + event.waitUntil( + self.caches.open('v1').then(function(cache: Cache) { + return cache.add('/sw-test/index.html'); + }) + ); +}); + +self.addEventListener('install', function(event: InstallEvent) { + event.waitUntil( + self.caches.open('v1').then(function(cache) { + return cache.addAll( + '/sw-test/', + '/sw-test/index.html', + '/sw-test/style.css', + '/sw-test/app.js', + '/sw-test/image-list.js', + '/sw-test/star-wars-logo.jpg', + '/sw-test/gallery/', + '/sw-test/gallery/bountyHunters.jpg', + '/sw-test/gallery/myLittleVader.jpg', + '/sw-test/gallery/snowTroopers.jpg' + ); + }) + ); +}); + +self.addEventListener('fetch', function(event: FetchEvent) { + var cachedResponse = self.caches.match(event.request).catch(function() { + return self.fetch(event.request).then(function(response: Response) { + return self.caches.open('v1').then(function(cache) { + cache.put(event.request, response.clone()); + return response; + }); + }); + }).catch(function() { + return self.caches.match('/sw-test/gallery/myLittleVader.jpg'); + }); + + event.respondWith(cachedResponse); +}); + +self.caches.open('v1').then(function(cache) { + cache.match('/images/image.png').then(function(response) { + cache.delete(response); + }); +}); + +self.caches.open('v1').then(function(cache: Cache) { + cache.keys().then(function(response) { + response.forEach(function(element, index, array) { + cache.delete(element); + }); + }); +}); + +self.caches.has('v1').then(function() { + self.caches.delete('v1').then(function() { + + }); +}); + +self.addEventListener('activate', function(event: ExtendableEvent) { + var cacheWhitelist = ['v2']; + + event.waitUntil( + self.caches.keys().then(function(keyList) { + for(var i = 0; i < keyList.length; i++) { + if (cacheWhitelist.indexOf(keyList[i]) === -1) { + return self.caches.delete(keyList[i]); + } + } + }) + ); +}); + +function sendMessage(message) { + return new Promise(function(resolve, reject) { + var messageChannel = new MessageChannel(); + messageChannel.port1.onmessage = function(event) { + if (event.data.error) { + reject(event.data.error); + } else { + resolve(event.data); + } + }; + navigator.serviceWorker.controller.postMessage(message, [messageChannel.port2]); + }); +} + +self.clients.matchAll({type: "test"}).then(function(clients) { + for(var i = 0 ; i < clients.length ; i++) { + if(clients[i].url === 'index.html') { + self.clients.openWindow(clients[i].url); + // or do something else involving the matching client + } + } +}); + +self.addEventListener('activate', function(e: ExtendableEvent) { + e.waitUntil(self.clients.claim()); +}); + +navigator.serviceWorker.register('service-worker.js', {scope: './'}).then(function(registration) { + // At this point, registration has taken place. + // The service worker will not handle requests until this page and any + // other instances of this page (in other tabs, etc.) have been + // closed/reloaded. + var serviceWorker; + if (registration.installing) { + serviceWorker = registration.installing; + } else if (registration.waiting) { + serviceWorker = registration.waiting; + } else if (registration.active) { + serviceWorker = registration.active; + } + if (serviceWorker) { + console.log(serviceWorker.state); + serviceWorker.addEventListener('statechange', function(e) { + console.log(e.target.state); + }); + } +}).catch(function(error) { + // Something went wrong during registration. The service-worker.js file + // might be unavailable or contain a syntax error. + +}); + +navigator.serviceWorker.getRegistration('/app').then(function(registration: ServiceWorkerRegistration) { + +}); + +navigator.serviceWorker.getRegistrations().then(function(registrations: Array) { + +}); + +self.registration.unregister(); + +self.addEventListener('install', function(event: ExtendableEvent) { + event.waitUntil(self.skipWaiting()); +}); + +self.addEventListener('notificationclick', function(event: NotificationEvent) { + console.log('On notification click: ', event.notification.tag); + event.notification.close(); + + // This looks to see if the current is already open and + // focuses if it is + event.waitUntil(self.clients.matchAll({ + type: "window" + }).then(function(clientList) { + for (var i = 0; i < clientList.length; i++) { + var client = clientList[i]; + } + if (self.clients.openWindow) + return self.clients.openWindow('/'); + })); +}); \ No newline at end of file diff --git a/service_worker_api/service_worker_api.d.ts b/service_worker_api/service_worker_api.d.ts new file mode 100644 index 0000000000..f9b2981463 --- /dev/null +++ b/service_worker_api/service_worker_api.d.ts @@ -0,0 +1,896 @@ +// Type definitions for service_worker_api +// Project: https://developer.mozilla.org/fr/docs/Web/API/ServiceWorker_API +// Definitions by: Tristan Caron +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/** + * Provides methods relating to the body of the response/request, allowing you + * to declare what its content type is and how it should be handled. + */ +interface Body { + /** + * Contains a Boolean that indicates whether the body has been read. + * @readonly + */ + bodyUsed: boolean; + + /** + * Takes a Response stream and reads it to completion. + * It returns a promise that resolves with an ArrayBuffer. + */ + arrayBuffer(): Promise; + + /** + * Takes a Response stream and reads it to completion. + * It returns a promise that resolves with a Blob. + */ + blob(): Promise; + + /** + * Takes a Response stream and reads it to completion. + * It returns a promise that resolves with a FormData object. + */ + formData(): Promise; + + /** + * Takes a Response stream and reads it to completion. + * It returns a promise that resolves with a JSON object. + */ + json(): Promise; + + /** + * Takes a Response stream and reads it to completion. + * It returns a promise that resolves with a USVString (text). + */ + text(): Promise; + +} + +/** + * Represents response/request headers, allowing you to query them and take + * different actions depending on the results. + */ +interface Header { + new(): Header; + + /** + * Appends a new value onto an existing header inside a Headers object, or + * adds the header if it does not already exist. + * + * @param name The name of the HTTP header you want to add to the Headers + * object. + * @param value The value of the HTTP header you want to add. + */ + append(name: string, value: string): void; + + /** + * Deletes a header from a Headers object. + * + * @param name The name of the HTTP header you want to delete from the + * Headers object. + */ + delete(name: string): void; + + /** + * Returns the first value of a given header from within a Headers object. + * + * @param name The name of the HTTP header whose value you want to retrieve + * from the Headers object. If the given name is not the name of an + * HTTP header, this method throws a TypeError. + */ + get(name: string): string; + + /** + * Returns an array of all the values of a header within a Headers object + * with a given name. + * + * @param name The name of the HTTP header whose values you want to retrieve + * from the Headers object. If the given name is not the name of an + * HTTP header, this method throws a TypeError. + */ + getAll(name:string): Array; + + /** + * Returns a boolean stating whether a Headers object contains a + * certain header. + * + * @param name The name of the HTTP header you want to test for. If the + * given name is not the name of an HTTP header, this method throws + * a TypeError. + */ + has(name: string): boolean; + + /** + * Sets a new value for an existing header inside a Headers object, or + * adds the header if it does not already exist. + * + * @param name The name of the HTTP header you want to set to a new value. + * If the given name is not the name of an HTTP header, this method throws + * a TypeError. + * @param value The new value you want to set. + */ + set(name: string, value: string): void; +} + +/** + * Represents the response to a request. + */ +interface Response extends Body { + new(): Response; + + /** + * Contains the type of the response (e.g., basic, cors). + * @readonly + */ + type: string; + + /** + * Contains the URL of the response. + * @readonly + */ + url: string; + + /** + * Contains a boolean stating whether this is the final URL of the response. + */ + useFinalURL: boolean; + + /** + * Contains the status code of the response (e.g., 200 for a success). + * @readonly + */ + status: number; + + /** + * Contains a boolean stating whether the response was successful + * (status in the range 200-299) or not. + * @readonly + */ + ok: boolean; + + /** + * Contains the status message corresponding to the status code + * (e.g., OK for 200). + * @readonly + */ + statusText: string; + + /** + * Contains the Headers object associated with the response. + * @readonly + */ + headers: Header; + + /** + * Creates a clone of a Response object. + */ + clone(): Response; + + /** + * Returns a new Response object associated with a network error. + */ + error(): Response; + + /** + * Creates a new response with a different URL. + */ + redirect(): Response; +} + +/** + * Represents a resource request. + */ +interface Request extends Body { + new(): Request; + + /** + * Contains the request's method (GET, POST, etc.). + * @readonly + */ + method: string; + + /** + * Contains the URL of the request. + * @readonly + */ + url: string; + + /** + * Contains the associated Headers object of the request. + * @readonly + */ + headers: Header; + + /** + * Contains the context of the request (e.g., audio, image, iframe, etc.). + * @readonly + */ + context: string; + + /** + * Contains the referrer of the request (e.g., client). + * @readonly + */ + referrer: string; + + /** + * Contains the mode of the request (e.g., cors, no-cors, same-origin). + * @readonly + */ + mode: string; + + /** + * Contains the credentials of the request (e.g., omit, same-origin). + * @readonly + */ + credentials: string; + + /** + * Contains the cache mode of the request (e.g., default, reload, no-cache). + * @readonly + */ + cache: string; + + /** + * Creates a copy of the current Request object. + */ + clone(): Request; +} + +/** + * An CacheOptions object allowing you to set specific control options for the + * matching done in the match operation. + * + * @property [ignoreSearch] A Boolean that specifies whether the matching + * process should ignore the query string in the url. If set to true, + * the ?value=bar part of http://foo.com/?value=bar would be ignored when + * performing a match. It defaults to false. + * + * @property [ignoreMethod] A Boolean that, when set to true, prevents matching + * operations from validating the Request http method (normally only GET + * and HEAD are allowed.) It defaults to false. + * + * @property [ignoreVary] A Boolean that when set to true tells the matching + * operation not to perform VARY header matching — i.e. if the URL matches you + * will get a match regardless of the Response object having a VARY header or + * not. It defaults to false. + * + * @property [cacheName] A DOMString that represents a specific cache to search + * within. Note that this option is ignored by Cache.match(). + */ +interface CacheOptions { + ignoreSearch?: boolean; + ignoreMethod?: boolean; + ignoreVary?: boolean; + cacheName?: string; +} + +/** + * Represents the storage for Request / Response object pairs that are cached as + * part of the ServiceWorker life cycle. + */ +interface Cache { + /** + * Returns a Promise that resolves to the response associated with the first + * matching request in the Cache object. + * + * @param request The Request you are attempting to find in the Cache. + * @param {CacheOptions} options + */ + match(request: Request | string, options?: CacheOptions): Promise; + + /** + * Returns a Promise that resolves to an array of all matching requests in + * the Cache object. + * + * @param request The Request you are attempting to find in the Cache. + * @param {CacheOptions} options + */ + matchAll(request: Request | string, options?: CacheOptions): Promise>; + + /** + * Returns a Promise that resolves to a new Cache entry whose key + * is the request. + * + * @param request The Request you want to add to the cache. + */ + add(request: Request | string): Promise; + + /** + * Returns a Promise that resolves to a new array of Cache entries whose + * keys are the requests. + * + * @param request An array of Request objects you want to add to the cache. + */ + addAll(...request: Array): Promise; + + /** + * Adds additional key/value pairs to the current Cache object. + * + * @param request The Request you want to add to the cache. + * @param response The response you want to match up to the request. + */ + put(request: Request, response: Response): Promise; + + /** + * Finds the Cache entry whose key is the request, and if found, deletes the + * Cache entry and returns a Promise that resolves to true. If no Cache + * entry is found, it returns false. + * + * @param request The Request you are looking to delete. + * @param {CacheOptions} options + */ + delete(request: Request | string, options?: CacheOptions): Promise; + + /** + * Returns a Promise that resolves to an array of Cache keys. + * + * @param request The Request want to return, if a specific key is desired. + * @param {CacheOptions} options + */ + keys(request?: Request, options?: CacheOptions): Promise>; +} + +/** + * Represents the storage for Cache objects. It provides a master directory of + * all the named caches that a ServiceWorker can access and maintains a mapping + * of string names to corresponding Cache objects. + */ +interface CacheStorage { + /** + * Checks if a given Request is a key in any of the Cache objects that the + * CacheStorage object tracks and returns a Promise that resolves + * to that match. + * + * @param request The Request you are looking for a match for in the CacheStorage. + * @param {CacheOptions} options + */ + match(request: Request | string, options?: CacheOptions): Promise; + + /** + * Returns a Promise that resolves to true if a Cache object matching + * the cacheName exists. + * + * @param cacheName The Request you are looking for a match for in the + * CacheStorage. + */ + has(cacheName: string): Promise; + + /** + * Returns a Promise that resolves to the Cache object matching + * the cacheName. + * + * @param cacheName The name of the cache you want to open. + */ + open(cacheName: string): Promise; + + /** + * Finds the Cache object matching the cacheName, and if found, deletes the + * Cache object and returns a Promise that resolves to true. If no + * Cache object is found, it returns false. + * + * @param cacheName The name of the cache you want to delete. + */ + delete(cacheName: string): Promise; + + /** + * Returns a Promise that will resolve with an array containing strings + * corresponding to all of the named Cache objects tracked by the + * CacheStorage. Use this method to iterate over a list of all the + * Cache objects. + */ + keys(): Promise>; +} + +/** + * Represents the scope of a service worker client. A service worker client is + * either a document in a browser context or a SharedWorker, which is controlled + * by an active worker. + */ +interface ServiceWorkerClient { + /** + * Allows a service worker client to send a message to a ServiceWorker. + * + * @param message The message to send to the service worker. + * @param [transfer] A transferable object such as, for example, a reference + * to a port. + */ + postMessage(message: string, transfer?: Object): void; + + /** + * Indicates the type of browsing context of the current client. + * This value can be one of auxiliary, top-level, nested, or none. + * @readonly + */ + frameType: string; + + /** + * Returns the id of the Client object. + * @readonly + */ + id: string; + + /** + * The URL of the current service worker client. + * @readonly + */ + url: string; +} + +interface WindowClient extends ServiceWorkerClient { + /** + * Gives user input focus to the current client. + */ + focus(): Promise; + + /** + * A boolean that indicates whether the current client has focus. + * @readonly + */ + focused: boolean; + + /** + * Indicates the visibility of the current client. This value can be one of + * hidden, visible, prerender, or unloaded. + * @readonly + */ + visibilityState: string; +} + +interface ServiceWorkerClientsMatchOptions { + includeUncontrolled?: boolean; + type?: string; +} + +/** + * Represents a container for a list of Client objects; the main way to access + * the active service worker clients at the current origin. + */ +interface ServiceWorkerClients { + /** + * Gets a list of service worker clients and returns them in a Promise. + * Include the options parameter to return all service worker clients whose + * origin is the same as the associated service worker's origin. If options + * are not included, the method returns only the service worker clients + * controlled by the service worker. + * + * @param options + */ + matchAll(options: ServiceWorkerClientsMatchOptions): Promise>; + + /** + * Opens a service worker Client in a new browser window. + * + * @param url A string representing the URL of the client you want to open + * in the window. + */ + openWindow(url: string): Promise; + + /** + * Allows an active Service Worker to set itself as the active worker for a + * client page when the worker and the page are in the same scope. + */ + claim(): Promise; +} + +/** + * Extends the lifetime of the install and activate events dispatched on the + * ServiceWorkerGlobalScope as part of the service worker lifecycle. This + * ensures that any functional events (like FetchEvent) are not dispatched to + * the ServiceWorker until it upgrades database schemas, deletes outdated cache + * entries, etc. + */ +interface ExtendableEvent extends Event { + /** + * Extends the lifetime of the event. + * It is intended to be called in the install EventHandler for the + * installing worker and on the active EventHandler for the active worker. + * + * @param all + */ + waitUntil(all: any): any; +} + +/** + * The parameter passed into the ServiceWorkerGlobalScope.onfetch handler, + * FetchEvent represents a fetch action that is dispatched on the + * ServiceWorkerGlobalScope of a ServiceWorker. It contains information about + * the request and resulting response, and provides the FetchEvent.respondWith() + * method, which allows us to provide an arbitrary response back to the + * controlled page. + */ +interface FetchEvent extends Event { + /** + * Returns a Boolean that is true if the event was dispatched with the + * user's intention for the page to reload, and false otherwise. Typically, + * pressing the refresh button in a browser is a reload, while clicking a + * link and pressing the back button is not. + * @readonly + */ + isReload: boolean; + + /** + * Returns the Request that triggered the event handler. + * @readonly + */ + request: Request; + + /** + * Returns the Client that the current service worker is controlling. + * @readonly + */ + client: ServiceWorkerClient; + + /** + * Resolves by returning a Response or a network error to Fetch. + * + * @param any + */ + respondWith(any): Response; +} + +/** + * Represents a service worker. Multiple browsing contexts (e.g. pages, workers, + * etc.) can be associated with the same ServiceWorker object. + */ +interface ServiceWorker extends Worker { + /** + * Returns the ServiceWorker serialized script URL defined as part of + * ServiceWorkerRegistration. The URL must be on the same origin as the + * document that registers the ServiceWorker. + * @readonly + */ + scriptURL: string; + + /** + * Returns the state of the service worker. It returns one of the following + * values: installing, installed, activating, activated, or redundant. + * @readonly + */ + state: string; + + /** + * An EventListener property called whenever an event of type statechange + * is fired; it is basically fired anytime the ServiceWorker.state changes. + * + * @param [statechangeevent] + */ + onstatechange: (statechangeevent?: Event) => void; +} + +/** + * The PushSubscription interface provides a subcription's URL endpoint and + * subscription ID. + */ +interface PushSubscription { + /** + * The endpoint associated with the push subscription. + * @readonly + */ + endpoint: any; + + /** + * The subscription ID associated with the push subscription. + * @readonly + */ + subscriptionId: any; +} + +/** + * The PushManager interface provides a way to receive notifications from + * third-party servers as well as request URLs for push notifications. + * This interface has replaced functionality offered by the obsolete + * PushRegistrationManager. + */ +interface PushManager { + /** + * Returns a promise that resolves to a PushSubscription with details of a + * new push subscription. + */ + subscribe(): Promise; + + /** + * Returns a promise that resolves to a PushSubscription details of + * the retrieved push subscription. + */ + getSubscription(): Promise; + + /** + * Returns a promise that resolves to the PushPermissionStatus of the + * requesting webapp, which will be one of granted, denied, or default. + */ + hasPermission(): Promise; +} + +/** + * Represents a service worker registration. + */ +interface ServiceWorkerRegistration extends EventTarget { + /** + * Returns a unique identifier for a service worker registration. + * This must be on the same origin as the document that registers + * the ServiceWorker. + * @readonly + */ + scope: any; + + /** + * Returns a service worker whose state is installing. This is initially + * set to null. + * @readonly + */ + installing: ServiceWorker; + + /** + * Returns a service worker whose state is installed. This is initially + * set to null. + * @readonly + */ + waiting: ServiceWorker; + + /** + * Returns a service worker whose state is either activating or activated. + * This is initially set to null. An active worker will control a + * ServiceWorkerClient if the client's URL falls within the scope of the + * registration (the scope option set when ServiceWorkerContainer.register + * is first called). + * @readonly + */ + active: ServiceWorker; + + /** + * Returns an interface to for managing push subscriptions, including + * subcribing, getting an anctive subscription, and accessing push + * permission status. + * @readonly + */ + pushManager: PushManager; + + /** + * An EventListener property called whenever an event of type updatefound + * is fired; it is fired any time the ServiceWorkerRegistration.installing + * property acquires a new service worker. + */ + onupdatefound: () => void; + + /** + * Allows you to update a service worker. + */ + update(); + + /** + * Unregisters the service worker registration and returns a promise + * (see Promise). The service worker will finish any ongoing operations + * before it is unregistered. + */ + unregister(): Promise; +} + +interface ServiceWorkerRegisterOptions { + scope: string; +} + +/** + * Provides an object representing the service worker as an overall unit in the + * network ecosystem, including facilities to register, unregister and update + * service workers, and access the state of service workers + * and their registrations. + */ +interface ServiceWorkerContainer { + /** + * Returns a ServiceWorker object if its state is activated (the same object + * returned by ServiceWorkerRegistration.active). This property returns null + * if the request is a force refresh (Shift + refresh) or if there is no + * active worker. + * @readonly + */ + controller: ServiceWorker; + + /** + * Defines whether a service worker is ready to control a page or not. + * It returns a Promise that will never reject, which resolves to a + * ServiceWorkerRegistration with an ServiceWorkerRegistration.active worker. + * @readonly + */ + ready: Promise; + + /** + * An event handler fired whenever a controllerchange event occurs — when + * the document's associated ServiceWorkerRegistration acquires a new + * ServiceWorkerRegistration.active worker. + * + * @param [controllerchangeevent] + */ + oncontrollerchange: (controllerchangeevent?: Event) => void; + + /** + * An event handler fired whenever an error event occurs in the associated + * service workers. + * + * @param [errorevent] + */ + onerror: (errorevent?: ErrorEvent) => void; + + /** + * An event handler fired whenever a message event occurs — when incoming + * messages are received to the ServiceWorkerContainer object (e.g. via a + * MessagePort.postMessage() call.) + * + * @param [messageevent] + */ + onmessage: (messageevent?: MessageEvent) => void; + + /** + * Creates or updates a ServiceWorkerRegistration for the given scriptURL. + * + * @param scriptURL The URL of the service worker script. + * @param [options] An options object to provide options upon registration. + * Currently available options are: scope: A USVString representing a URL + * that defines a service worker's registration scope; what range of URLs a + * service worker can control. This is usually a relative URL, and it + * defaults to '/' when not specified. + */ + register(scriptURL: string, options?: ServiceWorkerRegisterOptions): Promise; + + /** + * Gets a ServiceWorkerRegistration object whose scope URL matches the + * provided document URL. If the method can't return a + * ServiceWorkerRegistration, it returns a Promise. + * + * @param [scope] A unique identifier for a service worker registration — the + * scope URL of the registration object you want to return. This is usually + * a relative URL. + */ + getRegistration(scope?: string): Promise; + + /** + * Returns all ServiceWorkerRegistrations associated with a + * ServiceWorkerContainer in an array. If the method can't return + * ServiceWorkerRegistrations, it returns a Promise. + */ + getRegistrations(): Promise>; +} + +/** + * The parameter passed into the oninstall handler, the InstallEvent interface + * represents an install action that is dispatched on the + * ServiceWorkerGlobalScope of a ServiceWorker. As a child of ExtendableEvent, + * it ensures that functional events such as FetchEvent are not dispatched + * during installation. + */ +interface InstallEvent extends ExtendableEvent { + /** + * Returns the ServiceWorker that is currently actively controlling the page. + * @readonly + */ + activeWorker: ServiceWorker; +} + +interface ServiceWorkerGlobalScope { + /** + * Contains the Clients object associated with the service worker. + * @readonly + */ + clients: ServiceWorkerClients; + + /** + * Contains the ServiceWorkerRegistration object that represents the + * service worker's registration. + * @readonly + */ + registration: ServiceWorkerRegistration; + + /** + * An event handler fired whenever an activate event occurs — when a + * ServiceWorkerRegistration acquires a new ServiceWorkerRegistration.active + * worker. + * + * @param [activateevent] + */ + onactivate: (activateevent?: ExtendableEvent) => void; + + /** + * Not defined in the spec yet, but it looks like this will be fired when + * the device is nearly out of storage space, prompting the UA to start + * claiming back some space from web apps that are using client-side storage, + * and the current app is targeted. + * + * @param [beforeevictedevent] + */ + onbeforeevicted: (beforeevictedevent?: Event) => void; + + /** + * Not defined in the spec yet, but it looks like this will be fired when + * the device is out of storage space, and the UA claims back some space + * from the current app. + * + * @param [evictedevent] + */ + onevicted: (evictedevent?: Event) => void; + + /** + * An event handler fired whenever a fetch event occurs — when a fetch() + * is called. + * + * @param [fetchevent] + */ + onfetch: (fetchevent?: FetchEvent) => void; + + /** + * An event handler fired whenever an install event occurs — when a + * ServiceWorkerRegistration acquires a new + * ServiceWorkerRegistration.installing worker. + * + * @param [installevent] + */ + oninstall: (installevent?: InstallEvent) => void; + + /** + * An event handler fired whenever a message event occurs — when incoming + * messages are received. Controlled pages can use the + * MessagePort.postMessage() method to send messages to service workers. + * The service worker can optionally send a response back via the + * MessagePort exposed in event.data.port, corresponding to the controlled + * page. + * + * @param [messageevent] + */ + onmessage: (messageevent?: MessageEvent) => void; + + /** + * An event handler fired whenever a notificationclick event occurs — when + * a user clicks on a displayed notification. + * + * @param [notificationclickevent] + */ + onnotificationclick: (notificationclickevent?: NotificationEvent) => void; + + /** + * An event handler fired whenever a push event occurs — when a server + * push notification is received. + * + * @param [onpushevent] + */ + onpush: (onpushevent?: Event) => void; + + /** + * An event handler fired whenever a pushsubscriptionchange event occurs — + * when a push subscription has been invalidated, or is about to be + * invalidated (e.g. when a push service sets an expiration time). + * + * @param [pushsubscriptionchangeevent] + */ + onpushsubscriptionchange: (pushsubscriptionchangeevent?: Event) => void; + + /** + * Allows the current service worker registration to progress from waiting + * to active state while service worker clients are using it. + */ + skipWaiting(): Promise; + + /** + * TODO GlobalFetch + * @param url + * @param init + */ + fetch(url: string | Request, init?: Object): Promise; +} + +interface Navigator { + /** + * Returns a ServiceWorkerContainer object, which provides access to + * registration, removal, upgrade, and communication with the ServiceWorker + * objects for the associated document. + */ + serviceWorker: ServiceWorkerContainer; +} + +interface Window extends ServiceWorkerGlobalScope { + caches: CacheStorage; +} + +interface NotificationEvent extends Event, ExtendableEvent { + notification: any; +} \ No newline at end of file From 1e6428c3474fa9174a1d218be30ac350e0a48f6e Mon Sep 17 00:00:00 2001 From: tristancaron Date: Mon, 23 Mar 2015 21:10:09 +0100 Subject: [PATCH 004/415] Service Worker API --- service_worker_api/service_worker_api-test.ts | 6 +++--- service_worker_api/service_worker_api.d.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/service_worker_api/service_worker_api-test.ts b/service_worker_api/service_worker_api-test.ts index 67ce58cd40..a28446a382 100644 --- a/service_worker_api/service_worker_api-test.ts +++ b/service_worker_api/service_worker_api-test.ts @@ -104,7 +104,7 @@ self.addEventListener('activate', function(event: ExtendableEvent) { ); }); -function sendMessage(message) { +function sendMessage(message: string) { return new Promise(function(resolve, reject) { var messageChannel = new MessageChannel(); messageChannel.port1.onmessage = function(event) { @@ -136,7 +136,7 @@ navigator.serviceWorker.register('service-worker.js', {scope: './'}).then(functi // The service worker will not handle requests until this page and any // other instances of this page (in other tabs, etc.) have been // closed/reloaded. - var serviceWorker; + var serviceWorker: ServiceWorkerRegistration; if (registration.installing) { serviceWorker = registration.installing; } else if (registration.waiting) { @@ -146,7 +146,7 @@ navigator.serviceWorker.register('service-worker.js', {scope: './'}).then(functi } if (serviceWorker) { console.log(serviceWorker.state); - serviceWorker.addEventListener('statechange', function(e) { + serviceWorker.addEventListener('statechange', function(e: Event) { console.log(e.target.state); }); } diff --git a/service_worker_api/service_worker_api.d.ts b/service_worker_api/service_worker_api.d.ts index f9b2981463..3851d0ec10 100644 --- a/service_worker_api/service_worker_api.d.ts +++ b/service_worker_api/service_worker_api.d.ts @@ -1,6 +1,6 @@ // Type definitions for service_worker_api // Project: https://developer.mozilla.org/fr/docs/Web/API/ServiceWorker_API -// Definitions by: Tristan Caron +// Definitions by: Tristan Caron // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -526,9 +526,9 @@ interface FetchEvent extends Event { /** * Resolves by returning a Response or a network error to Fetch. * - * @param any + * @param all */ - respondWith(any): Response; + respondWith(all: any): Response; } /** @@ -658,7 +658,7 @@ interface ServiceWorkerRegistration extends EventTarget { /** * Allows you to update a service worker. */ - update(); + update(): void; /** * Unregisters the service worker registration and returns a promise From d12ab0b655fbe42f35d257773fb23219d608d252 Mon Sep 17 00:00:00 2001 From: tristancaron Date: Mon, 23 Mar 2015 21:19:54 +0100 Subject: [PATCH 005/415] Service Worker API --- service_worker_api/service_worker_api-test.ts | 4 ++-- service_worker_api/service_worker_api.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/service_worker_api/service_worker_api-test.ts b/service_worker_api/service_worker_api-test.ts index a28446a382..e144880ba1 100644 --- a/service_worker_api/service_worker_api-test.ts +++ b/service_worker_api/service_worker_api-test.ts @@ -136,7 +136,7 @@ navigator.serviceWorker.register('service-worker.js', {scope: './'}).then(functi // The service worker will not handle requests until this page and any // other instances of this page (in other tabs, etc.) have been // closed/reloaded. - var serviceWorker: ServiceWorkerRegistration; + var serviceWorker: ServiceWorker; if (registration.installing) { serviceWorker = registration.installing; } else if (registration.waiting) { @@ -146,7 +146,7 @@ navigator.serviceWorker.register('service-worker.js', {scope: './'}).then(functi } if (serviceWorker) { console.log(serviceWorker.state); - serviceWorker.addEventListener('statechange', function(e: Event) { + serviceWorker.addEventListener('statechange', function(e: any) { console.log(e.target.state); }); } diff --git a/service_worker_api/service_worker_api.d.ts b/service_worker_api/service_worker_api.d.ts index 3851d0ec10..77c80b6706 100644 --- a/service_worker_api/service_worker_api.d.ts +++ b/service_worker_api/service_worker_api.d.ts @@ -557,7 +557,7 @@ interface ServiceWorker extends Worker { * * @param [statechangeevent] */ - onstatechange: (statechangeevent?: Event) => void; + onstatechange: (statechangeevent?: any) => void; } /** From 3405f194a1f2c11e68d524971ab98591648067a5 Mon Sep 17 00:00:00 2001 From: bryn austin bellomy Date: Sat, 25 Apr 2015 20:00:43 -0500 Subject: [PATCH 006/415] adding cliff module --- cliff/cliff.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 cliff/cliff.d.ts diff --git a/cliff/cliff.d.ts b/cliff/cliff.d.ts new file mode 100644 index 0000000000..e0db79c986 --- /dev/null +++ b/cliff/cliff.d.ts @@ -0,0 +1,14 @@ +// Type definitions for cliff 0.1.10 +// Project: https://github.com/flatiron/cliff +// Definitions by: bryn austin bellomy +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +declare module "cliff" { + export function inspect(obj:any): string; + export function stringifyRows(rows:string[][], colors?:string[]): string; + export function stringifyObjectRows(rows:Array<{}>, keys:string[], colors?:string[]): string; + export function putRows(level:string, rows:string[][], colors?:string[]): void; + export function putObjectRows(level:string, rows:Array<{}>, keys:string[], colors?:string[]): void; + export function putObject(level:string, object:any, rewriters?:any, padding?:any): void; +} From 4be08db681656d8a5e00d3c02e02c2bd9c8f452f Mon Sep 17 00:00:00 2001 From: bryn austin bellomy Date: Sat, 25 Apr 2015 20:01:25 -0500 Subject: [PATCH 007/415] adding blessed module --- blessed/blessed.d.ts | 1269 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1269 insertions(+) create mode 100644 blessed/blessed.d.ts diff --git a/blessed/blessed.d.ts b/blessed/blessed.d.ts new file mode 100644 index 0000000000..6746afe5f5 --- /dev/null +++ b/blessed/blessed.d.ts @@ -0,0 +1,1269 @@ +// Type definitions for blessed 0.1.5 +// Project: https://github.com/chjj/blessed +// Definitions by: bryn austin bellomy +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "blessed" +{ + import events = require('events'); + import buffer = require('buffer'); + import child_process = require('child_process'); + + module Blessed + { + export var colors: Colors; + + export interface GenericCallback { + (...args:any[]): void; + } + + export interface ColorPair { + /** background, must be number (-1 for default). */ + bg?: number; + /** foreground, must be number (-1 for default). */ + fg?: number; + } + + export interface Style extends ColorPair { + bold?: boolean; + underline?: boolean; + border: Border; + hover: ColorPair; + } + + export interface Border extends ColorPair { + /** type of border ('line' or 'bg'). */ + type?: string; //'line'|'bg'; + /** character to use if bg type, default is space. */ + ch?: string; + } + + export interface Padding { + top?:number; + right?:number; + bottom?:number; + left?:number; + } + + export interface Position { + /** offsets of the element relative to its parent. can be a number, percentage (0-100%), or keyword (center). right and bottom do not accept keywords. */ + top?:number|string; + /** offsets of the element relative to its parent. can be a number, percentage (0-100%), or keyword (center). right and bottom do not accept keywords. */ + right?:number|string; + /** offsets of the element relative to its parent. can be a number, percentage (0-100%), or keyword (center). right and bottom do not accept keywords. */ + bottom?:number|string; + /** offsets of the element relative to its parent. can be a number, percentage (0-100%), or keyword (center). right and bottom do not accept keywords. */ + left?:number|string; + /** width of the element, can be a number, percentage (0-100%), or keyword (half or shrink). */ + width?:number|string; + /** height of the element, can be a number, percentage (0-100%), or keyword (half or shrink). */ + height?:number|string; + } + + export interface KeyCode { + name: string; + ctrl: boolean; + meta: boolean; + shift: boolean; + sequence: string; + full: string; + } + + export class Program + { + /** + Wrap the given text in terminal formatting codes corresponding to the given attribute + name. The `attr` string can be of the form `red fg` or `52 bg` where `52` is a 0-255 + integer color number. + */ + text (text:string, attr:string): string; + } + + export interface Colors { + /** Either pass a hex string, an array of 3 numbers, or three separate numbers representing an RGB value. This returns the 0-255 color number for that color. */ + match (r:string|number[]|number, g?:number, b?:number): number; + + /** An array of the 255 colors as hex strings. */ + colors: string[]; + } + + export interface NodeOptions + { + screen?: Screen; + parent?: Node; + children?: Node[]; + } + + export class Node extends events.EventEmitter + { + constructor(options?:NodeOptions); + + type : string; + options : NodeOptions; + parent : Node; + screen : Screen; + children : Node[]; + data : any; + _ : any; + $ : any; + index : number; + + // on(event:string, callback:() => void); + // on(event:'adopt', callback:() => void); + // on(event:'remove', callback:() => void); + // on(event:'reparent', callback:() => void); + // on(event:'attach', callback:() => void); + // on(event:'detach', callback:() => void); + + prepend(node:Node): void; + append(node:Node): void; + remove(node:Node): void; + insert(node:Node, index:number): void; + insertBefore(node:Node, refNode:Node): void; + insertAfter(node:Node, refNode:Node): void; + detach(): void; + // emitDescendants(): void; + // get(key:string): any; + // get(key:string, default:any): any; + // set(key:string, value:any): void; + } + + export interface ScreenOptions extends NodeOptions + { + /** the blessed Program to be associated with. will be automatically instantiated if none is provided. */ + program?: any; + /** attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with uniform cells to their sides). this is known to cause flickering with elements that are not full-width, however, it is more optimal for terminal rendering. */ + smartCSR?: boolean; + /** do CSR on any element within 20 cols of the screen edge on either side. faster than smartCSR, but may cause flickering depending on what is on each side of the element. */ + fastCSR?: boolean; + /** attempt to perform back_color_erase optimizations for terminals that support it. it will also work with terminals that don't support it, but only on lines with the default background color. as it stands with the current implementation, it's uncertain how much terminal performance this adds at the cost of overhead within node. */ + useBCE?: boolean; + /** amount of time (in ms) to redraw the screen after the terminal is resized (default: 300). */ + resizeTimeout?: number; + /** the width of tabs within an element's content. */ + tabSize?: number; + /** automatically position child elements with border and padding in mind. */ + autoPadding?: boolean; + /** the name of the logfile to use. if specified but the file does not exist, it will be created. see log method. */ + log?: string; + /** dump all output and input to desired file. can be used together with log option if set as a boolean. */ + dump?: any; + /** debug mode. enables usage of the `debug` method. also creates a debug console which will display when pressing F12. it will display all log and debug messages. */ + debug?: boolean; + /** Array of keys in their full format (e.g. C-c) to ignore when keys are locked. Useful for creating a key that will always exit no matter whether the keys are locked. */ + ignoreLocked?: string[]; + + /** Do not clear the screen, only scroll down enough to make room for the elements on the screen. do not use the alternate screenbuffer. useful for writing a CLI tool or some kind of prompt (experimental - see test/widget-noalt.js) */ + noAlt?: boolean; + + /** Options for the cursor. */ + cursor?: CursorOptions; + } + + export interface CursorOptions { + /** have blessed draw a custom cursor and hide the terminal cursor (experimental). */ + artificial?: boolean; + /** shape of the artificial cursor. can be: block, underline, or line. */ + shape?: string; //'block'|'underline'|'line'; + /** whether the artificial cursor blinks. */ + blink?: boolean; + /** color of the artificial cursor. accepts any valid color value (null is default). */ + color?: string; + } + + export interface ScreenEventCallback { + (character:string, keyCode:KeyCode): void; + } + + export class Screen extends Node + { + constructor(options?:ScreenOptions); + + /** the blessed Program object. */ + program: any; + /** the blessed Tput object (only available if you passed tput: true to the Program constructor.) */ + tput: any; + /** top of the focus history stack. */ + focused: any; + /** width of the screen (same as program.cols). */ + width: number; + /** height of the screen (same as program.rows). */ + height: number; + /** same as screen.width. */ + cols: number; + /** same as screen.height. */ + rows: number; + + /** calculated relative left offset. */ + left: number; + /** calculated relative right offset. */ + right: number; + /** calculated relative top offset. */ + top: number; + /** calculated relative bottom offset. */ + bottom: number; + /** calculated absolute left offset. */ + aleft: number; + /** calculated absolute right offset. */ + aright: number; + /** calculated absolute top offset. */ + atop: number; + /** calculated absolute bottom offset. */ + abottom: number; + + + /** whether the focused element grabs all keypresses. */ + grabKeys: boolean; + /** prevent keypresses from being received by any element. */ + lockKeys: boolean; + /** the currently hovered element. only set if mouse events are bound. */ + hover: Element; + /** set or get window title. */ + title: string; + + /** write string to the log file if one was created. */ + log(...msg:any[]): void; + /** same as the log method, but only gets called if the debug option was set. */ + debug(...msg:string[]): void; + /** allocate a new pending screen buffer and a new output screen buffer. */ + alloc(): void; + /** draw the screen based on the contents of the screen buffer. */ + draw(start:number, end:number): void; + /** render all child elements, writing all data to the screen buffer and drawing the screen. */ + render(): void; + /** clear any region on the screen. */ + clearRegion(x1:number, x2:number, y1:number, y2:number): void; + /** fill any region with a character of a certain attribute. */ + fillRegion(attr:number, ch:string, x1:number, x2:number, y1:number, y2:number): void; + /** focus element by offset of focusable elements. */ + focusOffset(offset:number): void; + /** focus previous element in the index. */ + focusPrevious(): void; + /** focus next element in the index. */ + focusNext(): void; + /** push element on the focus stack (equivalent to screen.focused = el). */ + focusPush(element:Element): void; + /** pop element off the focus stack. */ + focusPop(): void; + /** save the focused element. */ + saveFocus(): void; + /** restore the saved focused element. */ + restoreFocus(): void; + /** "rewind" focus to the last visible and attached element. */ + rewindFocus(): void; + /** bind a keypress listener for a specific key. */ + key(keyEvents:string|string[], callback:ScreenEventCallback): void; + /** bind a keypress listener for a specific key once. */ + onceKey(keyEvents:string|string[], callback:ScreenEventCallback): void; + /** remove a keypress listener for a specific key. */ + unkey(name:string, listener:ScreenEventCallback): void; + /** spawn a process in the foreground, return to blessed app after exit. */ + spawn(file:string, args:string[], options:NodeChildProcessExecOptions): child_process.ChildProcess; + /** spawn a process in the foreground, return to blessed app after exit. executes callback on error or exit. */ + exec(file:string, args:string[], options:NodeChildProcessExecOptions, callback:GenericCallback): child_process.ChildProcess; + /** read data from text editor. */ + readEditor(options:{}, callback:GenericCallback): void; + /** set effects based on two events and attributes. */ + setEffects(el:Element, fel:Element, over:string, out:string, effects:Style, temp?:string): void; + /** insert a line into the screen (using csr: this bypasses the output buffer). */ + insertLine(n:number, y:number, top:number, bottom:number): void; + /** delete a line from the screen (using csr: this bypasses the output buffer). */ + deleteLine(n:number, y:number, top:number, bottom:number): void; + /** insert a line at the bottom of the screen. */ + insertBottom(top:number, bottom:number): void; + /** insert a line at the top of the screen. */ + insertTop(top:number, bottom:number): void; + /** delete a line at the bottom of the screen. */ + deleteBottom(top:number, bottom:number): void; + /** delete a line at the top of the screen. */ + deleteTop(top:number, bottom:number): void; + + /** enable mouse events for the screen and optionally an element (automatically called when a form of on('mouse') is bound). */ + enableMouse(el?:Element): void; + /** enable keypress events for the screen and optionally an element (automatically called when a form of on('keypress') is bound). */ + enableKeys(el?:Element): void; + /** enable key and mouse events. calls bot enableMouse and enableKeys. */ + enableInput(el?:Element): void; + + /** attempt to copy text to clipboard using iTerm2's propriety sequence. returns true if successful. */ + copyToClipboard(text:string): boolean; + /** attempt to change cursor shape. will not work in all terminals (see artificial cursors for a solution to this). returns true if successful. */ + cursorShape(shape:string, blink:boolean): boolean; + /** attempt to change cursor color. returns true if successful. */ + cursorColor(color: string): boolean; + /** attempt to reset cursor. returns true if successful. */ + cursorReset(): boolean; + + } + + export interface ElementOptions extends NodeOptions + { + fg?: string; + bg?: string; + scrollbar?: ColorPair; + focus?: Style; + hover?: Style; + + /** border object, see below. */ + border?: Border; + /** positioning options. */ + position?: Position; + /** amount of padding on the inside of the element. can be a number or an object containing the properties: left, right, top, and bottom. */ + padding?: number|Padding; + /** element's text content. */ + content?: string; + /** element is clickable. */ + clickable?: boolean; + /** element is focusable and can receive key input. */ + input?: boolean; + /** element is focused. */ + focused?: boolean; + /** whether the element is hidden. */ + hidden?: boolean; + /** a simple text label for the element. */ + label?: string; + /** a floating text label for the element which appears on mouseover. */ + hoverText?: string; + /** text alignment: left, center, or right. */ + align?: string; + /** vertical text alignment: top, middle, or bottom. */ + valign?: string; + /** shrink/flex/grow to content and child elements. width/height during render. */ + shrink?: any; + /** width of the element, can be a number, percentage (0-100%), or keyword (half or shrink). */ + width?: number|string; + /** height of the element, can be a number, percentage (0-100%), or keyword (half or shrink). */ + height?: number|string; + /** whether the element is scrollable or not. */ + scrollable?: boolean; + /** background character (default is whitespace ). */ + ch?: string; + /** allow the element to be dragged with the mouse. */ + draggable?: boolean; + } + + export class Element extends Node + { + constructor(options?:ElementOptions); + + /** name of the element. useful for form submission. */ + name: string; + /** border object. */ + border: Border; + /** contains attributes (e.g. fg/bg/underline). see above. */ + style: Style; + /** raw width, height, and offsets. */ + position: Position; + /** type of border (line or bg). bg by default. */ + type: string; //'line'|'bg'; + /** character to use if bg type, default is space. */ + ch: string; + /** raw text content. */ + content: string; + /** whether the element is hidden or not. */ + hidden: boolean; + /** whether the element is visible or not. */ + visible: boolean; + /** whether the element is attached to a screen in its ancestry somewhere. */ + detached: boolean; + /** calculated width. */ + width: number; + /** calculated height. */ + height: number; + /** whether the element is draggable. set to true to allow dragging. */ + draggable: boolean; + + + + /** calculated relative left offset. */ + left: number; + /** calculated relative right offset. */ + right: number; + /** calculated relative top offset. */ + top: number; + /** calculated relative bottom offset. */ + bottom: number; + /** calculated absolute left offset. */ + aleft: number; + /** calculated absolute right offset. */ + aright: number; + /** calculated absolute top offset. */ + atop: number; + /** calculated absolute bottom offset. */ + abottom: number; + + + /** write content and children to the screen buffer. */ + render(): void; + /** hide element. */ + hide(): void; + /** show element. */ + show(): void; + /** toggle hidden/shown. */ + toggle(): void; + /** focus element. */ + focus(): void; + /** bind a keypress listener for a specific key. */ + key(name:string|string[], listener:(character?:any, keyCode?:any) => void): void; + /** bind a keypress listener for a specific key once. */ + onceKey(name:string, listener:() => void): void; + /** remove a keypress listener for a specific key. */ + unkey(name:string, listener:() => void): void; + /** same as el.on('screen', ...) except this will automatically cleanup listeners after the element is detached. */ + onScreenEvent(event:string, listener:(...args:any[]) => void): void; + /** set the z-index of the element (changes rendering order). */ + setIndex(z:number): void; + /** put the element in front of its siblings. */ + setFront(): void; + /** put the element in back of its siblings. */ + setBack(): void; + /** set the label text for the top-left corner. example options: {text:'foo',side:'left'} */ + setLabel(textOrOptions:string|{}): void; + /** remove the label completely. */ + removeLabel(): void; + /** set the hover text for the bottom-right corner. example options: {text:'foo'} */ + setHover(textOrOptions:string|{}): void; + /** remove the hover label completely. */ + removeHover(): void; + /** set the content. note: when text is input, it will be stripped of all non-SGR escape codes, tabs will be replaced with 8 spaces, and tags will be replaced with SGR codes (if enabled). */ + setContent(text:string): void; + /** return content, slightly different from el.content. assume the above formatting. */ + getContent(): void; + /** similar to setContent, but ignore tags and remove escape codes. */ + setText(text:string): void; + /** similar to getContent, but return content with tags and escape codes removed. */ + getText(): void; + /** insert a line into the box's content. */ + insertLine(index:number, lines:string|string[]): void; + /** delete a line from the box's content. */ + deleteLine(index:number, numLines:number): void; + /** get a line from the box's content. */ + getLine(index:number): void; + /** get a line from the box's content from the visible top. */ + getBaseLine(index:number): void; + /** set a line in the box's content. */ + setLine(index:number, line:string): void; + /** set a line in the box's content from the visible top. */ + setBaseLine(index:number, line:string): void; + /** clear a line from the box's content. */ + clearLine(index:number): void; + /** clear a line from the box's content from the visible top. */ + clearBaseLine(index:number): void; + /** insert a line at the top of the box. */ + insertTop(lines:string|string[]): void; + /** insert a line at the bottom of the box. */ + insertBottom(lines:string|string[]): void; + /** delete a line at the top of the box. */ + deleteTop(): void; + /** delete a line at the bottom of the box. */ + deleteBottom(): void; + /** unshift a line onto the top of the content. */ + unshiftLine(lines:string|string[]): void; + /** shift a line off the top of the content. */ + shiftLine(index:number): void; + /** push a line onto the bottom of the content. */ + pushLine(lines:string|string[]): void; + /** pop a line off the bottom of the content. */ + popLine(index:number): void; + /** an array containing the content lines. */ + getLines(): void; + /** an array containing the lines as they are displayed on the screen. */ + getScreenLines(): void; + /** get a string's real length, taking into account tags. */ + textLength(text:string): number; + + /** enable dragging of the element. */ + enableDrag(): void; + /** disable dragging of the element. */ + disableDrag(): void; + } + + + // + // Box + // + + export interface BoxOptions extends ElementOptions { + // intentionally empty + } + + export class Box extends Element { + constructor(options?:BoxOptions); + // intentionally empty + } + + + // + // ScrollableBox + // + + export interface ScrollableBoxOptions extends BoxOptions { + /** a limit to the childBase. default is `Infinity`. */ + baseLimit: number; + /** a option which causes the ignoring of `childOffset`. this in turn causes the childBase to change every time the element is scrolled. */ + alwaysScroll: boolean; + /** object enabling a scrollbar. */ + scrollbar: ScrollBar; + } + + /** A box with scrollable content. */ + export class ScrollableBox extends Box { + constructor(options?:ScrollableBoxOptions); + + /** the offset of the top of the scroll content. */ + childBase: number; + /** the offset of the chosen item/line. */ + childOffset: number; + /** scroll the content by a relative offset. */ + scroll(offset:number): void; + /** scroll the content to an absolute index. */ + scrollTo(index:number): void; + /** same as `scrollTo`. */ + setScroll(index:number): void; + /** set the current scroll index in percentage (0-100). */ + setScrollPerc(perc:number): void; + /** get the current scroll index in lines. */ + getScroll(): number; + /** get the actual height of the scrolling area. */ + getScrollHeight(): number; + /** get the current scroll index in percentage. */ + getScrollPerc(): number; + /** reset the scroll index to its initial state. */ + resetScroll(): void; + + } + + export interface ScrollBar { + /** style of the scrollbar. */ + style: Style; + /** style of the scrollbar track if present (takes regular style options). */ + track: Style; + } + + + // + // ScrollableText + // + + export interface ScrollableTextOptions extends ScrollableBoxOptions { + /** whether to enable automatic mouse support for this element. */ + mouse: boolean; + /** use predefined keys for navigating the text. */ + keys: boolean; + /** use vi keys with the `keys` option. */ + vi: boolean; + } + + /** __DEPRECATED__ - Use Box with the `scrollable` and `alwaysScroll` options instead. A scrollable text box which can display and scroll text, as well as handle pre-existing newlines and escape codes. */ + export class ScrollableText extends ScrollableBox { + constructor(options?:ScrollableTextOptions); + } + + + + // + // Text + // + + export interface TextOptions extends ElementOptions { + align?: string; //'left'|'center'|'right'; + } + + export class Text extends Element { + constructor(options?:TextOptions); + // intentionally empty + } + + + // + // Line + // + + export interface LineOptions extends BoxOptions { + orientation?: string; //'vertical'|'horizontal'; + style?: Style; + } + + export class Line extends Box { + constructor(options?:LineOptions); + // intentionally empty + } + + + // + // List + // + + export interface ListStyle extends Style { + selected?: Style; + item?: Style; + } + + export interface ListOptions extends BoxOptions + { + style?: ListStyle; + + /** whether to automatically enable mouse support for this list (allows clicking items). */ + mouse?: boolean; + /** use predefined keys for navigating the list. */ + keys?: any; + /** use vi keys with the keys option. */ + vi?: boolean; + /** an array of strings which become the list's items. */ + items?: string[]; + /** a function that is called when vi mode is enabled and the key / is pressed. This function accepts a callback function which should be called with the search string. The search string is then used to jump to an item that is found in items. */ + search?: (callback:(searchString:string) => void) => void; + /** whether the list is interactive and can have items selected (default: true). */ + interactive?: boolean; + } + + export class List extends Box + { + constructor(options?:ListOptions); + + /** The text of the currently selected item. */ + value:string; + /** The items in the list. */ + items:string[]; + /** The items in the list. */ + ritems:string[]; + /** The index of the current selection. */ + selected:number; + + /** add an item based on a string. */ + addItem(text:string): void; + /** returns the item index from the list. child can be an element, index, or string. */ + getItemIndex(child:Element|number|string): void; + /** returns the item element. child can be an element, index, or string. */ + getItem(child:Element|number|string): void; + /** removes an item from the list. child can be an element, index, or string. */ + removeItem(child:Element|number|string): void; + /** clears all items from the list. */ + clearItems(): void; + /** sets the list items to multiple strings. */ + setItems(items:string[]): void; + /** Sets the current selection by absolute index. */ + select(index:number): void; + /** Changes the current selection based on current offset. */ + move(offset:number): void; + /** select item above selected. */ + up(amount:number): void; + /** select item below selected. */ + down(amount:number): void; + /** show/focus list and pick an item. the callback is executed with the result. */ + pick(cwd:string, callback:(err:any, file:string) => void): void; + + /** show/focus list and pick an item. the callback is executed with the result. */ + pick(callback:(err:any, file:string) => void): void; + } + + // + // Input + // + + export interface InputOptions extends BoxOptions { + // intentionally empty + } + + export class Input extends Box { + constructor(options?:InputOptions); + // intentionally empty + } + + export interface InputOptions extends BoxOptions { + // intentionally empty + } + + // + // Textarea + // + + export interface TextareaOptions extends InputOptions + { + /** use pre-defined keys (`i` or `enter` for insert, `e` for editor, `C-e` for editor while inserting). */ + keys?: boolean; + /** use pre-defined mouse events (right-click for editor). */ + mouse?: boolean; + /** call `readInput()` when the element is focused. automatically unfocus. */ + inputOnFocus?: boolean; + } + + /** A box which allows multiline text input. */ + export class Textarea extends Input + { + constructor(options?:TextareaOptions); + + /** the input text. __read-only__. */ + value: string; + + /** submit the textarea (emits `submit`). */ + submit(): void; + /** cancel the textarea (emits `cancel`). */ + cancel(): void; + /** grab key events and start reading text from the keyboard. takes a callback which receives the final value. */ + readInput(callback:GenericCallback): void; + /** open text editor in `$EDITOR`, read the output from the resulting file. takes a callback which receives the final value. */ + readEditor(callback:GenericCallback): void; + /** the same as `this.value`, for now. */ + getValue(): string; + /** clear input. */ + clearValue(): void; + /** set value. */ + setValue(text:string): void; + } + + + // + // Textbox + // + + export interface TextboxOptions extends TextareaOptions { + /** completely hide text. */ + secret?: boolean; + /** replace text with asterisks (`*`). */ + censor?: boolean; + } + + /** A box which allows text input. */ + export class Textbox extends Textarea { + constructor(options?:TextboxOptions); + + /** completely hide text. */ + secret: boolean; + /** replace text with asterisks (`*`). */ + censor: boolean; + } + + + // + // Button + // + + export interface ButtonOptions extends InputOptions { + } + + /** A button which can be focused and allows key and mouse input. */ + export class Button extends Input { + constructor(options?:ButtonOptions); + + // on(event:string, callback:() => void): void; + // on(event:'press', callback:() => void); + + /** press button. emits 'press'. */ + press(): void; + } + + + // + // ProgressBar + // + + export interface ProgressBarOptions extends InputOptions { + /** can be `horizontal` or `vertical`. */ + orientation: string; + /** the character to fill the bar with (default is space). */ + pch: string; + /** the amount filled (0 - 100). */ + filled: number; + /** same as `filled`. */ + value: number; + /** enable key support. */ + keys: boolean; + /** enable mouse support. */ + mouse: boolean; + + /** contains the extra key 'bar', which defines the style of the bar contents itself. */ + style: ProgressBarStyle; + } + + export interface ProgressBarStyle extends Style { + /** style of the bar contents itself. */ + bar: Style; + } + + + export class ProgressBar extends Input { + constructor(options?:ProgressBarOptions); + + /** progress the bar by a fill amount. */ + progress(amount:number): void; + /** set progress to specific amount. */ + setProgress(amount:number): void; + /** reset the bar. */ + reset(): void; + } + + // + // Checkbox + // + + export interface CheckboxOptions extends InputOptions { + /** whether the element is checked or not. */ + checked: boolean; + /** enable mouse support. */ + mouse: boolean; + } + + + /** A checkbox which can be used in a form element. */ + export class Checkbox extends Input + { + constructor(options?:CheckboxOptions); + + /** the text next to the checkbox (do not use setcontent, use `check.text = ''`). */ + text: string; + /** whether the element is checked or not. */ + checked: boolean; + /** same as `checked`. */ + value: boolean; + + /** check the element. */ + check(): void; + /** uncheck the element. */ + uncheck(): void; + /** toggle checked state. */ + toggle(): void; + } + + + // + // RadioSet + // + + export interface RadioSetOptions extends BoxOptions { + } + + + export class RadioSet extends Box { + constructor(options?:RadioSetOptions); + } + + + // + // RadioButton + // + + export interface RadioButtonOptions extends CheckboxOptions { + } + + + /** A radio button which can be used in a form element. */ + export class RadioButton extends Checkbox { + constructor(options?:RadioButtonOptions); + } + + + + // + // Prompt + // + + export interface PromptOptions extends BoxOptions { + } + + + /** A prompt box containing a text input, okay, and cancel buttons (automatically hidden). */ + export class Prompt extends Box + { + constructor(options?:PromptOptions); + + /** show the prompt and wait for the result of the textbox. set text and initial value */ + input(text:string, value:any, callback:(val:any) => void): void; + /** show the prompt and wait for the result of the textbox. set text and initial value */ + setInput(text:string, value:any, callback:(val:any) => void): void; + /** show the prompt and wait for the result of the textbox. set text and initial value */ + readInput(text:string, value:any, callback:(val:any) => void): void; + } + + + // + // Question + // + + export interface QuestionOptions extends BoxOptions { + } + + + /** A question box containing okay and cancel buttons (automatically hidden). */ + export class Question extends Box + { + constructor(options?:QuestionOptions); + + /** ask a `question`. `callback` will yield the result. */ + ask(question:string, callback:(result:any) => void): void; + } + + + // + // Message + // + + export interface MessageOptions extends BoxOptions { + } + + + /** A box containing a message to be displayed (automatically hidden). */ + export class Message extends Box + { + constructor(options?:MessageOptions); + + /** display a message for a time (default is 3 seconds). set time to 0 for a perpetual message that is dismissed on keypress. */ + log(text:string, timeOrCallback:number|MessageCallback, callback?:MessageCallback): void; + /** display a message for a time (default is 3 seconds). set time to 0 for a perpetual message that is dismissed on keypress. */ + display(text:string, timeOrCallback:number|MessageCallback, callback?:MessageCallback): void; + /** display an error in the same way. */ + error(text:string, timeOrCallback:number|MessageCallback, callback?:MessageCallback): void; + } + + export interface MessageCallback { + (): void; + } + + + // + // Loading + // + + export interface LoadingOptions extends BoxOptions { + } + + /** A box with a spinning line to denote loading (automatically hidden). */ + export class Loading extends Box + { + constructor(options?:LoadingOptions); + + /** display the loading box with a message. will lock keys until `stop` is called. */ + load(text:string): void; + /** hide loading box. unlock keys. */ + stop(): void; + } + + + // + // Listbar + // + + export interface ListbarOptions extends BoxOptions + { + /** Listbar's `style` object includes sub-styles for `selected` and `item`. */ + style?: ListbarStyle; + + /** set buttons using an object with keys as titles of buttons, containing of objects containing keys of `keys` and `callback`. */ + items?: ListbarItemSet; + /** set buttons using an object with keys as titles of buttons, containing of objects containing keys of `keys` and `callback`. */ + commands?: ListbarItemSet; + /** automatically bind list buttons to keys 0-9. */ + autoCommandKeys?: boolean; + } + + export interface ListbarItemSet { + [name: string]: ListbarItem; + } + + export interface ListbarItem { + keys: string[]; + callback: GenericCallback; + } + + export interface ListbarStyle extends Style + { + /** style for a selected item. */ + selected: Style; + /** style for an unselected item. */ + item: Style; + } + + /** A horizontal list. Useful for a main menu bar. */ + export class Listbar extends Box + { + constructor(options?:ListbarOptions); + + /** append an item to the bar. */ + add(item:ListbarItem, callback:GenericCallback): void; + /** append an item to the bar. */ + addItem(item:ListbarItem, callback:GenericCallback): void; + /** append an item to the bar. */ + appendItem(item:ListbarItem, callback:GenericCallback): void; + + /** select button and execute its callback. */ + selectTab(index: number): void; + + /** set commands (see `commands` option above). */ + setItems(commands: ListbarItemSet): void; + /** select an item on the bar. */ + select(offset: number): void; + /** remove item from the bar. */ + removeItem(child:ListbarItem): void; + /** move focus relatively across the bar. */ + move(offset: number): void; + /** move focus left relatively across the bar. */ + moveLeft(offset: number): void; + /** move focus right relatively across the bar. */ + moveRight(offset: number): void; + } + + + // + // Log + // + + export interface LogOptions extends ScrollableTextOptions { + /** amount of scrollback allowed. default: Infinity. */ + scrollback?: number; + /** scroll to bottom on input even if the user has scrolled up. default: false. */ + scrollOnInput?: boolean; + } + + + /** A log permanently scrolled to the bottom. */ + export class Log extends ScrollableText + { + constructor(options?:LogOptions); + + /** amount of scrollback allowed. default: Infinity. */ + scrollback: number; + /** scroll to bottom on input even if the user has scrolled up. default: false. */ + scrollOnInput: boolean; + + /** add a log line. */ + log(text:string): void; + /** add a log line. */ + add(text:string): void; + } + + + // + // Table + // + + export interface TableOptions extends BoxOptions + { + /** array of array of strings representing rows (same as `data`). */ + rows?: string[][]; + /** array of array of strings representing rows (same as `rows`). */ + data?: string[][]; + /** spaces to attempt to pad on the sides of each cell. `2` by default: one space on each side (only useful if the width is shrunken). */ + pad?: number; + /** do not draw inner cells. */ + noCellBorders?: boolean; + /** fill cell borders with the adjacent background color. */ + fillCellBorders?: boolean; + + /** includes `header` and `cell` substyles. */ + style?: TableStyle; + } + + export interface TableStyle extends Style { + /** header style. */ + header: Style; + /** cell style. */ + cell: Style; + } + + /** A stylized table of text elements. */ + export class Table extends Box + { + /** includes `header` and `cell` substyles. */ + style: TableStyle; + + /** set rows in table. array of arrays of strings. */ + setData(rows: string[][]): void; + /** set rows in table. array of arrays of strings. */ + setRows(rows: string[][]): void; + } + + + // + // ListTable + // + + export interface ListTableOptions extends ListOptions + { + /** array of array of strings representing rows (same as `data`). */ + rows?: string[][]; + /** array of array of strings representing rows (same as `rows`). */ + data?: string[][]; + /** spaces to attempt to pad on the sides of each cell. `2` by default: one space on each side (only useful if the width is shrunken). */ + pad?: number; + + /** do not draw inner cells. */ + noCellBorders?: boolean; + + /** includes `header` and `cell` substyles. */ + style?: TableStyle; + } + + export interface ListTableStyle extends TableStyle { + } + + + /** A stylized table of text elements with a list. */ + export class ListTable extends List + { + constructor(options?:ListTableOptions); + + /** set rows in table. array of arrays of strings. */ + setData(rows: string[][]): void; + /** set rows in table. array of arrays of strings. */ + setRows(rows: string[][]): void; + } + + // + // Image + // + + export interface ImageOptions extends BoxOptions { + /** path to image. */ + file: string; + /** path to w3mimgdisplay. if a proper w3mimgdisplay path is not given, blessed will search the entire disk for the binary. */ + w3m: string; + } + + + /** Display an image in the terminal (jpeg, png, gif) using w3mimgdisplay. Requires w3m to be installed. X11 required: works in xterm, urxvt, and possibly other terminals. */ + export class Image extends Box + { + constructor(options?:ImageOptions); + + /** set the image in the box to a new path. */ + setImage (img:string, callback:GenericCallback): void; + /** clear the current image. */ + clearImage (callback:GenericCallback): void; + /** get the size of an image file in pixels. */ + imageSize (img:string, callback:GenericCallback): void; + /** get the size of the terminal in pixels. */ + termSize (callback:GenericCallback): void; + /** get the pixel to cell ratio for the terminal. */ + getPixelRatio (callback:GenericCallback): void; + } + + + // + // Form + // + + export interface FormOptions extends BoxOptions { + /** allow default keys (tab, vi keys, enter). */ + keys?:boolean; + /** allow vi keys. */ + vi?:boolean; + } + + export class Form extends Box + { + constructor(options?:FormOptions); + + /** last submitted data. */ + submission: any; + + // on(event:string, callback:() => void): void; + // on(event:'submit', callback:(data) => void): void; + // on(event:'cancel', callback:() => void): void; + // on(event:'reset', callback:() => void): void; + + next(): void; + previous(): void; + + resetSelected(): void; + /** focus first form element. */ + focusFirst(): void; + /** focus last form element. */ + focusLast(): void; + /** focus next form element. */ + focusNext(): void; + /** focus previous form element. */ + focusPrevious(): void; + /** submit the form. */ + submit(): void; + /** discard the form. */ + cancel(): void; + /** clear the form. */ + reset(): void; + } + + + // + // FileManager + // + + export interface FileManagerOptions extends ListOptions { + cwd?: string; + } + + export interface DirectoryEntry { + name: string; + text: string; + dir: boolean; + symlink: boolean; + } + + export class FileManager extends List + { + constructor(options?:FileManagerOptions); + + cwd: string; + + useFormatter (formatterFn:(entry:DirectoryEntry) => DirectoryEntry): void; + + /** refresh the file list (perform a readdir on cwd and update the list items). */ + refresh (cwd?:string, callback?:() => void): void; + + /** refresh the file list. */ + refresh (callback?:() => void): void; + + /** reset back to original cwd. */ + reset (cwd?:string, callback?:() => void): void; + } + + + // + // Terminal + // + + export interface TerminalOptions extends BoxOptions + { + /** handler for input data. */ + handler?: (userInput:Buffer) => void; + /** name of shell. $SHELL by default. */ + shell?:string; + /** args for shell. */ + args?:any; + /** can be line, underline, and block. */ + cursor?:string; //'line'|'underline'|'block'; + } + + export class Terminal extends Box + { + /** reference to the headless term.js terminal. */ + term: any; + /** reference to the pty.js pseudo terminal. */ + pty: any; + + /** write data to the terminal. */ + write(data:string): void; + + /** nearly identical to `element.screenshot`, however, the specified region includes the terminal's _entire_ scrollback, rather than just what is visible on the screen. */ + screenshot(xi?:number, xl?:number, yi?:number, yl?:number): string; + } + + + export interface NodeChildProcessExecOptions + { + cwd?: string; + stdio?: any; + customFds?: any; + env?: any; + encoding?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + } + } + + export = Blessed; +} + + + From efd7ae7dd16f7d27e4abf5ec1aa885c07f134e1c Mon Sep 17 00:00:00 2001 From: crissdev Date: Tue, 7 Jul 2015 15:56:05 +0300 Subject: [PATCH 008/415] improve definition for knockout.punches --- knockout.punches/knockout.punches-tests.ts | 24 ++++++++++++++++++- knockout.punches/knockout.punches.d.ts | 28 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/knockout.punches/knockout.punches-tests.ts b/knockout.punches/knockout.punches-tests.ts index bd5d53a5c5..bec2b1a4ef 100644 --- a/knockout.punches/knockout.punches-tests.ts +++ b/knockout.punches/knockout.punches-tests.ts @@ -2,7 +2,29 @@ function test_enable() { - ko.punches.enableAll(); +} +function test_filters() { + ko.filters.default([], 'Empty'); + ko.filters.default(null, 'Empty'); + ko.filters.default(0, 'Empty'); + ko.filters.default(' ', 'Empty'); + + ko.filters.fit('abcdef0123456789', 10); + ko.filters.fit('abcdef0123456789', 10, '_'); + ko.filters.fit('abcdef0123456789', 10, '_', 'left'); + ko.filters.fit('abcdef0123456789', 10, '_', 'middle'); + ko.filters.fit('abcdef0123456789', 10, '_', 'right'); + + ko.filters.json({}); + ko.filters.json({}, null, 4); + + ko.filters.number('123456789'); + ko.filters.number(12345.6789); + + ko.filters.lowercase('TEST'); + ko.filters.uppercase('test'); + + ko.filters.replace('1234abcd', '1234', ''); } \ No newline at end of file diff --git a/knockout.punches/knockout.punches.d.ts b/knockout.punches/knockout.punches.d.ts index d219d61f15..8bcb29ee89 100644 --- a/knockout.punches/knockout.punches.d.ts +++ b/knockout.punches/knockout.punches.d.ts @@ -9,8 +9,36 @@ interface KnockoutPunchesStatic { enableAll(): void; } +interface KnockoutPunchesFilters { + // Convert the value to uppercase. + uppercase(value: string): string; + + // Convert the value to lowercase. + lowercase(value: string): string; + + // Perform a search and replace on the value using String#replace. + replace(value: string, search: string, replace: string): string; + + // Trim the value if it’s longer than the given length. The trimmed portion is + // replaced with ... or the replacement value, if given. By default, the value + // is trimmed on the right but can be changed to left or middle through the + // where option. For example: name | fit:10::'middle' will + // convert Shakespeare to Shak...are. + fit(value: number | string, length?: number, replacement?: string, trimWhere?: string): string; + + // Convert the value to a JSON string using ko.toJSON. You can give a space value to format the JSON output. + json(rootObject: any, space?: any, replacer?: any): string; + + // Format the value using toLocaleString. + number(value: number | string): string; + + // If the value is blank, null, or an empty array, replace it with the given default value + default(value: any, defaultValue?: any): any; +} + interface KnockoutStatic { punches: KnockoutPunchesStatic; + filters: KnockoutPunchesFilters; } declare module "knockout.punches" { From 12cae19c1c23a970d76c45032a2559406bd4c666 Mon Sep 17 00:00:00 2001 From: Hiraash Thawfeek Date: Tue, 29 Sep 2015 23:15:53 +0530 Subject: [PATCH 009/415] Including definitions for Commangular library The commangular library definitions are added as per https://github.com/yukatan/commangular --- commangular/commangular-mock.d.ts | 73 ++++++++ commangular/commangular.d.ts | 273 ++++++++++++++++++++++++++++++ 2 files changed, 346 insertions(+) create mode 100644 commangular/commangular-mock.d.ts create mode 100644 commangular/commangular.d.ts diff --git a/commangular/commangular-mock.d.ts b/commangular/commangular-mock.d.ts new file mode 100644 index 0000000000..8f74b659fc --- /dev/null +++ b/commangular/commangular-mock.d.ts @@ -0,0 +1,73 @@ +// Type definitions for Commangular Mock 0.9.0 +// Project: http://commangular.org +// Definitions by: Hiraash Thawfeek +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module commangular { + + /////////////////////////////////////////////////////////////////////////// + // Commangular Static + // see http://commangular.org/docs/#commangular-namespace + /////////////////////////////////////////////////////////////////////////// + interface ICommAngularStatic { + + /** + * Mock dispatch function for testing commands. + */ + dispatch( ec: ICommandCall, callback: Function ); + } + + interface ICommandCall { + /** + * Name of the command that needs to + * execute + */ + command: string; + + /** + * Data that needs to be passed to the command + */ + data?: any; + } + + + /** + * Object type expected to be passed into the callback function + * of the dispatch() function + */ + interface ICommandInfo { + /** + * The data that was passed into the command + * @param key The property name that is in the object that was passed + */ + dataPassed( key : string ) : any; + + /** + * The data that was returned by the command + * @param key The result key that was defined in the command. If no result + * was defined use 'lastResult' as the key + */ + resultKey( key: string ): any; + + /** + * Indicates if the command execution was cancelled. + */ + canceled( ): boolean; + + /** + * Indicates if the command was executed???? + */ + commandExecuted( ): boolean; + } + +} + + +/** +* Mock dispatch function for testing commands. +* @param ec an ICommandCall object +* @param callback The function that will be called upon the completion of the command +* function should expecte an ICommandInfo paramter. +*/ +declare function dispatch( ec: commangular.ICommandCall, callback: Function ); + diff --git a/commangular/commangular.d.ts b/commangular/commangular.d.ts new file mode 100644 index 0000000000..bf3cbb5d94 --- /dev/null +++ b/commangular/commangular.d.ts @@ -0,0 +1,273 @@ +// Type definitions for Commangular 0.9.0 +// Project: http://commangular.org +// Definitions by: Hiraash Thawfeek +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare var commangular: commangular.ICommAngularStatic; + +declare module commangular { + + /////////////////////////////////////////////////////////////////////////// + // Commangular Static + // see http://commangular.org/docs/#commangular-namespace + /////////////////////////////////////////////////////////////////////////// + interface ICommAngularStatic { + + /** + * Use this function to create and register a command with Commangular + * + * @param commandName It's the name of the command you are creating. It's useful to reference the command from the command provider. + * @param commandFunction It's the command class that will be executed when commangular runs this command. + * It has to be something that implements ICommand. Same as angular syntax + * @param commandConfig It's and object with paramaters to configure the command execution. + */ + create (commandName: string, commandFunction: Function, commandConfig?:ICommandConfig) : void; + command (commandName: string, commandFunction: Function, commandConfig?:ICommandConfig) : void; + + /** + * This function allows you to hijack the execution before or after and + * execute some cross cutting functionality. + * see http://commangular.org/docs/#command-aspects + * @param aspectDescriptor The interceptor descriptor has two parts 'Where' and 'What'. + * Where do you want to intercept? you've 5 options : + * - @Before : The interceptor will be executed before the command. You will be able to + * cancel the command or modify the data that will be injected in the command or do + * some other operation you need before the command execution. + * - @After : The interceptor will be executed just after the command and before any other next + * command. You can get the lastResult from the command, cancel execution etc etc. + * - @AfterExecution : This intercetor is executed just after the command execute method and + * it can get the result from the command and update it before the onResult method is executed. + * - @AfterThrowing : This interceptor will be executed if the command or any interceptor of + * the command throws an exception. You can get the error throwed injected to do what you need. + * - @Around : The interceptor is executed around a command.That means that a especial + * object 'processor' will be injected in the interceptor and you can invoke the command + * or the next interceptor. It will be better explained below. + * @param aspectFunction It's the command class execute function that will be run for the given aspect. + * @param order You can chain any number of interceptors to the same command, so if you need to executed + * the interceptor in a specific order you can indicate it here. An order of 0 is assigned by default. + */ + aspect ( aspectDescriptor: string, aspectFunction: ICommand, order: number ) : void; + + /** + * Event aspects work the same way command aspects do, but they intercept all the command groups instead, + * so you can run some function before the command group starts it's execution , after or when any + * command or interceptor in the group throw an exception. + * see http://commangular.org/docs/#event-aspects + * @param aspectDescriptor The interceptor descriptor has two parts 'Where' and 'What'. + * Where do you want to intercept? you've 3 options : + * - @Before : The interceptor will be executed before the command. You will be able to + * cancel the command or modify the data that will be injected in the command or do + * some other operation you need before the command execution. + * - @After : The interceptor will be executed just after the command and before any other next + * command. You can get the lastResult from the command, cancel execution etc etc. + * - @AfterThrowing : This interceptor will be executed if the command or any interceptor of + * the command throws an exception. You can get the error throwed injected to do what you need. + * @param aspectFunction It's the command class execute function that will be run for the given aspect. + * @param order You can chain any number of interceptors to the same command, so if you need to executed + * the interceptor in a specific order you can indicate it here. An order of 0 is assigned by default. + */ + eventAspect( aspectDescriptor: string, aspectFunction: ICommand, order: number ) : void; + + /** + * TBD + */ + resolver( commandName: string, resolverFunction ) : void; + + /** + * Clears all commands and aspects registered with commangular. + */ + reset() : void; + + /** + * Can be used to enable/disable debug + */ + debug( enableDebug : boolean ) : void; + + /** + * TBD + */ + build() : void; + } + + /** + * The command function/object + * see http://commangular.org/docs/#commangular-namespace + */ + interface ICommand { + /** + * This function is what gets called when the command executes. + * It can take parameters in as injected by angular + */ + execute() : any; + + } + + interface IResultCommand extends ICommand{ + /** + * Is executed after the execute method and the interception chain and can receive + * the result from the execute method of the same command. + * + * @param result Value/object returned by the execution. + */ + onResult ( result: any ) : void; + + /** + * Is executed when the executed method ends with an error. Can receive the error throw by the execute method. + * @param error The error that occured during execution + */ + onError ( error: Error ) : void; + } + + /** + * The result object expected in the promise returned by the dispatch function + * This must be extended to add custom result keys + * see http://commangular.org/docs/#returning-result-from-commands + */ + interface ICommandResult { + /** + * By defualt the result of the command will be found in this property + */ + lastResult : any; + } + + /** + * Command creation configuration + * see http://commangular.org/docs/#the-command-config-object + */ + interface ICommandConfig { + /** + * This property instruct commangular to keep the value returned by the command in the value + * key passed in 'resultKey'. It has to be a string. It means that after the execution of this + * commands you will be able to inject on the next command using that key and the result of the command will be injected. + */ + resultKey : string; + } + + /** + * All the command configuration of your application is done in an angular config block and + * with the $commangularProvider. The provider is responsible to build the command strutures and + * map them to the desired event names. You can create multiple configs blocks in angular, so you + * can have multiple command config blocks to separate functional parts of your application. + * see http://commangular.org/docs/#using-the-provider + */ + interface ICommAngularProvider { + + /** + * This function lets you map a even name to a command sequence + * @param eventName An event that will be watched by commangular + */ + mapTo( eventName: string ) : ICommAngularDescriptor; + + /** + * Used along with mapTo function. Creates a sequence of commands that + * execute after one and other + * see http://commangular.org/docs/#building-command-sequences + */ + asSequence(): ICommAngularDescriptor; + + /** + * Used along with mapTo function. Maps commands to be executed parallel + * see http://commangular.org/docs/#building-parallel-commands + */ + asParallel(): ICommAngularDescriptor; + + /** + * A command flow is a decision point inside the command group.You can have any number + * of flows inside a command group and nesting them how you perfer. + * see http://commangular.org/docs/#building-command-flows + */ + asFlow(): ICommAngularDescriptor; + + findCommand( eventName: string ): ICommAngularDescriptor; + + } + + /** + * The service that enables the execution of commands + * see http://commangular.org/docs/#dispatching-events + */ + interface ICommAngularService { + + /** + * This function executes the given command sequence. + * see http://commangular.org/docs/#dispatching-events + * @param eventName Name of the even that will trigger a command sequence + * @param data Data of any type that will be passed to the command. + */ + dispatch( eventName: string, data?: any ) : ng.IPromise; + } + + interface ICommAngularDescriptor { + + /** + * Used along with mapTo function. Creates a sequence of commands that + * execute after one and other + * see http://commangular.org/docs/#building-command-sequences + */ + asSequence (): ICommAngularDescriptor; + + /** + * Used along with mapTo function. Maps commands to be executed parallel + * see http://commangular.org/docs/#building-parallel-commands + */ + asParallel(): ICommAngularDescriptor; + + /** + * A command flow is a decision point inside the command group.You can have any number + * of flows inside a command group and nesting them how you perfer. + * see http://commangular.org/docs/#building-command-flows + */ + asFlow(): ICommAngularDescriptor; + + /** + * Add commands to a descriptor. + * @param command The name that was used to create the command. + */ + add ( command: string ): ICommAngularDescriptor; + + /** + * Add descriptor to a descriptor. + * @param descriptor Another descriptor attached to a sequnce of commands. + */ + add ( descriptor: ICommAngularDescriptor ): ICommAngularDescriptor; + + /** + * This is to be used with flowing commands to attach an expression that + * evaluates using Angular $parse. + * see http://commangular.org/docs/#building-command-flows + * @param expression A string form expression that can make use of services to validate conditions. + * @param services A comma seperated list of services that are used in the above expression + */ + link ( expression: string, services?: string ): ICommAngularDescriptor; + + /** + * Works with the link function to attach a command to the flow if the + * expression becomes truthy. + * see http://commangular.org/docs/#building-command-flows + * @param command The name that was used to create the command. + */ + to ( command: string ): ICommAngularDescriptor; + + } + +} + +/** + * Extending the angular rootScope to include the dispatch function in all scopes. + */ +declare module angular { + + interface IRootScopeService { + + /** + * Commangular method to execute a command. + * @param eventName Name of the even that will trigger a command sequence + * @param data Data of any type that will be passed to the command. + */ + dispatch( eventName: string, data?: any ) : ng.IPromise; + + } + +} \ No newline at end of file From 683a6e7ec04521ccffc299fd89bcedd870d7582b Mon Sep 17 00:00:00 2001 From: Hiraash Thawfeek Date: Tue, 29 Sep 2015 23:31:03 +0530 Subject: [PATCH 010/415] Fixes for missing parts of the definition based on the CI test on DefinitelyTyped --- commangular/commangular-mock.d.ts | 4 ++-- commangular/commangular.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commangular/commangular-mock.d.ts b/commangular/commangular-mock.d.ts index 8f74b659fc..134e4d0d1e 100644 --- a/commangular/commangular-mock.d.ts +++ b/commangular/commangular-mock.d.ts @@ -14,7 +14,7 @@ declare module commangular { /** * Mock dispatch function for testing commands. */ - dispatch( ec: ICommandCall, callback: Function ); + dispatch( ec: ICommandCall, callback: Function ): void; } interface ICommandCall { @@ -69,5 +69,5 @@ declare module commangular { * @param callback The function that will be called upon the completion of the command * function should expecte an ICommandInfo paramter. */ -declare function dispatch( ec: commangular.ICommandCall, callback: Function ); +declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void; diff --git a/commangular/commangular.d.ts b/commangular/commangular.d.ts index bf3cbb5d94..b03a22574e 100644 --- a/commangular/commangular.d.ts +++ b/commangular/commangular.d.ts @@ -73,7 +73,7 @@ declare module commangular { /** * TBD */ - resolver( commandName: string, resolverFunction ) : void; + resolver( commandName: string, resolverFunction : Function ) : void; /** * Clears all commands and aspects registered with commangular. From c1f3aa4bc80f8f3c73d17db9fd6ef0003e7f0b18 Mon Sep 17 00:00:00 2001 From: James Gardner Date: Mon, 5 Oct 2015 09:39:03 +1300 Subject: [PATCH 011/415] Added AddClasses option to DroppableOptions interface The AddClasses option seems to be missing from the DroppableOptions interface. I have added it to the interface and alphabetically re-ordered the options so they match with the jQueryUI documentation. --- jqueryui/jqueryui.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index a49a779e28..2487087d60 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -474,9 +474,10 @@ declare module JQueryUI { } interface DroppableOptions extends DroppableEvents { - disabled?: boolean; accept?: any; activeClass?: string; + addClasses?: boolean; + disabled?: boolean; greedy?: boolean; hoverClass?: string; scope?: string; From e36c90fb816f60509bdf3984d4851ad6a63446a7 Mon Sep 17 00:00:00 2001 From: Simon Gausmann Date: Thu, 15 Oct 2015 14:43:40 +0200 Subject: [PATCH 012/415] adding typings for node-cache-manager lib --- cache-manager/cache-manager-tests.ts | 51 ++++++++++++++++++++++++++++ cache-manager/cache-manager.d.ts | 36 ++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 cache-manager/cache-manager-tests.ts create mode 100644 cache-manager/cache-manager.d.ts diff --git a/cache-manager/cache-manager-tests.ts b/cache-manager/cache-manager-tests.ts new file mode 100644 index 0000000000..36d2a559a0 --- /dev/null +++ b/cache-manager/cache-manager-tests.ts @@ -0,0 +1,51 @@ +/// + +import * as cacheManager from 'cache-manager' + +const memoryCache = cacheManager.caching({store: 'memory', max: 100, ttl: 10/*seconds*/}); +const ttl = 5; + +memoryCache.set('foo', 'bar', {ttl: ttl}, (err) => { + + if (err) { + throw err; + } + + memoryCache.get('foo', (err, result) => { + + // console.log(result); + + memoryCache.del('foo', (err) => { + }); + + }); +}); + +function getUser(id:number, cb:Function) { + + cb(null, {id: id, name: 'Bob'}); +} + +const userId = 123; +const key = 'user_' + userId; + +// Note: ttl is optional in wrap() +memoryCache.wrap<{id: number, name: string}>(key, (cb) => { + + getUser(userId, cb); + +}, {ttl: ttl}, (err, user) => { + + //console.log(user); + + // Second time fetches user from memoryCache + memoryCache.wrap<{id: number, name: string}>(key, (cb)=> { + + getUser(userId, cb); + + }, (err, user) => { + + //console.log(user); + + }); +}); \ No newline at end of file diff --git a/cache-manager/cache-manager.d.ts b/cache-manager/cache-manager.d.ts new file mode 100644 index 0000000000..e7cad31740 --- /dev/null +++ b/cache-manager/cache-manager.d.ts @@ -0,0 +1,36 @@ +// Type definitions for cache-manager v1.2.0 +// Project: https://github.com/BryanDonovan/node-cache-manager +// Definitions by: Simon Gausmann www.gausmann-media.de +// Definitions: https://github.com/borisyankov/DefinitelyTyped +declare module 'cache-manager' { + + + interface ICachingConfig { + ttl: number; + } + interface IStoreConfig extends ICachingConfig { + store:string; + max?: number; + isCacheableValue?:(value:any)=>boolean; + } + interface ICache { + set(key:string, value:T, options:ICachingConfig, callback?:(error:any)=>void):void; + set(key:string, value:T, ttl:number, callback?:(error:any)=>void):void; + + wrap(key:string, wrapper:(callback:(error:any, result:T)=>void)=>void, options:ICachingConfig, callback:(error:any, result:T)=>void):void; + wrap(key:string, wrapper:(callback:(error:any, result:T)=>void)=>void, callback:(error:any, result:T)=>void):void; + + get(key:string, callback:(error:any, result:T)=>void):void; + + del(key:string, callback?:(error:any)=>void):void; + } + + + module cacheManager { + function caching(ICongig:IStoreConfig):ICache; + + function multiCaching(Caches:ICache[]):ICache; + } + + export = cacheManager; +} \ No newline at end of file From d1b97507ac1b9097e48a8cf2abd23f1a5c0c38d1 Mon Sep 17 00:00:00 2001 From: Simon Gausmann Date: Thu, 15 Oct 2015 15:05:49 +0200 Subject: [PATCH 013/415] website in comments --- cache-manager/cache-manager.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cache-manager/cache-manager.d.ts b/cache-manager/cache-manager.d.ts index e7cad31740..d912f9f7bd 100644 --- a/cache-manager/cache-manager.d.ts +++ b/cache-manager/cache-manager.d.ts @@ -1,6 +1,6 @@ // Type definitions for cache-manager v1.2.0 // Project: https://github.com/BryanDonovan/node-cache-manager -// Definitions by: Simon Gausmann www.gausmann-media.de +// Definitions by: Simon Gausmann // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module 'cache-manager' { @@ -26,6 +26,7 @@ declare module 'cache-manager' { } + module cacheManager { function caching(ICongig:IStoreConfig):ICache; @@ -33,4 +34,4 @@ declare module 'cache-manager' { } export = cacheManager; -} \ No newline at end of file +} From d201ae04f7545013f581da033384ec7e967b14b2 Mon Sep 17 00:00:00 2001 From: Dominic Alie Date: Thu, 15 Oct 2015 14:05:21 -0400 Subject: [PATCH 014/415] Sylvester type definitions --- sylvester/sylvester-test.ts | 207 +++++++++ sylvester/sylvester.d.ts | 825 ++++++++++++++++++++++++++++++++++++ 2 files changed, 1032 insertions(+) create mode 100644 sylvester/sylvester-test.ts create mode 100644 sylvester/sylvester.d.ts diff --git a/sylvester/sylvester-test.ts b/sylvester/sylvester-test.ts new file mode 100644 index 0000000000..1eb5e076ec --- /dev/null +++ b/sylvester/sylvester-test.ts @@ -0,0 +1,207 @@ +/// +interface IAny { + a: any; +} + +var obj: IAny; +var n: number = 0; +var bool: boolean = false; +var str: string = ''; + +var l: Line = Line.create(v, v); +var m: Matrix = Matrix.create(v); +var p: Plane = Plane.create(v, v); +var v: Vector = Vector.create([n, n]); + +l = Line.create([n], [n]); +l = Line.X; +l = Line.Y; +l = Line.Z; +v = l.anchor; +bool = l.contains(v); +v = l.direction; +n = l.distanceFrom(l); +n = l.distanceFrom(v); +n = l.distanceFrom(p); +l = l.dup(); +bool = l.eql(l); +v = l.intersectionWith(l); +v = l.intersectionWith(p); +bool = l.intersects(l); +bool = l.intersects(p); +bool = l.isParallelTo(l); +bool = l.isParallelTo(p); +bool = l.liesIn(p); +v = l.pointClosestTo(l); +v = l.pointClosestTo(v); +l = l.reflectionIn(l); +l = l.reflectionIn(p); +l = l.reflectionIn(v); +l = l.rotate(n, l); +l = l.rotate(n, v); +l = l.setVectors([n, n], v); +l = l.setVectors(v, [n, n]); +l = l.translate(v); +l = l.translate([n, n]); + +m = Matrix.create(m); +m = Matrix.create([n]); +m = Matrix.create([[n]]); +m = Matrix.create(v); +m = Matrix.Diagonal(m); +m = Matrix.Diagonal([n]); +m = Matrix.Diagonal([[n]]); +m = Matrix.Diagonal(v); +m = Matrix.I(n); +m = Matrix.Random(n, n); +m = Matrix.Rotation(n); +m = Matrix.Rotation(n, v); +m = Matrix.RotationX(n); +m = Matrix.RotationY(n); +m = Matrix.RotationZ(n); +m = Matrix.Zero(n, n); +m = m.add(m); +m = m.augment(m); +m = m.augment(v); +bool = m.canMultiplyFromLeft(m); +v = m.col(n); +n = m.cols(); +n = m.det(); +n = m.determinant(); +v = m.diagonal(); +obj = m.dimensions(); +m = m.dup(); +v = m.e(n, n); +var element: number[][] = m.elements; +bool = m.eql(m); +bool = m.eql(v); +obj = m.indexOf(n); +str = m.inspect(); +m = m.inv(); +m = m.inverse(); +bool = m.isSameSizeAs(m); +bool = m.isSingular(); +bool = m.isSquare(); + +m = m.map((x, i, j) => { + n = x; + n = i; + n = j; +}); + +n = m.max(); +m = m.minor(n, n, n, n); +m = m.multiply(n); +m = m.multiply(m); +v = m.multiply(v); +n = m.rank(); +n = m.rk(); +m = m.round(); +v = m.row(n); +n = m.rows(); +m = m.setElements(m); +m = m.setElements([n, n]); +m = m.setElements([[n, n]]); +m = m.setElements(v); +m = m.snapTo(n); +m = m.subtract(m); +m = m.toRightTriangular(); +m = m.toUpperTriangular(); +n = m.tr(); +n = m.trace(); +m = m.transpose(); +m = m.x(m); +m = m.x(n); +v = m.x(v); + +p = Plane.create([0], [0]); +p = Plane.XY; +p = Plane.YX; +p = Plane.YZ; +p = Plane.ZX; +v = p.anchor; +bool = p.contains(v); +bool = p.contains(l); +n = p.distanceFrom(p); +n = p.distanceFrom(v); +n = p.distanceFrom(l); +p = p.dup(); +bool = p.eql(p); +v = p.intersectionWith(l); +l = p.intersectionWith(p); +bool = p.intersects(p); +bool = p.intersects(l); +bool = p.isParallelTo(p); +bool = p.isParallelTo(l); +bool = p.isPerpendicularTo(p); +v = p.normal; +v = p.pointClosestTo(v); +p = p.reflectionIn(p); +p = p.reflectionIn(v); +p = p.reflectionIn(l); +p = p.rotate(n, l); +p = p.setVectors([n], [n]); +p = p.setVectors(v, v); +p = p.setVectors([n], [n], [n]); +p = p.setVectors(v, v, v); +p = p.translate([n]); +p = p.translate(v); + +v = Vector.create(v); +v = Vector.i; +v = Vector.j; +v = Vector.k; +v = Vector.Random(n); +v = Vector.Zero(n); +v = v.add(v); +v = v.add([n, n]); +n = v.angleFrom(v); +v = v.cross(v); +v = v.cross([n, n]); +n = v.dimensions(); +n = v.distanceFrom(v); +n = v.distanceFrom(l); +n = v.distanceFrom(p); +n = v.dot(v); +n = v.dot([n, n]); +v = v.dup(); +n = v.e(n); + +v.each((x, i) => { + n = x; + n = i; +}); + +var elements: number[] = v.elements; +bool = v.eql(v); +bool = v.eql([n, n]); +n = v.indexOf(n); +str = v.inspect(); +bool = v.isAntiparallelTo(v); +bool = v.isParallelTo(v); +bool = v.isPerpendicularTo(v); +bool = v.liesIn(p); +bool = v.liesOn(l); + +v = v.map((x, i) => { + n = x; + n = i; +}); + +n = v.max(); +n = v.modulus(); +v = v.multiply(n); +v = v.reflectionIn(v); +v = v.reflectionIn(l); +v = v.reflectionIn(p); +v = v.rotate(n, v); +v = v.rotate(n, l); +v = v.round(); +v = v.setElements(v); +v = v.setElements([n, n]); +v = v.snapTo(n); +v = v.subtract(v); +v = v.to3D(); +m = v.toDiagonalMatrix(); +v = v.toUnitVector(); +v = v.x(n); \ No newline at end of file diff --git a/sylvester/sylvester.d.ts b/sylvester/sylvester.d.ts new file mode 100644 index 0000000000..0aa869d38c --- /dev/null +++ b/sylvester/sylvester.d.ts @@ -0,0 +1,825 @@ +// Type definitions for sylvester 0.1.3 +// Project: https://github.com/jcoglan/sylvester +// Definitions by: Stephane Alie +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// === Sylvester === +// Vector and Matrix mathematics modules for JavaScript +// Copyright (c) 2007 James Coglan + +interface VectorStatic { + /** + * Constructor function. + */ + create(elements: Vector|Array): Vector; + + i: Vector; + j: Vector; + k: Vector; + + /** + * Random vector of size n. + * + * @param {number} n The vector size. + */ + Random(n: number): Vector; + + /** + * Vector filled with zeros. + * + * @param {number} n The vector size. + */ + Zero(n: number): Vector; +} + +interface Vector { + /** + * Gets an array containing the vector's elements. + */ + elements: Array; + + /** + * Returns element i of the vector. + */ + e(i: number): number; + + /** + * Returns the number of elements the vector has. + */ + dimensions(): number; + + /** + * Returns the modulus ('length') of the vector. + */ + modulus(): number; + + /** + * Returns true if the vector is equal to the argument. + * + * @param {Vector|Array} vector The vector to compare equality. + */ + eql(vector: Vector|Array): boolean; + + /** + * Returns a copy of the vector. + */ + dup(): Vector; + + /** + * Maps the vector to another vector according to the given function. + * + * @param {Function} fn The function to apply to each element (x, i) => {}. + */ + map(fn: (x: number, i: number) => any): Vector; + + /** + * Calls the iterator for each element of the vector in turn. + * + * @param {Function} fn The function to apply to each element (x, i) => {}. + */ + each(fn: (x: number, i: number) => any): void; + + /** + * Returns a new vector created by normalizing the receiver. + */ + toUnitVector(): Vector; + + /** + * Returns the angle between the vector and the argument (also a vector). + * + * @param {Vector} vector The other vector to calculate the angle. + */ + angleFrom(vector: Vector): number; + + /** + * Returns true if the vector is parallel to the argument. + * + * @param {Vector} vector The other vector. + */ + isParallelTo(vector: Vector): boolean; + + /** + * Returns true if the vector is antiparallel to the argument. + * + * @param {Vector} vector The other vector. + */ + isAntiparallelTo(vector: Vector): boolean; + + /** + * Returns true iff the vector is perpendicular to the argument. + * + * @param {Vector} vector The other vector. + */ + isPerpendicularTo(vector: Vector): boolean; + + /** + * Returns the result of adding the argument to the vector. + * + * @param {Vector|Array} vector The vector. + */ + add(vector: Vector|Array): Vector; + + /** + * Returns the result of subtracting the argument from the vector. + * + * @param {Vector|Array} vector The vector. + */ + subtract(vector: Vector|Array): Vector; + + /** + * Returns the result of multiplying the elements of the vector by the argument. + * + * @param {number} k The value by which to multiply the vector. + */ + multiply(k: number): Vector; + + /** + * Returns the result of multiplying the elements of the vector by the argument (Alias for multiply(k)). + * + * @param {number} k The value by which to multiply the vector. + */ + x(k: number): Vector; + + /** + * Returns the scalar product of the vector with the argument. Both vectors must have equal dimensionality. + * + * @param: {Vector|Array} vector The other vector. + */ + dot(vector: Vector|Array): number; + + /** + * Returns the vector product of the vector with the argument. Both vectors must have dimensionality 3. + * + * @param {Vector|Array} vector The other vector. + */ + cross(vector: Vector|Array): Vector; + + /** + * Returns the (absolute) largest element of the vector. + */ + max(): number; + + /** + * Returns the index of the first match found. + * + * @param {number} x The value. + */ + indexOf(x: number): number; + + /** + * Returns a diagonal matrix with the vector's elements as its diagonal elements. + */ + toDiagonalMatrix(): Matrix; + + /** + * Returns the result of rounding the elements of the vector. + */ + round(): Vector; + + /** + * Returns a copy of the vector with elements set to the given value if they differ from + * it by less than Sylvester.precision. + * + * @param {number} x The value to snap to. + */ + snapTo(x: number): Vector; + + /** + * Returns the vector's distance from the argument, when considered as a point in space. + * + * @param {Vector|Line|Plane} obj The object to calculate the distance. + */ + distanceFrom(obj: Vector|Line|Plane): number; + + /** + * Returns true if the vector is point on the given line. + * + * @param {Line} line The line. + */ + liesOn(line: Line): boolean; + + /** + * Return true if the vector is a point in the given plane. + * + * @param {Plane} plane The plane. + */ + liesIn(plane: Plane): boolean; + + /** + * Rotates the vector about the given object. The object should be a point if the vector is 2D, + * and a line if it is 3D. Be careful with line directions! + * + * @param {number} t The angle in radians. + * @param {Vector|Line} obj The rotation axis. + */ + rotate(t: number, obj: Vector|Line): Vector; + + /** + * Returns the result of reflecting the point in the given point, line or plane. + * + * @param {Vector|Line|Plane} obj The object. + */ + reflectionIn(obj: Vector|Line|Plane): Vector; + + /** + * Utility to make sure vectors are 3D. If they are 2D, a zero z-component is added. + */ + to3D(): Vector; + + /** + * Returns a string representation of the vector. + */ + inspect(): string; + + /** + * Set vector's elements from an array. + * + * @param {Vector|Array} els The elements. + */ + setElements(els: Vector|Array): Vector; +} + +interface MatrixStatic { + /** + * Constructor function. + * + * @param {Array|Array>|Vector|Matrix} elements The elements. + */ + create(elements: Array|Array>|Vector | Matrix): Matrix; + + /** + * Identity matrix of size n. + * + * @param {number} n The size. + */ + I(n: number): Matrix; + + /** + * Diagonal matrix - all off-diagonal elements are zero + * + * @param {any} elements The elements. + */ + Diagonal(elements: Array|Array>|Vector | Matrix): Matrix; + + /** + * Rotation matrix about some axis. If no axis is supplied, assume we're after a 2D transform. + * + * @param {number} theta The angle in radians. + * @param {Vector} a [Optional] The axis. + */ + Rotation(theta: number, a?: Vector): Matrix; + + RotationX(t: number): Matrix; + RotationY(t: number): Matrix; + RotationZ(t: number): Matrix; + + /** + * Random matrix of n rows, m columns. + * + * @param {number} n The number of rows. + * @param {number} m The number of columns. + */ + Random(n: number, m: number): Matrix; + + /** + * Matrix filled with zeros. + * + * @param {number} n The number of rows. + * @param {number} m The number of columns. + */ + Zero(n: number, m: number): Matrix; +} + +interface Matrix { + /** + * Gets a nested array containing the matrix's elements. + */ + elements: Array>; + /** + * Returns element (i,j) of the matrix. + * + * @param {number} i The row index. + * @param {number} j The column index. + */ + e(i: number, j: number): any; + + /** + * Returns row k of the matrix as a vector. + * + * @param {number} i The row index. + */ + row(i: number): Vector; + + /** + * Returns column k of the matrix as a vector. + * + * @param {number} j The column index. + */ + col(j: number): Vector; + + /** + * Returns the number of rows/columns the matrix has. + * + * @return {any} An object { rows: , cols: }. + */ + dimensions(): any; + + /** + * Returns the number of rows in the matrix. + */ + rows(): number; + + /** + * Returns the number of columns in the matrix. + */ + cols(): number; + + /** + * Returns true if the matrix is equal to the argument. You can supply a vector as the argument, + * in which case the receiver must be a one-column matrix equal to the vector. + * + * @param {Vector|Matrix} matrix The argument to compare. + */ + eql(matrix: Vector|Matrix): boolean; + + /** + * Returns a copy of the matrix. + */ + dup(): Matrix; + + /** + * Maps the matrix to another matrix (of the same dimensions) according to the given function. + * + * @param {Function} fn The function. + */ + map(fn: (x: number, i: number, j: number) => any): Matrix; + + /** + * Returns true iff the argument has the same dimensions as the matrix. + * + * @param {Matrix} matrix The other matrix. + */ + isSameSizeAs(matrix: Matrix): boolean; + + /** + * Returns the result of adding the argument to the matrix. + * + * @param {Matrix} matrix The matrix to add. + */ + add(matrix: Matrix): Matrix; + + /** + * Returns the result of subtracting the argument from the matrix. + * + * @param {Matrix} matrix The matrix to substract. + */ + subtract(matrix: Matrix): Matrix; + + /** + * Returns true iff the matrix can multiply the argument from the left. + * + * @param {Matrix} matrix The matrix. + */ + canMultiplyFromLeft(matrix: Matrix): boolean; + + /** + * Returns the result of multiplying the matrix from the right by the argument. If the argument is a scalar + * then just multiply all the elements. If the argument is a vector, a vector is returned, which saves you + * having to remember calling col(1) on the result. + * + * @param {number|Matrix} matrix The multiplier. + */ + multiply(matrix: number|Matrix): Matrix; + + /** + * Returns the result of multiplying the matrix from the right by the argument. If the argument is a scalar + * then just multiply all the elements. If the argument is a vector, a vector is returned, which saves you + * having to remember calling col(1) on the result. + * + * @param {Vector} vector The multiplier. + */ + multiply(vector: Vector): Vector; + + x(matrix: number|Matrix): Matrix; + + x(vector: Vector): Vector; + + /** + * Returns a submatrix taken from the matrix. Argument order is: start row, start col, nrows, ncols. + * Element selection wraps if the required index is outside the matrix's bounds, so you could use + * this to perform row/column cycling or copy-augmenting. + * + * @param {number} a Starting row index. + * @param {number} b Starting column index. + * @param {number} c Number of rows. + * @param {number} d Number of columns. + */ + minor(a: number, b: number, c: number, d: number): Matrix; + + /** + * Returns the transpose of the matrix. + */ + transpose(): Matrix; + + /** + * Returns true if the matrix is square. + */ + isSquare(): boolean; + + /** + * Returns the (absolute) largest element of the matrix. + */ + max(): number; + + /** + * Returns the indeces of the first match found by reading row-by-row from left to right. + * + * @param {number} x The value. + * + * @return {any} The element indeces i.e: { row:1, col:1 } + */ + indexOf(x: number): any; + + /** + * If the matrix is square, returns the diagonal elements as a vector; otherwise, returns null. + */ + diagonal(): Vector; + + /** + * Make the matrix upper (right) triangular by Gaussian elimination. This method only adds multiples + * of rows to other rows. No rows are scaled up or switched, and the determinant is preserved. + */ + toRightTriangular(): Matrix; + toUpperTriangular(): Matrix; + + /** + * Returns the determinant for square matrices. + */ + determinant(): number; + det(): number; + + /** + * Returns true if the matrix is singular. + */ + isSingular(): boolean; + + /** + * Returns the trace for square matrices. + */ + trace(): number; + tr(): number; + + /** + * Returns the rank of the matrix. + */ + rank(): number; + rk(): number; + + /** + * Returns the result of attaching the given argument to the right-hand side of the matrix. + * + * @param {Matrix|Vector} matrix The matrix or vector. + */ + augment(matrix: Matrix|Vector): Matrix; + + /** + * Returns the inverse (if one exists) using Gauss-Jordan. + */ + inverse(): Matrix; + inv(): Matrix; + + /** + * Returns the result of rounding all the elements. + */ + round(): Matrix; + + /** + * Returns a copy of the matrix with elements set to the given value if they differ from it + * by less than Sylvester.precision. + * + * @param {number} x The value. + */ + snapTo(x: number): Matrix; + + /** + * Returns a string representation of the matrix. + */ + inspect(): string; + + /** + * Set the matrix's elements from an array. If the argument passed is a vector, the resulting matrix + * will be a single column. + * + * @param {Array|Array>|Vector|Matrix} matrix The elements. + */ + setElements(matrix: Array|Array>|Vector|Matrix): Matrix; +} + +interface LineStatic { + /** + * Constructor function. + * + * @param Array|Vector anchor The anchor vector. + * @param Array|Vector direction The direction vector. + */ + create(anchor: Array|Vector, direction: Array|Vector): Line; + + X: Line; + Y: Line; + Z: Line; +} + +interface Line { + /** + * Gets the 3D vector corresponding to a point on the line. + */ + anchor: Vector; + + /** + * Gets a normalized 3D vector representing the line's direction. + */ + direction: Vector; + + /** + * Returns true if the argument occupies the same space as the line. + * + * @param {Line} line The other line. + */ + eql(line: Line): boolean; + + /** + * Returns a copy of the line. + */ + dup(): Line; + + /** + * Returns the result of translating the line by the given vector/array. + * + * @param {Vector|Array} vector The translation vector. + */ + translate(vector: Vector|Array): Line; + + /** + * Returns true if the line is parallel to the argument. Here, 'parallel to' means that the argument's + * direction is either parallel or antiparallel to the line's own direction. A line is parallel to a + * plane if the two do not have a unique intersection. + * + * @param {Line|Plane} obj The object. + */ + isParallelTo(obj: Line|Plane): boolean; + + /** + * Returns the line's perpendicular distance from the argument, which can be a point, a line or a plane. + * + * @param {Vector|Line|Plane} obj The object. + */ + distanceFrom(obj: Vector|Line|Plane): number; + + /** + * Returns true if the argument is a point on the line. + * + * @param {Vector} point The point. + */ + contains(point: Vector): boolean; + + /** + * Returns true if the line lies in the given plane. + * + * @param {Plane} plane The plane. + */ + liesIn(plane: Plane): boolean; + + /** + * Returns true if the line has a unique point of intersection with the argument. + * + * @param {Line|Plane} obj The object. + */ + intersects(obj: Line|Plane): boolean; + + /** + * Returns the unique intersection point with the argument, if one exists. + * + * @param {Line|Plane} obj The object. + */ + intersectionWith(obj: Line|Plane): Vector; + + /** + * Returns the point on the line that is closest to the given point or line. + * + * @param {Vector|Line} obj The object. + */ + pointClosestTo(obj: Vector|Line): Vector; + + /** + * Returns a copy of the line rotated by t radians about the given line. Works by finding the argument's + * closest point to this line's anchor point (call this C) and rotating the anchor about C. Also rotates + * the line's direction about the argument's. Be careful with this - the rotation axis' direction + * affects the outcome! + * + * @param {number} t The angle in radians. + * @param {Vector|Line} axis The axis. + */ + rotate(t: number, axis: Vector|Line): Line; + + /** + * Returns the line's reflection in the given point or line. + * + * @param {Vector|Line|Plane} obj The object. + */ + reflectionIn(obj: Vector|Line|Plane): Line; + + /** + * Set the line's anchor point and direction. + * + * @param {Array|Vector} anchor The anchor vector. + * @param {Array|Vector} direction The direction vector. + */ + setVectors(anchor: Array|Vector, direction: Array|Vector): Line; +} + +interface PlaneStatic { + /** + * Constructor function. + */ + create(anchor: Array|Vector, normal: Array|Vector): Plane; + + /** + * Constructor function. + */ + create(anchor: Array|Vector, v1: Array|Vector, v2: Array|Vector): Plane; + + XY: Plane; + YZ: Plane; + ZX: Plane; + YX: Plane; +} + +interface Plane { + /** + * Gets the 3D vector corresponding to a point in the plane. + */ + anchor: Vector; + + /** + * Gets a normalized 3D vector perpendicular to the plane. + */ + normal: Vector; + + /** + * Returns true if the plane occupies the same space as the argument. + * + * @param {Plane} plane The other plane. + */ + eql(plane: Plane): boolean; + + /** + * Returns a copy of the plane. + */ + dup(): Plane; + + /** + * Returns the result of translating the plane by the given vector. + * + * @param {Array|Vector} vector The translation vector. + */ + translate(vector: Array|Vector): Plane; + + /** + * Returns true if the plane is parallel to the argument. Will return true if the planes are equal, + * or if you give a line and it lies in the plane. + * + * @param {Line|Plane} obj The object. + */ + isParallelTo(obj: Line|Plane): boolean; + + /** + * Returns true if the receiver is perpendicular to the argument. + * + * @param {Plane} plane The other plane. + */ + isPerpendicularTo(plane: Plane): boolean; + + /** + * Returns the plane's distance from the given object (point, line or plane). + * + * @parm {Vector|Line|Plane} obj The object. + */ + distanceFrom(obj: Vector|Line|Plane): number; + + /** + * Returns true if the plane contains the given point or line. + * + * @param {Vector|Line} obj The object. + */ + contains(obj: Vector|Line): boolean; + + /** + * Returns true if the plane has a unique point/line of intersection with the argument. + * + * @param {Line|Plane} obj The object. + */ + intersects(obj: Line|Plane): boolean; + + /** + * Returns the unique intersection with the argument, if one exists. + * + * @param {Line} line The line. + */ + intersectionWith(line: Line): Vector; + + /** + * Returns the unique intersection with the argument, if one exists. + * + * @param {Plane} plane The plane. + */ + intersectionWith(plane: Plane): Line; + + /** + * Returns the point in the plane closest to the given point. + * + * @param {Vector} point The point. + */ + pointClosestTo(point: Vector): Vector; + + /** + * Returns a copy of the plane, rotated by t radians about the given line. See notes on Line#rotate. + * + * @param {number} t The angle in radians. + * @param {Line} axis The line axis. + */ + rotate(t: number, axis: Line): Plane; + + /** + * Returns the reflection of the plane in the given point, line or plane. + * + * @param {Vector|Line|Plane} obj The object. + */ + reflectionIn(obj: Vector|Line|Plane): Plane; + + /** + * Sets the anchor point and normal to the plane. Normal vector is normalised before storage. + * + * @param {Array|Vector} anchor The anchor vector. + * @param {Array|Vector} normal The normal vector. + */ + setVectors(anchor: Array|Vector, normal: Array|Vector): Plane; + + /** + * Sets the anchor point and normal to the plane. The normal is calculated by assuming the three points + * should lie in the same plane. Normal vector is normalised before storage. + * + * @param {Array|Vector} anchor The anchor vector. + * @param {Array|Vector} v1 The first direction vector. + * @param {Array|Vector} v2 The second direction vector. + */ + setVectors(anchor: Array|Vector, v1: Array|Vector, v2: Array|Vector): Plane; +} + +declare module Sylvester { + export var version: string; + export var precision: number; +} + +declare var Vector: VectorStatic; +declare var Matrix: MatrixStatic; +declare var Line: LineStatic; +declare var Plane: PlaneStatic; + +/** +* Constructor function. +* +* @param {Vector|Array): Vector; + +/** +* Constructor function. +* +* @param {Array|Array>|Vector|Matrix} elements The elements. +*/ +declare function $M(elements: Array|Array>|Vector | Matrix): Matrix; + +/** +* Constructor function. +* +* @param Array|Vector anchor The anchor vector. +* @param Array|Vector direction The direction vector. +*/ +declare function $L(anchor: Array|Vector, direction: Array|Vector): Line; + +/** +* Constructor function. +* +* @param {Array|Vector} anchor The anchor vector. +* @param {Array|Vector} normal The normal vector. +*/ +declare function $P(anchor: Array|Vector, normal: Array|Vector): Plane; + +/** + * Constructor function. + * + * @param {Array|Vector} anchor The anchor vector. + * @param {Array|Vector} v1 The first direction vector. + * @param {Array|Vecotr} v2 The second direction vector. + */ +declare function $P(anchor: Array|Vector, v1: Array|Vector, v2: Array|Vector): Plane; \ No newline at end of file From 1fbadc073327fd627065c772509069b23c755d30 Mon Sep 17 00:00:00 2001 From: Simon Gausmann Date: Wed, 21 Oct 2015 20:45:16 +0200 Subject: [PATCH 015/415] removing I from Interface-Names --- cache-manager/cache-manager-tests.ts | 16 ++++++++-------- cache-manager/cache-manager.d.ts | 27 +++++++++++++-------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/cache-manager/cache-manager-tests.ts b/cache-manager/cache-manager-tests.ts index 36d2a559a0..36eeb4c141 100644 --- a/cache-manager/cache-manager-tests.ts +++ b/cache-manager/cache-manager-tests.ts @@ -2,10 +2,10 @@ import * as cacheManager from 'cache-manager' -const memoryCache = cacheManager.caching({store: 'memory', max: 100, ttl: 10/*seconds*/}); +const memoryCache = cacheManager.caching({ store: 'memory', max: 100, ttl: 10/*seconds*/ }); const ttl = 5; -memoryCache.set('foo', 'bar', {ttl: ttl}, (err) => { +memoryCache.set('foo', 'bar', { ttl: ttl }, (err) => { if (err) { throw err; @@ -21,25 +21,25 @@ memoryCache.set('foo', 'bar', {ttl: ttl}, (err) => { }); }); -function getUser(id:number, cb:Function) { +function getUser(id: number, cb: Function) { - cb(null, {id: id, name: 'Bob'}); + cb(null, { id: id, name: 'Bob' }); } const userId = 123; const key = 'user_' + userId; // Note: ttl is optional in wrap() -memoryCache.wrap<{id: number, name: string}>(key, (cb) => { +memoryCache.wrap<{ id: number, name: string }>(key, (cb) => { getUser(userId, cb); -}, {ttl: ttl}, (err, user) => { +}, { ttl: ttl }, (err, user) => { //console.log(user); // Second time fetches user from memoryCache - memoryCache.wrap<{id: number, name: string}>(key, (cb)=> { + memoryCache.wrap<{ id: number, name: string }>(key, (cb) => { getUser(userId, cb); @@ -48,4 +48,4 @@ memoryCache.wrap<{id: number, name: string}>(key, (cb) => { //console.log(user); }); -}); \ No newline at end of file +}); diff --git a/cache-manager/cache-manager.d.ts b/cache-manager/cache-manager.d.ts index d912f9f7bd..9570857f01 100644 --- a/cache-manager/cache-manager.d.ts +++ b/cache-manager/cache-manager.d.ts @@ -5,32 +5,31 @@ declare module 'cache-manager' { - interface ICachingConfig { + interface CachingConfig { ttl: number; } - interface IStoreConfig extends ICachingConfig { - store:string; + interface StoreConfig extends CachingConfig { + store: string; max?: number; - isCacheableValue?:(value:any)=>boolean; + isCacheableValue?: (value: any) => boolean; } - interface ICache { - set(key:string, value:T, options:ICachingConfig, callback?:(error:any)=>void):void; - set(key:string, value:T, ttl:number, callback?:(error:any)=>void):void; + interface Cache { + set(key: string, value: T, options: CachingConfig, callback?: (error: any) => void): void; + set(key: string, value: T, ttl: number, callback?: (error: any) => void): void; - wrap(key:string, wrapper:(callback:(error:any, result:T)=>void)=>void, options:ICachingConfig, callback:(error:any, result:T)=>void):void; - wrap(key:string, wrapper:(callback:(error:any, result:T)=>void)=>void, callback:(error:any, result:T)=>void):void; + wrap(key: string, wrapper: (callback: (error: any, result: T) => void) => void, options: CachingConfig, callback: (error: any, result: T) => void): void; + wrap(key: string, wrapper: (callback: (error: any, result: T) => void) => void, callback: (error: any, result: T) => void): void; - get(key:string, callback:(error:any, result:T)=>void):void; + get(key: string, callback: (error: any, result: T) => void): void; - del(key:string, callback?:(error:any)=>void):void; + del(key: string, callback?: (error: any) => void): void; } module cacheManager { - function caching(ICongig:IStoreConfig):ICache; - - function multiCaching(Caches:ICache[]):ICache; + function caching(ICongig: StoreConfig): Cache; + function multiCaching(Caches: Cache[]): Cache; } export = cacheManager; From 2319d7a678b044b3a31c00acbd87f23c233cfd73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Ostroz=CC=8Cli=CC=81k?= Date: Thu, 29 Oct 2015 13:28:44 +0100 Subject: [PATCH 016/415] Added karma-chai-sinon --- karma-chai-sinon/karma-chai-sinon.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 karma-chai-sinon/karma-chai-sinon.d.ts diff --git a/karma-chai-sinon/karma-chai-sinon.d.ts b/karma-chai-sinon/karma-chai-sinon.d.ts new file mode 100644 index 0000000000..059a1b80ef --- /dev/null +++ b/karma-chai-sinon/karma-chai-sinon.d.ts @@ -0,0 +1,12 @@ +// Type definitions for karma-chai-sinon 0.1.5 +// Project: https://github.com/tubalmartin/karma-chai-sinon +// Definitions by: Václav Ostrožlík +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare var should: Chai.Should; +declare var expect: Chai.ExpectStatic; +declare var assert: Chai.AssertStatic; +declare var sinon: Sinon.SinonStatic; From 6d2b4cc7a04d45df15cafe6bdb16c697e7413d2e Mon Sep 17 00:00:00 2001 From: Dominic Alie Date: Fri, 30 Oct 2015 10:12:18 -0400 Subject: [PATCH 017/415] Fix namespace issue --- sylvester/sylvester-test.ts | 17 +++ sylvester/sylvester.d.ts | 212 ++++++++++++++++++------------------ 2 files changed, 123 insertions(+), 106 deletions(-) diff --git a/sylvester/sylvester-test.ts b/sylvester/sylvester-test.ts index 1eb5e076ec..e42bb374e0 100644 --- a/sylvester/sylvester-test.ts +++ b/sylvester/sylvester-test.ts @@ -13,10 +13,14 @@ var m: Matrix = Matrix.create(v); var p: Plane = Plane.create(v, v); var v: Vector = Vector.create([n, n]); +l = $L(v, v); +l = $L([n], [n]); l = Line.create([n], [n]); + l = Line.X; l = Line.Y; l = Line.Z; + v = l.anchor; bool = l.contains(v); v = l.direction; @@ -44,10 +48,15 @@ l = l.setVectors(v, [n, n]); l = l.translate(v); l = l.translate([n, n]); +m = $M(m); +m = $M([n]); +m = $M([[n]]); +m = $M(v); m = Matrix.create(m); m = Matrix.create([n]); m = Matrix.create([[n]]); m = Matrix.create(v); + m = Matrix.Diagonal(m); m = Matrix.Diagonal([n]); m = Matrix.Diagonal([[n]]); @@ -114,11 +123,15 @@ m = m.x(m); m = m.x(n); v = m.x(v); +p = $P([n], [n]); +p = $P(v, v); p = Plane.create([0], [0]); + p = Plane.XY; p = Plane.YX; p = Plane.YZ; p = Plane.ZX; + v = p.anchor; bool = p.contains(v); bool = p.contains(l); @@ -147,10 +160,14 @@ p = p.setVectors(v, v, v); p = p.translate([n]); p = p.translate(v); +v = $V(v); +v = $V([n]); v = Vector.create(v); + v = Vector.i; v = Vector.j; v = Vector.k; + v = Vector.Random(n); v = Vector.Zero(n); v = v.add(v); diff --git a/sylvester/sylvester.d.ts b/sylvester/sylvester.d.ts index 0aa869d38c..2b899728f7 100644 --- a/sylvester/sylvester.d.ts +++ b/sylvester/sylvester.d.ts @@ -7,29 +7,111 @@ // Vector and Matrix mathematics modules for JavaScript // Copyright (c) 2007 James Coglan -interface VectorStatic { - /** - * Constructor function. - */ - create(elements: Vector|Array): Vector; +declare module Sylvester { + interface VectorStatic { + /** + * Constructor function. + */ + create(elements: Vector|Array): Vector; - i: Vector; - j: Vector; - k: Vector; + i: Vector; + j: Vector; + k: Vector; - /** - * Random vector of size n. - * - * @param {number} n The vector size. - */ - Random(n: number): Vector; + /** + * Random vector of size n. + * + * @param {number} n The vector size. + */ + Random(n: number): Vector; - /** - * Vector filled with zeros. - * - * @param {number} n The vector size. - */ - Zero(n: number): Vector; + /** + * Vector filled with zeros. + * + * @param {number} n The vector size. + */ + Zero(n: number): Vector; + } + interface MatrixStatic { + /** + * Constructor function. + * + * @param {Array|Array>|Vector|Matrix} elements The elements. + */ + create(elements: Array|Array>|Vector | Matrix): Matrix; + + /** + * Identity matrix of size n. + * + * @param {number} n The size. + */ + I(n: number): Matrix; + + /** + * Diagonal matrix - all off-diagonal elements are zero + * + * @param {any} elements The elements. + */ + Diagonal(elements: Array|Array>|Vector | Matrix): Matrix; + + /** + * Rotation matrix about some axis. If no axis is supplied, assume we're after a 2D transform. + * + * @param {number} theta The angle in radians. + * @param {Vector} a [Optional] The axis. + */ + Rotation(theta: number, a?: Vector): Matrix; + + RotationX(t: number): Matrix; + RotationY(t: number): Matrix; + RotationZ(t: number): Matrix; + + /** + * Random matrix of n rows, m columns. + * + * @param {number} n The number of rows. + * @param {number} m The number of columns. + */ + Random(n: number, m: number): Matrix; + + /** + * Matrix filled with zeros. + * + * @param {number} n The number of rows. + * @param {number} m The number of columns. + */ + Zero(n: number, m: number): Matrix; + } + + interface LineStatic { + /** + * Constructor function. + * + * @param Array|Vector anchor The anchor vector. + * @param Array|Vector direction The direction vector. + */ + create(anchor: Array|Vector, direction: Array|Vector): Line; + + X: Line; + Y: Line; + Z: Line; + } + interface PlaneStatic { + /** + * Constructor function. + */ + create(anchor: Array|Vector, normal: Array|Vector): Plane; + + /** + * Constructor function. + */ + create(anchor: Array|Vector, v1: Array|Vector, v2: Array|Vector): Plane; + + XY: Plane; + YZ: Plane; + ZX: Plane; + YX: Plane; + } } interface Vector { @@ -239,57 +321,6 @@ interface Vector { setElements(els: Vector|Array): Vector; } -interface MatrixStatic { - /** - * Constructor function. - * - * @param {Array|Array>|Vector|Matrix} elements The elements. - */ - create(elements: Array|Array>|Vector | Matrix): Matrix; - - /** - * Identity matrix of size n. - * - * @param {number} n The size. - */ - I(n: number): Matrix; - - /** - * Diagonal matrix - all off-diagonal elements are zero - * - * @param {any} elements The elements. - */ - Diagonal(elements: Array|Array>|Vector | Matrix): Matrix; - - /** - * Rotation matrix about some axis. If no axis is supplied, assume we're after a 2D transform. - * - * @param {number} theta The angle in radians. - * @param {Vector} a [Optional] The axis. - */ - Rotation(theta: number, a?: Vector): Matrix; - - RotationX(t: number): Matrix; - RotationY(t: number): Matrix; - RotationZ(t: number): Matrix; - - /** - * Random matrix of n rows, m columns. - * - * @param {number} n The number of rows. - * @param {number} m The number of columns. - */ - Random(n: number, m: number): Matrix; - - /** - * Matrix filled with zeros. - * - * @param {number} n The number of rows. - * @param {number} m The number of columns. - */ - Zero(n: number, m: number): Matrix; -} - interface Matrix { /** * Gets a nested array containing the matrix's elements. @@ -515,20 +546,6 @@ interface Matrix { setElements(matrix: Array|Array>|Vector|Matrix): Matrix; } -interface LineStatic { - /** - * Constructor function. - * - * @param Array|Vector anchor The anchor vector. - * @param Array|Vector direction The direction vector. - */ - create(anchor: Array|Vector, direction: Array|Vector): Line; - - X: Line; - Y: Line; - Z: Line; -} - interface Line { /** * Gets the 3D vector corresponding to a point on the line. @@ -637,23 +654,6 @@ interface Line { setVectors(anchor: Array|Vector, direction: Array|Vector): Line; } -interface PlaneStatic { - /** - * Constructor function. - */ - create(anchor: Array|Vector, normal: Array|Vector): Plane; - - /** - * Constructor function. - */ - create(anchor: Array|Vector, v1: Array|Vector, v2: Array|Vector): Plane; - - XY: Plane; - YZ: Plane; - ZX: Plane; - YX: Plane; -} - interface Plane { /** * Gets the 3D vector corresponding to a point in the plane. @@ -780,10 +780,10 @@ declare module Sylvester { export var precision: number; } -declare var Vector: VectorStatic; -declare var Matrix: MatrixStatic; -declare var Line: LineStatic; -declare var Plane: PlaneStatic; +declare var Vector: Sylvester.VectorStatic; +declare var Matrix: Sylvester.MatrixStatic; +declare var Line: Sylvester.LineStatic; +declare var Plane: Sylvester.PlaneStatic; /** * Constructor function. From 9c433c79496fb2b79a6e87f7e4be5d3bc3dfdf5a Mon Sep 17 00:00:00 2001 From: Dominic Alie Date: Mon, 2 Nov 2015 09:52:28 -0500 Subject: [PATCH 018/415] Renamed test file --- sylvester/{sylvester-test.ts => sylvester-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sylvester/{sylvester-test.ts => sylvester-tests.ts} (100%) diff --git a/sylvester/sylvester-test.ts b/sylvester/sylvester-tests.ts similarity index 100% rename from sylvester/sylvester-test.ts rename to sylvester/sylvester-tests.ts From b97eba0f03f534499b220f6a12af8da7855d5342 Mon Sep 17 00:00:00 2001 From: aaronbeall Date: Fri, 20 Nov 2015 12:59:08 -0500 Subject: [PATCH 019/415] Update react-addons-css-transition-group.d.ts with Timeout properties Added missing transitionAppearTimeout, transitionEnterTimeout, transitionLeaveTimeout to CSSTransitionGroupProps --- react/react-addons-css-transition-group.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/react/react-addons-css-transition-group.d.ts b/react/react-addons-css-transition-group.d.ts index c9b40476d5..19db30ec5e 100644 --- a/react/react-addons-css-transition-group.d.ts +++ b/react/react-addons-css-transition-group.d.ts @@ -20,8 +20,11 @@ declare namespace __React { interface CSSTransitionGroupProps extends TransitionGroupProps { transitionName: string | CSSTransitionGroupTransitionName; transitionAppear?: boolean; + transitionAppearTimeout?: number; transitionEnter?: boolean; + transitionEnterTimeout?: number; transitionLeave?: boolean; + transitionLeaveTimeout?: number; } type CSSTransitionGroup = ComponentClass; From a98b730f38c175babaad498da2000a41ade24ce0 Mon Sep 17 00:00:00 2001 From: Droritos Date: Sat, 28 Nov 2015 12:25:55 +0200 Subject: [PATCH 020/415] Create lockr.d.ts --- lockr/lockr.d.ts | 108 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 lockr/lockr.d.ts diff --git a/lockr/lockr.d.ts b/lockr/lockr.d.ts new file mode 100644 index 0000000000..eba2b85609 --- /dev/null +++ b/lockr/lockr.d.ts @@ -0,0 +1,108 @@ +// Type definitions for lockr 0.8.3 +// Project: https://github.com/tsironis/lockr +// Definitions by: Dror Weiss +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare var Lockr: lockr.ILockrStatic; + +declare module lockr { + interface ILockrStatic { + + /** + * Set a key to a particular value or a hash object (Object or Array) under a hash key. + * @param key + * @param value + */ + set(key: string, value: string | number | Object); + + /** + * Set a key to a particular value or a hash object (Object or Array) under a hash key. + * @param key + * @param value + */ + set(key: string, value: Array); + + /** + * Removes all data associated to a key. + * @param key + */ + rm(key: string); + + /** + * Returns the saved value for given key, even if the saved value is hash object. + * If value is null or undefined it returns a default value. + * @param key + * @param defaultValue + */ + get(key: string, defaultValue?: T): T; + + /** + * Adds a unique value to a particular set under a hash key. + * @param key + * @param value + */ + sadd(key: string, value: string | number | Object); + + /** + * Adds a unique value to a particular set under a hash key. + * @param key + * @param value + */ + sadd(key: string, value: Array); + + /** + * Returns the values of a particular set under a hash key. + * @param key + */ + smembers(key: string): (string | number | Object)[]; + + /** + * Returns the values of a particular set under a hash key. + * @param key + */ + smembers(key: string): Array; + + /** + * Returns whether the value exists in a particular set under a hash key. + * @param key + * @param value + */ + sismember(key: string, value: string | number | Object): boolean; + + /** + * Returns whether the value exists in a particular set under a hash key. + * @param key + * @param value + */ + sismember(key: string, value: Array): boolean; + + /** + * Removes a value from a particular set under a hash key. + * @param key + * @param value + */ + srem(key: string, value: string | number | Object); + + /** + * Removes a value from a particular set under a hash key. + * @param key + * @param value + */ + srem(key: string, value: Array); + + /** + * Returns all saved values & objects, in an Array. + */ + getAll(): (string | number | Object)[]; + + /** + * Empties localStorage. + */ + flush(); + } +} + + +declare module "lockr" { + export = Lockr; +} From 8b3ef3165d577de1621fbb174b90bc3a106b3e18 Mon Sep 17 00:00:00 2001 From: Droritos Date: Sat, 28 Nov 2015 13:05:13 +0200 Subject: [PATCH 021/415] Update lockr.d.ts --- lockr/lockr.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lockr/lockr.d.ts b/lockr/lockr.d.ts index eba2b85609..6655bf2b22 100644 --- a/lockr/lockr.d.ts +++ b/lockr/lockr.d.ts @@ -8,6 +8,11 @@ declare var Lockr: lockr.ILockrStatic; declare module lockr { interface ILockrStatic { + /** + * The prefix used by lockr. + */ + prefix: string; + /** * Set a key to a particular value or a hash object (Object or Array) under a hash key. * @param key From 39ac2bba70530ac65281823d8cce5202873d50f4 Mon Sep 17 00:00:00 2001 From: Droritos Date: Sat, 28 Nov 2015 13:06:11 +0200 Subject: [PATCH 022/415] Create lockr-tests.ts --- lockr/lockr-tests.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lockr/lockr-tests.ts diff --git a/lockr/lockr-tests.ts b/lockr/lockr-tests.ts new file mode 100644 index 0000000000..a791413965 --- /dev/null +++ b/lockr/lockr-tests.ts @@ -0,0 +1,25 @@ +/// + +Lockr.set('test', 123); +Lockr.sadd('array', 2); +Lockr.sadd('array', 3); +Lockr.set('hash', {"test": 123, "hey": "whatsup"}); +Lockr.set('hash', [1, 2, 3]); +Lockr.set('valueFalse', false); +Lockr.set('value0', 0); + +let value; +value = Lockr.get('test'); +Lockr.rm('test'); + +let contents; +contents = Lockr.getAll(); +Lockr.flush(); + +Lockr.sadd('test_set', 1); +Lockr.sadd('test_set', 2); +Lockr.smembers('test_set'); +Lockr.sismember('test_set', 1); +Lockr.srem('test_set', 1); + +Lockr.prefix = "imaprefix"; From f3ace73ce186068711d968e124bc1f5f1b1166fc Mon Sep 17 00:00:00 2001 From: Droritos Date: Sat, 28 Nov 2015 13:12:56 +0200 Subject: [PATCH 023/415] Update lockr.d.ts --- lockr/lockr.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lockr/lockr.d.ts b/lockr/lockr.d.ts index 6655bf2b22..169db126f5 100644 --- a/lockr/lockr.d.ts +++ b/lockr/lockr.d.ts @@ -18,20 +18,20 @@ declare module lockr { * @param key * @param value */ - set(key: string, value: string | number | Object); + set(key: string, value: string | number | Object): void; /** * Set a key to a particular value or a hash object (Object or Array) under a hash key. * @param key * @param value */ - set(key: string, value: Array); + set(key: string, value: Array): void; /** * Removes all data associated to a key. * @param key */ - rm(key: string); + rm(key: string): void; /** * Returns the saved value for given key, even if the saved value is hash object. @@ -46,14 +46,14 @@ declare module lockr { * @param key * @param value */ - sadd(key: string, value: string | number | Object); + sadd(key: string, value: string | number | Object): void; /** * Adds a unique value to a particular set under a hash key. * @param key * @param value */ - sadd(key: string, value: Array); + sadd(key: string, value: Array): void; /** * Returns the values of a particular set under a hash key. @@ -86,14 +86,14 @@ declare module lockr { * @param key * @param value */ - srem(key: string, value: string | number | Object); + srem(key: string, value: string | number | Object): void; /** * Removes a value from a particular set under a hash key. * @param key * @param value */ - srem(key: string, value: Array); + srem(key: string, value: Array): void; /** * Returns all saved values & objects, in an Array. @@ -103,7 +103,7 @@ declare module lockr { /** * Empties localStorage. */ - flush(); + flush(): void; } } From e9880e3833ae5f39fbae9b424e9f77a86da62add Mon Sep 17 00:00:00 2001 From: Droritos Date: Sat, 28 Nov 2015 13:19:03 +0200 Subject: [PATCH 024/415] Update lockr-tests.ts --- lockr/lockr-tests.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lockr/lockr-tests.ts b/lockr/lockr-tests.ts index a791413965..d1e2542121 100644 --- a/lockr/lockr-tests.ts +++ b/lockr/lockr-tests.ts @@ -8,12 +8,10 @@ Lockr.set('hash', [1, 2, 3]); Lockr.set('valueFalse', false); Lockr.set('value0', 0); -let value; -value = Lockr.get('test'); +let value = Lockr.get('test'); Lockr.rm('test'); -let contents; -contents = Lockr.getAll(); +let contents = Lockr.getAll(); Lockr.flush(); Lockr.sadd('test_set', 1); From 13e6958c49d05cd0093dd24448811ecbce35be7c Mon Sep 17 00:00:00 2001 From: Droritos Date: Sat, 28 Nov 2015 13:20:38 +0200 Subject: [PATCH 025/415] Update lockr-tests.ts --- lockr/lockr-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lockr/lockr-tests.ts b/lockr/lockr-tests.ts index d1e2542121..c8b3596630 100644 --- a/lockr/lockr-tests.ts +++ b/lockr/lockr-tests.ts @@ -8,7 +8,7 @@ Lockr.set('hash', [1, 2, 3]); Lockr.set('valueFalse', false); Lockr.set('value0', 0); -let value = Lockr.get('test'); +let value = Lockr.get('test'); Lockr.rm('test'); let contents = Lockr.getAll(); From 3e1a4a1af0564a993639a72d61835edbd4d0eabc Mon Sep 17 00:00:00 2001 From: Droritos Date: Sun, 6 Dec 2015 15:22:46 +0200 Subject: [PATCH 026/415] Update lockr.d.ts Changed naming of interface ILockrStatic to LockrStatic --- lockr/lockr.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lockr/lockr.d.ts b/lockr/lockr.d.ts index 169db126f5..c615c13e5d 100644 --- a/lockr/lockr.d.ts +++ b/lockr/lockr.d.ts @@ -3,10 +3,10 @@ // Definitions by: Dror Weiss // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare var Lockr: lockr.ILockrStatic; +declare var Lockr: lockr.LockrStatic; declare module lockr { - interface ILockrStatic { + interface LockrStatic { /** * The prefix used by lockr. From f4f0812f254fafa92c45bca356aa3e570c163f72 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Mon, 7 Dec 2015 13:22:33 -0500 Subject: [PATCH 027/415] Add NavbarHeader to react-bootstrap --- react-bootstrap/react-bootstrap.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/react-bootstrap/react-bootstrap.d.ts b/react-bootstrap/react-bootstrap.d.ts index c63c55e9d0..80286f1743 100644 --- a/react-bootstrap/react-bootstrap.d.ts +++ b/react-bootstrap/react-bootstrap.d.ts @@ -475,6 +475,15 @@ declare module "react-bootstrap" { interface NavBrandClass extends React.ComponentClass { } var NavBrand: NavBrandClass; + // + // ---------------------------------------- + interface NavbarHeaderProps { + + } + interface NavbarHeader extends React.ReactElement { } + interface NavbarHeaderClass extends React.ComponentClass { } + var NavbarHeader: NavbarHeaderClass; + // // ---------------------------------------- From fe3f2f35a881cd824c8da1142ff0b21a3071a372 Mon Sep 17 00:00:00 2001 From: cherrydev Date: Mon, 7 Dec 2015 12:45:56 -0800 Subject: [PATCH 028/415] added missing static functions Function definition for Dexie.delete at Dexie.js:3246 Function definition for Dexie.exists at Dexie.js:3259 Other static definitions are still missing. --- dexie/dexie.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dexie/dexie.d.ts b/dexie/dexie.d.ts index 13b9b31e0b..2de122385e 100644 --- a/dexie/dexie.d.ts +++ b/dexie/dexie.d.ts @@ -37,6 +37,10 @@ declare class Dexie { static shallowClone(obj: Object): Object; static deepClone(obj: Object): Object; + + static delete(databaseName : string): Dexie.Promise; + + static exists(databaseName : string): Dexie.Promise; version(versionNumber: number): Dexie.Version; From ae8fce14da334c1e525aa2515bbc494073448232 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Thu, 10 Dec 2015 09:37:39 +1100 Subject: [PATCH 029/415] Update definitions for ES6 compatability, NOTE: Confusion over cryptojs vs crypto-js. I would suggest merging the two projects but this needs to happen on the npm repository first... --- crypto-js/crypto-js.d.ts | 579 +++++++++++++++++++++++++++++++++++---- 1 file changed, 520 insertions(+), 59 deletions(-) diff --git a/crypto-js/crypto-js.d.ts b/crypto-js/crypto-js.d.ts index 0f02514027..cde0abd9b9 100644 --- a/crypto-js/crypto-js.d.ts +++ b/crypto-js/crypto-js.d.ts @@ -1,67 +1,528 @@ -// Type definitions for crypto-js v3.1.3 +// Type definitions for crypto-js v3.1.5 // Project: https://github.com/evanvosberg/crypto-js -// Definitions by: Michael Zabka +// Definitions by: Michael Zabka , Jason Turner // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module CryptoJS { - type Hash = (message: string, key?: string, ...options: any[]) => string; +declare module CryptoJSLocal{ + module lib{ + interface Base{ + extend(overrides: Object): Object + init(...args: any[]): void + //arguments of create() is same as init(). This is true for all subclasses + create(...args: any[]): Base + mixIn(properties: Object): void + clone(): Base + } - export interface Hashes { - MD5: Hash; - SHA1: Hash; - SHA256: Hash; - SHA224: Hash; - SHA512: Hash; - SHA384: Hash; - SHA3: Hash; - RIPEMD160: Hash; - HmacMD5: Hash; - HmacSHA1: Hash; - HmacSHA256: Hash; - HmacSHA224: Hash; - HmacSHA512: Hash; - HmacSHA384: Hash; - HmacSHA3: Hash; - HmacRIPEMD160: Hash; - PBKDF2: Hash; - AES: Hash; - TripleDES: Hash; - RC4: Hash; - Rabbit: Hash; - RabbitLegacy: Hash; - EvpKDF: Hash; - format: { - OpenSSL: Hash; - Hex: Hash; - }; - enc: { - Latin1: Hash; - Utf8: Hash; - Hex: Hash; - Utf16: Hash; - Base64: Hash; - }; - mode: { - CFB: Hash; - CTR: Hash; - CTRGladman: Hash; - OFB: Hash; - ECB: Hash; - }; - pad: { - Pkcs7: Hash; - Ansix923: Hash; - Iso10126: Hash; - Iso97971: Hash; - ZeroPadding: Hash; - NoPadding: Hash; - }; - } + interface WordArray extends Base{ + words: number[] + sigBytes: number + init(words?: number[], sigBytes?: number): void + create(words?: number[], sigBytes?: number): WordArray - export var hashes: Hashes; + init(typedArray: ArrayBuffer): void + init(typedArray: Int8Array): void + + //Because TypeScript uses a structural type system then we don't need (& can't) + //declare oveload function init, create for the following type (same as Int8Array): + //then Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array + //Note also: Uint8ClampedArray is not defined in lib.d.ts & not supported in IE + //@see http://compatibility.shwups-cms.ch/en/home?&property=Uint8ClampedArray + + create(typedArray: ArrayBuffer): WordArray + create(typedArray: Int8Array): WordArray + + toString(encoder?: enc.IEncoder): string + concat(wordArray: WordArray): WordArray + clamp(): void + clone(): WordArray + random(nBytes: number): WordArray + } + + interface BufferedBlockAlgorithm extends Base{ + reset(): void + clone(): BufferedBlockAlgorithm + } + + //tparam C - Configuration type + interface IHasher extends BufferedBlockAlgorithm{ + cfg: C + init(cfg?: C): void + create(cfg?: C): IHasher + + update(messageUpdate: string): Hasher + update(messageUpdate: WordArray): Hasher + + finalize(messageUpdate?: string): WordArray + finalize(messageUpdate?: WordArray): WordArray + + blockSize: number + + _createHelper(hasher: Hasher): IHasherHelper + _createHmacHelper(hasher: Hasher): IHasherHmacHelper + + clone(): IHasher + } + interface Hasher extends IHasher{} + + //tparam C - Configuration type + interface IHasherHelper{ + (message: string, cfg?: C): WordArray + (message: WordArray, cfg?: C): WordArray + } + interface HasherHelper extends IHasherHelper{} + + interface IHasherHmacHelper{ + (message: string, key: string): WordArray + (message: string, key: WordArray): WordArray + (message: WordArray, key: string): WordArray + (message: WordArray, key: WordArray): WordArray + } + + //tparam C - Configuration type + interface ICipher extends BufferedBlockAlgorithm{ + cfg: C + createEncryptor(key: WordArray, cfg?: C): ICipher + createDecryptor(key: WordArray, cfg?: C): ICipher + + create(xformMode?: number, key?: WordArray, cfg?: C): ICipher + init(xformMode?: number, key?: WordArray, cfg?: C): void + + process(dataUpdate: string): WordArray + process(dataUpdate: WordArray): WordArray + + finalize(dataUpdate?: string): WordArray + finalize(dataUpdate?: WordArray): WordArray + + keySize: number + ivSize: number + + _createHelper(cipher: Cipher): ICipherHelper + + clone(): ICipher + } + interface Cipher extends ICipher{} + + interface IStreamCipher extends ICipher{ + drop?: number; + + createEncryptor(key: WordArray, cfg?: C): IStreamCipher + createDecryptor(key: WordArray, cfg?: C): IStreamCipher + + create(xformMode?: number, key?: WordArray, cfg?: C): IStreamCipher + + blockSize: number + } + interface StreamCipher extends IStreamCipher{} + + interface BlockCipherMode extends Base{ + createEncryptor(cipher: Cipher, iv: number[]): mode.IBlockCipherEncryptor + createDecryptor(cipher: Cipher, iv: number[]): mode.IBlockCipherDecryptor + init(cipher?: Cipher, iv?: number[]): void + create(cipher?: Cipher, iv?: number[]): BlockCipherMode + } + + //BlockCipher has interface same as IStreamCipher + interface BlockCipher extends IStreamCipher{} + + interface IBlockCipherCfg { + iv?: WordArray; + mode?: mode.IBlockCipherModeImpl //default CBC + padding?: pad.IPaddingImpl //default Pkcs7 + } + + interface CipherParamsData { + ciphertext?: lib.WordArray + key?: lib.WordArray + iv?: lib.WordArray + salt?: lib.WordArray + algorithm?: Cipher + mode?: mode.IBlockCipherModeImpl + padding?: pad.IPaddingImpl + blockSize?: number + formatter?: format.IFormatter + } + + interface CipherParams extends Base, CipherParamsData{ + init(cipherParams?: CipherParamsData): void + create(cipherParams?: CipherParamsData): CipherParams + toString(formatter?: format.IFormatter): string + } + + //tparam C - Configuration type + interface ISerializableCipher extends Base{ + cfg: C + encrypt(cipher: Cipher, message: WordArray, key: WordArray, cfg?: C): CipherParams + encrypt(cipher: Cipher, message: string, key: WordArray, cfg?: C): CipherParams + + decrypt(cipher: Cipher, ciphertext: CipherParamsData, key: WordArray, cfg?: C): WordArray + decrypt(cipher: Cipher, ciphertext: string, key: WordArray, cfg?: C): WordArray + } + + interface SerializableCipher extends ISerializableCipher{} + interface ISerializableCipherCfg{ + format?: format.IFormatter //default OpenSSLFormatter + iv?: WordArray; + mode?: mode.IBlockCipherModeImpl; + padding?: pad.IPaddingImpl; + } + + interface IPasswordBasedCipher extends Base{ + cfg: C + encrypt(cipher: Cipher, message: WordArray, password: string, cfg?: C): CipherParams + encrypt(cipher: Cipher, message: string, password: string, cfg?: C): CipherParams + + decrypt(cipher: Cipher, ciphertext: CipherParamsData, password: string, cfg?: C): WordArray + decrypt(cipher: Cipher, ciphertext: string, password: string, cfg?: C): WordArray + } + + interface PasswordBasedCipher extends IPasswordBasedCipher{} + interface IPasswordBasedCipherCfg extends ISerializableCipherCfg{ + kdf?: kdf.IKdfImpl //default OpenSSLKdf + mode?: mode.IBlockCipherModeImpl; + padding?: pad.IPaddingImpl; + } + + /** see Cipher._createHelper */ + interface ICipherHelper{ + encrypt(message: string, password: string, cfg?: C): CipherParams + encrypt(message: string, key: WordArray, cfg?: C): CipherParams + encrypt(message: WordArray, password: string, cfg?: C): CipherParams + encrypt(message: WordArray, key: WordArray, cfg?: C): CipherParams + + decrypt(ciphertext: string, password: string, cfg?: C): WordArray + decrypt(ciphertext: string, key: WordArray, cfg?: C): WordArray + decrypt(ciphertext: CipherParamsData, password: string, cfg?: C): WordArray + decrypt(ciphertext: CipherParamsData, key: WordArray, cfg?: C): WordArray + } + + interface CipherHelper extends ICipherHelper{} + interface LibStatic{ + Base: lib.Base + WordArray: lib.WordArray + CipherParams: lib.CipherParams + SerializableCipher: lib.SerializableCipher + PasswordBasedCipher: lib.PasswordBasedCipher + } + } + + module enc{ + interface IEncoder{ + stringify(wordArray: lib.WordArray): string + } + interface IDecoder{ + parse(s: string): lib.WordArray + } + interface ICoder extends IEncoder, IDecoder {} + + interface EncStatic{ + Hex: ICoder + Latin1: ICoder + Utf8: ICoder + Base64: ICoder + Utf16: ICoder + Utf16BE: ICoder + Utf16LE: ICoder + } + } + + module kdf{ + interface KdfStatic{ + OpenSSL: IKdfImpl + } + + interface IKdfImpl{ + execute(password: string, keySize: number, ivSize: number, salt?: string): lib.CipherParams + execute(password: string, keySize: number, ivSize: number, salt?: lib.WordArray): lib.CipherParams + } + } + + module format{ + interface FormatStatic{ + OpenSSL: IFormatter + Hex: IFormatter + } + + interface IFormatter{ + stringify(cipherParams: lib.CipherParamsData): string + parse(s: string): lib.CipherParams + } + } + + module algo{ + interface AlgoStatic{ + AES: algo.AES + DES: algo.DES + TripleDES: algo.TripleDES + + RabbitLegacy: algo.RabbitLegacy + Rabbit: algo.Rabbit + RC4: algo.RC4 + + MD5: algo.MD5 + RIPEMD160: algo.RIPEMD160 + SHA1: algo.SHA1 + SHA256: algo.SHA256 + SHA224: algo.SHA224 + SHA384: algo.SHA384 + SHA512: algo.SHA512 + + SHA3: algo.SHA3 + + HMAC: algo.HMAC + + EvpKDF: algo.EvpKDF + PBKDF2: algo.PBKDF2 + + RC4Drop: algo.RC4Drop + } + + interface IBlockCipherImpl extends lib.BlockCipher{ + encryptBlock(M: number[], offset: number): void + decryptBlock(M: number[], offset: number): void + + createEncryptor(key: lib.WordArray, cfg?: lib.CipherParamsData): IBlockCipherImpl + createDecryptor(key: lib.WordArray, cfg?: lib.CipherParamsData): IBlockCipherImpl + + create(xformMode?: number, key?: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl + } + + interface AES extends IBlockCipherImpl{} + interface DES extends IBlockCipherImpl{} + interface TripleDES extends IBlockCipherImpl{} + + interface RabbitLegacy extends lib.StreamCipher{} + interface Rabbit extends lib.StreamCipher{} + interface RC4 extends lib.StreamCipher{} + + interface MD5 extends lib.Hasher{} + interface RIPEMD160 extends lib.Hasher{} + interface SHA1 extends lib.Hasher{} + interface SHA256 extends lib.Hasher{} + interface SHA224 extends lib.Hasher{} + interface SHA384 extends lib.Hasher{} + interface SHA512 extends lib.Hasher{} + + interface SHA3 extends lib.IHasher{} + interface ISHA3Cfg{ + outputLength?: number //default 512 + } + + interface HMAC extends lib.Base{ + init(hasher?: lib.Hasher, key?: string): void + init(hasher?: lib.Hasher, key?: lib.WordArray): void + create(hasher?: lib.Hasher, key?: string): HMAC + create(hasher?: lib.Hasher, key?: lib.WordArray): HMAC + + update(messageUpdate: string): HMAC + update(messageUpdate: lib.WordArray): HMAC + + finalize(messageUpdate?: string): lib.WordArray + finalize(messageUpdate?: lib.WordArray): lib.WordArray + } + + interface EvpKDF extends lib.Base{ + cfg: IEvpKDFCfg + init(cfg?: IEvpKDFCfg): void + create(cfg?: IEvpKDFCfg): EvpKDF + compute(password: string, salt: string): lib.WordArray + compute(password: string, salt: lib.WordArray): lib.WordArray + compute(password: lib.WordArray, salt: string): lib.WordArray + compute(password: lib.WordArray, salt: lib.WordArray): lib.WordArray + } + interface IEvpKDFCfg{ + keySize?: number //default 128/32 + hasher?: lib.Hasher //default MD5, or SHA1 with PBKDF2 + iterations?: number //default 1 + } + interface IEvpKDFHelper{ + (password: string, salt: string, cfg?: IEvpKDFCfg): lib.WordArray + (password: string, salt: lib.WordArray, cfg?: IEvpKDFCfg): lib.WordArray + (password: lib.WordArray, salt: string, cfg?: IEvpKDFCfg): lib.WordArray + (password: lib.WordArray, salt: lib.WordArray, cfg?: IEvpKDFCfg): lib.WordArray + } + + interface PBKDF2 extends EvpKDF{} //PBKDF2 is same as EvpKDF + + interface RC4Drop extends RC4 { } + } + + module mode{ + interface ModeStatic{ + CBC: mode.CBC + CFB: mode.CFB + CTR: mode.CTR + CTRGladman: mode.CTRGladman + ECB: mode.ECB + OFB: mode.OFB + } + + interface IBlockCipherEncryptor extends lib.BlockCipherMode{ + processBlock(words: number[], offset: number): void + } + interface IBlockCipherDecryptor extends lib.BlockCipherMode{ //exactly as IBlockCipherEncryptor + processBlock(words: number[], offset: number): void + } + interface IBlockCipherModeImpl extends lib.BlockCipherMode{ + Encryptor: IBlockCipherEncryptor + Decryptor: IBlockCipherDecryptor + } + + interface CBC extends IBlockCipherModeImpl{} + interface CFB extends IBlockCipherModeImpl{} + interface CTR extends IBlockCipherModeImpl{} + interface CTRGladman extends IBlockCipherModeImpl{} + interface ECB extends IBlockCipherModeImpl{} + interface OFB extends IBlockCipherModeImpl{} + } + + module pad{ + interface PadStatic{ + Pkcs7: pad.Pkcs7 + AnsiX923: pad.AnsiX923 + Iso10126: pad.Iso10126 + Iso97971: pad.Iso97971 + ZeroPadding: pad.ZeroPadding + NoPadding: pad.NoPadding + } + + interface IPaddingImpl{ + pad(data: lib.WordArray, blockSize: number): void + unpad(data: lib.WordArray): void + } + + interface Pkcs7 extends IPaddingImpl{} + interface AnsiX923 extends IPaddingImpl{} + interface Iso10126 extends IPaddingImpl{} + interface Iso97971 extends IPaddingImpl{} + interface ZeroPadding extends IPaddingImpl{} + interface NoPadding extends IPaddingImpl{} + } + + module x64{ + interface X64Static{ + Word: x64.Word + WordArray: x64.WordArray + } + + interface Word extends lib.Base{ + high: number + low: number + + init(high?: number, low?: number): void + create(high?: number, low?: number): Word + } + + interface WordArray extends lib.Base{ + words: Word[] + sigBytes: number + + init(words?: Word[], sigBytes?: number): void + create(words?: Word[], sigBytes?: number): WordArray + toX32(): lib.WordArray + clone(): WordArray + } + } + + interface CryptoJSStatic{ + lib: lib.LibStatic + enc: enc.EncStatic + kdf: kdf.KdfStatic + format: format.FormatStatic + algo: algo.AlgoStatic + mode: mode.ModeStatic + pad: pad.PadStatic + x64: x64.X64Static + + AES: CryptoJSLocal.lib.ICipherHelper + DES: CryptoJSLocal.lib.ICipherHelper + TripleDES: CryptoJSLocal.lib.ICipherHelper + + RabbitLegacy: CryptoJSLocal.lib.CipherHelper + Rabbit: CryptoJSLocal.lib.CipherHelper + RC4: CryptoJSLocal.lib.CipherHelper + RC4Drop: CryptoJSLocal.lib.ICipherHelper + + MD5: CryptoJSLocal.lib.HasherHelper + HmacMD5: CryptoJSLocal.lib.IHasherHmacHelper + RIPEMD160: CryptoJSLocal.lib.HasherHelper + HmacRIPEMD160: CryptoJSLocal.lib.IHasherHmacHelper + SHA1: CryptoJSLocal.lib.HasherHelper + HmacSHA1: CryptoJSLocal.lib.IHasherHmacHelper + SHA256: CryptoJSLocal.lib.HasherHelper + HmacSHA256: CryptoJSLocal.lib.IHasherHmacHelper + SHA224: CryptoJSLocal.lib.HasherHelper + HmacSHA224: CryptoJSLocal.lib.IHasherHmacHelper + SHA512: CryptoJSLocal.lib.HasherHelper + HmacSHA512: CryptoJSLocal.lib.IHasherHmacHelper + SHA384: CryptoJSLocal.lib.HasherHelper + HmacSHA384: CryptoJSLocal.lib.IHasherHmacHelper + + SHA3: CryptoJSLocal.lib.IHasherHelper + HmacSHA3: CryptoJSLocal.lib.IHasherHmacHelper + + EvpKDF: CryptoJSLocal.algo.IEvpKDFHelper + PBKDF2: CryptoJSLocal.algo.IEvpKDFHelper //PBKDF2 is same as EvpKDF + } + type Hash = (message: string, key?: string, ...options: any[]) => string; + + export interface Hashes { + MD5: Hash; + SHA1: Hash; + SHA256: Hash; + SHA224: Hash; + SHA512: Hash; + SHA384: Hash; + SHA3: Hash; + RIPEMD160: Hash; + HmacMD5: Hash; + HmacSHA1: Hash; + HmacSHA256: Hash; + HmacSHA224: Hash; + HmacSHA512: Hash; + HmacSHA384: Hash; + HmacSHA3: Hash; + HmacRIPEMD160: Hash; + PBKDF2: Hash; + AES: Hash; + TripleDES: Hash; + RC4: Hash; + Rabbit: Hash; + RabbitLegacy: Hash; + EvpKDF: Hash; + format: { + OpenSSL: Hash; + Hex: Hash; + }; + enc: { + Latin1: Hash; + Utf8: Hash; + Hex: Hash; + Utf16: Hash; + Base64: Hash; + }; + mode: { + CFB: Hash; + CTR: Hash; + CTRGladman: Hash; + OFB: Hash; + ECB: Hash; + }; + pad: { + Pkcs7: Hash; + Ansix923: Hash; + Iso10126: Hash; + Iso97971: Hash; + ZeroPadding: Hash; + NoPadding: Hash; + }; + } + + export var hashes: Hashes; } -declare module 'crypto-js' { - import hashes = CryptoJS.hashes; - export = hashes; +declare var CryptoJS: CryptoJSLocal.CryptoJSStatic; + +declare module "crypto-js" { + export = CryptoJS; } From ff75d43ec14eb0d457231790b36e68b347c54016 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Thu, 10 Dec 2015 11:04:01 +1100 Subject: [PATCH 030/415] Updated to include interceptor defintiions... --- axios/axios.d.ts | 289 ++++++++++++++++++++++++++--------------------- 1 file changed, 159 insertions(+), 130 deletions(-) diff --git a/axios/axios.d.ts b/axios/axios.d.ts index 48f57a73a3..86414bde6b 100644 --- a/axios/axios.d.ts +++ b/axios/axios.d.ts @@ -1,162 +1,191 @@ + // Type definitions for axios 0.5.2 // Project: https://github.com/mzabriskie/axios -// Definitions by: Marcel Buesing +// Definitions by: Marcel Buesing , Jason Turner // Definitions: https://github.com/borisyankov/DefinitelyTyped /// declare module Axios { - /** - * - request body data type - */ - interface AxiosXHRConfigBase { + /** + * - request body data type + */ + interface AxiosXHRConfigBase { + + /** + * Change the request data before it is sent to the server. + * This is only applicable for request methods 'PUT', 'POST', and 'PATCH' + * The last function in the array must return a string or an ArrayBuffer + */ + transformRequest?: ((data: T) => U) | [(data: T) => U]; + + /** + * change the response data to be made before it is passed to then/catch + */ + transformResponse?: (data: T) => U; + + /** + * custom headers to be sent + */ + headers?: Object; + + /** + * URL parameters to be sent with the request + */ + params?: Object; + + /** + * indicates whether or not cross-site Access-Control requests + * should be made using credentials + */ + withCredentials?: boolean; + + /** + * indicates the type of data that the server will respond with + * options are 'arraybuffer', 'blob', 'document', 'json', 'text' + */ + responseType?: string; + + /** + * name of the cookie to use as a value for xsrf token + */ + xsrfCookieName?: string; + + /** + * name of the http header that carries the xsrf token value + */ + xsrfHeaderName?: string; + + } /** - * Change the request data before it is sent to the server. - * This is only applicable for request methods 'PUT', 'POST', and 'PATCH' - * The last function in the array must return a string or an ArrayBuffer + * - request body data type */ - transformRequest?: ((data:T) => U)|[(data:T) => U]; + interface AxiosXHRConfig extends AxiosXHRConfigBase { + /** + * server URL that will be used for the request, options are: + * GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH + */ + url: string; + + /** + * request method to be used when making the request + */ + method?: string; + + /** + * data to be sent as the request body + * Only applicable for request methods 'PUT', 'POST', and 'PATCH' + * When no `transformRequest` is set, must be a string, an ArrayBuffer or a hash + */ + data?: T; + } /** - * change the response data to be made before it is passed to then/catch + * - expected response type, + * - request body data type */ - transformResponse?: (data:T) => U; + interface AxiosXHR { + /** + * Response that was provided by the server + */ + data: T; + + /** + * HTTP status code from the server response + */ + status: number; + + /** + * HTTP status message from the server response + */ + statusText: string; + + /** + * headers that the server responded with + */ + headers: Object; + + /** + * config that was provided to `axios` for the request + */ + config: AxiosXHRConfig; + } /** - * custom headers to be sent + * - expected response type, + * - request body data type */ - headers?: Object; + interface AxiosStatic { - /** - * URL parameters to be sent with the request - */ - params?: Object; + (config: AxiosXHRConfig): Promise>; - /** - * indicates whether or not cross-site Access-Control requests - * should be made using credentials - */ - withCredentials?: boolean; + new (config: AxiosXHRConfig): Promise>; - /** - * indicates the type of data that the server will respond with - * options are 'arraybuffer', 'blob', 'document', 'json', 'text' - */ - responseType?: string; - - /** - * name of the cookie to use as a value for xsrf token - */ - xsrfCookieName?: string; - - /** - * name of the http header that carries the xsrf token value - */ - xsrfHeaderName?: string; - - } - - /** - * - request body data type - */ - interface AxiosXHRConfig extends AxiosXHRConfigBase { - /** - * server URL that will be used for the request, options are: - * GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH - */ - url: string; - - /** - * request method to be used when making the request - */ - method?: string; - - /** - * data to be sent as the request body - * Only applicable for request methods 'PUT', 'POST', and 'PATCH' - * When no `transformRequest` is set, must be a string, an ArrayBuffer or a hash - */ - data?: T; - } - - /** - * - expected response type, - * - request body data type - */ - interface AxiosXHR { - /** - * Response that was provided by the server - */ - data: T; - - /** - * HTTP status code from the server response - */ - status: number; - - /** - * HTTP status message from the server response - */ - statusText: string; - - /** - * headers that the server responded with - */ - headers: Object; - - /** - * config that was provided to `axios` for the request - */ - config: AxiosXHRConfig; - } - - /** - * - expected response type, - * - request body data type - */ - interface AxiosStatic { - - (config: AxiosXHRConfig): Promise>; - - new (config: AxiosXHRConfig): Promise>; - - /** - * convenience alias, method = GET - */ - get(url: string, config?: AxiosXHRConfigBase): Promise>; + /** + * convenience alias, method = GET + */ + get(url: string, config?: AxiosXHRConfigBase): Promise>; - /** - * convenience alias, method = DELETE - */ - delete(url: string, config?: AxiosXHRConfigBase): Promise>; + /** + * convenience alias, method = DELETE + */ + delete(url: string, config?: AxiosXHRConfigBase): Promise>; - /** - * convenience alias, method = HEAD - */ - head(url: string, config?: AxiosXHRConfigBase): Promise>; + /** + * convenience alias, method = HEAD + */ + head(url: string, config?: AxiosXHRConfigBase): Promise>; - /** - * convenience alias, method = POST - */ - post(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + /** + * convenience alias, method = POST + */ + post(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; - /** - * convenience alias, method = PUT - */ - put(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + /** + * convenience alias, method = PUT + */ + put(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; - /** - * convenience alias, method = PATCH - */ - patch(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; - } + /** + * convenience alias, method = PATCH + */ + patch(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + interceptors: { + request: Interceptor, + response: Interceptor + } + } + + + + export interface Response { + data?: any; + status?: number; + statusText?: string; + headers?: any; + config?: any; + } + export interface success { + (response: Response): void + } + export interface error { + (response: Axios.Response): void; + } + + export interface Interceptor { + use(success: success, error?: error): void; + eject(interceptor: Interceptor); + } } declare var axios: Axios.AxiosStatic; declare module "axios" { - export = axios; + export = axios; } + + + From f1dfef373316e7dac737171498be047e2cb71d52 Mon Sep 17 00:00:00 2001 From: Rafal Witczak Date: Sun, 29 Nov 2015 12:08:33 -0800 Subject: [PATCH 031/415] TSD file for angular-q-spread module --- angular-q-spread/angular-q-spread-test.ts | 42 +++++++++++++++++++++++ angular-q-spread/angular-q-spread.d.ts | 17 +++++++++ 2 files changed, 59 insertions(+) create mode 100644 angular-q-spread/angular-q-spread-test.ts create mode 100644 angular-q-spread/angular-q-spread.d.ts diff --git a/angular-q-spread/angular-q-spread-test.ts b/angular-q-spread/angular-q-spread-test.ts new file mode 100644 index 0000000000..932ecc4fa9 --- /dev/null +++ b/angular-q-spread/angular-q-spread-test.ts @@ -0,0 +1,42 @@ +/// + +interface IMyService { + getFirstname(): ng.IPromise; + getLastname(): ng.IPromise; +} + +interface IScope { + name: string; +} + +function TestCtrl($scope: IScope, $q: ng.IQService, MyService: IMyService) { + $scope.name = null; + + function firstCallback(firstname: string, lastname: string) + { + return firstname + ' ' + lastname; + } + + function anotherCallback(fullname: string) + { + $scope.name = fullname; + } + + function failureCallback(reason: any) + { + alert('Could not load data: ' + reason); + } + + $q + .all([ + MyService.getFirstname(), + MyService.getLastname() + ]) + .spread(firstCallback) + .then(anotherCallback) + .catch(failureCallback); +}; + +TestCtrl.$inject = ['$scope', '$q', 'MyService']; + +angular.module('test').controller('TestCtrl', TestCtrl); diff --git a/angular-q-spread/angular-q-spread.d.ts b/angular-q-spread/angular-q-spread.d.ts new file mode 100644 index 0000000000..3eb37dc4e0 --- /dev/null +++ b/angular-q-spread/angular-q-spread.d.ts @@ -0,0 +1,17 @@ +// Type definitions for angular-q-spread module +// Project: https://www.npmjs.com/package/angular-q-spread +// Definitions by: rafw87 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module angular { + interface IPromise { + /** + This method can be used as a replacement for then. Similarly, it takes two parameters, a callback when all promises are resolved and a callback for failure. The resolve callback is going to be called with the result of the list of promises passed to $q.all as separate parameters instead of one parameters which is an array. + * @param successCallback Callback for resolved promise, similar to then's one, but takes multiple parameters instead of single array parameter + * @param errorCallback Callback for error, the same as for then + */ + spread(successCallback: (...promiseValues: any[]) => IPromise|TResult, errorCallback?: (reason: any) => any): IPromise; + } +} From 8561b6b2ded8edbeea5ecfe1a8e24def963f257e Mon Sep 17 00:00:00 2001 From: cherrydev Date: Thu, 10 Dec 2015 14:43:38 -0800 Subject: [PATCH 032/415] Update dexie.d.ts Fix embarrassing typo --- dexie/dexie.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dexie/dexie.d.ts b/dexie/dexie.d.ts index 2de122385e..2a527cff93 100644 --- a/dexie/dexie.d.ts +++ b/dexie/dexie.d.ts @@ -13,7 +13,7 @@ interface Thenable { declare class Dexie { constructor(databaseName: string); - constructor(databaseName: string, options: { addons: Array<(db: Dexie) => void> }); + constructor(databaseName: string, options: { addons: Array<(db: Dexie) => void> });b name: string; tables: Dexie.Table[]; @@ -40,7 +40,7 @@ declare class Dexie { static delete(databaseName : string): Dexie.Promise; - static exists(databaseName : string): Dexie.Promise; + static exists(databaseName : string): Dexie.Promise; version(versionNumber: number): Dexie.Version; From 030953bec9719ad5069c5a434fe7f1c31f275ac9 Mon Sep 17 00:00:00 2001 From: cherrydev Date: Thu, 10 Dec 2015 14:49:05 -0800 Subject: [PATCH 033/415] Update dexie.d.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cat walked across the keyboard. Just not my day… --- dexie/dexie.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dexie/dexie.d.ts b/dexie/dexie.d.ts index 2a527cff93..ca90689fa0 100644 --- a/dexie/dexie.d.ts +++ b/dexie/dexie.d.ts @@ -13,7 +13,7 @@ interface Thenable { declare class Dexie { constructor(databaseName: string); - constructor(databaseName: string, options: { addons: Array<(db: Dexie) => void> });b + constructor(databaseName: string, options: { addons: Array<(db: Dexie) => void> }); name: string; tables: Dexie.Table[]; From 0a0cadd8536635c3e53a9757b9396d256d6dd2d5 Mon Sep 17 00:00:00 2001 From: darktutu Date: Fri, 11 Dec 2015 18:10:11 +0800 Subject: [PATCH 034/415] directive compile can return a function whit void IDirective --- angularjs/angular.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index a489141d54..f90992e27e 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1650,7 +1650,7 @@ declare module angular { templateElement: IAugmentedJQuery, templateAttributes: IAttributes, transclude: ITranscludeFunction - ): IDirectivePrePost; + ): void | IDirectivePrePost; } interface IDirective { From 42fc54a14dc7f835da5cacc525926be1ad0f0e00 Mon Sep 17 00:00:00 2001 From: "raf_w87@wp.pl" Date: Sat, 12 Dec 2015 17:09:02 +0100 Subject: [PATCH 035/415] TSD file for angular-q-spread module - angular-q-spread-test.ts -> angular-q-spread-tests.ts --- .../{angular-q-spread-test.ts => angular-q-spread-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename angular-q-spread/{angular-q-spread-test.ts => angular-q-spread-tests.ts} (100%) diff --git a/angular-q-spread/angular-q-spread-test.ts b/angular-q-spread/angular-q-spread-tests.ts similarity index 100% rename from angular-q-spread/angular-q-spread-test.ts rename to angular-q-spread/angular-q-spread-tests.ts From 02941d70e88487358f99e3b5700baf5411dc17c3 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 14 Dec 2015 15:34:11 +1100 Subject: [PATCH 036/415] Added react bootstrap validation --- .../react-bootstrap-validation.d.ts | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 react-bootstrap-validation/react-bootstrap-validation.d.ts diff --git a/react-bootstrap-validation/react-bootstrap-validation.d.ts b/react-bootstrap-validation/react-bootstrap-validation.d.ts new file mode 100644 index 0000000000..9eeee01c1f --- /dev/null +++ b/react-bootstrap-validation/react-bootstrap-validation.d.ts @@ -0,0 +1,83 @@ +/// + +declare module ReactBootstrapValidation{ + + export interface Form { + model; + validateOne: any; + validateAll: any; + errorHelp: string | any; + validationEvent: string; + onValidSubmit: any; + + } + export interface ValidatedInput + { + + name: string; + validationEvent: string; + validate: any; + + type: any; + label: any; + errorHelp: any; + } + + export interface Radio extends ValidatedInput { + + } + + + export interface RadioGroup extends ValidatedInput { + validationEvent: any; + } + + export interface Validator { + + required(val: String); + //Returns true if the value is not null.Can be used as an alias to !isNull validation rule. + isChecked(val: String); + + } + + export interface FileValidator extends Validator { + ref: any; + name: any; + type :any; + label:any; + multiple: any; + validate: any; + + isEmpty(files: FileList); + + /// Returns true if there are no files in file list. + isSingle(files: FileList); + + // Returns true if files count equals to 1. + isMultiple(files: FileList); + + //Returns true if files count is more than 1. + isFilesCount(files: FileList, min: Number, max:Array ); + + //Returns true if files count is within allowed range.If max is not supplied, checks if files count equals min. + isTotalSize(files: FileList, min: Number, max: Array); + + //Returns true if total size of all files is within allowed range. + isEachFileSize(files: FileList, min: Number, max: Array); + + //Returns true if each file's size is within allowed range. + isExtension(files: FileList, extensions: Array); + + //Returns true if each file's extension is in the extensions array. + isType(files: FileList, types: Array); + } + + export interface InputContainer { + + } + } + + +declare module 'react-bootstrap-validation' { + export = ReactBootstrapValidation; +} \ No newline at end of file From 06336e28fcead25080b58e7c5aae073b78cfe3c1 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sun, 20 Dec 2015 10:46:02 +1100 Subject: [PATCH 037/415] Revert "Merge branch 'master' of https://github.com/brewsoftware/DefinitelyTyped" This reverts commit 0adfcd3dfd9860cef6b73762fa8c1eb5c4886dad, reversing changes made to 40c60850ad6c8175a62d5ab48c4e016ea5b3dffe. --- axios/axios.d.ts | 289 ++++----- crypto-js/crypto-js.d.ts | 583 ++---------------- .../react-bootstrap-validation.d.ts | 83 --- 3 files changed, 191 insertions(+), 764 deletions(-) delete mode 100644 react-bootstrap-validation/react-bootstrap-validation.d.ts diff --git a/axios/axios.d.ts b/axios/axios.d.ts index 86414bde6b..48f57a73a3 100644 --- a/axios/axios.d.ts +++ b/axios/axios.d.ts @@ -1,191 +1,162 @@ - // Type definitions for axios 0.5.2 // Project: https://github.com/mzabriskie/axios -// Definitions by: Marcel Buesing , Jason Turner +// Definitions by: Marcel Buesing // Definitions: https://github.com/borisyankov/DefinitelyTyped /// declare module Axios { - /** - * - request body data type - */ - interface AxiosXHRConfigBase { - - /** - * Change the request data before it is sent to the server. - * This is only applicable for request methods 'PUT', 'POST', and 'PATCH' - * The last function in the array must return a string or an ArrayBuffer - */ - transformRequest?: ((data: T) => U) | [(data: T) => U]; - - /** - * change the response data to be made before it is passed to then/catch - */ - transformResponse?: (data: T) => U; - - /** - * custom headers to be sent - */ - headers?: Object; - - /** - * URL parameters to be sent with the request - */ - params?: Object; - - /** - * indicates whether or not cross-site Access-Control requests - * should be made using credentials - */ - withCredentials?: boolean; - - /** - * indicates the type of data that the server will respond with - * options are 'arraybuffer', 'blob', 'document', 'json', 'text' - */ - responseType?: string; - - /** - * name of the cookie to use as a value for xsrf token - */ - xsrfCookieName?: string; - - /** - * name of the http header that carries the xsrf token value - */ - xsrfHeaderName?: string; - - } + /** + * - request body data type + */ + interface AxiosXHRConfigBase { /** - * - request body data type + * Change the request data before it is sent to the server. + * This is only applicable for request methods 'PUT', 'POST', and 'PATCH' + * The last function in the array must return a string or an ArrayBuffer */ - interface AxiosXHRConfig extends AxiosXHRConfigBase { - /** - * server URL that will be used for the request, options are: - * GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH - */ - url: string; - - /** - * request method to be used when making the request - */ - method?: string; - - /** - * data to be sent as the request body - * Only applicable for request methods 'PUT', 'POST', and 'PATCH' - * When no `transformRequest` is set, must be a string, an ArrayBuffer or a hash - */ - data?: T; - } + transformRequest?: ((data:T) => U)|[(data:T) => U]; /** - * - expected response type, - * - request body data type + * change the response data to be made before it is passed to then/catch */ - interface AxiosXHR { - /** - * Response that was provided by the server - */ - data: T; - - /** - * HTTP status code from the server response - */ - status: number; - - /** - * HTTP status message from the server response - */ - statusText: string; - - /** - * headers that the server responded with - */ - headers: Object; - - /** - * config that was provided to `axios` for the request - */ - config: AxiosXHRConfig; - } + transformResponse?: (data:T) => U; /** - * - expected response type, - * - request body data type + * custom headers to be sent */ - interface AxiosStatic { + headers?: Object; - (config: AxiosXHRConfig): Promise>; + /** + * URL parameters to be sent with the request + */ + params?: Object; - new (config: AxiosXHRConfig): Promise>; + /** + * indicates whether or not cross-site Access-Control requests + * should be made using credentials + */ + withCredentials?: boolean; - /** - * convenience alias, method = GET - */ - get(url: string, config?: AxiosXHRConfigBase): Promise>; + /** + * indicates the type of data that the server will respond with + * options are 'arraybuffer', 'blob', 'document', 'json', 'text' + */ + responseType?: string; + + /** + * name of the cookie to use as a value for xsrf token + */ + xsrfCookieName?: string; + + /** + * name of the http header that carries the xsrf token value + */ + xsrfHeaderName?: string; + + } + + /** + * - request body data type + */ + interface AxiosXHRConfig extends AxiosXHRConfigBase { + /** + * server URL that will be used for the request, options are: + * GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH + */ + url: string; + + /** + * request method to be used when making the request + */ + method?: string; + + /** + * data to be sent as the request body + * Only applicable for request methods 'PUT', 'POST', and 'PATCH' + * When no `transformRequest` is set, must be a string, an ArrayBuffer or a hash + */ + data?: T; + } + + /** + * - expected response type, + * - request body data type + */ + interface AxiosXHR { + /** + * Response that was provided by the server + */ + data: T; + + /** + * HTTP status code from the server response + */ + status: number; + + /** + * HTTP status message from the server response + */ + statusText: string; + + /** + * headers that the server responded with + */ + headers: Object; + + /** + * config that was provided to `axios` for the request + */ + config: AxiosXHRConfig; + } + + /** + * - expected response type, + * - request body data type + */ + interface AxiosStatic { + + (config: AxiosXHRConfig): Promise>; + + new (config: AxiosXHRConfig): Promise>; + + /** + * convenience alias, method = GET + */ + get(url: string, config?: AxiosXHRConfigBase): Promise>; - /** - * convenience alias, method = DELETE - */ - delete(url: string, config?: AxiosXHRConfigBase): Promise>; + /** + * convenience alias, method = DELETE + */ + delete(url: string, config?: AxiosXHRConfigBase): Promise>; - /** - * convenience alias, method = HEAD - */ - head(url: string, config?: AxiosXHRConfigBase): Promise>; + /** + * convenience alias, method = HEAD + */ + head(url: string, config?: AxiosXHRConfigBase): Promise>; - /** - * convenience alias, method = POST - */ - post(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + /** + * convenience alias, method = POST + */ + post(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; - /** - * convenience alias, method = PUT - */ - put(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + /** + * convenience alias, method = PUT + */ + put(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; - /** - * convenience alias, method = PATCH - */ - patch(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; - interceptors: { - request: Interceptor, - response: Interceptor - } - } - - - - export interface Response { - data?: any; - status?: number; - statusText?: string; - headers?: any; - config?: any; - } - export interface success { - (response: Response): void - } - export interface error { - (response: Axios.Response): void; - } - - export interface Interceptor { - use(success: success, error?: error): void; - eject(interceptor: Interceptor); - } + /** + * convenience alias, method = PATCH + */ + patch(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + } } declare var axios: Axios.AxiosStatic; declare module "axios" { - export = axios; + export = axios; } - - - diff --git a/crypto-js/crypto-js.d.ts b/crypto-js/crypto-js.d.ts index cde0abd9b9..0f02514027 100644 --- a/crypto-js/crypto-js.d.ts +++ b/crypto-js/crypto-js.d.ts @@ -1,528 +1,67 @@ -// Type definitions for crypto-js v3.1.5 +// Type definitions for crypto-js v3.1.3 // Project: https://github.com/evanvosberg/crypto-js -// Definitions by: Michael Zabka , Jason Turner +// Definitions by: Michael Zabka // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module CryptoJSLocal{ - module lib{ - interface Base{ - extend(overrides: Object): Object - init(...args: any[]): void - //arguments of create() is same as init(). This is true for all subclasses - create(...args: any[]): Base - mixIn(properties: Object): void - clone(): Base - } - - interface WordArray extends Base{ - words: number[] - sigBytes: number - init(words?: number[], sigBytes?: number): void - create(words?: number[], sigBytes?: number): WordArray - - init(typedArray: ArrayBuffer): void - init(typedArray: Int8Array): void - - //Because TypeScript uses a structural type system then we don't need (& can't) - //declare oveload function init, create for the following type (same as Int8Array): - //then Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array - //Note also: Uint8ClampedArray is not defined in lib.d.ts & not supported in IE - //@see http://compatibility.shwups-cms.ch/en/home?&property=Uint8ClampedArray - - create(typedArray: ArrayBuffer): WordArray - create(typedArray: Int8Array): WordArray - - toString(encoder?: enc.IEncoder): string - concat(wordArray: WordArray): WordArray - clamp(): void - clone(): WordArray - random(nBytes: number): WordArray - } - - interface BufferedBlockAlgorithm extends Base{ - reset(): void - clone(): BufferedBlockAlgorithm - } - - //tparam C - Configuration type - interface IHasher extends BufferedBlockAlgorithm{ - cfg: C - init(cfg?: C): void - create(cfg?: C): IHasher - - update(messageUpdate: string): Hasher - update(messageUpdate: WordArray): Hasher - - finalize(messageUpdate?: string): WordArray - finalize(messageUpdate?: WordArray): WordArray - - blockSize: number - - _createHelper(hasher: Hasher): IHasherHelper - _createHmacHelper(hasher: Hasher): IHasherHmacHelper - - clone(): IHasher - } - interface Hasher extends IHasher{} - - //tparam C - Configuration type - interface IHasherHelper{ - (message: string, cfg?: C): WordArray - (message: WordArray, cfg?: C): WordArray - } - interface HasherHelper extends IHasherHelper{} - - interface IHasherHmacHelper{ - (message: string, key: string): WordArray - (message: string, key: WordArray): WordArray - (message: WordArray, key: string): WordArray - (message: WordArray, key: WordArray): WordArray - } - - //tparam C - Configuration type - interface ICipher extends BufferedBlockAlgorithm{ - cfg: C - createEncryptor(key: WordArray, cfg?: C): ICipher - createDecryptor(key: WordArray, cfg?: C): ICipher - - create(xformMode?: number, key?: WordArray, cfg?: C): ICipher - init(xformMode?: number, key?: WordArray, cfg?: C): void - - process(dataUpdate: string): WordArray - process(dataUpdate: WordArray): WordArray - - finalize(dataUpdate?: string): WordArray - finalize(dataUpdate?: WordArray): WordArray - - keySize: number - ivSize: number - - _createHelper(cipher: Cipher): ICipherHelper - - clone(): ICipher - } - interface Cipher extends ICipher{} - - interface IStreamCipher extends ICipher{ - drop?: number; - - createEncryptor(key: WordArray, cfg?: C): IStreamCipher - createDecryptor(key: WordArray, cfg?: C): IStreamCipher - - create(xformMode?: number, key?: WordArray, cfg?: C): IStreamCipher - - blockSize: number - } - interface StreamCipher extends IStreamCipher{} - - interface BlockCipherMode extends Base{ - createEncryptor(cipher: Cipher, iv: number[]): mode.IBlockCipherEncryptor - createDecryptor(cipher: Cipher, iv: number[]): mode.IBlockCipherDecryptor - init(cipher?: Cipher, iv?: number[]): void - create(cipher?: Cipher, iv?: number[]): BlockCipherMode - } - - //BlockCipher has interface same as IStreamCipher - interface BlockCipher extends IStreamCipher{} - - interface IBlockCipherCfg { - iv?: WordArray; - mode?: mode.IBlockCipherModeImpl //default CBC - padding?: pad.IPaddingImpl //default Pkcs7 - } - - interface CipherParamsData { - ciphertext?: lib.WordArray - key?: lib.WordArray - iv?: lib.WordArray - salt?: lib.WordArray - algorithm?: Cipher - mode?: mode.IBlockCipherModeImpl - padding?: pad.IPaddingImpl - blockSize?: number - formatter?: format.IFormatter - } - - interface CipherParams extends Base, CipherParamsData{ - init(cipherParams?: CipherParamsData): void - create(cipherParams?: CipherParamsData): CipherParams - toString(formatter?: format.IFormatter): string - } - - //tparam C - Configuration type - interface ISerializableCipher extends Base{ - cfg: C - encrypt(cipher: Cipher, message: WordArray, key: WordArray, cfg?: C): CipherParams - encrypt(cipher: Cipher, message: string, key: WordArray, cfg?: C): CipherParams - - decrypt(cipher: Cipher, ciphertext: CipherParamsData, key: WordArray, cfg?: C): WordArray - decrypt(cipher: Cipher, ciphertext: string, key: WordArray, cfg?: C): WordArray - } - - interface SerializableCipher extends ISerializableCipher{} - interface ISerializableCipherCfg{ - format?: format.IFormatter //default OpenSSLFormatter - iv?: WordArray; - mode?: mode.IBlockCipherModeImpl; - padding?: pad.IPaddingImpl; - } - - interface IPasswordBasedCipher extends Base{ - cfg: C - encrypt(cipher: Cipher, message: WordArray, password: string, cfg?: C): CipherParams - encrypt(cipher: Cipher, message: string, password: string, cfg?: C): CipherParams - - decrypt(cipher: Cipher, ciphertext: CipherParamsData, password: string, cfg?: C): WordArray - decrypt(cipher: Cipher, ciphertext: string, password: string, cfg?: C): WordArray - } - - interface PasswordBasedCipher extends IPasswordBasedCipher{} - interface IPasswordBasedCipherCfg extends ISerializableCipherCfg{ - kdf?: kdf.IKdfImpl //default OpenSSLKdf - mode?: mode.IBlockCipherModeImpl; - padding?: pad.IPaddingImpl; - } - - /** see Cipher._createHelper */ - interface ICipherHelper{ - encrypt(message: string, password: string, cfg?: C): CipherParams - encrypt(message: string, key: WordArray, cfg?: C): CipherParams - encrypt(message: WordArray, password: string, cfg?: C): CipherParams - encrypt(message: WordArray, key: WordArray, cfg?: C): CipherParams - - decrypt(ciphertext: string, password: string, cfg?: C): WordArray - decrypt(ciphertext: string, key: WordArray, cfg?: C): WordArray - decrypt(ciphertext: CipherParamsData, password: string, cfg?: C): WordArray - decrypt(ciphertext: CipherParamsData, key: WordArray, cfg?: C): WordArray - } - - interface CipherHelper extends ICipherHelper{} - interface LibStatic{ - Base: lib.Base - WordArray: lib.WordArray - CipherParams: lib.CipherParams - SerializableCipher: lib.SerializableCipher - PasswordBasedCipher: lib.PasswordBasedCipher - } - } - - module enc{ - interface IEncoder{ - stringify(wordArray: lib.WordArray): string - } - interface IDecoder{ - parse(s: string): lib.WordArray - } - interface ICoder extends IEncoder, IDecoder {} - - interface EncStatic{ - Hex: ICoder - Latin1: ICoder - Utf8: ICoder - Base64: ICoder - Utf16: ICoder - Utf16BE: ICoder - Utf16LE: ICoder - } - } - - module kdf{ - interface KdfStatic{ - OpenSSL: IKdfImpl - } - - interface IKdfImpl{ - execute(password: string, keySize: number, ivSize: number, salt?: string): lib.CipherParams - execute(password: string, keySize: number, ivSize: number, salt?: lib.WordArray): lib.CipherParams - } - } - - module format{ - interface FormatStatic{ - OpenSSL: IFormatter - Hex: IFormatter - } - - interface IFormatter{ - stringify(cipherParams: lib.CipherParamsData): string - parse(s: string): lib.CipherParams - } - } - - module algo{ - interface AlgoStatic{ - AES: algo.AES - DES: algo.DES - TripleDES: algo.TripleDES - - RabbitLegacy: algo.RabbitLegacy - Rabbit: algo.Rabbit - RC4: algo.RC4 - - MD5: algo.MD5 - RIPEMD160: algo.RIPEMD160 - SHA1: algo.SHA1 - SHA256: algo.SHA256 - SHA224: algo.SHA224 - SHA384: algo.SHA384 - SHA512: algo.SHA512 - - SHA3: algo.SHA3 - - HMAC: algo.HMAC - - EvpKDF: algo.EvpKDF - PBKDF2: algo.PBKDF2 - - RC4Drop: algo.RC4Drop - } - - interface IBlockCipherImpl extends lib.BlockCipher{ - encryptBlock(M: number[], offset: number): void - decryptBlock(M: number[], offset: number): void - - createEncryptor(key: lib.WordArray, cfg?: lib.CipherParamsData): IBlockCipherImpl - createDecryptor(key: lib.WordArray, cfg?: lib.CipherParamsData): IBlockCipherImpl - - create(xformMode?: number, key?: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl - } - - interface AES extends IBlockCipherImpl{} - interface DES extends IBlockCipherImpl{} - interface TripleDES extends IBlockCipherImpl{} - - interface RabbitLegacy extends lib.StreamCipher{} - interface Rabbit extends lib.StreamCipher{} - interface RC4 extends lib.StreamCipher{} - - interface MD5 extends lib.Hasher{} - interface RIPEMD160 extends lib.Hasher{} - interface SHA1 extends lib.Hasher{} - interface SHA256 extends lib.Hasher{} - interface SHA224 extends lib.Hasher{} - interface SHA384 extends lib.Hasher{} - interface SHA512 extends lib.Hasher{} - - interface SHA3 extends lib.IHasher{} - interface ISHA3Cfg{ - outputLength?: number //default 512 - } - - interface HMAC extends lib.Base{ - init(hasher?: lib.Hasher, key?: string): void - init(hasher?: lib.Hasher, key?: lib.WordArray): void - create(hasher?: lib.Hasher, key?: string): HMAC - create(hasher?: lib.Hasher, key?: lib.WordArray): HMAC - - update(messageUpdate: string): HMAC - update(messageUpdate: lib.WordArray): HMAC - - finalize(messageUpdate?: string): lib.WordArray - finalize(messageUpdate?: lib.WordArray): lib.WordArray - } - - interface EvpKDF extends lib.Base{ - cfg: IEvpKDFCfg - init(cfg?: IEvpKDFCfg): void - create(cfg?: IEvpKDFCfg): EvpKDF - compute(password: string, salt: string): lib.WordArray - compute(password: string, salt: lib.WordArray): lib.WordArray - compute(password: lib.WordArray, salt: string): lib.WordArray - compute(password: lib.WordArray, salt: lib.WordArray): lib.WordArray - } - interface IEvpKDFCfg{ - keySize?: number //default 128/32 - hasher?: lib.Hasher //default MD5, or SHA1 with PBKDF2 - iterations?: number //default 1 - } - interface IEvpKDFHelper{ - (password: string, salt: string, cfg?: IEvpKDFCfg): lib.WordArray - (password: string, salt: lib.WordArray, cfg?: IEvpKDFCfg): lib.WordArray - (password: lib.WordArray, salt: string, cfg?: IEvpKDFCfg): lib.WordArray - (password: lib.WordArray, salt: lib.WordArray, cfg?: IEvpKDFCfg): lib.WordArray - } - - interface PBKDF2 extends EvpKDF{} //PBKDF2 is same as EvpKDF - - interface RC4Drop extends RC4 { } - } - - module mode{ - interface ModeStatic{ - CBC: mode.CBC - CFB: mode.CFB - CTR: mode.CTR - CTRGladman: mode.CTRGladman - ECB: mode.ECB - OFB: mode.OFB - } - - interface IBlockCipherEncryptor extends lib.BlockCipherMode{ - processBlock(words: number[], offset: number): void - } - interface IBlockCipherDecryptor extends lib.BlockCipherMode{ //exactly as IBlockCipherEncryptor - processBlock(words: number[], offset: number): void - } - interface IBlockCipherModeImpl extends lib.BlockCipherMode{ - Encryptor: IBlockCipherEncryptor - Decryptor: IBlockCipherDecryptor - } - - interface CBC extends IBlockCipherModeImpl{} - interface CFB extends IBlockCipherModeImpl{} - interface CTR extends IBlockCipherModeImpl{} - interface CTRGladman extends IBlockCipherModeImpl{} - interface ECB extends IBlockCipherModeImpl{} - interface OFB extends IBlockCipherModeImpl{} - } - - module pad{ - interface PadStatic{ - Pkcs7: pad.Pkcs7 - AnsiX923: pad.AnsiX923 - Iso10126: pad.Iso10126 - Iso97971: pad.Iso97971 - ZeroPadding: pad.ZeroPadding - NoPadding: pad.NoPadding - } - - interface IPaddingImpl{ - pad(data: lib.WordArray, blockSize: number): void - unpad(data: lib.WordArray): void - } - - interface Pkcs7 extends IPaddingImpl{} - interface AnsiX923 extends IPaddingImpl{} - interface Iso10126 extends IPaddingImpl{} - interface Iso97971 extends IPaddingImpl{} - interface ZeroPadding extends IPaddingImpl{} - interface NoPadding extends IPaddingImpl{} - } - - module x64{ - interface X64Static{ - Word: x64.Word - WordArray: x64.WordArray - } - - interface Word extends lib.Base{ - high: number - low: number - - init(high?: number, low?: number): void - create(high?: number, low?: number): Word - } - - interface WordArray extends lib.Base{ - words: Word[] - sigBytes: number - - init(words?: Word[], sigBytes?: number): void - create(words?: Word[], sigBytes?: number): WordArray - toX32(): lib.WordArray - clone(): WordArray - } - } - - interface CryptoJSStatic{ - lib: lib.LibStatic - enc: enc.EncStatic - kdf: kdf.KdfStatic - format: format.FormatStatic - algo: algo.AlgoStatic - mode: mode.ModeStatic - pad: pad.PadStatic - x64: x64.X64Static - - AES: CryptoJSLocal.lib.ICipherHelper - DES: CryptoJSLocal.lib.ICipherHelper - TripleDES: CryptoJSLocal.lib.ICipherHelper - - RabbitLegacy: CryptoJSLocal.lib.CipherHelper - Rabbit: CryptoJSLocal.lib.CipherHelper - RC4: CryptoJSLocal.lib.CipherHelper - RC4Drop: CryptoJSLocal.lib.ICipherHelper - - MD5: CryptoJSLocal.lib.HasherHelper - HmacMD5: CryptoJSLocal.lib.IHasherHmacHelper - RIPEMD160: CryptoJSLocal.lib.HasherHelper - HmacRIPEMD160: CryptoJSLocal.lib.IHasherHmacHelper - SHA1: CryptoJSLocal.lib.HasherHelper - HmacSHA1: CryptoJSLocal.lib.IHasherHmacHelper - SHA256: CryptoJSLocal.lib.HasherHelper - HmacSHA256: CryptoJSLocal.lib.IHasherHmacHelper - SHA224: CryptoJSLocal.lib.HasherHelper - HmacSHA224: CryptoJSLocal.lib.IHasherHmacHelper - SHA512: CryptoJSLocal.lib.HasherHelper - HmacSHA512: CryptoJSLocal.lib.IHasherHmacHelper - SHA384: CryptoJSLocal.lib.HasherHelper - HmacSHA384: CryptoJSLocal.lib.IHasherHmacHelper - - SHA3: CryptoJSLocal.lib.IHasherHelper - HmacSHA3: CryptoJSLocal.lib.IHasherHmacHelper - - EvpKDF: CryptoJSLocal.algo.IEvpKDFHelper - PBKDF2: CryptoJSLocal.algo.IEvpKDFHelper //PBKDF2 is same as EvpKDF - } - type Hash = (message: string, key?: string, ...options: any[]) => string; - - export interface Hashes { - MD5: Hash; - SHA1: Hash; - SHA256: Hash; - SHA224: Hash; - SHA512: Hash; - SHA384: Hash; - SHA3: Hash; - RIPEMD160: Hash; - HmacMD5: Hash; - HmacSHA1: Hash; - HmacSHA256: Hash; - HmacSHA224: Hash; - HmacSHA512: Hash; - HmacSHA384: Hash; - HmacSHA3: Hash; - HmacRIPEMD160: Hash; - PBKDF2: Hash; - AES: Hash; - TripleDES: Hash; - RC4: Hash; - Rabbit: Hash; - RabbitLegacy: Hash; - EvpKDF: Hash; - format: { - OpenSSL: Hash; - Hex: Hash; - }; - enc: { - Latin1: Hash; - Utf8: Hash; - Hex: Hash; - Utf16: Hash; - Base64: Hash; - }; - mode: { - CFB: Hash; - CTR: Hash; - CTRGladman: Hash; - OFB: Hash; - ECB: Hash; - }; - pad: { - Pkcs7: Hash; - Ansix923: Hash; - Iso10126: Hash; - Iso97971: Hash; - ZeroPadding: Hash; - NoPadding: Hash; - }; - } - - export var hashes: Hashes; +declare module CryptoJS { + type Hash = (message: string, key?: string, ...options: any[]) => string; + + export interface Hashes { + MD5: Hash; + SHA1: Hash; + SHA256: Hash; + SHA224: Hash; + SHA512: Hash; + SHA384: Hash; + SHA3: Hash; + RIPEMD160: Hash; + HmacMD5: Hash; + HmacSHA1: Hash; + HmacSHA256: Hash; + HmacSHA224: Hash; + HmacSHA512: Hash; + HmacSHA384: Hash; + HmacSHA3: Hash; + HmacRIPEMD160: Hash; + PBKDF2: Hash; + AES: Hash; + TripleDES: Hash; + RC4: Hash; + Rabbit: Hash; + RabbitLegacy: Hash; + EvpKDF: Hash; + format: { + OpenSSL: Hash; + Hex: Hash; + }; + enc: { + Latin1: Hash; + Utf8: Hash; + Hex: Hash; + Utf16: Hash; + Base64: Hash; + }; + mode: { + CFB: Hash; + CTR: Hash; + CTRGladman: Hash; + OFB: Hash; + ECB: Hash; + }; + pad: { + Pkcs7: Hash; + Ansix923: Hash; + Iso10126: Hash; + Iso97971: Hash; + ZeroPadding: Hash; + NoPadding: Hash; + }; + } + + export var hashes: Hashes; } -declare var CryptoJS: CryptoJSLocal.CryptoJSStatic; - -declare module "crypto-js" { - export = CryptoJS; +declare module 'crypto-js' { + import hashes = CryptoJS.hashes; + export = hashes; } diff --git a/react-bootstrap-validation/react-bootstrap-validation.d.ts b/react-bootstrap-validation/react-bootstrap-validation.d.ts deleted file mode 100644 index 9eeee01c1f..0000000000 --- a/react-bootstrap-validation/react-bootstrap-validation.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/// - -declare module ReactBootstrapValidation{ - - export interface Form { - model; - validateOne: any; - validateAll: any; - errorHelp: string | any; - validationEvent: string; - onValidSubmit: any; - - } - export interface ValidatedInput - { - - name: string; - validationEvent: string; - validate: any; - - type: any; - label: any; - errorHelp: any; - } - - export interface Radio extends ValidatedInput { - - } - - - export interface RadioGroup extends ValidatedInput { - validationEvent: any; - } - - export interface Validator { - - required(val: String); - //Returns true if the value is not null.Can be used as an alias to !isNull validation rule. - isChecked(val: String); - - } - - export interface FileValidator extends Validator { - ref: any; - name: any; - type :any; - label:any; - multiple: any; - validate: any; - - isEmpty(files: FileList); - - /// Returns true if there are no files in file list. - isSingle(files: FileList); - - // Returns true if files count equals to 1. - isMultiple(files: FileList); - - //Returns true if files count is more than 1. - isFilesCount(files: FileList, min: Number, max:Array ); - - //Returns true if files count is within allowed range.If max is not supplied, checks if files count equals min. - isTotalSize(files: FileList, min: Number, max: Array); - - //Returns true if total size of all files is within allowed range. - isEachFileSize(files: FileList, min: Number, max: Array); - - //Returns true if each file's size is within allowed range. - isExtension(files: FileList, extensions: Array); - - //Returns true if each file's extension is in the extensions array. - isType(files: FileList, types: Array); - } - - export interface InputContainer { - - } - } - - -declare module 'react-bootstrap-validation' { - export = ReactBootstrapValidation; -} \ No newline at end of file From adaedc02189c2b4a6429637aef7ca8d88e66b063 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Tue, 22 Dec 2015 15:12:14 +1100 Subject: [PATCH 038/415] added re-validator --- revalidator/revalidator.d.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 revalidator/revalidator.d.ts diff --git a/revalidator/revalidator.d.ts b/revalidator/revalidator.d.ts new file mode 100644 index 0000000000..aaf38ba78f --- /dev/null +++ b/revalidator/revalidator.d.ts @@ -0,0 +1,16 @@ +// Type definitions for axios 0.5.2 + +// Definitions by: Jason Turner +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Revalidator { + interface RevalidatorStatic { + validate(object: any, schema: any, options: any): any; + } +} + +declare var revalidator: Revalidator.RevalidatorStatic; + +declare module "revalidator" { + export = revalidator; +} From 71a528be4d644460a64ec4c7f4dc727df8c91ff7 Mon Sep 17 00:00:00 2001 From: David Broder-Rodgers Date: Wed, 23 Dec 2015 14:05:39 +0000 Subject: [PATCH 039/415] Updated chai-things typing --- chai-things/chai-things.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chai-things/chai-things.d.ts b/chai-things/chai-things.d.ts index bc2b89c46f..0c00e1746e 100644 --- a/chai-things/chai-things.d.ts +++ b/chai-things/chai-things.d.ts @@ -1,7 +1,7 @@ // Type definitions for chai-things // Project: https://github.com/chaijs/chai-things // Definitions by: David Broder-Rodgers -// Definitions: https://github.com/DavidBR-SW/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -25,14 +25,14 @@ declare module Chai { interface Anything extends Assertion { (): any; - that: Assertion - with: Assertion + that: Assertion; + with: Assertion; } interface Something extends Assertion { (): any; - that: Assertion - with: Assertion + that: Assertion; + with: Assertion; } interface Item { From 3d4881b0799d1b2fabcebd8afbf0e50f450c6387 Mon Sep 17 00:00:00 2001 From: Darren Hill Date: Wed, 23 Dec 2015 11:25:30 -0500 Subject: [PATCH 040/415] Added Definitions for jSuite and SuiteScript --- jsuite/jsuite.d.ts | 42 + suitescript/suitescript.d.ts | 6625 ++++++++++++++++++++++++++++++++++ 2 files changed, 6667 insertions(+) create mode 100644 jsuite/jsuite.d.ts create mode 100644 suitescript/suitescript.d.ts diff --git a/jsuite/jsuite.d.ts b/jsuite/jsuite.d.ts new file mode 100644 index 0000000000..2d32c88e68 --- /dev/null +++ b/jsuite/jsuite.d.ts @@ -0,0 +1,42 @@ +// Type definitions for jSuite +// Project: https://github.com/darrenthill/jsuite +// Definitions by: Darren Hill +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +interface Iconfig { + logging?: boolean; + smartConvert?: boolean; + searchId?: string; + recordType?: string; + filterExpression?: any; + columns?: string; + start?: number; + end?: number; + maxUnitsUsage?: number; +} +declare module jSuite { + function getVersion(): string; + function setLogging(toggle: boolean): void; + function getRoleCenter(): any; + function getUser(): any; + function getScriptParameter(paramName: string): any; + function getDeploymentId(): any; + function getScriptId(): any; + function isProduction(): any; + function clearSublist(transaction: nlobjRecord, listType: string): void; + function getCompanyPreference(paramName: string): any; + function roundNum(num: number, length: number): number; + function isNumber(n: any): boolean; + function runSearch(config?: Iconfig): any; + function lookupField(dataIn: any): string; + function submitField(dataIn: any): any; + function asyncLookupField(config: any, callback: any): void; + function asyncSubmitField(config: any): JQueryXHR; + function audit(title: string, message: string): void; + function debug(title: string, message: string): void; + function error(title: string, message: string): void; + function emergency(title: string, message: string): void; +} diff --git a/suitescript/suitescript.d.ts b/suitescript/suitescript.d.ts new file mode 100644 index 0000000000..3fee0a8785 --- /dev/null +++ b/suitescript/suitescript.d.ts @@ -0,0 +1,6625 @@ +// Type definitions for Suite Script +// Project: http://www.netsuite.com +// Definitions by: Darren Hill +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace nlobjRecord.prototype { + // nlobjRecord.prototype.getSubList.!ret + + /** + * + */ + interface GetSubListRet { + + /** + * + */ + prototype : { + + /** + * + */ + addButton : /*no type*/{}; + + /** + * + */ + setLabel : /* nlobjSubList.prototype.setLabel */ any; + + /** + * + */ + setHelpText : /* nlobjSubList.prototype.setHelpText */ any; + + /** + * + */ + setDisplayType : /* nlobjSubList.prototype.setDisplayType */ any; + + /** + * + */ + setLineItemValue : /* nlobjSubList.prototype.setLineItemValue */ any; + + /** + * + */ + setLineItemMatrixValue : /* nlobjSubList.prototype.setLineItemMatrixValue */ any; + + /** + * + */ + setLineItemValues : /* nlobjSubList.prototype.setLineItemValues */ any; + + /** + * + */ + getLineItemCount : /* nlobjSubList.prototype.getLineItemCount */ any; + + /** + * + */ + addField : /* nlobjSubList.prototype.addField */ any; + + /** + * + */ + setUniqueField : /* nlobjSubList.prototype.setUniqueField */ any; + + /** + * + */ + addRefreshButton : /* nlobjSubList.prototype.addRefreshButton */ any; + + /** + * + */ + addMarkAllButtons : /* nlobjSubList.prototype.addMarkAllButtons */ any; + } + } +} +declare namespace nlobjRecord.prototype.GetSubListRet.prototype { + // nlobjRecord.prototype.getSubList.!ret.prototype.addButton.!ret + + /** + * + */ + interface AddButtonRet { + + /** + * + */ + prototype : { + + /** + * + */ + setLabel : /* nlobjButton.prototype.setLabel */ any; + + /** + * + */ + setDisabled : /* nlobjButton.prototype.setDisabled */ any; + } + } +} +declare namespace nlobjRecord.prototype { + // nlobjRecord.prototype.getField.!ret + + /** + * + */ + interface GetFieldRet { + + /** + * + */ + prototype : { + + /** + * + */ + getName : /* nlobjField.prototype.getName */ any; + + /** + * + */ + getLabel : /* nlobjField.prototype.getLabel */ any; + + /** + * + */ + getType : /* nlobjField.prototype.getType */ any; + + /** + * + */ + isHidden : /* nlobjField.prototype.isHidden */ any; + + /** + * + */ + isMandatory : /* nlobjField.prototype.isMandatory */ any; + + /** + * + */ + isDisabled : /* nlobjField.prototype.isDisabled */ any; + + /** + * + */ + setLabel : /* nlobjField.prototype.setLabel */ any; + + /** + * + */ + setAlias : /* nlobjField.prototype.setAlias */ any; + + /** + * + */ + setDefaultValue : /* nlobjField.prototype.setDefaultValue */ any; + + /** + * + */ + setDisabled : /* nlobjField.prototype.setDisabled */ any; + + /** + * + */ + setMandatory : /* nlobjField.prototype.setMandatory */ any; + + /** + * + */ + setMaxLength : /* nlobjField.prototype.setMaxLength */ any; + + /** + * + */ + setDisplayType : /* nlobjField.prototype.setDisplayType */ any; + + /** + * + */ + setBreakType : /* nlobjField.prototype.setBreakType */ any; + + /** + * + */ + setLayoutType : /* nlobjField.prototype.setLayoutType */ any; + + /** + * + */ + setLinkText : /* nlobjField.prototype.setLinkText */ any; + + /** + * + */ + setDisplaySize : /* nlobjField.prototype.setDisplaySize */ any; + + /** + * + */ + setPadding : /* nlobjField.prototype.setPadding */ any; + + /** + * + */ + setHelpText : /* nlobjField.prototype.setHelpText */ any; + + /** + * + */ + addSelectOption : /* nlobjField.prototype.addSelectOption */ any; + } + } +} +declare namespace nlobjPortlet.prototype { + // nlobjPortlet.prototype.addEditColumn.!0 + + /** + * + */ + interface AddEditColumn0 { + + /** + * + */ + prototype : { + + /** + * + */ + setLabel : /* nlobjColumn.prototype.setLabel */ any; + + /** + * + */ + setURL : /* nlobjColumn.prototype.setURL */ any; + + /** + * + */ + addParamToURL : /* nlobjColumn.prototype.addParamToURL */ any; + } + } +} +declare namespace nlobjForm.prototype { + // nlobjForm.prototype.addTab.!ret + + /** + * + */ + interface AddTabRet { + + /** + * + */ + prototype : { + + /** + * + */ + setLabel : /* nlobjTab.prototype.setLabel */ any; + + /** + * + */ + setHelpText : /* nlobjTab.prototype.setHelpText */ any; + } + } +} +declare namespace nlobjAssistant.prototype { + // nlobjAssistant.prototype.setCurrentStep.!0 + + /** + * + */ + interface SetCurrentStep0 { + + /** + * + */ + prototype : { + + /** + * + */ + setLabel : /* nlobjAssistantStep.prototype.setLabel */ any; + + /** + * + */ + setHelpText : /* nlobjAssistantStep.prototype.setHelpText */ any; + + /** + * + */ + getStepNumber : /* nlobjAssistantStep.prototype.getStepNumber */ any; + + /** + * + */ + getFieldValue : /* nlobjAssistantStep.prototype.getFieldValue */ any; + + /** + * + */ + getFieldValues : /* nlobjAssistantStep.prototype.getFieldValues */ any; + + /** + * + */ + getLineItemCount : /* nlobjAssistantStep.prototype.getLineItemCount */ any; + + /** + * + */ + getLineItemValue : /* nlobjAssistantStep.prototype.getLineItemValue */ any; + + /** + * + */ + getAllFields : /* nlobjAssistantStep.prototype.getAllFields */ any; + + /** + * + */ + getAllLineItems : /* nlobjAssistantStep.prototype.getAllLineItems */ any; + + /** + * + */ + getAllLineItemFields : /* nlobjAssistantStep.prototype.getAllLineItemFields */ any; + } + } +} +declare namespace nlobjForm.prototype { + // nlobjForm.prototype.addFieldGroup.!ret + + /** + * + */ + interface AddFieldGroupRet { + + /** + * + */ + prototype : { + + /** + * + */ + setLabel : /* nlobjFieldGroup.prototype.setLabel */ any; + + /** + * + */ + setCollapsible : /* nlobjFieldGroup.prototype.setCollapsible */ any; + + /** + * + */ + setSingleColumn : /* nlobjFieldGroup.prototype.setSingleColumn */ any; + + /** + * + */ + setShowBorder : /* nlobjFieldGroup.prototype.setShowBorder */ any; + } + } +} +declare namespace nlobjForm.prototype { + // nlobjForm.prototype.addButton.!ret + + /** + * + */ + interface AddButtonRet { + + /** + * + */ + prototype : { + + /** + * + */ + setLabel : /* nlobjButton.prototype.setLabel */ any; + + /** + * + */ + setDisabled : /* nlobjButton.prototype.setDisabled */ any; + } + } +} + +/** + * Return a new record using values from an existing record. + * @governance 10 units for transactions, 2 for custom records, 4 for all other records + * + * @param {string} type The record type name. + * @param {int} id The internal ID for the record. + * @param {Object} initializeValues Contains an array of name/value pairs of defaults to be used during record initialization. + * @return {nlobjRecord} Returns an nlobjRecord object of a copied record. + * + * @since 2007.0 + * @param type + * @param id + * @param initializeValues + * @return + */ +declare function nlapiCopyRecord(type:string, id:any, initializeValues:any):nlobjRecord; + +declare function nlapiDisableLineItemField(type:string, fldnam:string, val:boolean):void; +declare function nlapiDisableField(fldnam:string, val:any):void; + +/** + * Load an existing record from the system. + * @governance 10 units for transactions, 2 for custom records, 4 for all other records + * + * @param {string} type The record type name. + * @param {int} id The internal ID for the record. + * @param {Object} initializeValues Contains an array of name/value pairs of defaults to be used during record initialization. + * @return {nlobjRecord} Returns an nlobjRecord object of an existing NetSuite record. + * + * @exception {SSS_INVALID_RECORD_TYPE} + * @exception {SSS_TYPE_ARG_REQD} + * @exception {SSS_INVALID_INTERNAL_ID} + * @exception {SSS_ID_ARG_REQD} + * + * @since 2007.0 + * @param type + * @param id + * @param initializeValues + * @return + */ +declare function nlapiLoadRecord(type:string, id:any, initializeValues:any):nlobjRecord; + +/** + * Instantiate a new nlobjRecord object containing all the default field data for that record type. + * @governance 10 units for transactions, 2 for custom records, 4 for all other records + * + * @param {string} type record type ID. + * @param {Object} initializeValues Contains an array of name/value pairs of defaults to be used during record initialization. + * @return {nlobjRecord} Returns an nlobjRecord object of a new record from the system. + * + * @exception {SSS_INVALID_RECORD_TYPE} + * @exception {SSS_TYPE_ARG_REQD} + * + * @since 2007.0 + * @param type + * @param initializeValues + * @return + */ +declare function nlapiCreateRecord(type:string, initializeValues:any):nlobjRecord; + +/** + * Submit a record to the system for creation or update. + * @governance 20 units for transactions, 4 for custom records, 8 for all other records + * + * @param {nlobjRecord} record nlobjRecord object containing the data record. + * @param {boolean} [doSourcing] If not set, this argument defaults to false. + * @param {boolean} [ignoreMandatoryFields] Disables mandatory field validation for this submit operation. + * @return {string} internal ID for committed record. + * + * @exception {SSS_INVALID_RECORD_OBJ} + * @exception {SSS_RECORD_OBJ_REQD} + * @exception {SSS_INVALID_SOURCE_ARG} + * + * @since 2007.0 + * @param record + * @param doSourcing? + * @param ignoreMandatoryFields? + * @return + */ +declare function nlapiSubmitRecord(record:any, doSourcing?:boolean, ignoreMandatoryFields?:boolean):string; + +/** + * Delete a record from the system. + * @governance 20 units for transactions, 4 for custom records, 8 for all other records + * + * @param {string} type The record type name. + * @param {int} id The internal ID for the record. + * @return {void} + * + * @exception {SSS_INVALID_RECORD_TYPE} + * @exception {SSS_TYPE_ARG_REQD} + * @exception {SSS_INVALID_INTERNAL_ID} + * @exception {SSS_ID_ARG_REQD} + * + * @since 2007.0 + * @param type + * @param id + * @return + */ +declare function nlapiDeleteRecord(type:string, id:any):void; + +/** + * Perform a record search using an existing search or filters and columns. + * @governance 10 units + * @restriction returns the first 1000 rows in the search + * + * @param {string} type record type ID. + * @param {int, string} [id] The internal ID or script ID for the saved search to use for search. + * @param {nlobjSearchFilter, nlobjSearchFilter[]} [filters] [optional] A single nlobjSearchFilter object - or - an array of nlobjSearchFilter objects. + * @param {nlobjSearchColumn, nlobjSearchColumn[]} [columns] [optional] A single nlobjSearchColumn object - or - an array of nlobjSearchColumn objects. + * @return {nlobjSearchResult[]} Returns an array of nlobjSearchResult objects corresponding to the searched records. + * + * @exception {SSS_INVALID_RECORD_TYPE} + * @exception {SSS_TYPE_ARG_REQD} + * @exception {SSS_INVALID_SRCH_ID} + * @exception {SSS_INVALID_SRCH_FILTER} + * @exception {SSS_INVALID_SRCH_FILTER_JOIN} + * @exception {SSS_INVALID_SRCH_OPERATOR} + * @exception {SSS_INVALID_SRCH_COL_NAME} + * @exception {SSS_INVALID_SRCH_COL_JOIN} + * + * @since 2007.0 + * @param type + * @param id + * @param filters + * @param columns + */ +declare function nlapiSearchRecord(type:string, id:any, filters:any, columns:any):nlobjSearchResult[]; + +/** + * Perform a global record search across the system. + * @governance 10 units + * @restriction returns the first 1000 rows in the search + * + * @param {string} keywords Global search keywords string or expression. + * @return {nlobjSearchResult[]} Returns an Array of nlobjSearchResult objects containing the following four columns: name, type (as shown in the UI), info1, and info2. + * + * @since 2008.1 + * @param keywords + */ +declare function nlapiSearchGlobal(keywords:string):nlobjSearchResult[]; + +/** + * Perform a duplicate record search using Duplicate Detection criteria. + * @governance 10 units + * @restriction returns the first 1000 rows in the search + * + * @param {string} type The recordType you are checking duplicates for (for example, customer|lead|prospect|partner|vendor|contact). + * @param {string[]} [fields] array of field names used to detect duplicate (for example, companyname|email|name|phone|address1|city|state|zipcode). + * @param {int} [id] internal ID of existing record. Depending on the use case, id may or may not be a required argument. + * @return {nlobjSearchResult[]} Returns an Array of nlobjSearchResult objects corresponding to the duplicate records. + * + * @since 2008.1 + * @param type + * @param fields + * @param id? + */ +declare function nlapiSearchDuplicate(type:string, fields:any, id?:any):nlobjSearchResult[]; + +/** + * Create a new record using values from an existing record of a different type. + * @governance 10 units for transactions, 2 for custom records, 4 for all other records + * + * @param {string} type The record type name. + * @param {int} id The internal ID for the record. + * @param {string} transformType The recordType you are transforming the existing record into. + * @param {Object} [transformValues] An object containing transform default option/value pairs used to pre-configure transformed record + * @return {nlobjRecord} + * + * @exception {SSS_INVALID_URL_CATEGORY} + * @exception {SSS_CATEGORY_ARG_REQD} + * @exception {SSS_INVALID_TASK_ID} + * @exception {SSS_TASK_ID_REQD} + * @exception {SSS_INVALID_INTERNAL_ID} + * @exception {SSS_INVALID_EDITMODE_ARG} + * + * @since 2007.0 + * @param type + * @param id + * @param transformType + * @param transformValues? + * @return + */ +declare function nlapiTransformRecord(type:string, id:any, transformType:string, transformValues?:any):nlobjRecord; + +/** + * void a transaction based on type and id . + * @governance 10 units for transactions + * + * @param {string} type The transaction type name. + * @param {string} id The internal ID for the record. + * @return {string} if accounting preference is reversing journal, then it is new journal id, + * otherwise, it is the input record id + * + * @since 2014.1 + * @param type + * @param id + * @return + */ +declare function nlapiVoidTransaction(type:string, id:string):string; + +/** + * Fetch the value of one or more fields on a record. This API uses search to look up the fields and is much + * faster than loading the record in order to get the field. + * @governance 10 units for transactions, 2 for custom records, 4 for all other records + * + * @param {string} type The record type name. + * @param {int} id The internal ID for the record. + * @param {string, string[]} fields - field or fields to look up. + * @param {boolean} [text] If set then the display value is returned instead for select fields. + * @return {string, Object} single value or an Object of field name/value pairs depending on the fields argument. + * + * @since 2008.1 + * @param type + * @param id + * @param fields + * @param text? + */ +declare function nlapiLookupField(type:string, id:number, fields:string, text?:boolean):string; +declare function nlapiLookupField(type:string, id:number, fields:string[], text?:boolean):any; + +/** + * Submit the values of a field or set of fields for an existing record. + * @governance 10 units for transactions, 2 for custom records, 4 for all other records + * @restriction only supported for records and fields where DLE (Direct List Editing) is supported + * + * @param {string} type The record type name. + * @param {int} id The internal ID for the record. + * @param {string, string[]} fields field or fields being updated. + * @param {string, string[]} values field value or field values used for updating. + * @param {boolean} [doSourcing] If not set, this argument defaults to false and field sourcing does not occur. + * @return {void} + * + * @since 2008.1 + * @param type + * @param id + * @param fields + * @param values + * @param doSourcing? + * @return + */ +declare function nlapiSubmitField(type:string, id:any, fields:any, values:any, doSourcing?:boolean):void; + +/** + * Attach a single record to another with optional properties. + * @governance 10 units + * + * @param {string} type1 The record type name being attached + * @param {int} id1 The internal ID for the record being attached + * @param {string} type2 The record type name being attached to + * @param {int} id2 The internal ID for the record being attached to + * @param {Object} [properties] Object containing name/value pairs used to configure attach operation + * @return {void} + * + * @since 2008.2 + * @param type1 + * @param id1 + * @param type2 + * @param id2 + * @param properties? + * @return + */ +declare function nlapiAttachRecord(type1:string, id1:any, type2:string, id2:any, properties?:any):void; + +/** + * Detach a single record from another with optional properties. + * @governance 10 units + * + * @param {string} type1 The record type name being attached + * @param {int} id1 The internal ID for the record being attached + * @param {string} type2 The record type name being attached to + * @param {int} id2 The internal ID for the record being attached to + * @param {Object} [properties] Object containing name/value pairs used to configure detach operation + * @return {void} + * + * @since 2008.2 + * @param type1 + * @param id1 + * @param type2 + * @param id2 + * @param properties? + * @return + */ +declare function nlapiDetachRecord(type1:string, id1:any, type2:string, id2:any, properties?:any):void; + +/** + * Resolve a URL to a resource or object in the system. + * + * @param {string} type type specifier for URL: suitelet|tasklink|record|mediaitem + * @param {string} subtype subtype specifier for URL (corresponding to type): scriptid|taskid|recordtype|mediaid + * @param {string} [id] internal ID specifier (sub-subtype corresponding to type): deploymentid|n/a|recordid|n/a + * @param {string} [pagemode] string specifier used to configure page (suitelet: external|internal, tasklink|record: edit|view) + * @return {string} + * + * @since 2007.0 + * @param type + * @param subtype + * @param id? + * @param pagemode? + * @return + */ +declare function nlapiResolveURL(type:string, subtype:string, id?:string, pagemode?:string):string; + +/** + * Redirect the user to a page. Only valid in the UI on Suitelets and User Events. In Client scripts this will initialize the redirect URL used upon submit. + * + * @param {string} type type specifier for URL: suitelet|tasklink|record|mediaitem + * @param {string} subtype subtype specifier for URL (corresponding to type): scriptid|taskid|recordtype|mediaid + * @param {string} [id] internal ID specifier (sub-subtype corresponding to type): deploymentid|n/a|recordid|n/a + * @param {string} [pagemode] string specifier used to configure page (suitelet: external|internal, tasklink|record: edit|view) + * @param {Object} [parameters] Object used to specify additional URL parameters as name/value pairs + * @return {void} + * + * @since 2007.0 + * @param type + * @param subtype + * @param id? + * @param pagemode? + * @param parameters? + * @return + */ +declare function nlapiSetRedirectURL(type:string, subtype:string, id?:string, pagemode?:string, parameters?:any):void; + +/** + * Request a URL to an external or internal resource. + * @restriction NetSuite maintains a white list of CAs that are allowed for https requests. Please see the online documentation for the complete list. + * @governance 10 units + * + * @param {string} url A fully qualified URL to an HTTP(s) resource + * @param {string, Object} [postdata] - string, document, or Object containing POST payload + * @param {Object} [headers] - Object containing request headers. + * @param {function} [callback] - available on the Client to support asynchronous requests. function is passed an nlobjServerResponse with the results. + * @return {nlobjServerResponse} + * + * @exception {SSS_UNKNOWN_HOST} + * @exception {SSS_INVALID_HOST_CERT} + * @exception {SSS_REQUEST_TIME_EXCEEDED} + * + * @since 2007.0 + * @param url + * @param postdata + * @param headers? + * @param callback? + * @param method + * @return + */ +declare function nlapiRequestURL(url:string, postdata:any, headers?:any, callback?:any, method?:any):any; + +/** + * Return context information about the current user/script. + * + * @return {nlobjContext} + * + * @since 2007.0 + * @return + */ +declare function nlapiGetContext():any; + +/** + * Return the internal ID for the currently logged in user. Returns -4 when called from online forms or "Available without Login" Suitelets. + * + * @return {int} + * + * @since 2005.0 + * @return + */ +declare function nlapiGetUser():any; + +/** + * Return the internal ID for the current user's role. Returns 31 (Online Form User) when called from online forms or "Available without Login" Suitelets. + * + * @return {int} + * + * @since 2005.0 + * @return + */ +declare function nlapiGetRole():any; + +/** + * Return the internal ID for the current user's department. + * + * @return {int} + * + * @since 2005.0 + * @return + */ +declare function nlapiGetDepartment():any; + +/** + * Return the internal ID for the current user's location. + * + * @return {int} + * + * @since 2005.0 + * @return + */ +declare function nlapiGetLocation():any; + +/** + * Return the internal ID for the current user's subsidiary. + * + * @return {int} + * + * @since 2008.1 + * @return + */ +declare function nlapiGetSubsidiary():any; + +/** + * Return the recordtype corresponding to the current page or userevent script. + * + * @return {string} + * + * @since 2007.0 + * @return + */ +declare function nlapiGetRecordType():string; + +/** + * Return the internal ID corresponding to the current page or userevent script. + * + * @return {int} + * + * @since 2007.0 + * @return + */ +declare function nlapiGetRecordId():any; + +/** + * Send out an email and associate it with records in the system. + * Supported base types are entity for entities, transaction for transactions, activity for activities and cases, record|recordtype for custom records + * @governance 10 units + * @restriction all outbound emails subject to email Anti-SPAM policies + * + * @param {int} from internal ID for employee user on behalf of whom this email is sent + * @param {string, int} to email address or internal ID of user that this email is being sent to + * @param {string} subject email subject + * @param {string} body email body + * @param {string, string[]} cc copy email address(es) + * @param {string, string[]} bcc blind copy email address(es) + * @param {Object} records Object of base types -> internal IDs used to associate email to records. i.e. {entity: 100, record: 23, recordtype: customrecord_surveys} + * @param {nlobjFile[]} files array of nlobjFile objects (files) to include as attachments + * @param {boolean} notifySenderOnBounce controls whether or not the sender will receive email notification of bounced emails (defaults to false) + * @param {boolean} internalOnly controls or not the resultingMmessage record will be visible to non-employees on the Communication tab of attached records (defaults to false) + * @param {string} replyTo email reply-to address + * @return {void} + * + * @since 2007.0 + * @param from + * @param to + * @param subject + * @param body + * @param cc + * @param bcc + * @param records + * @param files + * @param notifySenderOnBounce + * @param internalOnly + * @param replyTo + * @return + */ +declare function nlapiSendEmail(from:any, to:any, subject:string, body:string, cc:any, bcc:any, records:any, files:any, notifySenderOnBounce:boolean, internalOnly:boolean, replyTo:string):any; + +/** + * Sends a single on-demand campaign email to a specified recipient and returns a campaign response ID to track the email. + * @governance 10 units + * @restriction works in conjunction with the Lead Nurturing (campaigndrip) sublist only + * + * @param {int} campaigneventid internal ID of the campaign event + * @param {int} recipientid internal ID of the recipient - the recipient must have an email + * @return {int} + * + * @since 2010.1 + * @param campaigneventid + * @param recipientid + * @return + */ +declare function nlapiSendCampaignEmail(campaigneventid:any, recipientid:any):any; + +/** + * Send out a fax and associate it with records in the system. This requires fax preferences to be configured. + * Supported base types are entity for entities, transaction for transactions, activity for activities and cases, record|recordtype for custom records + * @governance 10 units + * + * @param {int} from internal ID for employee user on behalf of whom this fax is sent + * @param {string, int} to fax address or internal ID of user that this fax is being sent to + * @param {string} subject fax subject + * @param {string} body fax body + * @param {Object} records Object of base types -> internal IDs used to associate fax to records. i.e. {entity: 100, record: 23, recordtype: customrecord_surveys} + * @param {nlobjFile[]} files array of nlobjFile objects (files) to include as attachments + * @return {void} + * + * @since 2008.2 + * @param from + * @param to + * @param subject + * @param body + * @param records + * @param files + * @return + */ +declare function nlapiSendFax(from:any, to:any, subject:string, body:string, records:any, files:any):any; + +/** + * Return field definition for a field. + * + * @param {string} fldnam the name of the field + * @return {nlobjField} + * + * @since 2009.1 + * @param fldnam + * @return + */ +declare function nlapiGetField(fldnam:string):any; + +/** + * Return field definition for a matrix field. + * + * @param {string} type matrix sublist name + * @param {string} fldnam matrix field name + * @param {int} column matrix field column index (1-based) + * @return {nlobjField} + * + * @since 2009.2 + * @param type + * @param fldnam + * @param column + * @return + */ +declare function nlapiGetMatrixField(type:string, fldnam:string, column:any):any; + +/** + * Return field definition for a sublist field. + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} [linenum] line number for sublist field (1-based) and only valid for sublists of type staticlist and list + * @return {nlobjField} + * + * @since 2009.1 + * @param type + * @param fldnam + * @param linenum? + * @return + */ +declare function nlapiGetLineItemField(type:string, fldnam:string, linenum?:any):any; + +/** + * Return an nlobjField containing sublist field metadata. + * + * @param {string} type matrix sublist name + * @param {string} fldnam matrix field name + * @param {int} linenum line number (1-based) + * @param {int} column matrix column index (1-based) + * @return {nlobjField} + * + * @since 2009.2 + * @param type + * @param fldnam + * @param linenum + * @param column + * @return + */ +declare function nlapiGetLineItemMatrixField(type:string, fldnam:string, linenum:any, column:any):any; + +/** + * Return the value of a field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} fldnam the field name + * @return {string} + * + * @since 2005.0 + * @param fldnam + * @return + */ +declare function nlapiGetFieldValue(fldnam:string):string; + +/** + * Set the value of a field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @restriction synchronous arg is only supported in client SuiteScript + * + * @param {string} fldnam the field name + * @param {string} value value used to set field + * @param {boolean} [firefieldchanged] if false then the field change event is suppressed (defaults to true) + * @param {boolean} [synchronous] if true then sourcing and field change execution happens synchronously (defaults to false). + * @return {void} + * + * @since 2005.0 + * @param fldnam + * @param value + * @param firefieldchanged? + * @param synchronous? + * @return + */ +declare function nlapiSetFieldValue(fldnam:string, value:string, firefieldchanged?:boolean, synchronous?:boolean):any; + +/** + * Return the display value of a select field's current selection on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} fldnam the field name + * @return {string} + * + * @since 2005.0 + * @param fldnam + * @return + */ +declare function nlapiGetFieldText(fldnam:string):string; + +/** + * Set the value of a field on the current record on a page using it's label. + * @restriction synchronous arg is only supported in client SuiteScript + * + * @param {string} fldnam the field name + * @param {string} txt display name used to lookup field value + * @param {boolean} [firefieldchanged] if false then the field change event is suppressed (defaults to true) + * @param {boolean} [synchronous] if true then sourcing and field change execution happens synchronously (defaults to false). + * @return {void} + * + * @since 2005.0 + * @param fldnam + * @param txt + * @param firefieldchanged? + * @param synchronous? + * @return + */ +declare function nlapiSetFieldText(fldnam:string, txt:string, firefieldchanged?:boolean, synchronous?:boolean):any; + +/** + * Return the values of a multiselect field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} fldnam the field name + * @return {string[]} + * + * @since 2005.0 + * @param fldnam + */ +declare function nlapiGetFieldValues(fldnam:string):void; + +/** + * Set the values of a multiselect field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @restriction synchronous arg is only supported in client SuiteScript + * + * @param {string} fldnam field name + * @param {string[]} values array of strings containing values for field + * @param {boolean} [firefieldchanged] if false then the field change event is suppressed (defaults to true) + * @param {boolean} [synchronous] if true then sourcing and field change execution happens synchronously (defaults to false). + * @return {void} + * + * @since 2005.0 + * @param fldnam + * @param values + * @param firefieldchanged? + * @param synchronous? + * @return + */ +declare function nlapiSetFieldValues(fldnam:string, values:any, firefieldchanged?:boolean, synchronous?:boolean):any; + +/** + * Return the values (via display text) of a multiselect field on the current record. + * @restriction supported in client and user event scripts only. + * @param {string} fldnam field name + * @return {string[]} + * + * @since 2009.1 + * @param fldnam + */ +declare function nlapiGetFieldTexts(fldnam:string):void; + +/** + * Set the values (via display text) of a multiselect field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @restriction synchronous arg is only supported in client SuiteScript + * + * @param {string} fldnam field name + * @param {string[]} texts array of strings containing display values for field + * @param {boolean} [firefieldchanged] if false then the field change event is suppressed (defaults to true) + * @param {boolean} [synchronous] if true then sourcing and field change execution happens synchronously (defaults to false). + * @return {void} + * + * @since 2009.1 + * @param fldnam + * @param texts + * @param firefieldchanged? + * @param synchronous? + * @return + */ +declare function nlapiSetFieldTexts(fldnam:string, texts:any, firefieldchanged?:boolean, synchronous?:boolean):any; + +/** + * Get the value of a matrix header field + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} column matrix column index (1-based) + * @return {string} + * + * @since 2009.2 + * @param type + * @param fldnam + * @param column + * @return + */ +declare function nlapiGetMatrixValue(type:string, fldnam:string, column:any):string; + +/** + * Set the value of a matrix header field + * @restriction synchronous arg is only supported in client SuiteScript + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} column matrix column index (1-based) + * @param {string} value field value for matrix field + * @param {boolean} [firefieldchanged] if false then the field change event is suppressed (defaults to true) + * @param {boolean} [synchronous] if true then sourcing and field change execution happens synchronously (defaults to false). + * @return {void} + * + * @since 2009.2 + * @param type + * @param fldnam + * @param column + * @param value + * @param firefieldchanged? + * @param synchronous? + * @return + */ +declare function nlapiSetMatrixValue(type:string, fldnam:string, column:any, value:string, firefieldchanged?:boolean, synchronous?:boolean):any; + +/** + * Get the current value of a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} column matrix column index (1-based) + * @return {string} value + * + * @since 2009.2 + * @param type + * @param fldnam + * @param column + * @return + */ +declare function nlapiGetCurrentLineItemMatrixValue(type:string, fldnam:string, column:any):string; + +/** + * Set the current value of a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @restriction synchronous arg is only supported in Client SuiteScript + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} column matrix column index (1-based) + * @param {string} value matrix field value + * @param {boolean} [firefieldchanged] if false then the field change event is suppressed (defaults to true) + * @param {boolean} [synchronous] if true then sourcing and field change execution happens synchronously (defaults to false). + * @return {void} + * + * @since 2009.2 + * @param type + * @param fldnam + * @param column + * @param value + * @param firefieldchanged? + * @param synchronous? + * @return + */ +declare function nlapiSetCurrentLineItemMatrixValue(type:string, fldnam:string, column:any, value:string, firefieldchanged?:boolean, synchronous?:boolean):any; + +/** + * Return the value of a sublist matrix field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} linenum line number (1-based) + * @param {int} column column index (1-based) + * @param {string} value + * + * @since 2009.2 + * @param type + * @param fldnam + * @param linenum + * @param column + */ +declare function nlapiGetLineItemMatrixValue(type:string, fldnam:string, linenum:any, column:any):void; + +/** + * Return the value of a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} linenum line number (1-based) + * @return {string} + * + * @since 2005.0 + * @param type + * @param fldnam + * @param linenum + * @return + */ +declare function nlapiGetLineItemValue(type:string, fldnam:string, linenum:any):string; + +/** + * Return the value of a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} linenum line number (1-based) + * @param {string} timezone value + * @return {string} + * + * @since 2013.2 + * @param type + * @param fldnam + * @param linenum + * @param timezone + * @return + */ +declare function nlapiGetLineItemDateTimeValue(type:string, fldnam:string, linenum:any, timezone:string):string; + +/** + * Set the value of a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} linenum line number (1-based) + * @param {string} value + * @retun {void} + * + * @since 2005.0 + * @param type + * @param fldnam + * @param linenum + * @param value + */ +declare function nlapiSetLineItemValue(type:string, fldnam:string, linenum:any, value:string):void; + +/** + * Set the value of a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} linenum line number (1-based) + * @param {string} datetime value + * @param {string} timezone value + * @retun {void} + * + * @since 2013.2 + * @param type + * @param fldnam + * @param linenum + * @param value + * @param timezone + */ +declare function nlapiSetLineItemDateTimeValue(type:string, fldnam:string, linenum:any, value:any, timezone:string):void; + +/** + * Return the label of a select field's current selection for a particular line. + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} linenum line number (1-based) + * @return {string} + * + * @since 2005.0 + * @param type + * @param fldnam + * @param linenum + * @return + */ +declare function nlapiGetLineItemText(type:string, fldnam:string, linenum:any):string; + +/** + * Return the 1st line number that a sublist field value appears in + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {string} val the value being queried for in a sublist field + * @return {int} + * + * @since 2009.2 + * @param type + * @param fldnam + * @param val + * @return + */ +declare function nlapiFindLineItemValue(type:string, fldnam:string, val:string):any; + +/** + * Return the 1st line number that a matrix field value appears in + * + * @param {string} type sublist name + * @param {string} fldnam matrix field name + * @param {int} column matrix column index (1-based) + * @param {string} val the value being queried for in a matrix field + * @return {int} + * + * @since 2009.2 + * @param type + * @param fldnam + * @param column + * @param val + * @return + */ +declare function nlapiFindLineItemMatrixValue(type:string, fldnam:string, column:any, val:string):any; + +/** + * Return the number of columns for a matrix field + * + * @param {string} type sublist name + * @param {string} fldnam matrix field name + * @return {int} + * + * @since 2009.2 + * @param type + * @param fldnam + * @return + */ +declare function nlapiGetMatrixCount(type:string, fldnam:string):any; + +/** + * Return the number of sublists in a sublist on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @return {int} + * + * @since 2005.0 + * @param type + * @return + */ +declare function nlapiGetLineItemCount(type:string):any; + +/** + * Insert and select a new line into the sublist on a page or userevent. + * + * @param {string} type sublist name + * @param {int} [line] line number at which to insert a new line. + * @return{void} + * + * @since 2005.0 + * @param type + * @param line? + */ +declare function nlapiInsertLineItem(type:string, line?:any):void; + +/** + * Remove the currently selected line from the sublist on a page or userevent. + * + * @param {string} type sublist name + * @param {int} [line] line number to remove. + * @return {void} + * + * @since 2005.0 + * @param type + * @param line? + * @return + */ +declare function nlapiRemoveLineItem(type:string, line?:any):any; + +/** + * Set the value of a field on the currently selected line. + * @restriction synchronous arg is only supported in client SuiteScript + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {string} value field value + * @param {boolean} [firefieldchanged] if false then the field change event is suppressed (defaults to true) + * @param {boolean} [synchronous] if true then sourcing and field change execution happens synchronously (defaults to false). + * @return {void} + * + * @since 2005.0 + * @param type + * @param fldnam + * @param value + * @param firefieldchanged? + * @param synchronous? + * @return + */ +declare function nlapiSetCurrentLineItemValue(type:string, fldnam:string, value:string, firefieldchanged?:boolean, synchronous?:boolean):any; + +/** + * Set the value of a field on the currently selected line. + * @restriction synchronous arg is only supported in client SuiteScript + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {string} value field value + * @param {string} timezone value + * @return {void} + * + * @since 2013.2 + * @param type + * @param fldnam + * @param value + * @param timezone + * @return + */ +declare function nlapiSetCurrentLineItemDateTimeValue(type:string, fldnam:string, value:string, timezone:string):any; + +/** + * Set the value of a field on the currently selected line using it's label. + * @restriction synchronous arg is only supported in client SuiteScript + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {string} txt string containing display value or search text. + * @param {boolean} [firefieldchanged] if false then the field change event is suppressed (defaults to true) + * @param {boolean} [synchronous] if true then sourcing and field change execution happens synchronously (defaults to false). + * @return {void} + * + * @since 2005.0 + * @param type + * @param fldnam + * @param txt + * @param firefieldchanged? + * @param synchronous? + * @return + */ +declare function nlapiSetCurrentLineItemText(type:string, fldnam:string, txt:string, firefieldchanged?:boolean, synchronous?:boolean):any; + +/** + * Return the value of a field on the currently selected line. + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @return {string} + * + * @since 2005.0 + * @param type + * @param fldnam + * @return + */ +declare function nlapiGetCurrentLineItemValue(type:string, fldnam:string):string; + +/** + * Return the value of a field on the currently selected line. + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {string} timezone value + * @return {string} + * + * @since 2013.2 + * @param type + * @param fldnam + * @param timezone + * @return + */ +declare function nlapiGetCurrentLineItemDateTimeValue(type:string, fldnam:string, timezone:string):string; + +/** + * Return the label of a select field's current selection on the currently selected line. + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @return {string} + * + * @since 2005.0 + * @param type + * @param fldnam + * @return + */ +declare function nlapiGetCurrentLineItemText(type:string, fldnam:string):string; + +/** + * Return the line number for the currently selected line. + * + * @param {string} type sublist name + * @return {int} + * + * @since 2005.0 + * @param type + * @return + */ +declare function nlapiGetCurrentLineItemIndex(type:string):any; + +/** + * Disable a sublist field. + * @restriction Only supported on sublists of type inlineeditor, editor and list (current field only) + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {boolean} disable if true then field is disabled + * @param {int} linenum line number for sublist field (1-based) and only valid for sublists of type list + * @return {void} + * + * @since 2009.1 + * @param type + * @param fldnam + * @param disable + * @param linenum + * @return + */ +declare function nlapiSetLineItemDisabled(type:string, fldnam:string, disable:boolean, linenum:any):any; + +/** + * Return field mandatoriness. + * + * @param {string} fldnam field name + * @return {boolean} + * + * @since 2009.1 + * @param fldnam + * @return + */ +declare function nlapiGetFieldMandatory(fldnam:string):boolean; + +/** + * Return sublist field mandatoriness. + * @restriction Only supported on sublists of type inlineeditor or editor (current field only) + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @return {boolean} + * + * @since 2009.1 + * @param type + * @param fldnam + * @return + */ +declare function nlapiGetLineItemMandatory(type:string, fldnam:string):boolean; + +/** + * Make a field mandatory. + * + * @param {string} fldnam field name + * @param {boolean} mandatory if true then field is made mandatory + * @return {void} + * + * @since 2009.1 + * @param fldnam + * @param mandatory + * @return + */ +declare function nlapiSetFieldMandatory(fldnam:string, mandatory:boolean):any; + +/** + * Make a sublist field mandatory. + * @restriction Only supported on sublists of type inlineeditor or editor (current field only) + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {boolean} mandatory if true then field is made mandatory + * @return {void} + * + * @since 2009.2 + * @param type + * @param fldnam + * @param mandatory + * @return + */ +declare function nlapiSetLineItemMandatory(type:string, fldnam:string, mandatory:boolean):any; + +/** + * Select an existing line in a sublist. + * + * @param {string} type sublist name + * @param {int} linenum line number to select + * @return {void} + * + * @since 2005.0 + * @param type + * @param linenum + * @return + */ +declare function nlapiSelectLineItem(type:string, linenum:any):any; + +/** + * Save changes made on the currently selected line to the sublist. + * + * @param {string} type sublist name + * @return {void} + * + * @since 2005.0 + * @param type + * @return + */ +declare function nlapiCommitLineItem(type:string):any; + +/** + * Cancel any changes made on the currently selected line. + * @restriction Only supported for sublists of type inlineeditor and editor + * + * @param {string} type sublist name + * @return {void} + * + * @since 2005.0 + * @param type + * @return + */ +declare function nlapiCancelLineItem(type:string):any; + +/** + * Select a new line in a sublist. + * @restriction Only supported for sublists of type inlineeditor and editor + * + * @param {string} type sublist name + * @return {void} + * + * @since 2005.0 + * @param type + * @return + */ +declare function nlapiSelectNewLineItem(type:string):any; + +/** + * Refresh the sublist table. + * @restriction Only supported for sublists of type inlineeditor, editor, and staticlist + * @restriction Client SuiteScript only. + * + * @param {string} type sublist name + * @return{void} + * + * @since 2005.0 + * @param type + */ +declare function nlapiRefreshLineItems(type:string):void; + +/** + * Adds a select option to a scripted select or multiselect field. + * @restriction Client SuiteScript only + * + * @param {string} fldnam field name + * @param {string} value internal ID for select option + * @param {string} text display text for select option + * @param {boolean} [selected] if true then option will be selected by default + * @return {void} + * + * @since 2008.2 + * @param fldnam + * @param value + * @param text + * @param selected? + * @return + */ +declare function nlapiInsertSelectOption(fldnam:string, value:string, text:string, selected?:boolean):any; + +/** + * Removes a select option (or all if value is null) from a scripted select or multiselect field. + * @restriction Client SuiteScript only + * + * @param {string} fldnam field name + * @param {string} value internal ID of select option to remove + * @return {void} + * + * @since 2008.2 + * @param fldnam + * @param value + * @return + */ +declare function nlapiRemoveSelectOption(fldnam:string, value:string):any; + +/** + * Adds a select option to a scripted select or multiselect sublist field. + * @restriction Client SuiteScript only + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {string} value internal ID for select option + * @param {string} text display text for select option + * @param {boolean} [selected] if true then option will be selected by default + * @return {void} + * + * @since 2008.2 + * @param type + * @param fldnam + * @param value + * @param text + * @param selected? + * @return + */ +declare function nlapiInsertLineItemOption(type:string, fldnam:string, value:string, text:string, selected?:boolean):any; + +/** + * Removes a select option (or all if value is null) from a scripted select or multiselect sublist field. + * @restriction Client SuiteScript only + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {string} value internal ID for select option to remove + * @return {void} + * + * @since 2008.2 + * @param type + * @param fldnam + * @param value + * @return + */ +declare function nlapiRemoveLineItemOption(type:string, fldnam:string, value:string):any; + +/** + * Returns true if any changes have been made to a sublist. + * @restriction Client SuiteScript only + * + * @param {string} type sublist name + * @return {boolean} + * + * @since 2005.0 + * @param type + * @return + */ +declare function nlapiIsLineItemChanged(type:string):boolean; + +/** + * Return an record object containing the data being submitted to the system for the currenr record. + * @restriction User Event scripts only + * + * @return {nlobjRecord} + * + * @since 2008.1 + * @return + */ +declare function nlapiGetNewRecord():any; + +/** + * Return an record object containing the current record's data prior to the write operation. + * @restriction beforeSubmit|afterSubmit User Event scripts only + * + * @return {nlobjRecord} + * + * @since 2008.1 + * @return + */ +declare function nlapiGetOldRecord():any; + +/** + * Create an nlobjError object that can be used to abort script execution and configure error notification + * + * @param {string} code error code + * @param {string} details error description + * @param {boolean} [suppressEmail] if true then suppress the error notification emails from being sent out (false by default). + * @return {nlobjError} + * + * @since 2008.2 + * @param code + * @param details + * @param suppressEmail? + * @return + */ +declare function nlapiCreateError(code:string, details:string, suppressEmail?:boolean):any; + +/** + * Return a new entry form page. + * @restriction Suitelets only + * + * @param {string} title page title + * @param {boolean} [hideHeader] true to hide the page header (false by default) + * @return {nlobjForm} + * + * @since 2008.2 + * @param title + * @param hideHeader? + * @return + */ +declare function nlapiCreateForm(title:string, hideHeader?:boolean):nlobjForm; + +/** + * Return a new list page. + * @restriction Suitelets only + * + * @param {string} title page title + * @param {boolean} [hideHeader] true to hide the page header (false by default) + * @return {nlobjList} + * + * @since 2008.2 + * @param title + * @param hideHeader? + * @return + */ +declare function nlapiCreateList(title:string, hideHeader?:boolean):any; + +/** + * Return a new assistant page. + * @restriction Suitelets only + * + * @param {string} title page title + * @param {boolean} [hideHeader] true to hide the page header (false by default) + * @return {nlobjAssistant} + * + * @since 2009.2 + * @param title + * @param hideHeader? + * @return + */ +declare function nlapiCreateAssistant(title:string, hideHeader?:boolean):any; + +/** + * Load a file from the file cabinet (via its internal ID or path). + * @governance 10 units + * @restriction Server SuiteScript only + * + * @param {string, int} id internal ID or relative path to file in the file cabinet (i.e. /SuiteScript/foo.js) + * @return {nlobjFile} + * + * @since 2008.2 + * @param id + * @return + */ +declare function nlapiLoadFile(id:any):any; + +/** + * Add/update a file in the file cabinet. + * @governance 20 units + * @restriction Server SuiteScript only + * + * @param {nlobjFile} file a file object to submit + * @return {int} return internal ID of file + * + * @since 2009.1 + * @param file + * @return + */ +declare function nlapiSubmitFile(file:any):any; + +/** + * Delete a file from the file cabinet. + * @governance 20 units + * @restriction Server SuiteScript only + * + * @param {int} id internal ID of file to be deleted + * @return {id} + * + * @since 2009.1 + * @param id + * @return + */ +declare function nlapiDeleteFile(id:any):any; + +/** + * Instantiate a file object (specifying the name, type, and contents which are base-64 encoded for binary types.) + * @restriction Server SuiteScript only + * + * @param {string} name file name + * @param {string} type file type i.e. plainText, htmlDoc, pdf, word (see documentation for the list of supported file types) + * @param {string} contents string containing file contents (must be base-64 encoded for binary types) + * @return {nlobjFile} + * + * @since 2009.1 + * @param name + * @param type + * @param contents + * @return + */ +declare function nlapiCreateFile(name:string, type:string, contents:string):any; + +/** + * Perform a mail merge operation using any template and up to 2 records and returns an nlobjFile with the results. + * @restriction only supported for record types that are available in mail merge: transactions, entities, custom records, and cases + * @restriction Server SuiteScript only + * @governance 10 units + * + * @param {int} id internal ID of template + * @param {string} baseType primary record type + * @param {int} baseId internal ID of primary record + * @param {string} [altType] secondary record type + * @param {int} [altId] internal ID of secondary record + * @param {Object} [fields] Object of merge field values to use in the mail merge (by default all field values are obtained from records) which overrides those from the record. + * @return {nlobjFile} + * + * @since 2008.2 + * @param id + * @param baseType + * @param baseId + * @param altType? + * @param altId? + * @param fields? + * @return + */ +declare function nlapiMergeRecord(id:any, baseType:string, baseId:any, altType?:string, altId?:any, fields?:any):any; + +/** + * Print a record (transaction) gievn its type, id, and output format. + * @restriction Server SuiteScript only + * @governance 10 units + * + * @param {string} type print output type: transaction|statement|packingslip|pickingticket + * @param {int} id internal ID of record to print + * @param {string} [format] output format: html|pdf|default + * @param {Object} [properties] Object of properties used to configure print + * @return {nlobjFile} + * + * @since 2008.2 + * @param type + * @param id + * @param format? + * @param properties? + * @return + */ +declare function nlapiPrintRecord(type:string, id:any, format?:string, properties?:any):any; + +/** + * Generate a PDF from XML using the BFO report writer (see http://big.faceless.org/products/report/). + * @restriction Server SuiteScript only + * @governance 10 units + * + * @param {string} input string containing BFO compliant XHTML + * @return {nlobjFile} + * + * @since 2009.1 + * @param input + * @return + */ +declare function nlapiXMLToPDF(input:string):any; + +/** + * Create a template renderer used to generate various outputs based on a template. + * @restriction Server SuiteScript only + * @governance 10 units + * + * @param {string} type media type: pdf|html + * @param {string} [engineType] [optional]: default is freemarker/html + * @return {nlobjTemplateRenderer} + * @return + */ +declare function nlapiCreateTemplateRenderer():any; + +/** + * Create an email merger used to assemble subject and body text of an email from a given + * FreeMarker template and a set of associated records. + * @restriction Server SuiteScript only + * + * @param {int} templateId internal ID of the template + * @return {nlobjEmailMerger} + * + * @since 2015.1 + * @param id + * @return + */ +declare function nlapiCreateEmailMerger(id:any):any; + +/** + * Create an entry in the script execution log (note that execution log entries are automatically purged after 30 days). + * + * @param {string} type log type: debug|audit|error|emergency + * @param {string} title log title (up to 90 characters supported) + * @param {string} [details] log details (up to 3000 characters supported) + * @return {void} + * + * @since 2008.1 + * @param type + * @param title + * @param details? + * @return + */ +declare function nlapiLogExecution(type:string, title:string, details?:string):any; + +/** + * Queue a scheduled script for immediate execution and return the status QUEUED if successfull. + * @restriction Server SuiteScript only + * @governance 20 units + * + * @param {string, int} script script ID or internal ID of scheduled script + * @param {string, int} [deployment] script ID or internal ID of scheduled script deployment. If empty, the first "free" deployment (i.e. status = Not Scheduled or Completed) will be used + * @param {Object} parameters Object of parameter name->values used in this scheduled script instance + * @return {string} QUEUED or null if no available deployments were found or the current status of the deployment specified if it was not available. + * + * @since 2008.1 + * @param script + * @param deployment + * @param parameters + * @return + */ +declare function nlapiScheduleScript(script:any, deployment:any, parameters:any):string; + +/** + * Return a URL with a generated OAuth token. + * @restriction Suitelets and Portlets only + * @governance 20 units + * + * @param {string} ssoAppKey + * @return {string} + * + * @since 2009.2 + * @param ssoAppKey + * @return + */ +declare function nlapiOutboundSSO(ssoAppKey:string):string; + +/** + * Loads a configuration record + * @restriction Server SuiteScript only + * @governance 10 units + * + * @param {string} type + * @return {nlobjConfiguration} + * + * @since 2009.2 + * @param type + * @return + */ +declare function nlapiLoadConfiguration(type:string):any; + +/** + * Commits all changes to a configuration record. + * @restriction Server SuiteScript only + * @governance 10 units + * + * @param {nlobjConfiguration} setup record + * @return (void) + * + * @since 2009.2 + * @param setup + */ +declare function nlapiSubmitConfiguration(setup:any):void; + +/** + * Convert a String into a Date object. + * + * @param {string} str date string in the user's date format, timeofday format, or datetime format + * @param {string} format format type to use: date|datetime|timeofday with date being the default + * @return {date} + * + * @since 2005.0 + * @param str + * @param format + * @return + */ +declare function nlapiStringToDate(str:string, format:string):any; + +/** + * Convert a Date object into a String + * + * @param {date} d date object being converted to a string + * @param {string} [formattype] format type to use: date|datetime|timeofday with date being the default + * @return {string} + * + * @since 2005.0 + * @param d + * @param formattype? + * @return + */ +declare function nlapiDateToString(d:any, formattype?:string):string; + +/** + * Add days to a Date object and returns a new Date + * + * @param {date} d date object used to calculate the new date + * @param {int} days the number of days to add to this date object. + * @return {date} + * + * @since 2008.1 + * @param d + * @param days + * @return + */ +declare function nlapiAddDays(d:any, days:any):any; + +/** + * Add months to a Date object and returns a new Date. + * + * @param {date} d date object used to calculate the new date + * @param {int} months the number of months to add to this date object. + * @return {date} + * + * @since 2008.1 + * @param d + * @param months + * @return + */ +declare function nlapiAddMonths(d:any, months:any):any; + +/** + * Format a number for data entry into a currency field. + * + * @param {string} str numeric string used to format for display as currency using user's locale + * @return {string} + * + * @since 2008.1 + * @param str + * @return + */ +declare function nlapiFormatCurrency(str:string):string; + +/** + * Encrypt a String using a SHA-1 hash function + * + * @param {string} s string to encrypt + * @return {string} + * + * @since 2009.2 + * @param s + * @return + */ +declare function nlapiEncrypt(s:string):string; + +/** + * Escape a String for use in an XML document. + * + * @param {string} text string to escape + * @return {string} + * + * @since 2008.1 + * @param text + * @return + */ +declare function nlapiEscapeXML(text:string):string; + +/** + * Convert a String into an XML document. Note that in Server SuiteScript XML is supported natively by the JS runtime using the e4x standard (http://en.wikipedia.org/wiki/E4X) + * This makes scripting XML simpler and more efficient + * + * @param {string} str string being parsed into an XML document + * @return {document} + * + * @since 2008.1 + * @param str + * @return + */ +declare function nlapiStringToXML(str:string):any; + +/** + * Convert an XML document into a String. Note that in Server SuiteScript XML is supported natively by the JS runtime using the e4x standard (http://en.wikipedia.org/wiki/E4X) + * This makes scripting XML data simpler and more efficient + * + * @param {document} xml document being serialized into a string + * @return {string} + * + * @since 2008.1 + * @param xml + * @return + */ +declare function nlapiXMLToString(xml:any):string; + +/** + * Validate that a given XML document conforms to a given XML schema. XML Schema Definition (XSD) is the expected schema format. + * + * @param {document} xmlDocument xml to validate + * @param {document} schemaDocument schema to enforce + * @param {string} schemaFolderId if your schema utilizes or tags which refer to sub-schemas by file name (as opposed to URL), + * provide the Internal Id of File Cabinet folder containing these sub-schemas as the schemaFolderId argument + * @throws {nlobjError} error containsing validation failure message(s) - limited to first 10 + * + * @since 2014.1 + * @param xmlDocument + * @param schemaDocument + * @param schemaFolderId + */ +declare function nlapiValidateXML(xmlDocument:any, schemaDocument:any, schemaFolderId:string):void; + +/** + * select a value from an XML node using XPath. Supports custom namespaces (nodes in default namespace can be referenced using "nlapi" as the prefix) + * + * @param {node} node node being queried + * @param {string} xpath string containing XPath expression. + * @return {string} + * + * @since 2008.2 + * @param node + * @param xpath + * @return + */ +declare function nlapiSelectValue(node:any, xpath:string):string; + +/** + * Select an array of values from an XML node using XPath. Supports custom namespaces (nodes in default namespace can be referenced using "nlapi" as the prefix) + * + * @param {node} node node being queried + * @param {string} xpath string containing XPath expression. + * @return {string[]} + * + * @since 2008.1 + * @param node + * @param xpath + */ +declare function nlapiSelectValues(node:any, xpath:string):void; + +/** + * Select a node from an XML node using XPath. Supports custom namespaces (nodes in default namespace can be referenced using "nlapi" as the prefix) + * + * @param {node} node node being queried + * @param {string} xpath string containing XPath expression. + * @return {node} + * + * @since 2008.1 + * @param node + * @param xpath + * @return + */ +declare function nlapiSelectNode(node:any, xpath:string):any; + +/** + * Select an array of nodes from an XML node using XPath. Supports custom namespaces (nodes in default namespace can be referenced using "nlapi" as the prefix) + * + * @param {node} node node being queried + * @param {string} xpath string containing XPath expression. + * @return {node[]} + * + * @since 2008.1 + * @param node + * @param xpath + */ +declare function nlapiSelectNodes(node:any, xpath:string):void; + +/** + * Calculate exchange rate between two currencies as of today or an optional effective date. + * @governance 10 units + * + * @param {string, int} fromCurrency internal ID or currency code of currency we are converting from + * @param {string, int} toCurrency internal ID or currency code of currency we are converting to + * @param {string} [date] string containing date of effective exchange rate. defaults to today + * @return {float} + * + * @since 2009.1 + * @param fromCurrency + * @param toCurrency + * @param date? + * @return + */ +declare function nlapiExchangeRate(fromCurrency:any, toCurrency:any, date?:string):any; + +/** + * Initiates a workflow on-demand and returns the workflow instance ID for the workflow-record combination. + * @governance 20 units + * + * @param {string} recordtype record type ID of the workflow base record + * @param {int} id internal ID of the base record + * @param {string, int} workflowid internal ID or script ID for the workflow definition + * @return {int} + * + * @since 2010.1 + * @param recordtype + * @param id + * @param workflowid + * @return + */ +declare function nlapiInitiateWorkflow(recordtype:string, id:any, workflowid:any):any; + +/** + * Initiates a workflow on-demand and returns the workflow instance ID for the workflow-record combination. + * @governance 20 units + * + * @param {string} recordtype record type ID of the workflow base record + * @param {string, int} id internal ID of the base record + * @param {string, int} workflowid internal ID or script ID for the workflow definition + * @return {string} + * + * @since 2014.2 + * @param recordType + * @param id + * @param workflowId + * @param parameters + * @return + */ +declare function nlapiInitiateWorkflowAsync(recordType:any, id:any, workflowId:any, parameters:any):string; + +/** + * Triggers a workflow on a record. + * @governance 20 units + * + * @param {string} recordtype record type ID of the workflow base record + * @param {int} id internal ID of the base record + * @param {string, int} workflowid internal ID or script ID for the workflow definition + * @param {string, int} actionid internal ID or script ID of the action script + * @param {string, int} stateid internal ID or script ID of the state contains the referenced add button action + * @return {int} + * + * @since 2010.1 + * @param recordtype + * @param id + * @param workflowid + * @param actionid + * @param stateid + * @return + */ +declare function nlapiTriggerWorkflow(recordtype:string, id:any, workflowid:any, actionid:any, stateid:any):any; + +/** + * Create a subrecord on a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @retun {nlobjSubrecord} + * + * @since 2011.2 + * @param type + * @param fldnam + */ +declare function nlapiCreateCurrentLineSubrecord(type:string, fldnam:string):void; + +/** + * edit a subrecord on a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @retun {nlobjSubrecord} + * + * @since 2011.2 + * @param type + * @param fldnam + */ +declare function nlapiEditCurrentLineItemSubrecord(type:string, fldnam:string):void; + +/** + * remove a subrecord on a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @retun {void} + * + * @since 2011.2 + * @param type + * @param fldnam + */ +declare function nlapiRemoveCurrentLineItemSubrecord(type:string, fldnam:string):void; + +/** + * view a subrecord on a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @retun {nlobjSubrecord} + * + * @since 2011.2 + * @param type + * @param fldnam + */ +declare function nlapiViewCurrentLineItemSubrecord(type:string, fldnam:string):void; + +/** + * view a subrecord on a sublist field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @retun {nlobjSubrecord} + * + * @since 2011.2 + * @param type + * @param fldnam + * @param linenum + */ +declare function nlapiViewLineItemSubrecord(type:string, fldnam:string, linenum:any):void; + +/** + * get a cache object. + * @param {string} name of the cache + * @return {nlobjCache} + * + * @since 2013.2 + * @param name + * @return + */ +declare function nlapiGetCache(name:string):any; + +/** + * create a subrecord on body field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} fldnam body field name + * @retun {nlobjSubrecord} + * + * @since 2011.2 + * @param fldnam + */ +declare function createSubrecord(fldnam:string):void; + +/** + * edit a subrecord on body field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} fldnam body field name + * @retun {nlobjSubrecord} + * + * @since 2011.2 + * @param fldnam + */ +declare function editSubrecord(fldnam:string):void; + +/** + * remove a subrecord on body field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} fldnam body field name + * @retun {void} + * + * @since 2011.2 + * @param fldnam + */ +declare function removeSubrecord(fldnam:string):void; + +/** + * view a subrecord on body field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} fldnam body field name + * @retun {nlobjSubrecord} + * + * @since 2011.2 + * @param fldnam + */ +declare function viewSubrecord(fldnam:string):void; + +/** + * Return a new instance of nlobjRecord used for accessing and manipulating record objects. + * + * @classDescription Class definition for business records in the system. + * @return {nlobjRecord} + * @constructor + * + * @since 2008.2 + */ +declare interface nlobjRecord { + + /** + * + * @return + */ + new (): any; + + /** + * Return the internalId of the record or NULL for new records. + * + * @return {int} Return the integer value of the record ID. + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.1 + * @return + */ + getId(): any; + + /** + * Return the recordType corresponding to this record. + * + * @return {string} The string value of the record name internal ID + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.1 + * @return + */ + getRecordType(): string; + + /** + * Return field metadata for field. + * + * @param {string} fldnam field name + * @return {nlobjField} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.1 + * @param fldnam + * @return + */ + getField(fldnam:string): () => void; + + /** + * Return sublist metadata for sublist. + * + * @param {string} type sublist name + * @return {nlobjSubList} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param type + * @return + */ + getSubList(type:string): () => void; + + /** + * Return field metadata for field. + * + * @param {string} type matrix sublist name + * @param {string} fldnam matrix field name + * @param {column} linenum matrix column (1-based) + * @return {nlobjField} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param type + * @param fldnam + * @param column + * @return + */ + getMatrixField(type:string, fldnam:string, column:any): () => void; + + /** + * Return metadata for sublist field. + * + * @param {string} type sublist name + * @param {string} fldnam sublist field name + * @param {int} [linenum] line number (1-based). If empty, the current sublist field is returned. only settable for sublists of type list + * @return {nlobjField} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param type + * @param fldnam + * @param linenum? + * @return + */ + getLineItemField(type:string, fldnam:string, linenum?:any): () => void; + + /** + * Return metadata for sublist field. + * + * @param {string} type matrix sublist name + * @param {string} fldnam matrix field name + * @param {int} linenum line number + * @param {column} linenum matrix column (1-based) + * @return {nlobjField} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param type + * @param fldnam + * @param linenum + * @param column + * @return + */ + getLineItemMatrixField(type:string, fldnam:string, linenum:any, column:any): () => void; + + /** + * Set the value of a field. + * + * @param {string} name field name + * @param {string} value field value + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.1 + * @param name + * @param value + * @return + */ + setFieldValue(name:string, value:string): any; + + /** + * Set the values of a multi-select field. + * + * @param {string} name field name + * @param {string[]} values string array containing field values + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.1 + * @param name + * @param values + */ + setFieldValues(name:string, values:any): void; + + /** + * Return the value of a field. + * + * @param {string} name field name + * @return {string} + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.1 + * @param name + * @return + */ + getFieldValue(name:string): string; + + /** + * Return the selected values of a multi-select field as an Array. + * + * @param {string} name field name + * @return {string[]} + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.1 + * @param name + */ + getFieldValues(name:string): void; + + /** + * Set the value (via display value) of a select field. + * @restriction only supported for select fields + * + * @param {string} name field name + * @param {string} text field display value + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.2 + * @param name + * @param text + * @return + */ + setFieldText(name:string, text:string): any; + + /** + * Set the values (via display values) of a multi-select field. + * @restriction only supported for multi-select fields + * + * @param {string} name field name + * @param {string[]} texts array of field display values + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.2 + * @param name + * @param texts + * @return + */ + setFieldTexts(name:string, texts:any): any; + + /** + * Return the display value for a select field. + * @restriction only supported for select fields + * + * @param {string} name field name + * @return {string} + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.2 + * @param name + * @return + */ + getFieldText(name:string): string; + + /** + * Return the selected display values of a multi-select field as an Array. + * @restriction only supported for multi-select fields + * + * @param {string} name field name + * @return {string[]} + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.2 + * @param name + */ + getFieldTexts(name:string): void; + + /** + * Get the value of a matrix header field. + * + * @param {string} type matrix sublist name + * @param {string} name matrix field name + * @param {int} column matrix column index (1-based) + * @return {string} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param type + * @param name + * @param column + * @return + */ + getMatrixValue(type:string, name:string, column:any): string; + + /** + * Set the value of a matrix header field. + * + * @param {string} type matrix sublist name + * @param {string} name matrix field name + * @param {int} column matrix column index (1-based) + * @param {string} value field value + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param type + * @param name + * @param column + * @param value + * @return + */ + setMatrixValue(type:string, name:string, column:any, value:string): any; + + /** + * Return an Array of all field names on the record. + * + * @return {string[]} + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.1 + */ + getAllFields(): void; + + /** + * Return an Array of all field names on a record for a particular sublist. + * + * @param {string} group sublist name + * @return {string[]} + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.2 + * @param group + */ + getAllLineItemFields(group:string): void; + + /** + * Set the value of a sublist field. + * + * @param {string} group sublist name + * @param {string} name sublist field name + * @param {int} line line number (1-based) + * @param {string} value sublist field value + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.1 + * @param group + * @param name + * @param line + * @param value + */ + setLineItemValue(group:string, name:string, line:any, value:string): void; + + /** + * Set the value of a sublist field. + * + * @param {string} group sublist name + * @param {string} name sublist field name + * @param {int} line line number (1-based) + * @param {string} datetime value + * @param {string} timezone value + * + * @method + * @memberOf nlobjRecord + * + * @since 2013.2 + * @param group + * @param name + * @param line + * @param value + * @param timezone + */ + setLineItemDateTimeValue(group:string, name:string, line:any, value:any, timezone:string): void; + + /** + * Return the value of a sublist field. + * + * @param {string} group sublist name + * @param {string} name sublist field name + * @param {int} line line number (1-based) + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.1 + * @param group + * @param name + * @param line + */ + getLineItemValue(group:string, name:string, line:any): void; + + /** + * Return the value of a sublist field. + * + * @param {string} group sublist name + * @param {string} name sublist field name + * @param {int} line line number (1-based) + * @param {string} timezone value + * + * @method + * @memberOf nlobjRecord + * + * @since 2013.2 + * @param group + * @param name + * @param line + * @param timezone + */ + getLineItemDateTimeValue(group:string, name:string, line:any, timezone:string): void; + + /** + * Return the text value of a sublist field. + * + * @param {string} group sublist name + * @param {string} name sublist field name + * @param {int} line line number (1-based) + * @return {string} + * + * @method + * @memberOf nlobjRecord + * + * @since 2008.2 + * @param group + * @param name + * @param line + * @return + */ + getLineItemText(group:string, name:string, line:any): string; + + /** + * Set the current value of a sublist field. + * @param {string} group sublist name + * @param {string} name sublist field name + * @param {string} value sublist field value + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param name + * @param value + * @return + */ + setCurrentLineItemValue(group:string, name:string, value:string): any; + + /** + * Set the current value of a sublist field. + * @param {string} group sublist name + * @param {string} name sublist field name + * @param {string} value sublist field value + * @param {string} timezone value + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 2013.2 + * @param group + * @param name + * @param value + * @param timezone + * @return + */ + setCurrentLineItemDateTimeValue(group:string, name:string, value:string, timezone:string): any; + + /** + * Return the current value of a sublist field. + * + * @param {string} group sublist name + * @param {string} name sublist field name + * @return {string} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param name + * @return + */ + getCurrentLineItemValue(group:string, name:string): string; + + /** + * Return the current value of a sublist field. + * + * @param {string} group sublist name + * @param {string} name sublist field name + * @param {string} timezone value + * @return {string} + * + * @method + * @memberOf nlobjRecord + * + * @since 2013.2 + * @param group + * @param name + * @param timezone + * @return + */ + getCurrentLineItemDateTimeValue(group:string, name:string, timezone:string): string; + + /** + * Return the current display value of a sublist field. + * + * @param {string} group sublist name + * @param {string} name sublist field name + * @return {string} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param name + * @return + */ + getCurrentLineItemText(group:string, name:string): string; + + /** + * Set the current value of a sublist matrix field. + * + * @param {string} group matrix sublist name + * @param {string} name matrix field name + * @param {int} column matrix field column index (1-based) + * @param {string} value matrix field value + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param name + * @param column + * @param value + * @return + */ + setCurrentLineItemMatrixValue(group:string, name:string, column:any, value:string): any; + + /** + * Return the current value of a sublist matrix field. + * + * @param {string} group matrix sublist name + * @param {string} name matrix field name + * @param {int} column matrix field column index (1-based) + * @return {string} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param name + * @param column + * @return + */ + getCurrentLineItemMatrixValue(group:string, name:string, column:any): string; + + /** + * Return the number of columns for a matrix field. + * + * @param {string} group matrix sublist name + * @param {string} name matrix field name + * @return {int} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param name + * @return + */ + getMatrixCount(group:string, name:string): any; + + /** + * Return the number of lines in a sublist. + * + * @param {string} group sublist name + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + */ + getLineItemCount(group:string): void; + + /** + * Return line number for 1st occurence of field value in a sublist column. + * + * @param {string} group sublist name + * @param {string} fldnam sublist field name + * @param {string} value sublist field value + * @return {int} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param fldnam + * @param value + * @return + */ + findLineItemValue(group:string, fldnam:string, value:string): any; + + /** + * Return line number for 1st occurence of field value in a sublist column. + * + * @param {string} group sublist name + * @param {string} fldnam sublist field name + * @param {int} column matrix column index (1-based) + * @param {string} value matrix field value + * @return {int} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param fldnam + * @param column + * @param value + * @return + */ + findLineItemMatrixValue(group:string, fldnam:string, column:any, value:string): any; + + /** + * Insert a new line into a sublist. + * + * @param {string} group sublist name + * @param {int} [line] line index at which to insert line + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param line? + */ + insertLineItem(group:string, line?:any): void; + + /** + * Remove an existing line from a sublist. + * + * @param {string} group sublist name + * @param {int} [line] line number to remove + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param line? + */ + removeLineItem(group:string, line?:any): void; + + /** + * Insert and select a new line in a sublist. + * + * @param {string} group sublist name + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @return + */ + selectNewLineItem(group:string): any; + + /** + * Select an existing line in a sublist. + * + * @param {string} group sublist name + * @param {int} line line number to select + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @param line + * @return + */ + selectLineItem(group:string, line:any): any; + + /** + * Commit the current line in a sublist. + * + * @param {string} group sublist name + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 2009.2 + * @param group + * @return + */ + commitLineItem(group:string): any; + + /** + * set the value of a field. + * + * @param {string} name field name + * @param {string} value field value + * @return {void} + * + * @method + * @memberOf nlobjRecord + * + * @since 20013.2 + * @param name + * @param value + * @param timezone + * @return + */ + setDateTimeValue(name:string, value:string, timezone:string): any; + + /** + * Return the value of a field on the current record on a page. + * @restriction supported in client and user event scripts only. + * @param {string} fldnam the field name + * @param {string} timezone Olson value + * @return {string} + * + * @since 2013.2 + * @param fldnam + * @param timezone + * @return + */ + getDateTimeValue(fldnam:string, timezone:string): string; +} + +/** + * Return a new instance of nlobjConfiguration.. + * + * @classDescription Class definition for interacting with setup/configuration pages + * @return {nlobjConfiguration} + * @constructor + * + * @since 2009.2 + */ +declare interface nlobjConfiguration { + + /** + * + * @return + */ + new (): any; + + /** + * return the type corresponding to this setup record. + * + * @return {string} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + * @return + */ + getType(): string; + + /** + * return field metadata for field. + * + * @param {string} fldnam field name + * @return {nlobjField} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + * @param fldnam + * @return + */ + getField(fldnam:string): () => void; + + /** + * set the value of a field. + * + * @param {string} name field name + * @param {string} value field value + * @return {void} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + * @param name + * @param value + * @return + */ + setFieldValue(name:string, value:string): any; + + /** + * Set the values of a multi-select field. + * @restriction only supported for multi-select fields + * + * @param {string} name field name + * @param {string[]} value field values + * @return {void} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + * @param name + * @param value + * @return + */ + setFieldValues(name:string, value:any): any; + + /** + * return the value of a field. + * + * @param {string} name field name + * @return {string} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + * @param name + * @return + */ + getFieldValue(name:string): string; + + /** + * return the selected values of a multi-select field as an Array. + * @restriction only supported for multi-select fields + * + * @param {string} name field name + * @return {string[]} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + * @param name + */ + getFieldValues(name:string): void; + + /** + * set the value (via display value) of a field. + * @restriction only supported for select fields + * + * @param {string} name field name + * @param {string} text field display text + * @return {void} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + * @param name + * @param text + * @return + */ + setFieldText(name:string, text:string): any; + + /** + * set the values (via display values) of a multi-select field. + * @restriction only supported for multi-select fields + * + * @param {string} name field name + * @param {string[]} texts array of field display text values + * @return {void} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + * @param name + * @param texts + * @return + */ + setFieldTexts(name:string, texts:any): any; + + /** + * return the text value of a field. + * @restriction only supported for select fields + * + * @param {string} name field name + * @return {string} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + * @param name + * @return + */ + getFieldText(name:string): string; + + /** + * return the selected text values of a multi-select field as an Array. + * @param {string} name field name + * @return {string[]} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + * @param name + */ + getFieldTexts(name:string): void; + + /** + * return an Array of all field names on the record. + * @return {string[]} + * + * @method + * @memberOf nlobjConfiguration + * + * @since 2009.2 + */ + getAllFields(): void; +} + +/** + * Return a new instance of nlobjFile used for accessing and manipulating files in the file cabinet. + * + * @classDescription Encapsulation of files (media items) in the file cabinet. + * @return {nlobjFile} + * @constructor + * + * @since 2009.1 + */ +declare interface nlobjFile { + + /** + * + * @return + */ + new (): any; + + /** + * Return the name of the file. + * @return {string} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @return + */ + getName(): string; + + /** + * Sets the name of a file. + * @param {string} name the name of the file + * @return {void} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @param name + * @return + */ + setName(name:string): any; + + /** + * return the internal ID of the folder that this file is in. + * @return {int} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @return + */ + getFolder(): any; + + /** + * sets the internal ID of the folder that this file is in. + * @param {int} folder + * @return {void} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @param folder + * @return + */ + setFolder(folder:any): any; + + /** + * sets the character encoding for the file. + * @param {String} encoding + * @return {void} + * + * @method + * @memberOf nlobjFile + * + * @since 2010.2 + * @param encoding + * @return + */ + setEncoding(encoding:string): any; + + /** + * return true if the file is "Available without Login". + * @return {boolean} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @return + */ + isOnline(): boolean; + + /** + * sets the file's "Available without Login" status. + * @param {boolean} online + * @return {void} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @param online + * @return + */ + setIsOnline(online:boolean): any; + + /** + * return true if the file is inactive. + * @return {boolean} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @return + */ + isInactive(): boolean; + + /** + * sets the file's inactive status. + * @param {boolean} inactive + * @return {void} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @param inactive + * @return + */ + setIsInactive(inactive:boolean): any; + + /** + * return the file description. + * @return {string} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @return + */ + getDescription(): string; + + /** + * sets the file's description. + * @param {string} descr the file description + * @return {void} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @param descr + * @return + */ + setDescription(descr:string): any; + + /** + * Return the id of the file (if stored in the FC). + * @return {int} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @return + */ + getId(): any; + + /** + * Return the size of the file in bytes. + * @return {int} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @return + */ + getSize(): any; + + /** + * Return the URL of the file (if stored in the FC). + * @return {string} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @return + */ + getURL(): string; + + /** + * Return the type of the file. + * @return {string} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @return + */ + getType(): string; + + /** + * Return the value (base64 encoded for binary types) of the file. + * @return {string} + * + * @method + * @memberOf nlobjFile + * + * @since 2009.1 + * @return + */ + getValue(): string; +} + +/** + * Return a new instance of nlobjSearchFilter filter objects used to define search criteria. + * + * @classDescription search filter + * @constructor + * @param {string} name filter name. + * @param {string} join internal ID for joined search where this filter is defined + * @param {string} operator operator name (i.e. anyOf, contains, lessThan, etc..) + * @param {string|string[]} value + * @param {string} value2 + * @return {nlobjSearchFilter} + * + * @since 2007.0 + */ +declare interface nlobjSearchFilter { + + /** + * + * @param name + * @param join + * @param operator + * @param value + * @param value2 + * @return + */ + new (name:string, join:string, operator:string, value:any, value2:string): any; + + /** + * Return the name of this search filter. + * @return {string} + * + * @method + * @memberOf nlobjSearchFilter + * + * @since 2007.0 + * @return + */ + getName(): string; + + /** + * Return the join id for this search filter. + * @return {string} + * + * @method + * @memberOf nlobjSearchFilter + * + * @since 2008.1 + * @return + */ + getJoin(): string; + + /** + * Return the filter operator used. + * @return {string} + * + * @method + * @memberOf nlobjSearchFilter + * + * @since 2008.2 + * @return + */ + getOperator(): string; +} + +/** + * Return a new instance of nlobjSearchColumn used for column objects used to define search return columns. + * + * @classDescription search column. + * @return {nlobjSearchColumn} + * @constructor + * @param {string} name column name. + * @param {string} join internal ID for joined search where this column is defined + * @param {string} summary + * + * @since 2007.0 + */ +declare interface nlobjSearchColumn { + + /** + * + * @param name + * @param join + * @param summary + * @return + */ + new (name:string, join:string, summary:string): any; + + /** + * return the name of this search column. + * @return {string} + * + * @method + * @memberOf nlobjSearchColumn + * @since 2008.1 + * @return + */ + getName(): string; + + /** + * return the join id for this search column. + * @return {string} + * + * @method + * @memberOf nlobjSearchColumn + * @since 2008.1 + * @return + */ + getJoin(): string; + + /** + * return the label of this search column. + * @return {string} + * + * @method + * @memberOf nlobjSearchColumn + * + * @since 2009.1 + * @return + */ + getLabel(): string; + + /** + * return the summary type (avg,group,sum,count) of this search column. + * @return {string} + * + * @method + * @memberOf nlobjSearchColumn + * @since 2008.1 + * @return + */ + getSummary(): string; + + /** + * return formula for this search column. + * @return {string} + * + * @method + * @memberOf nlobjSearchColumn + * + * @since 2009.2 + * @return + */ + getFormula(): string; + + /** + * return nlobjSearchColumn sorted in either ascending or descending order. + * @return {nlobjSearchColumn} + * @param {boolean} sort if not set, defaults to false, which returns column data in ascending order. + * + * @method + * @memberOf nlobjSearchColumn + * + * @since 2010.1 + * @param order + * @return + */ + setSort(order:any): (name:string, join:string, summary:string) => void; +} + +/** + * Return a new instance of nlobjSearchResult used for search result row object. + * + * @classDescription Class definition for interacting with the results of a search operation + * @return {nlobjSearchResult} + * @constructor + */ +declare interface nlobjSearchResult { + + /** + * + * @return + */ + new (): any; + + /** + * return the internalId for the record returned in this row. + * @method + * @memberOf nlobjSearchResult + * @return {int} + * @return + */ + getId(): any; + + /** + * return the recordtype for the record returned in this row. + * @method + * @memberOf nlobjSearchResult + * @return {string} + * @return + */ + getRecordType(): string; + + /** + * return the value for a return column specified by name, join ID, and summary type. + * @param {string} name the name of the search column + * @param {string} join the join ID for the search column + * @param {string} summary summary type specified for this column + * @return {string} + * + * @method + * @memberOf nlobjSearchResult + * + * @since 2008.1 + * @param name + * @param join + * @param summary + * @return + */ + getValue(name:string, join:string, summary:string): string; + + /** + * return the text value of this return column if it's a select field. + * @param {string} name the name of the search column + * @param {string} join the join ID for the search column + * @param {string} summary summary type specified for this column + * @return {string} + * + * @method + * @memberOf nlobjSearchResult + * + * @since 2008.1 + * @param name + * @param join + * @param summary + * @return + */ + getText(name:string, join:string, summary:string): string; + + /** + * return an array of all nlobjSearchColumn objects returned in this search. + * @return {nlobjSearchColumn[]} + * + * @method + * @memberOf nlobjSearchResult + * + * @since 2009.2 + */ + getAllColumns(): void; +} + +/** + * Return a new instance of nlobjContext used for user and script context information. + * + * @classDescription Utility class providing information about the current user and the script runtime. + * @return {nlobjContext} + * @constructor + */ +declare interface nlobjContext { + + /** + * + * @return + */ + new (): any; + + /** + * return the name of the current user. + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2007.0 + * @return + */ + getName(): string; + + /** + * return the internalId of the current user. + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2007.0 + * @return + */ + getUser(): string; + + /** + * return the internalId of the current user's role. + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2007.0 + * @return + */ + getRole(): string; + + /** + * return the script ID of the current user's role. + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2008.2 + * @return + */ + getRoleId(): string; + + /** + * return the internalId of the current user's center type. + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2008.2 + * @return + */ + getRoleCenter(): string; + + /** + * return the email address of the current user. + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2007.0 + * @return + */ + getEmail(): string; + + /** + * return the internal ID of the contact logged in on behalf of a customer, vendor, or partner. It returns -1 for non-contact logins + * @return {int} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.1 + * @return + */ + getContact(): any; + + /** + * return the account ID of the current user. + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2007.0 + * @return + */ + getCompany(): string; + + /** + * return the internalId of the current user's department. + * @return {int} + * + * @method + * @memberOf nlobjContext + * + * @since 2007.0 + * @return + */ + getDepartment(): any; + + /** + * return the internalId of the current user's location. + * @return {int} + * + * @method + * @memberOf nlobjContext + * + * @since 2007.0 + * @return + */ + getLocation(): any; + + /** + * return the internalId of the current user's subsidiary. + * @return {int} + * + * @method + * @memberOf nlobjContext + * + * @since 2007.0 + * @return + */ + getSubsidiary(): any; + + /** + * return the execution context for this script: webServices|csvImport|client|userInterface|scheduledScript|portlet|suitelet|debugger|custommassupdate + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2007.0 + * @return + */ + getExecutionContext(): string; + + /** + * return the amount of usage units remaining for this script. + * @return {int} + * + * @method + * @memberOf nlobjContext + * + * @since 2007.0 + * @return + */ + getRemainingUsage(): any; + + /** + * return true if feature is enabled, false otherwise + * @param {string} name + * @return {boolean} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + * @param name + * @return + */ + getFeature(name:string): boolean; + + /** + * return current user's permission level (0-4) for this permission + * @param {string} name + * @return {int} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + * @param name + * @return + */ + getPermission(name:string): any; + + /** + * return system or script preference selection for current user + * @param {string} name + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + * @param name + * @return + */ + getPreference(name:string): string; + + /** + * return value of session object set by script + * @param {string} name + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + * @param name + * @return + */ + getSessionObject(name:string): string; + + /** + * set the value of a session object using a key. + * @param {string} name + * @param {string} value + * @return {void} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + * @param name + * @param value + * @return + */ + setSessionObject(name:string, value:string): any; + + /** + * return an array containing the names of all keys used to set session objects + * @return {string[]} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + */ + getAllSessionObjects(): void; + + /** + * return the NetSuite version for the current account + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + * @return + */ + getVersion(): string; + + /** + * return the environment that the script is executing in: SANDBOX, PRODUCTION, BETA, INTERNAL + * @since 2008.2 + */ + getEnvironment(): void; + + /** + * return the logging level for the current script execution. Not supported in CLIENT scripts + * @since 2008.2 + */ + getLogLevel(): void; + + /** + * return the script ID for the current script + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + * @return + */ + getScriptId(): string; + + /** + * return the deployment ID for the current script + * @return {string} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + * @return + */ + getDeploymentId(): string; + + /** + * return the % complete specified for the current scheduled script execution + * @return {int} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + * @return + */ + getPercentComplete(): any; + + /** + * set the % complete for the current scheduled script execution + * @param {float} ct the percentage of records completed + * @return {void} + * + * @method + * @memberOf nlobjContext + * + * @since 2009.2 + * @param pct + * @return + */ + setPercentComplete(pct:any): any; + + /** + * return a system/script setting. Types are SCRIPT, SESSION, FEATURE, PERMISSION + * + * @param {string} type + * @param {string} name + * @since 2007.0 + * @deprecated + * @param type + * @param name + */ + getSetting(type:string, name:string): void; + + /** + * set a system/script setting. Only supported type is SESSION + * + * @param {string} type + * @param {string} name + * @param {string} value + * @since 2007.0 + * @deprecated + * @param type + * @param name + * @param value + */ + setSetting(type:string, name:string, value:string): void; + + /** + * return an Object containing name/value pairs of color groups to their corresponding RGB hex color based on the currenly logged in user's color them preferences. + * @return {Object} + * + * @method + * @memberOf nlobjContext + * + * @since 2010.1 + * @return + */ + getColorPreferences(): any; + + /** + * return the runtime version of SuiteScript, could be 1.0 or 2.0 + * @return {Object} + * + * @method + * @memberOf nlobjContext + * + * @since 2014.1 + * @return + */ + getRuntimeVersion(): any; +} + +/** + * Return a new instance of nlobjError used system or user-defined error object. + * + * @classDescription Encapsulation of errors thrown during script execution. + * @return {nlobjError} + * @constructor + */ +declare interface nlobjError { + + /** + * + * @return + */ + new (): any; + + /** + * return the error db ID for this error (if it was an unhandled unexpected error). + * @return {string} + * + * @method + * @memberOf nlobjError + * + * @since 2008.2 + * @return + */ + getId(): string; + + /** + * return the error code for this system or user-defined error. + * @return {string} + * + * @method + * @memberOf nlobjError + * + * @since 2008.2 + * @return + */ + getCode(): string; + + /** + * return the error description for this error. + * @return {string} + * + * @method + * @memberOf nlobjError + * + * @since 2008.2 + * @return + */ + getDetails(): string; + + /** + * return a stacktrace containing the location of the error. + * @return {string[]} + * + * @method + * @memberOf nlobjError + * + * @since 2008.2 + */ + getStackTrace(): void; + + /** + * return the userevent script name where this error was thrown. + * @return {string} + * + * @method + * @memberOf nlobjError + * + * @since 2008.2 + * @return + */ + getUserEvent(): string; + + /** + * return the internalid of the record if this error was thrown in an aftersubmit script. + * @return {int} + * + * @method + * @memberOf nlobjError + * + * @since 2008.2 + * @return + */ + getInternalId(): any; +} + +/** + * Return a new instance of nlobjServerResponse.. + * + * @classDescription Contains the results of a server response to an outbound Http(s) call. + * @return {nlobjServerResponse} + * @constructor + * + * @since 2008.1 + */ +declare interface nlobjServerResponse { + + /** + * + * @return + */ + new (): any; + + /** + * return the Content-Type header in response + * @return {string} + * + * @method + * @memberOf nlobjServerResponse + * + * @since 2008.1 + * @return + */ + getContentType(): string; + + /** + * return the value of a header returned. + * @param {string} name the name of the header to return + * @return {string} + * + * @method + * @memberOf nlobjServerResponse + * + * @since 2008.1 + * @param name + * @return + */ + getHeader(name:string): string; + + /** + * return all the values of a header returned. + * @param {string} name the name of the header to return + * @return {string[]} + * + * @method + * @memberOf nlobjServerResponse + * + * @since 2008.1 + * @param name + */ + getHeaders(name:string): void; + + /** + * return an Array of all headers returned. + * @return {string[]} + * + * @method + * @memberOf nlobjServerResponse + * + * @since 2008.1 + */ + getAllHeaders(): void; + + /** + * return the response code returned. + * @return {int} + * + * @method + * @memberOf nlobjServerResponse + * + * @since 2008.1 + * @return + */ + getCode(): any; + + /** + * return the response body returned. + * @return {string} + * + * @method + * @memberOf nlobjServerResponse + * + * @since 2008.1 + * @return + */ + getBody(): string; + + /** + * return the nlobjError thrown via a client call to nlapiRequestURL. + * @return {nlobjError} + * + * @method + * @memberOf nlobjServerResponse + * + * @since 2008.1 + * @return + */ + getError(): () => void; +} + +/** + * Return a new instance of nlobjResponse used for scripting web responses in Suitelets + * + * @classDescription Accessor to Http response made available to Suitelets. + * @return {nlobjResponse} + * @constructor + */ +declare interface nlobjResponse { + + /** + * + * @return + */ + new (): any; + + /** + * add a value for a response header. + * @param {string} name of header + * @param {string} value for header + * @return {void} + * + * @method + * @memberOf nlobjResponse + * + * @since 2008.2 + * @param name + * @param value + * @return + */ + addHeader(name:string, value:string): any; + + /** + * set the value of a response header. + * @param {string} name of header + * @param {string} value for header + * @return {void} + * + * @method + * @memberOf nlobjResponse + * + * @since 2008.2 + * @param name + * @param value + * @return + */ + setHeader(name:string, value:string): any; + + /** + * return the value of a response header. + * @param {string} name of header + * @return {string} + * + * @method + * @memberOf nlobjResponse + * + * @since 2008.2 + * @return + */ + getHeader(): string; + + /** + * return an Array of all response header values for a header + * @param {string} name of header + * @return {string[]} + * + * @method + * @memberOf nlobjResponse + * + * @since 2008.2 + * @param name + */ + getHeaders(name:string): void; + + /** + * return an Array of all response headers + * @return {Object} + * + * @method + * @memberOf nlobjResponse + * + * @since 2008.2 + * @return + */ + getAllHeaders(): any; + + /** + * suppress caching for this response. + * @return {void} + * + * @method + * @memberOf nlobjResponse + * + * @since 2009.1 + * @return + */ + sendNoCache(): any; + + /** + * sets the content type for the response (and an optional filename for binary output). + * + * @param {string} type the file type i.e. plainText, word, pdf, htmldoc (see list of media item types) + * @param {string} filename the file name + * @param {string} disposition Content Disposition used for streaming attachments: inline|attachment + * @return {void} + * @method + * @memberOf nlobjResponse + * + * @since 2008.2 + * @param type + * @param filename + * @param disposition + * @return + */ + setContentType(type:string, filename:string, disposition:string): any; + + /** + * sets the redirect URL for the response. all URLs must be internal unless the Suitelet is being executed in an "Available without Login" context + * at which point it can use type "external" to specify an external url via the subtype arg + * + * @param {string} type type specifier for URL: suitelet|tasklink|record|mediaitem|external + * @param {string} subtype subtype specifier for URL (corresponding to type): scriptid|taskid|recordtype|mediaid|url + * @param {string} [id] internal ID specifier (sub-subtype corresponding to type): deploymentid|n/a|recordid|n/a + * @param {string} [pagemode] string specifier used to configure page (suitelet: external|internal, tasklink|record: edit|view) + * @param {Object} [parameters] Object used to specify additional URL parameters as name/value pairs + * @return {void} + * @method + * @memberOf nlobjResponse + * + * @since 2008.2 + * @param type + * @param subtype + * @param id? + * @param pagemode? + * @param parameters? + * @return + */ + sendRedirect(type:string, subtype:string, id?:string, pagemode?:string, parameters?:any): any; + + /** + * write information (text/xml/html) to the response. + * + * @param {string} output + * @return {void} + * @method + * @memberOf nlobjResponse + * + * @since 2008.2 + * @param output + * @return + */ + write(output:string): any; + + /** + * write line information (text/xml/html) to the response. + * + * @param {string} output + * @return {void} + * @method + * @memberOf nlobjResponse + * + * @since 2008.2 + * @param output + * @return + */ + writeLine(output:string): any; + + /** + * write a UI object page. + * + * @param {Object} pageobject page UI object: nlobjList|nlobjAssistant|nlobjForm|nlobjDashboard + * @return {void} + * @method + * @memberOf nlobjResponse + * + * @since 2008.2 + * @param pageobject + * @return + */ + writePage(pageobject:any): any; + + /** + * sets the character encoding for the response. + * @param {String} encoding + * @return {void} + * @method + * @memberOf nlobjResponse + * + * @since 2012.2 + * @param encoding + * @return + */ + setEncoding(encoding:string): any; +} + +/** + * Return a new instance of nlobjRequest used for scripting web requests in Suitelets + * + * @classDescription Accessor to Http request data made available to Suitelets + * @return {nlobjRequest} + * @constructor + */ +declare interface nlobjRequest { + + /** + * + * @return + */ + new (): any; + + /** + * return the value of a request parameter. + * + * @param {string} name parameter name + * @return {string} + * @method + * @memberOf nlobjRequest + * + * @since 2008.2 + * @param name + * @return + */ + getParameter(name:string): string; + + /** + * return the values of a request parameter as an Array. + * + * @param {string} name parameter name + * @return {string[]} + * @method + * @memberOf nlobjRequest + * + * @since 2008.2 + * @param name + */ + getParameterValues(name:string): void; + + /** + * return an Object containing all the request parameters and their values. + * @return {Object} + * @method + * @memberOf nlobjRequest + * + * @since 2008.2 + * @return + */ + getAllParameters(): any; + + /** + * return the value of a sublist value. + * @param {string} group sublist name + * @param {string} name sublist field name + * @param {int} line sublist line number + * @return {string} + * + * @method + * @memberOf nlobjRequest + * + * @since 2008.2 + * @param group + * @param name + * @param line + * @return + */ + getLineItemValue(group:string, name:string, line:any): string; + + /** + * return the number of lines in a sublist. + * @param {string} group sublist name + * @return {int} + * + * @method + * @memberOf nlobjRequest + * + * @since 2008.2 + * @param group + * @return + */ + getLineItemCount(group:string): any; + + /** + * return the value of a request header. + * @param {string} name + * @return {string} + * + * @method + * @memberOf nlobjRequest + * + * @since 2008.2 + * @param name + * @return + */ + getHeader(name:string): string; + + /** + * return an Object containing all the request headers and their values. + * @return {Object} + * + * @method + * @memberOf nlobjRequest + * + * @since 2008.2 + * @return + */ + getAllHeaders(): any; + + /** + * return the value of an uploaded file. + * @param {string} name file field name + * @return {nlobjFile} + * + * @method + * @memberOf nlobjRequest + * + * @since 2009.1 + * @param name + * @return + */ + getFile(name:string): () => void; + + /** + * return an Object containing field names to file objects for all uploaded files. + * @return {Object} + * + * @method + * @memberOf nlobjRequest + * + * @since 2009.1 + * @return + */ + getAllFiles(): any; + + /** + * return the body of the POST request + * @return {string} + * + * @method + * @memberOf nlobjRequest + * @since 2008.1 + * @return + */ + getBody(): string; + + /** + * return the URL of the request + * @return {string} + * + * @method + * @memberOf nlobjRequest + * @since 2008.1 + * @return + */ + getURL(): string; + + /** + * return the METHOD of the request + * @return {string} + * + * @method + * @memberOf nlobjRequest + * @since 2008.1 + * @return + */ + getMethod(): string; +} + +/** + * Return a new instance of nlobjPortlet used for scriptable dashboard portlet. + * + * @classDescription UI Object used for building portlets that are displayed on dashboard pages + * @return {nlobjPortlet} + * @constructor + */ +declare interface nlobjPortlet { + + /** + * + * @return + */ + new (): any; + + /** + * set the portlet title. + * + * @param {string} title + * @since 2008.2 + * @param title + */ + setTitle(title:string): void; + + /** + * set the entire contents of the HTML portlet (will be placed inside a ...). + * + * @param {string} html + * @since 2008.2 + * @param html + */ + setHtml(html:string): void; + + /** + * add a column (nlobjColumn) to this LIST portlet and return it. + * + * @param {string} name column name + * @param {string} type column type + * @param {string} label column label + * @param {string} [align] column alignment + * @since 2008.2 + * @param name + * @param type + * @param label + * @param align? + */ + addColumn(name:string, type:string, label:string, align?:string): void; + + /** + * add an Edit column (nlobjColumn) to the left of the column specified (supported on LIST portlets only). + * + * @param {nlobjColumn} column + * @param {boolean} showView should Edit|View instead of Edit link + * @param {string} [showHref] column that evaluates to T or F that determines whether to disable the edit|view link per-row. + * @return {nlobjColumn} + * + * @since 2008.2 + * @param column + * @param showView + * @param showHref? + * @return + */ + addEditColumn(column:() => void, showView:boolean, showHref?:string): () => void; + + /** + * add a row (nlobjSearchResult or Array of name-value pairs) to this LIST portlet. + * + * @param {string[]|nlobjSearchResult} row + * @since 2008.2 + * @param row + */ + addRow(row:any): void; + + /** + * add multiple rows (Array of nlobjSearchResults or name-value pair Arrays) to this LIST portlet. + * + * @param {string[][]|nlobjSearchResult[]} rows + * @since 2008.2 + * @param rows + */ + addRows(rows:any): void; + + /** + * add a field (nlobjField) to this FORM portlet and return it. + * + * @param {string} name field name + * @param {string} type field type + * @param {string} [label] field label + * @param {string, int} [source] script ID or internal ID for source list (select and multiselects only) -or- radio value for radio fields + * @return {nlobjField} + * + * @since 2008.2 + * @param name + * @param type + * @param label? + * @param source + * @return + */ + addField(name:string, type:string, label?:string, source?:any): () => void; + + /** + * add a FORM submit button to this FORM portlet. + * + * @param {string} url URL that this form portlet will POST to + * @param {string} [label] label for submit button (defaults to Save) + * @since 2008.2 + * @param url + * @param label? + */ + setSubmitButton(url:string, label?:string): void; + + /** + * add a line (containing text or simple HTML) with optional indenting and URL to this LINKS portlet. + * + * @param {string} text data to output to line + * @param {string} [url] URL if this line should be clickable (if NULL then line will not be clickable) + * @param {int} indent # of indents to insert before text + * @since 2008.2 + * @param text + * @param url? + * @param indent + */ + addLine(text:string, url?:string, indent?:any): void; +} + +/** + * Return a new instance of nlobjList used for scriptable list page. + * + * @classDescription UI Object page type used for building lists + * @return {nlobjList} + * @constructor + */ +declare interface nlobjList { + + /** + * + * @return + */ + new (): any; + + /** + * set the page title. + * + * @param {string} title + * @since 2008.2 + * @param title + */ + setTitle(title:string): void; + + /** + * set the global style for this list: grid|report|plain|normal. + * + * @param {string} style overall style used to render list + * @since 2008.2 + * @param style + */ + setStyle(style:string): void; + + /** + * set the Client SuiteScript used for this page. + * + * @param {string, int} script script ID or internal ID for global client script used to enable Client SuiteScript on page + * @since 2008.2 + * @param script + */ + setScript(script:any): void; + + /** + * add a column (nlobjColumn) to this list and return it. + * + * @param {string} name column name + * @param {string} type column type + * @param {string} label column label + * @param {string} [align] column alignment + * @return {nlobjColumn} + * + * @since 2008.2 + * @param name + * @param type + * @param label + * @param align? + * @return + */ + addColumn(name:string, type:string, label:string, align?:string): () => void; + + /** + * add an Edit column (nlobjColumn) to the left of the column specified. + * + * @param {nlobjColumn} column + * @param {boolean} showView should Edit|View instead of Edit link + * @param {string} [showHref] column that evaluates to T or F that determines whether to disable the edit|view link per-row. + * @return {nlobjColumn} + * + * @since 2008.2 + * @param column + * @param showView + * @param showHref? + * @return + */ + addEditColumn(column:() => void, showView:boolean, showHref?:string): () => void; + + /** + * add a row (Array of name-value pairs or nlobjSearchResult) to this portlet. + * + * @param {string[], nlobjSearchResult} row data used to add a single row + * @since 2008.2 + * @param row + */ + addRow(row:any): void; + + /** + * add multiple rows (Array of nlobjSearchResults or name-value pair Arrays) to this portlet. + * + * @param {string[][], nlobjSearchResult[]} rows data used to add multiple rows + * @since 2008.2 + * @param rows + */ + addRows(rows:any): void; + + /** + * add a button (nlobjButton) to the footer of this page. + * + * @param {string} name button name + * @param {string} label button label + * @param {string} script button script (function name) + * @since 2008.2 + * @param name + * @param label + * @param script + */ + addButton(name:string, label:string, script:string): void; + + /** + * add a navigation cross-link to the page. + * + * @param {string} type page link type: crosslink|breadcrumb + * @param {string} title page link title + * @param {string} url URL for page link + * @since 2008.2 + * @param type + * @param title + * @param url + */ + addPageLink(type:string, title:string, url:string): void; +} + +/** + * Return a new instance of nlobjForm used for scriptable form page. + * + * @classDescription UI Object page type used for building basic data entry forms. + * @return {nlobjForm} + * @constructor + */ +declare interface nlobjForm { + + /** + * + * @return + */ + new (): nlobjForm; + + /** + * set the page title. + * + * @param {string} title + * @since 2008.2 + * @param title + */ + setTitle(title:string): void; + + /** + * set additional title Html. INTERNAL ONLY + * + * @param {string} title + * @since 2008.2 + * @param html + */ + addTitleHtml(html:any): void; + + /** + * set the Client Script definition used for this page. + * + * @param {string, int} script script ID or internal ID for global client script used to enable Client SuiteScript on page + * @since 2008.2 + * @param script + */ + setScript(script:any): void; + + /** + * set the values for all the fields on this form. + * + * @param {Object} values Object containing field name/value pairs + * @since 2008.2 + * @param values + */ + setFieldValues(values:any): void; + + /** + * add a navigation cross-link to the page. + * + * @param {string} type page link type: crosslink|breadcrumb + * @param {string} title page link title + * @param {string} url URL for page link + * @since 2008.2 + * @param type + * @param title + * @param url + */ + addPageLink(type:string, title:string, url:string): void; + + /** + * add a button to this form. + * + * @param {string} name button name + * @param {string} label button label + * @param {string} script button script (function name) + * @return {nlobjButton} + * + * @since 2008.2 + * @param name + * @param label + * @param script + * @return + */ + addButton(name:string, label:string, script?:string): nlobjButton; + + /** + * get a button from this form by name. + * @param {string} name + * @return {nlobjButton} + * + * @method + * @memberOf nlobjForm + * + * @since 2009.2 add + * @param name + * @return + */ + getButton(name:string): nlobjButton; + + /** + * add a reset button to this form. + * + * @param {string} [label] label for this button. defaults to "Reset" + * @return {nlobjButton} + * + * @since 2008.2 + * @param label? + * @return + */ + addResetButton(label?:string): nlobjButton; + + /** + * add a submit button to this form. + * + * @param {string} [label] label for this submit button. defaults to "Save" + * @return {nlobjButton} + * + * @since 2008.2 + * @param label? + * @return + */ + addSubmitButton(label?:string): nlobjButton; + + /** + * add a tab (nlobjTab) to this form and return it. + * + * @param {string} name tab name + * @param {string} label tab label + * @return {nlobjTab} + * + * @since 2008.2 + * @param name + * @param label + * @return + */ + addTab(name:string, label:string): nlobjTab; + + /** + * add a field (nlobjField) to this form and return it. + * + * @param {string} name field name + * @param {string} type field type + * @param {string} [label] field label + * @param {string, int} [source] script ID or internal ID for source list (select and multiselects only) -or- radio value for radio fields + * @param {string} [tab] tab name that this field will live on. If empty then the field is added to the main section of the form (immediately below the title bar) + * @return {nlobjField} + * + * @since 2008.2 + * @param name + * @param type + * @param label? + * @param sourceOrRadio + * @param tab? + * @return + */ + addField(name:string, type:string, label?:string, sourceOrRadio?:any, tab?:string): nlobjField; + + /** + * + * @param name + * @param label + * @param domain + * @param scriptId + * @param value + */ + addCredentialField(name:string, label:string, website?:string, scriptId?:string, value?:string, entityMatch?:boolean, tab?:string): nlobjField; + + /** + * add a subtab (nlobjTab) to this form and return it. + * + * @param {string} name subtab name + * @param {string} label subtab label + * @param {string} [tab] parent tab that this subtab lives on. If empty, it is added to the main tab. + * @return {nlobjTab} + * + * @since 2008.2 + * @param name + * @param label + * @param tab? + * @return + */ + addSubTab(name:string, label:string, tab?:string): nlobjTab; + + /** + * add a sublist (nlobjSubList) to this form and return it. + * + * @param {string} name sublist name + * @param {string} type sublist type: inlineeditor|editor|list|staticlist + * @param {string} label sublist label + * @param {string} [tab] parent tab that this sublist lives on. If empty, it is added to the main tab + * @return {nlobjSubList} + * + * @since 2008.2 + * @param name + * @param type + * @param label + * @param tab? + * @return + */ + addSubList(name:string, type:string, label:string, tab?:string): nlobjSubList; + + /** + * insert a tab (nlobjTab) before another tab (name). + * + * @param {nlobjTab} tab the tab object to insert + * @param {string} nexttab the name of the tab before which to insert this tab + * @return {nlobjTab} + * + * @since 2008.2 + * @param tab + * @param nexttab + * @return + */ + insertTab(tab:() => void, nexttab:string): nlobjTab; + + /** + * insert a field (nlobjField) before another field (name). + * + * @param {nlobjField} field the field object to insert + * @param {string} nextfld the name of the field before which to insert this field + * @return {nlobjField} + * + * @since 2008.2 + * @param field + * @param nextfld + * @return + */ + insertField(field:() => void, nextfld:string): nlobjField; + + /** + * insert a subtab (nlobjTab) before another subtab or sublist (name). + * + * @param {nlobjTab} subtab the subtab object to insert + * @param {string} nextsubtab the name of the subtab before which to insert this subtab + * @return {nlobjTab} + * + * @since 2008.2 + * @param subtab + * @param nextsubtab + * @return + */ + insertSubTab(subtab:() => void, nextsubtab:string): nlobjTab; + + /** + * insert a sublist (nlobjSubList) before another subtab or sublist (name). + * + * @param {nlobjSubList} sublist the sublist object to insert + * @param {string} nextsublist the name of the sublist before which to insert this sublist + * @return {nlobjSubList} + * + * @since 2008.2 + * @param sublist + * @param nextsublist + * @return + */ + insertSubList(sublist:() => void, nextsublist:string): nlobjSubList; + + /** + * return a tab (nlobjTab) on this form. + * + * @param {string} name tab name + * @return {nlobjTab} + * + * @since 2008.2 + * @param name + * @return + */ + getTab(name:string): nlobjTab; + + /** + * return a field (nlobjField) on this form. + * + * @param {string} name field name + * @param {string} [radio] if this is a radio field, specify which radio field to return based on radio value + * @return {nlobjField} + * + * @since 2008.2 + * @param name + * @param radio? + * @return + */ + getField(name:string, radio?:string): nlobjField; + + /** + * return a subtab (nlobjTab) on this form. + * + * @param {string} name subtab name + * @return {nlobjTab} + * + * @since 2008.2 + * @param name + * @return + */ + getSubTab(name:string): nlobjTab; + + /** + * return a sublist (nlobjSubList) on this form. + * + * @param {string} name sublist name + * @return {nlobjSubList} + * + * @since 2008.2 + * @param name + * @return + */ + getSubList(name:string): nlobjSubList; + + /** + * add a field group to the form. + * @param {string} name field group name + * @param {string} label field group label + * @param tab + * @return {nlobjFieldGroup} + * + * @method + * @memberOf nlobjForm + * + * @since 2011.1 + * @param name + * @param label + * @param tab + * @return + */ + addFieldGroup(name:string, label:string, tab:any): nlobjFieldGroup; + + /** + * get a list of all tabs. + * @return an array with names of all tabs + * + * @method + * @memberOf nlobjForm + * + * @since 2012.2 + */ + getTabs(): nlobjTab[]; +} + +/** + * Return a new instance of nlobjAssistant. + * + * @classDescription UI Object page type used to build multi-step "assistant" pages to simplify complex workflows. All data and state for an assistant is tracked automatically + * throughout the user's session up until completion of the assistant. + * + * @return {nlobjAssistant} + * @constructor + * + * @since 2009.2 + */ +declare interface nlobjAssistant { + + /** + * + * @return + */ + new (): any; + + /** + * set the page title. + * @param {string} title + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param title + * @return + */ + setTitle(title:string): any; + + /** + * set the script ID for Client Script used for this form. + * @param {string, int} script script ID or internal ID for global client script used to enable Client SuiteScript on page + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param script + * @return + */ + setScript(script:any): any; + + /** + * set the splash screen used for this page. + * @param {string} title splash portlet title + * @param {string} text1 splash portlet content (left side) + * @param {string} [text2] splash portlet content (right side) + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param title + * @param text1 + * @param text2? + * @return + */ + setSplash(title:string, text1:string, text2?:string): any; + + /** + * show/hide shortcut link. Always hidden on external pages + * @param {boolean} show enable/disable "Add To Shortcut" link on this page + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param show + * @return + */ + setShortcut(show:boolean): any; + + /** + * set the values for all the fields on this page. + * @param {Object} values Object of field name/value pairs used to set all fields on page + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param values + * @return + */ + setFieldValues(values:any): any; + + /** + * if ordered, steps are show on left and must be completed sequentially, otherwise steps are shown on top and can be done in any order + * @param {boolean} ordered If true (default assistant behavior) then a navigation order thru the steps/pages will be imposed on the user. Otherwise the user + * will be allowed to navigate across steps/pages in any order they choose. + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param ordered + * @return + */ + setOrdered(ordered:boolean): any; + + /** + * if numbered, step numbers are displayed next to the step's label in the navigation area + * @param {boolean} numbered If true (default assistant behavior) step numbers will be displayed next to the step label + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param numbered + * @return + */ + setNumbered(numbered:boolean): any; + + /** + * return true if all the steps have been completed. + * @return {boolean} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @return + */ + isFinished(): boolean; + + /** + * mark assistant page as completed and optionally set the rich text to display on completed page. + * @param {string} html completion message (rich text) to display on the "Finish" page + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param html + * @return + */ + setFinished(html:string): any; + + /** + * return true if the assistant has an error message to display for the current step. + * @return {boolean} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @return + */ + hasError(): boolean; + + /** + * set the error message for the currrent step. + * @param {string} html error message (rich text) to display on the page to the user + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param html + * @return + */ + setError(html:string): any; + + /** + * mark a step as current. It will be highlighted accordingly when the page is displayed + * @param {nlobjAssistantStep} step assistant step object representing the current step that the user is on. + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param step + * @return + */ + setCurrentStep(step:() => void): any; + + /** + * add a step to the assistant. + * @param {string} name the name of the step + * @param {string} label label used for this step + * @return {nlobjAssistantStep} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param name + * @param label + * @return + */ + addStep(name:string, label:string): () => void; + + /** + * add a field to this page and return it. + * @param {string} name field name + * @param {string} type field type + * @param {string} [label] field label + * @param {string, int} [source] script ID or internal ID for source list (select and multiselects only) -or- radio value for radio fields + * @param {string} [group] group name that this field will live on. If empty then the field is added to the main section of the page + * @return {nlobjField} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param name + * @param type + * @param label? + * @param source + * @param group? + * @return + */ + addField(name:string, type:string, label?:string, source?:any, group?:string): () => void; + + /** + * add a sublist to this page and return it. For now only sublists of type inlineeditor are supported + * @param {string} name sublist name + * @param {string} type sublist type (inlineeditor only for now) + * @param {string} label sublist label + * @return {nlobjSubList} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param name + * @param type + * @param label + * @return + */ + addSubList(name:string, type:string, label:string): () => void; + + /** + * add a field group to the page. + * @param {string} name field group name + * @param {string} label field group label + * @return {nlobjFieldGroup} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param name + * @param label + * @return + */ + addFieldGroup(name:string, label:string): () => void; + + /** + * return an assistant step on this page. + * @param {string} name step name + * @return {nlobjAssistantStep} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param name + * @return + */ + getStep(name:string): () => void; + + /** + * return a field on this page. + * @param {string} name field name + * @return {nlobjField} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param name + * @return + */ + getField(name:string): () => void; + + /** + * return a sublist on this page. + * @param {string} name sublist name + * @return {nlobjSubList} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param name + * @return + */ + getSubList(name:string): () => void; + + /** + * return a field group on this page. + * @param {string} name field group name + * @return {nlobjFieldGroup} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param name + * @return + */ + getFieldGroup(name:string): () => void; + + /** + * return an array of all the assistant steps for this assistant. + * @return {nlobjAssistantStep[]} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + */ + getAllSteps(): void; + + /** + * return an array of the names of all fields on this page. + * @return {string[]} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + */ + getAllFields(): void; + + /** + * return an array of the names of all sublists on this page . + * @return {string[]} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + */ + getAllSubLists(): void; + + /** + * return an array of the names of all field groups on this page. + * @return {string[]} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + */ + getAllFieldGroups(): void; + + /** + * return the last submitted action by the user: next|back|cancel|finish|jump + * @return {string} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @return + */ + getLastAction(): string; + + /** + * return step from which the last submitted action came from + * @return {nlobjAssistantStep} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @return + */ + getLastStep(): () => void; + + /** + * return the next logical step corresponding to the user's last submitted action. You should only call this after + * you have successfully captured all the information from the last step and are ready to move on to the next step. You + * would use the return value to set the current step prior to continuing. + * + * @return {nlobjAssistantStep} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @return + */ + getNextStep(): () => void; + + /** + * return current step set via nlobjAssistant.setCurrentStep(step) + * @return {nlobjAssistantStep} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @return + */ + getCurrentStep(): () => void; + + /** + * return the total number of steps in the assistant + * @return {int} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @return + */ + getStepCount(): any; + + /** + * redirect the user following a user submit operation. Use this to automatically redirect the user to the next logical step. + * @param {nlobjResponse} response the response object used to communicate back to the user's client + * @return {void} + * + * @method + * @memberOf nlobjAssistant + * + * @since 2009.2 + * @param response + * @return + */ + sendRedirect(response:() => void): any; +} + +/** + * Return a new instance of nlobjField used for scriptable form/sublist field. + * This object is READ-ONLY except for scripted fields created via the UI Object API using Suitelets or beforeLoad user events + * + * @classDescription Core descriptor for fields used to define records and also used to build pages and portlets. + * @return {nlobjField} + * @constructor + */ +declare interface nlobjField { + + /** + * + * @return + */ + new (): /* nlobjField */ any; + + /** + * return field name. + * @return {string} + * + * @method + * @memberOf nlobjField + * + * @since 2009.2 + * @return + */ + getName(): string; + + /** + * return field label. + * @return {string} + * + * @method + * @memberOf nlobjField + * + * @since 2009.2 + * @return + */ + getLabel(): string; + + /** + * return field type. + * @return {string} + * + * @method + * @memberOf nlobjField + * + * @since 2009.2 + * @return + */ + getType(): string; + + /** + * return true if field is hidden. + * @return {boolean} + * + * @method + * @memberOf nlobjField + * + * @since 2009.2 + * @return + */ + isHidden(): boolean; + + /** + * return true if field is mandatory. + * @return {boolean} + * + * @method + * @memberOf nlobjField + * + * @since 2009.2 + * @return + */ + isMandatory(): boolean; + + /** + * return true if field is disabled. + * @return {boolean} + * + * @method + * @memberOf nlobjField + * + * @since 2009.2 + * @return + */ + isDisabled(): boolean; + + /** + * set the label for this field. + * This method is only supported on scripted fields via the UI Object API + * + * @param {string} label + * @return {nlobjField} + * + * @since 2008.2 + * @param label + * @return + */ + setLabel(label:string): () => void; + + /** + * set the alias used to set the value for this field. Defaults to field name. + * This method is only supported on scripted fields via the UI Object API + * + * @param {string} alias column used to populate the field (mostly relevant when populating sublist fields) + * @return {nlobjField} + * + * @since 2008.2 + * @param alias + * @return + */ + setAlias(alias:string): () => void; + + /** + * set the default value for this field. + * This method is only supported on scripted fields via the UI Object API + * + * @param {string} value + * @return {nlobjField} + * + * @since 2008.2 + * @param value + * @return + */ + setDefaultValue(value:string): () => void; + + /** + * Disable field via field metadata. + * This method is only supported on scripted fields via the UI Object API + * @param {boolean} disabled if true then field should be disabled. + * @return {nlobjField} + * + * @method + * @memberOf nlobjField + * + * @since 2009.2 + * @param disabled + * @return + */ + setDisabled(disabled:boolean): () => void; + + /** + * make this field mandatory. + * This method is only supported on scripted fields via the UI Object API + * + * @param {boolean} mandatory if true then field becomes mandatory + * @return {nlobjField} + * + * @since 2008.2 + * @param mandatory + * @return + */ + setMandatory(mandatory:boolean): () => void; + + /** + * set the maxlength for this field (only valid for certain field types). + * This method is only supported on scripted fields via the UI Object API + * + * @param {int} maxlength maximum length for this field + * @return {nlobjField} + * + * @since 2008.2 + * @param maxlength + * @return + */ + setMaxLength(maxlength:any): () => void; + + /** + * set the display type for this field. + * This method is only supported on scripted fields via the UI Object API + * + * @param {string} type display type: inline|normal|hidden|disabled|readonly|entry + * @return {nlobjField} + * + * @since 2008.2 + * @param type + * @return + */ + setDisplayType(type:string): () => void; + + /** + * set the break type (startcol|startrow|none) for this field. startrow is only used for fields with a layout type of outside + * This method is only supported on scripted fields via the UI Object API + * + * @param {string} breaktype break type used to add a break in flow layout for this field: startcol|startrow|none + * @return {nlobjField} + * + * @method + * @memberOf nlobjField + * + * @since 2009.2 + * @param breaktype + * @return + */ + setBreakType(breaktype:string): () => void; + + /** + * set the layout type and optionally the break type. + * This method is only supported on scripted fields via the UI Object API + * + * @param {string} type layout type: outside|startrow|midrow|endrow|normal + * @param {string} [breaktype] break type: startcol|startrow|none + * @return {nlobjField} + * + * @since 2008.2 + * @param type + * @param breaktype? + * @return + */ + setLayoutType(type:string, breaktype?:string): () => void; + + /** + * set the text that gets displayed in lieu of the field value for URL fields. + * + * @param {string} text user-friendly display value in lieu of URL + * @return {nlobjField} + * + * @since 2008.2 + * @param text + * @return + */ + setLinkText(text:string): () => void; + + /** + * set the width and height for this field. + * This method is only supported on scripted fields via the UI Object API + * + * @param {int} width + * @param {int} height + * @return {nlobjField} + * + * @since 2008.2 + * @param width + * @param height + * @return + */ + setDisplaySize(width:any, height:any): () => void; + + /** + * set the amount of emppty vertical space (rows) between this field and the previous field. + * This method is only supported on scripted fields via the UI Object API + * + * @param {int} padding # of empty rows to display above field + * @return {nlobjField} + * + * @since 2008.2 + * @param padding + * @return + */ + setPadding(padding:any): () => void; + + /** + * set help text for this field. If inline is set on assistant pages, help is displayed inline below field + * This method is only supported on scripted fields via the UI Object API + * + * @param {string} help field level help content (rich text) for field + * @param {string} [inline] if true then in addition to the popup field help, the help will also be displayed inline below field (supported on assistant pages only) + * @return {nlobjField} + * + * @method + * @memberOf nlobjField + * + * @since 2009.2 + * @param help + * @param inline? + * @return + */ + setHelpText(help:string, inline?:string): () => void; + + /** + * add a select option to this field (valid for select/multiselect fields). + * This method is only supported on scripted fields via the UI Object API + * + * @param {string} value internal ID for this select option + * @param {string} text display value for this select option + * @param {boolean} [selected] if true then this select option will be selected by default + * @since 2008.2 + * @param value + * @param text + * @param selected? + */ + addSelectOption(value:string, text:string, selected?:boolean): void; +} + +/** + * Return a new instance of nlobjSubList used for scriptable sublist (sublist). + * This object is READ-ONLY except for instances created via the UI Object API using Suitelets or beforeLoad user events. + * + * @classDescription high level container for defining sublist (many to one) relationships on a record or multi-line data entry UIs on pages. + * @return {nlobjSubList} + * @constructor + */ +declare interface nlobjSubList { + + /** + * + * @return + */ + new (): /* nlobjSubList */ any; + + /** + * set the label for this sublist. + * This method is only supported on sublists via the UI Object API + * + * @param {string} label + * @since 2008.2 + * @param label + */ + setLabel(label:string): void; + + /** + * set helper text for this sublist. + * This method is only supported on sublists via the UI Object API + * + * @param {string} help + * @since 2008.2 + * @param help + */ + setHelpText(help:string): void; + + /** + * set the displaytype for this sublist: hidden|normal. + * This method is only supported on scripted or staticlist sublists via the UI Object API + * + * @param {string} type + * @since 2008.2 + * @param type + */ + setDisplayType(type:string): void; + + /** + * set the value of a cell in this sublist. + * + * @param {string} field sublist field name + * @param {int} line line number (1-based) + * @param {string} value sublist value + * + * @method + * @memberOf nlobjSubList + * + * @since 2008.2 + * @param field + * @param line + * @param value + */ + setLineItemValue(field:string, line:any, value:string): void; + + /** + * set the value of a matrix cell in this sublist. + * @param {string} field matrix field name + * @param {int} line line number (1-based) + * @param {int} column matrix column index (1-based) + * @param {string} value matrix field value + * @return {void} + * + * @method + * @memberOf nlobjSubList + * + * @since 2009.2 + * @param field + * @param line + * @param column + * @param value + * @return + */ + setLineItemMatrixValue(field:string, line:any, column:any, value:string): any; + + /** + * set values for multiple lines (Array of nlobjSearchResults or name-value pair Arrays) in this sublist. + * Note that this method is only supported on scripted sublists via the UI Object API + * + * @param {string[][], nlobjSearchResult[]} values + * @since 2008.2 + * @param values + */ + setLineItemValues(values:any): void; + + /** + * Return the number of lines in a sublist. + * + * @param {string} group sublist name + * + * @method + * @memberOf nlobjSubList + * @since 2010.1 + * @param group + */ + getLineItemCount(group:string): void; + + /** + * add a field (column) to this sublist. + * + * @param {string} name field name + * @param {string} type field type + * @param {string} label field label + * @param {string, int} [source] script ID or internal ID for source list used for this select field + * @return {nlobjField} + * + * @method + * @memberOf nlobjSubList + * + * @since 2008.2 + * @param name + * @param type + * @param label + * @param source + * @return + */ + addField(name:string, type:string, label:string, source:any): () => void; + + /** + * designate a field on sublist that must be unique across all lines (only supported on sublists of type inlineeditor, editor). + * @param {string} fldnam the name of a field on this sublist whose value must be unique across all lines + * @return {nlobjField} + * + * @method + * @memberOf nlobjSubList + * + * @since 2009.2 + * @param fldnam + * @return + */ + setUniqueField(fldnam:string): () => void; + + /** + * add a button to this sublist. + * + * @param {string} name button name + * @param {string} label button label + * @param {string} script button script (function name) + * @return {nlobjButton} + * + * @method + * @memberOf nlobjSubList + * + * @since 2008.2 + * @param name + * @param label + * @param script + * @return + */ + addButton(name:string, label:string, script:string): () => void; + + /** + * add "Refresh" button to sublists of type "staticlist" to support manual refreshing of the sublist (without entire page reloads) if it's contents are very volatile + * @return {nlobjButton} + * + * @method + * @memberOf nlobjSubList + * + * @since 2009.2 + * @return + */ + addRefreshButton(): () => void; + + /** + * add "Mark All" and "Unmark All" buttons to this sublist of type "list". + * + * @method + * @memberOf nlobjSubList + * + * @since 2008.2 + */ + addMarkAllButtons(): void; +} + +/** + * Return a new instance of nlobjColumn used for scriptable list column. + * + * @classDescription Class definition for columns used on lists and list portlets. + * @return {nlobjColumn} + * @constructor + */ +declare interface nlobjColumn { + + /** + * + * @return + */ + new (): /* nlobjColumn */ any; + + /** + * set the header name for this column. + * + * @param {string} label the label for this column + * + * @method + * @memberOf nlobjColumn + * + * @since 2008.2 + * @param label + */ + setLabel(label:string): void; + + /** + * set the base URL (optionally defined per row) for this column. + * + * @param {string} value the base URL or a column in the datasource that returns the base URL for each row + * @param {boolean} perRow if true then the 1st arg is expected to be a column in the datasource + * + * @method + * @memberOf nlobjColumn + * + * @since 2008.2 + * @param value + * @param perRow + */ + setURL(value:string, perRow:boolean): void; + + /** + * add a URL parameter (optionally defined per row) to this column's URL. + * + * @param {string} param the name of a parameter to add to URL + * @param {string} value the value of the parameter to add to URL -or- a column in the datasource that returns the parameter value for each row + * @param {boolean} [perRow] if true then the 2nd arg is expected to be a column in the datasource + * + * @method + * @memberOf nlobjColumn + * + * @since 2008.2 + * @param param + * @param value + * @param perRow? + */ + addParamToURL(param:string, value:string, perRow?:boolean): void; +} + +/** + * Return a new instance of nlobjTab used for scriptable tab or subtab. + * + * @classDescription high level grouping for fields on a data entry form (nlobjForm). + * @return {nlobjTab} + * @constructor + */ +declare interface nlobjTab { + + /** + * + * @return + */ + new (): /* nlobjTab */ any; + + /** + * set the label for this tab or subtab. + * + * @param {string} label string used as label for this tab or subtab + * @return {nlobjTab} + * + * @since 2008.2 + * @param label + * @return + */ + setLabel(label:string): () => void; + + /** + * set helper text for this tab or subtab. + * + * @param {string} help inline help text used for this tab or subtab + * @return {nlobjTab} + * + * @since 2008.2 + * @param help + * @return + */ + setHelpText(help:string): () => void; +} + +/** + * Return a new instance of nlobjAssistantStep. + * + * @classDescription assistant step definition. Used to define individual steps/pages in multi-step workflows. + * @return {nlobjAssistantStep} + * @constructor + * + * @since 2009.2 + */ +declare interface nlobjAssistantStep { + + /** + * + * @return + */ + new (): /* nlobjAssistantStep */ any; + + /** + * set the label for this assistant step. + * @param {string} label display label used for this assistant step + * @return {void} + * + * @method + * @memberOf nlobjAssistantStep + * + * @since 2009.2 + * @param label + * @return + */ + setLabel(label:string): any; + + /** + * set helper text for this assistant step. + * @param {string} help inline help text to display on assistant page for this step + * @return {nlobjAssistantStep} + * + * @method + * @memberOf nlobjAssistantStep + * + * @since 2009.2 + * @param help + * @return + */ + setHelpText(help:string): () => void; + + /** + * return the index of this step in the assistant page (1-based) + * @return {int} the index of this step in the assistant (1-based) based on the order in which the steps were added. + * + * @method + * @memberOf nlobjAssistantStep + * + * @since 2009.2 + * @return + */ + getStepNumber(): any; + + /** + * return the value of a field entered by the user during this step. + * @param {string} name field name + * @return {string} + * + * @method + * @memberOf nlobjAssistantStep + * + * @since 2009.2 + * @param name + * @return + */ + getFieldValue(name:string): string; + + /** + * return the selected values of a multi-select field as an Array entered by the user during this step. + * @param {string} name multi-select field name + * @return {string[]} + * + * @method + * @memberOf nlobjAssistantStep + * + * @since 2009.2 + * @param name + */ + getFieldValues(name:string): void; + + /** + * return the number of lines previously entered by the user in this step (or -1 if the sublist does not exist). + * @param {string} group sublist name + * @return {int} + * + * @method + * @memberOf nlobjAssistantStep + * + * @since 2009.2 + * @param group + * @return + */ + getLineItemCount(group:string): any; + + /** + * return the value of a sublist field entered by the user during this step. + * @param {string} group sublist name + * @param {string} name sublist field name + * @param {int} line sublist (1-based) + * @return {string} + * + * @method + * @memberOf nlobjAssistantStep + * + * @since 2009.2 + * @param group + * @param name + * @param line + * @return + */ + getLineItemValue(group:string, name:string, line:any): string; + + /** + * return an array of the names of all fields entered by the user during this step. + * @return {string[]} + * + * @method + * @memberOf nlobjAssistantStep + * + * @since 2009.2 + */ + getAllFields(): void; + + /** + * return an array of the names of all sublists entered by the user during this step. + * @return {string[]} + * + * @method + * @memberOf nlobjAssistantStep + * + * @since 2009.2 + */ + getAllLineItems(): void; + + /** + * return an array of the names of all sublist fields entered by the user during this step + * @param {string} group sublist name + * @return {string[]} + * + * @method + * @memberOf nlobjAssistantStep + * + * @since 2009.2 + * @param group + */ + getAllLineItemFields(group:string): void; +} + +/** + * Return a new instance of nlobjFieldGroup (currently only supported on nlobjAssistant pages) + * + * @classDescription object used for grouping fields on pages (currently only supported on assistant pages). + * @return {nlobjFieldGroup} + * @constructor + * + * @since 2009.2 + */ +declare interface nlobjFieldGroup { + + /** + * + * @return + */ + new (): /* nlobjFieldGroup */ any; + + /** + * set the label for this field group. + * @param {string} label display label for field group + * @return {nlobjFieldGroup} + * + * @method + * @memberOf nlobjFieldGroup + * + * @since 2009.2 + * @param label + * @return + */ + setLabel(label:string): () => void; + + /** + * set collapsibility property for this field group. + * + * @param {boolean} collapsible if true then this field group is collapsible + * @param {boolean} [defaultcollapsed] if true and the field group is collapsible, collapse this field group by default + * @return {nlobjFieldGroup} + * + * @method + * @memberOf nlobjFieldGroup + * + * @since 2009.2 + * @param collapsible + * @param defaultcollapsed? + * @return + */ + setCollapsible(collapsible:boolean, defaultcollapsed?:boolean): () => void; + + /** + * set singleColumn property for this field group. + * + * @param {boolean} singleColumn if true then this field group is displayed in single column + * @return {nlobjFieldGroup} + * + * @method + * @memberOf nlobjFieldGroup + * + * @since 2011.1 + * @param singleColumn + * @return + */ + setSingleColumn(singleColumn:boolean): () => void; + + /** + * set showBorder property for this field group. + * + * @param {boolean} showBorder if true then this field group shows border including label of group + * @return {nlobjFieldGroup} + * + * @method + * @memberOf nlobjFieldGroup + * + * @since 2011.1 + * @param showBorder + * @return + */ + setShowBorder(showBorder:boolean): () => void; +} + +/** + * Return a new instance of nlobjButton. + * + * @classDescription buttons used for triggering custom behaviors on pages. + * @return {nlobjButton} + * @constructor + * + * @since 2009.2 + */ +declare interface nlobjButton { + + /** + * + * @return + */ + new (): nlobjButton; + + /** + * set the label for this button. + * @param {string} label display label for button + * @return {nlobjButton} + * + * @method + * @memberOf nlobjButton + * + * @since 2008.2 + * @param label + * @return + */ + setLabel(label:string): nlobjButton; + + /** + * disable or enable button. + * @param {boolean} disabled if true then this button should be disabled on the page + * @return {nlobjButton} + * + * @method + * @memberOf nlobjButton + * + * @since 2008.2 + * @param disabled + * @return + */ + setDisabled(disabled:boolean): nlobjButton; + + setVisible(visible:boolean): nlobjButton; +} + +/** + * Return a new instance of nlobjSelectOption. + * + * @classDescription select|radio option used for building select fields via the UI Object API and for describing select|radio fields. + * @return {nlobjSelectOption} + * @constructor + * + * @since 2009.2 + */ +declare interface nlobjSelectOption { + + /** + * + * @return + */ + new (): any; + + /** + * return internal ID for select option + * @return {string} + * + * @method + * @memberOf nlobjSelectOption + * + * @since 2009.2 + * @return + */ + getId(): string; + + /** + * return display value for select option. + * @return {string} + * + * @method + * @memberOf nlobjSelectOption + * + * @since 2009.2 + * @return + */ + getText(): string; +} + +/** + * @return nlobjLogin + * + * @since 2012.2 + */ +declare function nlapiGetLogin():void; + +/** + * @param {string} Job Type + * @return {nlobjJobManager} + * + * @since 2013.1 + * @param jobType + * @return + */ +declare function nlapiGetJobManager(jobType:any):any; From e7df72296ea2a55f57ece35e28bb930ae93b19b5 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Thu, 7 Jan 2016 22:23:43 -0500 Subject: [PATCH 041/415] Add redux-promise-middleware --- .../redux-promise-middleware-tests.ts | 46 +++++++++++++++++++ .../redux-promise-middleware.d.ts | 12 +++++ 2 files changed, 58 insertions(+) create mode 100644 redux-promise-middleware/redux-promise-middleware-tests.ts create mode 100644 redux-promise-middleware/redux-promise-middleware.d.ts diff --git a/redux-promise-middleware/redux-promise-middleware-tests.ts b/redux-promise-middleware/redux-promise-middleware-tests.ts new file mode 100644 index 0000000000..ef7e7d82de --- /dev/null +++ b/redux-promise-middleware/redux-promise-middleware-tests.ts @@ -0,0 +1,46 @@ +/// +/// + +import { createStore, applyMiddleware, Store, Dispatch } from "redux"; +import promiseMiddleware from "redux-promise-middleware"; + +declare var rootReducer: Function; +declare var Promise: any; +declare var doSomethingAsyncAndReturnPromise: any; +declare var someActionCreator: any; + +const createStoreWithMiddleware = applyMiddleware( + promiseMiddleware() +)(createStore); + +const store: Store = createStoreWithMiddleware(rootReducer); + +export function myAsyncActionCreator(data: any) { + return { + type: "ACTION", + payload: { + promise: doSomethingAsyncAndReturnPromise(data), + data: data + } + }; +} + +const actionCreator1 = () => ({ + type: "FIRST_ACTION_TYPE", + payload: { + promise: Promise.resolve({ + type: "SECOND_ACTION_TYPE", + payload: "...", + }) + } +}); + +const actionCreator2 = () => ({ + type: "FIRST_ACTION_TYPE", + payload: { + promise: Promise.resolve((action: string, dispatch: Redux.Dispatch, getState: Function) => { + dispatch({ type: "SECEOND_ACTION_TYPE", payload: "..." }); + dispatch(someActionCreator()); + }) + } +}); diff --git a/redux-promise-middleware/redux-promise-middleware.d.ts b/redux-promise-middleware/redux-promise-middleware.d.ts new file mode 100644 index 0000000000..e1350cde0e --- /dev/null +++ b/redux-promise-middleware/redux-promise-middleware.d.ts @@ -0,0 +1,12 @@ +// Type definitions for redux-promise-middleware +// Project: https://github.com/pburtchaell/redux-promise-middleware +// Definitions by: ianks +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "redux-promise-middleware" { + function promiseMiddleware(config?: { promiseTypeSuffixes: string[] }): Redux.Middleware; + + export default promiseMiddleware; +} From b4a6b1adbcb8fda098848a985931f4d5481484f5 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 21 Jan 2016 21:59:19 +0100 Subject: [PATCH 042/415] feat(monk): add monk 1.0.1 definitions --- monk/monk.d.ts | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 monk/monk.d.ts diff --git a/monk/monk.d.ts b/monk/monk.d.ts new file mode 100644 index 0000000000..1a467fc6af --- /dev/null +++ b/monk/monk.d.ts @@ -0,0 +1,69 @@ +// Type definitions for Monk v1.0.1 +// Project: http://github.com/LearnBoost/monk.git +// Definitions by: Patrick Bartsch +// Definitions: https://github.com/DefinitelyTyped/Monk + +declare module "monk" { + function m(database: string): m.Monk; + module m { + export interface promise { + type:string + on(eventName:string, fn:Function):void; + error(fn:Function):promise; + success(fn:Function):promise; + } + + export interface Collection { + id(hexstring:string):string // returns ObjectId + id(obj:Object):string // returns ObjectId + id():string // returns new generated ObjectId + + /* + * All commands accept the simple data[, …], options and a callback. + * You can pass fields to select as an array: data[, …], ['field', …], fn + * You can pass fields as a string delimited by spaces: data[, …], 'field1 field2', fn + * To exclude a field, prefix the field name with '-': data[, …], '-field1', fn + */ + cast(obj?:Object):Object; + + count(needle:Object, fn?:Function):promise; + + distinct(field:string, options?:Object, fn?:Function):promise; + + drop(fn?:Function):promise; + + insert(data:Object, options?:Object, fn?:Function):promise; + + find(needle:Object, options?:Object, fn?:Function):promise; + findOne(needle:Object, options?:Object, fn?:Function):promise; + /** + * findAndModify + * + * @param {Object} search query, or { query, update } object + * @param {Object} optional, update object + * @param {Object|String|Array} optional, options or fields + * @param {Function} callback + * @return {Promise} + * @api public + */ + findAndModify(needle:Object, update?:Object, filter?:string[], options?:Object, fn?:Function):promise; + findById(id:string, options?:Object, fn?:Function):promise; + + update(needle:Object, update:Object, filter?:string[], options?:Object, fn?:Function):promise; + updateById(id:string, update:Object, filter?:string[], options?:Object, fn?:Function):promise; + + remove(needle:Object, options?:Object, fn?:Function):promise; + removeById(id:string, options?:Object, fn?:Function):promise; + + } + + export interface Monk { + (database: string): void; + close():void; + + get(collection:string):Collection; + } + } + + export = m; +} From d95cc8609acf50dac01261316fa3e82a47113679 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Sun, 24 Jan 2016 09:33:08 -0800 Subject: [PATCH 043/415] add `on` func for Editor --- ace/ace.d.ts | 2 ++ ace/tests/ace-default-tests.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ace/ace.d.ts b/ace/ace.d.ts index 8fed295f20..f1b4b69e1d 100644 --- a/ace/ace.d.ts +++ b/ace/ace.d.ts @@ -1037,6 +1037,8 @@ declare module AceAjax { **/ export interface Editor { + on(ev: string, callback: (e: any) => any): void; + addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any): void; addEventListener(ev: string, callback: Function): void; diff --git a/ace/tests/ace-default-tests.ts b/ace/tests/ace-default-tests.ts index f8a280c1a2..798550dec9 100644 --- a/ace/tests/ace-default-tests.ts +++ b/ace/tests/ace-default-tests.ts @@ -5,6 +5,9 @@ var editor = ace.edit("editor"); editor.setTheme("ace/theme/monokai"); editor.getSession().setMode("ace/mode/javascript"); +editor.on("blur", (e) => e); +editor.on("change", (e) => e); + editor.setTheme("ace/theme/twilight"); editor.getSession().setMode("ace/mode/javascript"); From d5faebe532cac24ff670443999777f14c29587d7 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 3 Feb 2016 09:32:36 +0100 Subject: [PATCH 044/415] React slick definition type --- react-slick/react-slick-test.tsx | 31 ++++++++++++++++++++++ react-slick/react-slick.d.ts | 45 ++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 react-slick/react-slick-test.tsx create mode 100644 react-slick/react-slick.d.ts diff --git a/react-slick/react-slick-test.tsx b/react-slick/react-slick-test.tsx new file mode 100644 index 0000000000..c351419401 --- /dev/null +++ b/react-slick/react-slick-test.tsx @@ -0,0 +1,31 @@ +/// +/// +/// + +import * as React from "react" +import * as ReactDOM from "react-dom" +import * as Slider from "react-slick" + +class SliderTest extends React.Component, {}> { + + render() { + let settings = { + speed: 500, + slidesToShow: 8, + slidesToScroll: 1, + draggable: false, + infinite: false + }; + + return ( +
+ +

Slide1

+

Slide2

+
+
+ ) + } +} + +ReactDOM.render(, document.body); diff --git a/react-slick/react-slick.d.ts b/react-slick/react-slick.d.ts new file mode 100644 index 0000000000..222089b537 --- /dev/null +++ b/react-slick/react-slick.d.ts @@ -0,0 +1,45 @@ +/// + +declare module 'react-slick' { + interface __config { + className?: string + adaptiveHeight?: boolean + arrows?: boolean + autoplay?: boolean + autoplaySpeed?: number // integer + centerMode?: boolean + centerPadding?: string | any + cssEase?: string | any + dots?: boolean + dotsClass?: string + draggable?: boolean + easing?: string + fade?: boolean + focusOnSelect?: boolean + infinite?: boolean // should the gallery wrap around it's contents + initialSlide?: number // int + lazyLoad?: boolean + rtl?: boolean + slide?: string + slidesToShow?: number // int + slidesToScroll?: number // int + speed?: number //int + swipe?: boolean + swipeToSlide?: boolean + touchMove?: boolean + touchThreshold?: number // int + variableWidth?: boolean + useCSS?: boolean + vertical?: boolean + afterChange?: (() => void) + beforeChange?: (() => void) + slickGoTo?: number // int + } + + interface Slider extends __config { + responsive?: { breakpoint: number; settings: __config}[] + } + + var Slider: __React.ClassicComponentClass; + export = Slider; +} From 65ed470927fc807ffcfd29d726dfda6f4f79b549 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 3 Feb 2016 09:47:43 +0100 Subject: [PATCH 045/415] React slick definition type --- react-slick/react-slick.d.ts | 78 ++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/react-slick/react-slick.d.ts b/react-slick/react-slick.d.ts index 222089b537..090037bc52 100644 --- a/react-slick/react-slick.d.ts +++ b/react-slick/react-slick.d.ts @@ -1,45 +1,45 @@ -/// +/// -declare module 'react-slick' { - interface __config { - className?: string - adaptiveHeight?: boolean - arrows?: boolean - autoplay?: boolean - autoplaySpeed?: number // integer - centerMode?: boolean - centerPadding?: string | any - cssEase?: string | any - dots?: boolean - dotsClass?: string - draggable?: boolean - easing?: string - fade?: boolean - focusOnSelect?: boolean - infinite?: boolean // should the gallery wrap around it's contents - initialSlide?: number // int - lazyLoad?: boolean - rtl?: boolean - slide?: string - slidesToShow?: number // int - slidesToScroll?: number // int - speed?: number //int - swipe?: boolean - swipeToSlide?: boolean - touchMove?: boolean - touchThreshold?: number // int - variableWidth?: boolean - useCSS?: boolean - vertical?: boolean - afterChange?: (() => void) - beforeChange?: (() => void) - slickGoTo?: number // int - } +interface __config { + className?: string + adaptiveHeight?: boolean + arrows?: boolean + autoplay?: boolean + autoplaySpeed?: number // integer + centerMode?: boolean + centerPadding?: string | any + cssEase?: string | any + dots?: boolean + dotsClass?: string + draggable?: boolean + easing?: string + fade?: boolean + focusOnSelect?: boolean + infinite?: boolean // should the gallery wrap around it's contents + initialSlide?: number // int + lazyLoad?: boolean + rtl?: boolean + slide?: string + slidesToShow?: number // int + slidesToScroll?: number // int + speed?: number //int + swipe?: boolean + swipeToSlide?: boolean + touchMove?: boolean + touchThreshold?: number // int + variableWidth?: boolean + useCSS?: boolean + vertical?: boolean + afterChange?: (() => void) + beforeChange?: (() => void) + slickGoTo?: number // int +} - interface Slider extends __config { - responsive?: { breakpoint: number; settings: __config}[] - } +interface Slider extends __config { + responsive?: { breakpoint: number; settings: __config}[] +} +declare module "react-slick" { var Slider: __React.ClassicComponentClass; export = Slider; } From 04faa1e002ed6996f20ebf9cb319d35f7f45de1e Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 3 Feb 2016 10:01:59 +0100 Subject: [PATCH 046/415] React slick definition type --- react-slick/react-slick.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/react-slick/react-slick.d.ts b/react-slick/react-slick.d.ts index 090037bc52..2dfadcf133 100644 --- a/react-slick/react-slick.d.ts +++ b/react-slick/react-slick.d.ts @@ -1,3 +1,8 @@ +// Type definitions for [react-slick] +// Project: [https://github.com/akiran/react-slick] +// Definitions by: [Andrey Balokha] <[https://github.com/andrewBalekha]> +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + /// interface __config { From 85ae5b9531449b4c878ec30aaea122f6572d6784 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 3 Feb 2016 10:05:04 +0100 Subject: [PATCH 047/415] React slick definition type --- react-slick/react-slick.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react-slick/react-slick.d.ts b/react-slick/react-slick.d.ts index 2dfadcf133..43c9cdcf69 100644 --- a/react-slick/react-slick.d.ts +++ b/react-slick/react-slick.d.ts @@ -1,6 +1,6 @@ -// Type definitions for [react-slick] -// Project: [https://github.com/akiran/react-slick] -// Definitions by: [Andrey Balokha] <[https://github.com/andrewBalekha]> +// Type definitions for react-slick +// Project: https://github.com/akiran/react-slick +// Definitions by: Andrey Balokha // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 4674eac751cb6820363959532a60f1c420c6a159 Mon Sep 17 00:00:00 2001 From: "jeff.noble" Date: Wed, 3 Feb 2016 10:40:14 -0500 Subject: [PATCH 048/415] The casing for the bodyType is different than what comes back from getTypeAsync(). --- office-js/office-js.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/office-js/office-js.d.ts b/office-js/office-js.d.ts index e82e78fb3f..41acf23619 100644 --- a/office-js/office-js.d.ts +++ b/office-js/office-js.d.ts @@ -4689,7 +4689,7 @@ declare module Office.MailboxEnums { /** * The body is in HTML format */ - HTML, + Html, /** * The body is in text format */ From 824761509fb46114aa55036829452941f135a543 Mon Sep 17 00:00:00 2001 From: Damiano Date: Fri, 12 Feb 2016 23:27:38 +0100 Subject: [PATCH 049/415] Missing "require" property on IComponentOptions Added missing require property on IComponentOptions --- angularjs/angular.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 67b3eb488d..59645137d7 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1706,6 +1706,10 @@ declare module angular { * $attrs - Current attributes object for the element */ templateUrl?: string | Function; + /** + * Define object mapping to other directive or component required controllers. + */ + require?: any; /** * Define DOM attribute binding to component properties. Component properties are always bound to the component * controller and not to the scope. From f9d6506b938c33ab9cb2b9618ab41c4fa8f7b694 Mon Sep 17 00:00:00 2001 From: "Andrew V. Sparrow" Date: Sat, 13 Feb 2016 11:07:50 +0600 Subject: [PATCH 050/415] Sockjs should extends WebSocket --- sockjs/sockjs.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sockjs/sockjs.d.ts b/sockjs/sockjs.d.ts index e9569ba22c..ae6819f520 100644 --- a/sockjs/sockjs.d.ts +++ b/sockjs/sockjs.d.ts @@ -8,19 +8,19 @@ interface SockJSSimpleEvent { toString(): string; } -interface SJSOpenEvent extends SockJSSimpleEvent {} +interface SJSOpenEvent extends SockJSSimpleEvent, Event {} -interface SJSCloseEvent extends SockJSSimpleEvent { +interface SJSCloseEvent extends SockJSSimpleEvent, CloseEvent { code: number; reason: string; wasClean: boolean; } -interface SJSMessageEvent extends SockJSSimpleEvent { +interface SJSMessageEvent extends SockJSSimpleEvent, MessageEvent { data: string; } -interface SockJS extends EventTarget { +interface SockJS extends WebSocket { protocol: string; readyState: number; onopen: (ev: SJSOpenEvent) => any; @@ -49,4 +49,4 @@ declare var SockJS: { null_origin?: boolean; }; }): SockJS; -}; \ No newline at end of file +}; From 0a45f056612592dd1e09ecaaa553f633720db351 Mon Sep 17 00:00:00 2001 From: Ryan Schmukler Date: Sat, 9 Jan 2016 16:53:47 -0500 Subject: [PATCH 051/415] expand googlemaps definitions --- googlemaps/google.maps.d.ts | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 82a13d9122..bca09b3f39 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -1517,7 +1517,7 @@ declare module google.maps { addressControl?: boolean; addressControlOptions?: StreetViewAddressControlOptions; clickToGo?: boolean; - disableDefaultUi?: boolean; + disableDefaultUI?: boolean; disableDoubleClickZoom?: boolean; enableCloseButton?: boolean; imageDateControl?: boolean; @@ -1530,6 +1530,7 @@ declare module google.maps { pov?: StreetViewPov; scrollwheel?: boolean; visible?: boolean; + zoom?: number; zoomControl?: boolean; zoomControlOptions?: ZoomControlOptions; } @@ -1571,7 +1572,29 @@ declare module google.maps { worldSize?: Size; } + export enum StreetViewPreference { + BEST, + NEAREST + } + + export enum StreetViewSource { + DEFAULT, + OUTDOOR + } + + export interface StreetViewLocationRequest { + location: LatLng|LatLngLiteral; + preference?: StreetViewPreference; + radius?: number; + source?: StreetViewSource; + } + + export interface StreetViewPanoRequest { + pano: string; + } + export class StreetViewService { + getPanorama(request: StreetViewLocationRequest|StreetViewPanoRequest, cb: (data: StreetViewPanoramaData, status: StreetViewStatus) => void): void; getPanoramaById(pano: string, callback: (streetViewPanoramaData: StreetViewPanoramaData, streetViewStatus: StreetViewStatus) => void): void; getPanoramaByLocation(latlng: LatLng|LatLngLiteral, radius: number, callback: (streetViewPanoramaData: StreetViewPanoramaData, streetViewStatus: StreetViewStatus) => void ): void; } From 74a8ca9e7e9e86b4368996da45d740dcf1386a46 Mon Sep 17 00:00:00 2001 From: MizunagiKB Date: Sat, 20 Feb 2016 14:11:16 +0900 Subject: [PATCH 052/415] Collection.remove: Argument type is missing. It is different arguments in the add function and remove function. (add - Backbone.Collection.add, remove - Backbone.Collection.remove) Those that can be used in argument, a Model instance, id string or a JS object http://backbonejs.org/#Collection-remove --- backbone/backbone-global.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backbone/backbone-global.d.ts b/backbone/backbone-global.d.ts index c16e1a59e3..1962bb08ef 100644 --- a/backbone/backbone-global.d.ts +++ b/backbone/backbone-global.d.ts @@ -206,8 +206,8 @@ declare module Backbone { pluck(attribute: string): any[]; push(model: TModel, options?: AddOptions): TModel; pop(options?: Silenceable): TModel; - remove(model: TModel, options?: Silenceable): TModel; - remove(models: TModel[], options?: Silenceable): TModel[]; + remove(model: {}|TModel, options?: Silenceable): TModel; + remove(models: ({}|TModel)[], options?: Silenceable): TModel[]; reset(models?: TModel[], options?: Silenceable): TModel[]; set(models?: TModel[], options?: Silenceable): TModel[]; shift(options?: Silenceable): TModel; From b7973616d40f9f67fbb09cbd5fc7f3aa8817fb4b Mon Sep 17 00:00:00 2001 From: YUDIEL CURBELO Date: Sat, 20 Feb 2016 00:57:52 -0500 Subject: [PATCH 053/415] path function to allow (string | number)[] It is totally legal to have something like this: paper.path(['M' + (startX), (startY), 'L' + (startX), (startY)]); --- raphael/raphael.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raphael/raphael.d.ts b/raphael/raphael.d.ts index 80419302ad..38d6c53654 100644 --- a/raphael/raphael.d.ts +++ b/raphael/raphael.d.ts @@ -210,7 +210,7 @@ interface RaphaelPaper { getFont(family: string, weight?: number, style?: string, stretch?: string): RaphaelFont; height: number; image(src: string, x: number, y: number, width: number, height: number): RaphaelElement; - path(pathString?: string): RaphaelPath; + path(pathString?: string | (string | number)[]): RaphaelPath; print(x: number, y: number, str: string, font: RaphaelFont, size?: number, origin?: string, letter_spacing?: number): RaphaelPath; rect(x: number, y: number, width: number, height: number, r?: number): RaphaelElement; remove(): void; From a6f84522683e0abd14258ffeb0162b9e4c3d1cff Mon Sep 17 00:00:00 2001 From: Laszlo Pandy Date: Thu, 25 Feb 2016 14:19:57 +0100 Subject: [PATCH 054/415] Whitespace only: remove tabs in foogaloop.d.ts --- vimeo/froogaloop.d.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vimeo/froogaloop.d.ts b/vimeo/froogaloop.d.ts index 61f58e284f..077e79cbce 100644 --- a/vimeo/froogaloop.d.ts +++ b/vimeo/froogaloop.d.ts @@ -4,15 +4,17 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped interface VimeoParams { - name:string; - value:any; + name:string; + value:any; } + interface VimeoPlayerAPI { (method: string): any; (method: string, callback: (value: any, player_id: any) =>void ): any; - (method: string, value: any): any; - (method: string, value: VimeoParams[]): any; + (method: string, value: any): any; + (method: string, value: VimeoParams[]): any; } + interface VimeoPlayer { api: VimeoPlayerAPI; addEvent(eventName: string, callback: (e: any) =>void ): any; @@ -25,4 +27,4 @@ interface VimeoPlayer { getDomainFromUrl(url: string): string; } -declare var $f: VimeoPlayerAPI; \ No newline at end of file +declare var $f: VimeoPlayerAPI; From cca549d09caf1a66fcdb2a259e8b03a2983a89d3 Mon Sep 17 00:00:00 2001 From: Laszlo Pandy Date: Thu, 25 Feb 2016 14:21:23 +0100 Subject: [PATCH 055/415] Fix vimeo/froogaloop.d.ts --- vimeo/froogaloop.d.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/vimeo/froogaloop.d.ts b/vimeo/froogaloop.d.ts index 077e79cbce..d0e54e3199 100644 --- a/vimeo/froogaloop.d.ts +++ b/vimeo/froogaloop.d.ts @@ -19,12 +19,7 @@ interface VimeoPlayer { api: VimeoPlayerAPI; addEvent(eventName: string, callback: (e: any) =>void ): any; removeEvent(eventName: string): void; - postMessage(method: string, params:VimeoParams[], target): void; - onMessagReceived(event); - storeCallback(eventName: string, callback, target_id: string); - getCallback(eventName: string, target_id: string); - removeCallback(eventName: string, target_id: string); - getDomainFromUrl(url: string): string; } declare var $f: VimeoPlayerAPI; +declare var Froogaloop: VimeoPlayerAPI; From cbf669a7a0cb7e236ef1ee252cc836344a4a9417 Mon Sep 17 00:00:00 2001 From: Laszlo Pandy Date: Thu, 25 Feb 2016 14:22:36 +0100 Subject: [PATCH 056/415] Whitespace only. --- vimeo/froogaloop.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vimeo/froogaloop.d.ts b/vimeo/froogaloop.d.ts index d0e54e3199..b4af11258a 100644 --- a/vimeo/froogaloop.d.ts +++ b/vimeo/froogaloop.d.ts @@ -10,14 +10,14 @@ interface VimeoParams { interface VimeoPlayerAPI { (method: string): any; - (method: string, callback: (value: any, player_id: any) =>void ): any; + (method: string, callback: (value: any, player_id: any) => void): any; (method: string, value: any): any; (method: string, value: VimeoParams[]): any; } interface VimeoPlayer { api: VimeoPlayerAPI; - addEvent(eventName: string, callback: (e: any) =>void ): any; + addEvent(eventName: string, callback: (e: any) => void): any; removeEvent(eventName: string): void; } From 4db61597fa28a9f8bbb19f410f6f38f80271d203 Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Tue, 1 Mar 2016 15:13:50 +0100 Subject: [PATCH 057/415] Create connect-redis definitions --- connect-redis/connect-redis-tests.ts | 4 +++ connect-redis/connect-redis.d.ts | 38 ++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 connect-redis/connect-redis-tests.ts create mode 100644 connect-redis/connect-redis.d.ts diff --git a/connect-redis/connect-redis-tests.ts b/connect-redis/connect-redis-tests.ts new file mode 100644 index 0000000000..3c50074117 --- /dev/null +++ b/connect-redis/connect-redis-tests.ts @@ -0,0 +1,4 @@ +import * as connectRedis from "connect-redis"; +import * as session from "express-session"; + +let RedisStore = connectRedis(session); diff --git a/connect-redis/connect-redis.d.ts b/connect-redis/connect-redis.d.ts new file mode 100644 index 0000000000..4ba0490fe1 --- /dev/null +++ b/connect-redis/connect-redis.d.ts @@ -0,0 +1,38 @@ +// Type definitions for connect-redis +// Project: https://npmjs.com/package/connect-redis +// Definitions by: Xavier Stouder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "connect-redis" { + import * as express from "express"; + import * as session from "express-session"; + import * as redis from "redis"; + + function s(options: (options?: session.SessionOptions) => express.RequestHandler): s.RedisStore; + + namespace s { + interface RedisStore extends session.Store { + new (options: RedisStoreOptions): session.Store; + } + interface RedisStoreOptions { + client?: redis.RedisClient; + host?: string; + port?: number; + socket?: string; + url?: string; + ttl?: number; + disableTTL?: boolean; + db?: number; + pass?: string; + prefix?: string; + unref?: boolean; + serializer?: Serializer | JSON; + } + interface Serializer { + stringify: Function; + parse: Function; + } + } + + export = s; +} From 1ea67ceea476ea5b226130ced5f2cef247eedaab Mon Sep 17 00:00:00 2001 From: abraaoalves Date: Tue, 1 Mar 2016 19:01:41 -0300 Subject: [PATCH 058/415] ad files --- .../jquery-truncate-html-tests.ts | 5 +++++ .../jquery-truncate-html.d.ts | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 jquery-truncate-html/jquery-truncate-html-tests.ts create mode 100644 jquery-truncate-html/jquery-truncate-html.d.ts diff --git a/jquery-truncate-html/jquery-truncate-html-tests.ts b/jquery-truncate-html/jquery-truncate-html-tests.ts new file mode 100644 index 0000000000..fe043601b0 --- /dev/null +++ b/jquery-truncate-html/jquery-truncate-html-tests.ts @@ -0,0 +1,5 @@ +/// + +jQuery('

Stuff and Nonsense

').truncate({ + length: 13 +}).html(); diff --git a/jquery-truncate-html/jquery-truncate-html.d.ts b/jquery-truncate-html/jquery-truncate-html.d.ts new file mode 100644 index 0000000000..d7f4abaa3b --- /dev/null +++ b/jquery-truncate-html/jquery-truncate-html.d.ts @@ -0,0 +1,22 @@ +// Type definitions for jQuery-truncate-html.js +// Project: https://github.com/kbwood/timeentry +// Definitions by: Abraão Alves +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface ITruncateOptions{ + length?: number; + stripTags?: boolean; + words?: boolean; + noBreaks?: boolean; + ellipsis?: string; +} + +interface jQuery{ + truncate(options: ITruncateOptions) : jQuery; +} + +interface JQueryStatic { + truncate(html: string, options: ITruncateOptions) : string; +} From 13d212dfb3ef4672039019036bf2d08acbe728eb Mon Sep 17 00:00:00 2001 From: abraaoalves Date: Tue, 1 Mar 2016 21:40:34 -0300 Subject: [PATCH 059/415] make tests --- .../jquery-truncate-html-tests.ts | 15 ++++++++++++--- jquery-truncate-html/jquery-truncate-html.d.ts | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/jquery-truncate-html/jquery-truncate-html-tests.ts b/jquery-truncate-html/jquery-truncate-html-tests.ts index fe043601b0..e20f9c22ee 100644 --- a/jquery-truncate-html/jquery-truncate-html-tests.ts +++ b/jquery-truncate-html/jquery-truncate-html-tests.ts @@ -1,5 +1,14 @@ /// -jQuery('

Stuff and Nonsense

').truncate({ - length: 13 -}).html(); + +function truncateHtmlString(): string { + return $.truncate('

Stuff and Nonsense

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

Stuff and Nonsense

').truncate({ + length: 13 + }); +} diff --git a/jquery-truncate-html/jquery-truncate-html.d.ts b/jquery-truncate-html/jquery-truncate-html.d.ts index d7f4abaa3b..3a22eaffdb 100644 --- a/jquery-truncate-html/jquery-truncate-html.d.ts +++ b/jquery-truncate-html/jquery-truncate-html.d.ts @@ -13,8 +13,8 @@ interface ITruncateOptions{ ellipsis?: string; } -interface jQuery{ - truncate(options: ITruncateOptions) : jQuery; +interface JQuery{ + truncate(options: ITruncateOptions) : JQuery; } interface JQueryStatic { From 41d21c491c0bb1eff11d98265e30a290d4410ce2 Mon Sep 17 00:00:00 2001 From: rgvassar Date: Wed, 2 Mar 2016 10:25:09 -0800 Subject: [PATCH 060/415] angular-animate Added the on, off, and pin methods to the IAnimateService interface. --- angularjs/angular-animate.d.ts | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/angularjs/angular-animate.d.ts b/angularjs/angular-animate.d.ts index be83611e07..c29fd1857e 100644 --- a/angularjs/angular-animate.d.ts +++ b/angularjs/angular-animate.d.ts @@ -27,6 +27,42 @@ declare module angular.animate { * see http://docs.angularjs.org/api/ngAnimate/service/$animate */ interface IAnimateService { + /** + * Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...) has fired + * on the given element or among any of its children. Once the listener is fired, the provided callback + * is fired with the following params: + * + * @event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...) + * @container the container element that will capture each of the animation events that are fired on itself as well as among its children + * @callback the callback function that will be fired when the listener is triggered + * The arguments present in the callback function are: + * element - The captured DOM element that the animation was fired on. + * phase - The phase of the animation. The two possible phases are start (when the animation starts) and close (when it ends). + */ + on(event: string, container: JQuery, callback: (element?: JQuery, phase?: string) => any): void; + + /** + * Deregisters an event listener based on the event which has been associated with the provided element. + * This method can be used in three different ways depending on the arguments. + * + * @event the animation event (e.g. enter, leave, move, addClass, removeClass, etc...) + * @container the container element the event listener was placed on. + * @callback the callback function that was registered as the listener + */ + off(event: string, container?: JQuery, callback?: (element?: JQuery, phase?: string) => any): void; + + /** + * Associates the provided element with a host parent element to allow the element to be animated even if + * it exists outside of the DOM structure of the Angular application. By doing so, any animation triggered + * via $animate can be issued on the element despite being outside the realm of the application or within + * another application. Say for example if the application was bootstrapped on an element that is somewhere + * inside of the tag, but we wanted to allow for an element to be situated as a direct child of document.body, + * then this can be achieved by pinning the element via $animate.pin(element). Keep in mind that calling + * $animate.pin(element, parentElement) will not actually insert into the DOM anywhere; it will just create the association. + * Note that this feature is only active when the ngAnimate module is used. + */ + pin(element: JQuery, parentElement: JQuery): void; + /** * Globally enables / disables animations. * From 90ecfb5cab21366189c700d34c76f6fe13a1bd3f Mon Sep 17 00:00:00 2001 From: artem Date: Fri, 4 Mar 2016 12:10:52 +0200 Subject: [PATCH 061/415] Update restangular.d.ts --- restangular/restangular.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index db17e51cf8..68e1144dc0 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -93,6 +93,7 @@ declare module restangular { service(route: string, parent?: any): IService; stripRestangular(element: any): any; extendModel(route: string, extender: (model: IElement) => any): void; + extendCollection(route: string, extender: (collection: ICollection) => any): void; } interface IElement extends IService { From 4064f5b0d8945fc38b3568b5bb6a3b24d9e410fc Mon Sep 17 00:00:00 2001 From: AbraaoAlves Date: Sat, 5 Mar 2016 11:26:59 -0300 Subject: [PATCH 062/415] Remove "I" prefix --- jquery-truncate-html/jquery-truncate-html.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery-truncate-html/jquery-truncate-html.d.ts b/jquery-truncate-html/jquery-truncate-html.d.ts index 3a22eaffdb..e410716b0a 100644 --- a/jquery-truncate-html/jquery-truncate-html.d.ts +++ b/jquery-truncate-html/jquery-truncate-html.d.ts @@ -5,7 +5,7 @@ /// -interface ITruncateOptions{ +interface TruncateOptions{ length?: number; stripTags?: boolean; words?: boolean; @@ -14,9 +14,9 @@ interface ITruncateOptions{ } interface JQuery{ - truncate(options: ITruncateOptions) : JQuery; + truncate(options: TruncateOptions) : JQuery; } interface JQueryStatic { - truncate(html: string, options: ITruncateOptions) : string; + truncate(html: string, options: TruncateOptions) : string; } From b906a40b8e52d904daeb69d145de75e0084d5896 Mon Sep 17 00:00:00 2001 From: wagich Date: Sat, 5 Mar 2016 17:25:14 +0100 Subject: [PATCH 063/415] corrects naming of `setGallerySize` member in FlickityOptions --- flickity/flickity.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flickity/flickity.d.ts b/flickity/flickity.d.ts index bf4541e5ff..febb09b525 100644 --- a/flickity/flickity.d.ts +++ b/flickity/flickity.d.ts @@ -269,7 +269,7 @@ interface FlickityOptions { * * default: true */ - useSetGallerySize?: boolean; + setGallerySize?: boolean; /** * Adjusts sizes and positions when window is resized. From ec13362958058efcaff223167f987f16a809e668 Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Sat, 5 Mar 2016 17:56:49 +0100 Subject: [PATCH 064/415] Fix references path --- connect-redis/connect-redis.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/connect-redis/connect-redis.d.ts b/connect-redis/connect-redis.d.ts index 4ba0490fe1..21af697f38 100644 --- a/connect-redis/connect-redis.d.ts +++ b/connect-redis/connect-redis.d.ts @@ -4,9 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "connect-redis" { - import * as express from "express"; - import * as session from "express-session"; - import * as redis from "redis"; + /// + /// + /// function s(options: (options?: session.SessionOptions) => express.RequestHandler): s.RedisStore; From 252bd4bb4e881da01b0324cc40f7277098c6aead Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Sat, 5 Mar 2016 17:58:29 +0100 Subject: [PATCH 065/415] Fix path --- connect-redis/connect-redis.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/connect-redis/connect-redis.d.ts b/connect-redis/connect-redis.d.ts index 21af697f38..078b99073c 100644 --- a/connect-redis/connect-redis.d.ts +++ b/connect-redis/connect-redis.d.ts @@ -4,9 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "connect-redis" { - /// - /// - /// + /// + /// + /// function s(options: (options?: session.SessionOptions) => express.RequestHandler): s.RedisStore; From 6513e0853e3522c0e06d346e048d815cb0331809 Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Sat, 5 Mar 2016 18:01:14 +0100 Subject: [PATCH 066/415] References & imports --- connect-redis/connect-redis.d.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/connect-redis/connect-redis.d.ts b/connect-redis/connect-redis.d.ts index 078b99073c..b3a1529569 100644 --- a/connect-redis/connect-redis.d.ts +++ b/connect-redis/connect-redis.d.ts @@ -3,10 +3,15 @@ // Definitions by: Xavier Stouder // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +/// +/// + declare module "connect-redis" { - /// - /// - /// + import * as express from "express"; + import * as session from "express-session"; + import * as redis from "redis"; + function s(options: (options?: session.SessionOptions) => express.RequestHandler): s.RedisStore; From e88d574f91aef319947931009d40477dc501a36e Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Sat, 5 Mar 2016 18:03:42 +0100 Subject: [PATCH 067/415] Fix tests references --- connect-redis/connect-redis-tests.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/connect-redis/connect-redis-tests.ts b/connect-redis/connect-redis-tests.ts index 3c50074117..fa61b7304c 100644 --- a/connect-redis/connect-redis-tests.ts +++ b/connect-redis/connect-redis-tests.ts @@ -1,3 +1,6 @@ +/// +/// + import * as connectRedis from "connect-redis"; import * as session from "express-session"; From 91d48d1b2823289abec4aabd30dbc6d9899da206 Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Sat, 5 Mar 2016 18:05:51 +0100 Subject: [PATCH 068/415] Fix name --- connect-redis/connect-redis-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connect-redis/connect-redis-tests.ts b/connect-redis/connect-redis-tests.ts index fa61b7304c..2ad4d53bd5 100644 --- a/connect-redis/connect-redis-tests.ts +++ b/connect-redis/connect-redis-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// import * as connectRedis from "connect-redis"; From 01c976de75d8564675ed4eba811be31cbf6d82ad Mon Sep 17 00:00:00 2001 From: Strato Date: Thu, 10 Mar 2016 11:56:31 +0100 Subject: [PATCH 069/415] Added some missing properties 'getSignalBars()' seems to always return null anyway... Whole Windows.Data.Pdf namespace is still missing. Lots of class of Windows.ApplicationModel.Contacts are missing as well. --- winrt/winrt.d.ts | 166 +++++++++++++++++++++++++---------------------- 1 file changed, 90 insertions(+), 76 deletions(-) diff --git a/winrt/winrt.d.ts b/winrt/winrt.d.ts index 687d7f83d4..5ce721b082 100644 --- a/winrt/winrt.d.ts +++ b/winrt/winrt.d.ts @@ -8201,6 +8201,7 @@ declare module Windows { getDataPlanStatus(): Windows.Networking.Connectivity.DataPlanStatus; getLocalUsage(StartTime: Date, EndTime: Date): Windows.Networking.Connectivity.DataUsage; getLocalUsage(StartTime: Date, EndTime: Date, States: Windows.Networking.Connectivity.RoamingStates): Windows.Networking.Connectivity.DataUsage; + getSignalBars(): Windows.Foundation.IReference; } export class ConnectionCost implements Windows.Networking.Connectivity.IConnectionCost { approachingDataLimit: boolean; @@ -8267,6 +8268,7 @@ declare module Windows { getDataPlanStatus(): Windows.Networking.Connectivity.DataPlanStatus; getLocalUsage(StartTime: Date, EndTime: Date): Windows.Networking.Connectivity.DataUsage; getLocalUsage(StartTime: Date, EndTime: Date, States: Windows.Networking.Connectivity.RoamingStates): Windows.Networking.Connectivity.DataUsage; + getSignalBars(): Windows.Foundation.IReference; } export class LanIdentifier implements Windows.Networking.Connectivity.ILanIdentifier { infrastructureId: Windows.Networking.Connectivity.LanIdentifierData; @@ -11340,15 +11342,18 @@ declare module Windows { } export interface ILauncherOptions { contentType: string; + desiredRemainingView: Windows.UI.ViewManagement.ViewSizePreference; displayApplicationPicker: boolean; fallbackUri: Windows.Foundation.Uri; preferredApplicationDisplayName: string; preferredApplicationPackageFamilyName: string; treatAsUntrusted: boolean; - uI: Windows.System.LauncherUIOptions; + UI: Windows.System.LauncherUIOptions; + } export class LauncherOptions implements Windows.System.ILauncherOptions { contentType: string; + desiredRemainingView: Windows.UI.ViewManagement.ViewSizePreference; displayApplicationPicker: boolean; fallbackUri: Windows.Foundation.Uri; preferredApplicationDisplayName: string; @@ -11590,87 +11595,96 @@ declare module Windows { } declare module Windows { export module UI { - export module ViewManagement { - export enum ApplicationViewState { - fullScreenLandscape, - filled, - snapped, - fullScreenPortrait, - } + export module ViewManagement { + export enum ViewSizePreference { + default = 0, + useLess = 1, + useHalf = 2, + useMore = 3, + useMinimum = 4, + useNone = 5 + } + + export enum ApplicationViewState { + fullScreenLandscape, + filled, + snapped, + fullScreenPortrait, + } + + /** + * Defines an instance of a window (app view) and the information that describes it. + **/ + export class ApplicationView { + /** + * Gets the window (app view) for the current app. + **/ + static getForCurrentView(): ApplicationView; /** - * Defines an instance of a window (app view) and the information that describes it. + * Attempts to unsnap a previously snapped app. This call will only succeed when the app is running in the foreground. **/ - export class ApplicationView { - /** - * Gets the window (app view) for the current app. - **/ - static getForCurrentView(): ApplicationView; - - /** - * Attempts to unsnap a previously snapped app. This call will only succeed when the app is running in the foreground. - **/ - static tryUnsnap(): boolean; - - /** - * Gets the state of the current app view. - **/ - static value: Windows.UI.ViewManagement.ApplicationViewState; - - /** - * Indicates whether the app terminates when the last window is closed. - **/ - static terminateAppOnFinalViewClose: boolean; - - /** - * Gets the current orientation of the window (app view) with respect to the display. - **/ - orientation: ApplicationViewOrientation; - - /** - * Gets or sets the displayed title of the window. - **/ - title: string; - - /** - * Gets or sets whether screen capture is enabled for the window (app view). - **/ - isScreenCaptureEnabled: boolean; - - /** - * Gets whether the window (app view) is on the Windows lock screen. - **/ - isOnLockScreen: boolean; - - /** - * Gets whether the window(app view) is full screen or not. - **/ - isFullScreen: boolean; - - /** - * Gets the current ID of the window (app view) . - **/ - id: number; - - /** - * Gets whether the current window (app view) is adjacent to the right edge of the screen. - **/ - adjacentToRightDisplayEdge: boolean; - - /** - * Gets whether the current window (app view) is adjacent to the left edge of the screen. - **/ - adjacentToLeftDisplayEdge: number; - - /** - * Gets the title bar of the app. - **/ - titleBar: ApplicationViewTitleBar; - } + static tryUnsnap(): boolean; /** - * Defines the set of display orientation modes for a window (app view). + * Gets the state of the current app view. **/ + static value: Windows.UI.ViewManagement.ApplicationViewState; + + /** + * Indicates whether the app terminates when the last window is closed. + **/ + static terminateAppOnFinalViewClose: boolean; + + /** + * Gets the current orientation of the window (app view) with respect to the display. + **/ + orientation: ApplicationViewOrientation; + + /** + * Gets or sets the displayed title of the window. + **/ + title: string; + + /** + * Gets or sets whether screen capture is enabled for the window (app view). + **/ + isScreenCaptureEnabled: boolean; + + /** + * Gets whether the window (app view) is on the Windows lock screen. + **/ + isOnLockScreen: boolean; + + /** + * Gets whether the window(app view) is full screen or not. + **/ + isFullScreen: boolean; + + /** + * Gets the current ID of the window (app view) . + **/ + id: number; + + /** + * Gets whether the current window (app view) is adjacent to the right edge of the screen. + **/ + adjacentToRightDisplayEdge: boolean; + + /** + * Gets whether the current window (app view) is adjacent to the left edge of the screen. + **/ + adjacentToLeftDisplayEdge: number; + + /** + * Gets the title bar of the app. + **/ + titleBar: ApplicationViewTitleBar; + } + + /** + * Defines the set of display orientation modes for a window (app view). + **/ export enum ApplicationViewOrientation { landscape, portrait From 7f6c9bdbce542f3531022bb16a5753ef9331e58f Mon Sep 17 00:00:00 2001 From: Riron Date: Thu, 10 Mar 2016 16:54:23 +0100 Subject: [PATCH 070/415] Add createInstance() method Adds the missing createInstance() method: You can create multiple instances of localForage that point to different stores using createInstance. All the configuration options used by config are supported. ``` var store = localforage.createInstance({ name: "nameHere" }); var otherStore = localforage.createInstance({ name: "otherName" }); // Setting the key on one of these doesn't affect the other. store.setItem("key", "value"); otherStore.setItem("key", "value2"); ``` --- localForage/localForage.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/localForage/localForage.d.ts b/localForage/localForage.d.ts index d42012e5f2..be1803b308 100644 --- a/localForage/localForage.d.ts +++ b/localForage/localForage.d.ts @@ -86,6 +86,13 @@ interface LocalForage { iterate(iteratee: (value: any, key: string, iterationNumber: number) => any): Promise; iterate(iteratee: (value: any, key: string, iterationNumber: number) => any, callback: (err: any, result: any) => void): void; + + /** + * Create a new instance of localForage to point to a different store. + * All the configuration options used by config are supported. + * @param {LocalForageOptions} options + */ + createInstance(options: LocalForageOptions): LocalForage; } declare module "localforage" { From c2a803dacae48642c117fe358d8c1d929f4d1a0f Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Thu, 10 Mar 2016 17:19:16 +0100 Subject: [PATCH 071/415] Update connect-redis-tests.ts --- connect-redis/connect-redis-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connect-redis/connect-redis-tests.ts b/connect-redis/connect-redis-tests.ts index 2ad4d53bd5..abc14977ee 100644 --- a/connect-redis/connect-redis-tests.ts +++ b/connect-redis/connect-redis-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// import * as connectRedis from "connect-redis"; From 5597d81a2dfa7a555e8af3d5bfd57357e902b916 Mon Sep 17 00:00:00 2001 From: RVassar Date: Sat, 12 Mar 2016 20:21:20 -0800 Subject: [PATCH 072/415] Not sure what the changes are here. Different line endings or something. --- angular-load/angular-load.d.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/angular-load/angular-load.d.ts b/angular-load/angular-load.d.ts index a35d1c59d8..65d5bc388a 100644 --- a/angular-load/angular-load.d.ts +++ b/angular-load/angular-load.d.ts @@ -1,15 +1,15 @@ -// Type definitions for angular-load v0.4.1 -// Project: https://github.com/urish/angular-load -// Definitions by: david-gang -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module angular.load { - - interface IAngularLoadService { - loadScript(url:string): ng.IPromise; - loadCss(url:string): ng.IPromise; - } - -} +// Type definitions for angular-load v0.4.1 +// Project: https://github.com/urish/angular-load +// Definitions by: david-gang +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular.load { + + interface IAngularLoadService { + loadScript(url:string): ng.IPromise; + loadCss(url:string): ng.IPromise; + } + +} From 74f4692670283fd9a547469557079da38bb10084 Mon Sep 17 00:00:00 2001 From: Strato Date: Mon, 14 Mar 2016 00:27:55 +0100 Subject: [PATCH 073/415] Fixed what seems to be the problem with travis --- winrt/winrt.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winrt/winrt.d.ts b/winrt/winrt.d.ts index 5ce721b082..3d25a6469f 100644 --- a/winrt/winrt.d.ts +++ b/winrt/winrt.d.ts @@ -11348,7 +11348,7 @@ declare module Windows { preferredApplicationDisplayName: string; preferredApplicationPackageFamilyName: string; treatAsUntrusted: boolean; - UI: Windows.System.LauncherUIOptions; + uI: Windows.System.LauncherUIOptions; } export class LauncherOptions implements Windows.System.ILauncherOptions { From ff98d72f5ad685208b16dfa79cd063319fc1397e Mon Sep 17 00:00:00 2001 From: gael Magnan Date: Wed, 16 Mar 2016 13:58:12 +0100 Subject: [PATCH 074/415] Added new version of jwt-simple, now supports v 0.5.0 --- jwt-simple/jwt-simple-0.2.0-tests.ts | 12 ++++++++++++ jwt-simple/jwt-simple-0.2.0.d.ts | 22 ++++++++++++++++++++++ jwt-simple/jwt-simple.d.ts | 10 ++++++---- 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 jwt-simple/jwt-simple-0.2.0-tests.ts create mode 100644 jwt-simple/jwt-simple-0.2.0.d.ts diff --git a/jwt-simple/jwt-simple-0.2.0-tests.ts b/jwt-simple/jwt-simple-0.2.0-tests.ts new file mode 100644 index 0000000000..8a0cc59c52 --- /dev/null +++ b/jwt-simple/jwt-simple-0.2.0-tests.ts @@ -0,0 +1,12 @@ +/// + +import jwt = require('jwt-simple'); +var payload = { foo: 'bar' }; +var secret:string = 'xxx'; + +// encode +var token = jwt.encode(payload, secret); + +// decode +var decoded = jwt.decode(token, secret); +console.log(decoded); //=> { foo: 'bar' } \ No newline at end of file diff --git a/jwt-simple/jwt-simple-0.2.0.d.ts b/jwt-simple/jwt-simple-0.2.0.d.ts new file mode 100644 index 0000000000..0ee3cc6799 --- /dev/null +++ b/jwt-simple/jwt-simple-0.2.0.d.ts @@ -0,0 +1,22 @@ +// Type definitions for jwt-simple v0.2.0 +// Project: https://github.com/hokaccha/node-jwt-simple +// Definitions by: Ken Fukuyama +// Definitions: https://github.com/borisyankov/DefinitelyTyped +declare module "jwt-simple" { + /** + * Decode jwt + * @param token + * @param key + * @param noVerify + * @api public + */ + export function decode(token:any, key:string, noVerify?:boolean):any; + /** + * Encode jwt + * @param payload + * @param key + * @param algorithm default is HS256 + * @api public + */ + export function encode(payload:any, key:string, algorithm?:string):string; +} diff --git a/jwt-simple/jwt-simple.d.ts b/jwt-simple/jwt-simple.d.ts index 0ee3cc6799..4640f25e33 100644 --- a/jwt-simple/jwt-simple.d.ts +++ b/jwt-simple/jwt-simple.d.ts @@ -1,6 +1,6 @@ -// Type definitions for jwt-simple v0.2.0 +// Type definitions for jwt-simple v0.5.0 // Project: https://github.com/hokaccha/node-jwt-simple -// Definitions by: Ken Fukuyama +// Definitions by: Gael Magnan // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module "jwt-simple" { /** @@ -8,15 +8,17 @@ declare module "jwt-simple" { * @param token * @param key * @param noVerify + * @param algorithm default is HS256 * @api public */ - export function decode(token:any, key:string, noVerify?:boolean):any; + export function decode(token:any, key:string, noVerify?:boolean, algorithm?:string):any; /** * Encode jwt * @param payload * @param key * @param algorithm default is HS256 + * @param options * @api public */ - export function encode(payload:any, key:string, algorithm?:string):string; + export function encode(payload:any, key:string, algorithm?:string, options?:any):string; } From 8afd4a79f7a0c233817d479141c310ed0d8a7540 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 16 Mar 2016 12:56:54 -0700 Subject: [PATCH 075/415] Updated Fuse.js definition to 2.2.0 (partially) --- fuse/fuse.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fuse/fuse.d.ts b/fuse/fuse.d.ts index bf175bff6c..e180c652e0 100644 --- a/fuse/fuse.d.ts +++ b/fuse/fuse.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Fuse.js 1.1.5 +// Type definitions for Fuse.js 2.2.0 // Project: https://github.com/krisk/Fuse // Definitions by: Greg Smith // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -11,12 +11,13 @@ declare class Fuse { declare module fuse { interface IFuseOptions extends ISearchOptions { caseSensitive?: boolean; - includeScore?: boolean; + include?: string[]; shouldSort?: boolean; searchFn?: any; sortFn?: (a: {score: number}, b: {score: number}) => number; getFn?: (obj: any, path: string) => any; - keys?: string[]; + keys?: string[] | { name:string; weight:number} []; + verbose?:boolean; } interface ISearchOptions { From 96ea748284dd67f821642362216c6d336d173207 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Fri, 18 Mar 2016 12:56:29 +0100 Subject: [PATCH 076/415] HammerJS: Creating an instance of Hammer returns an object, which is not a function. So calling "new" on it doesn't make sense. --- hammerjs/hammerjs.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/hammerjs/hammerjs.d.ts b/hammerjs/hammerjs.d.ts index e2d4a8c528..4125987d64 100644 --- a/hammerjs/hammerjs.d.ts +++ b/hammerjs/hammerjs.d.ts @@ -97,8 +97,6 @@ interface HammerOptions extends HammerDefaults interface HammerManager { - new( element:HTMLElement, options?:any ):HammerManager; - add( recogniser:Recognizer ):Recognizer; add( recogniser:Recognizer ):HammerManager; add( recogniser:Recognizer[] ):Recognizer; From 60ddc18a594f87b9c8d36860c3ff239836211ed6 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Fri, 18 Mar 2016 14:01:19 +0100 Subject: [PATCH 077/415] HammerJS: Added the HammerManagerConstructor interface, and used it where it should. --- hammerjs/hammerjs.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hammerjs/hammerjs.d.ts b/hammerjs/hammerjs.d.ts index 4125987d64..d4ea189dd8 100644 --- a/hammerjs/hammerjs.d.ts +++ b/hammerjs/hammerjs.d.ts @@ -39,7 +39,7 @@ interface HammerStatic DIRECTION_VERTICAL: number; DIRECTION_ALL: number; - Manager: HammerManager; + Manager: HammerManagerConstructor; Input: HammerInput; TouchAction: TouchAction; @@ -95,6 +95,10 @@ interface HammerOptions extends HammerDefaults } +interface HammerManagerConstructor { + new( element:HTMLElement, options?:any ):HammerManager; +} + interface HammerManager { add( recogniser:Recognizer ):Recognizer; From 03f28267c52a54f285d3d2a0ee8d7d6e6cb57e1a Mon Sep 17 00:00:00 2001 From: James Moey Date: Tue, 22 Mar 2016 13:58:57 +1100 Subject: [PATCH 078/415] Update rabbit.js definition. --- rabbit.js/rabbit.js.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rabbit.js/rabbit.js.d.ts b/rabbit.js/rabbit.js.d.ts index 7e09cfe14a..a6ac4e5c7f 100644 --- a/rabbit.js/rabbit.js.d.ts +++ b/rabbit.js/rabbit.js.d.ts @@ -22,6 +22,7 @@ declare module "rabbit.js" { persistent?: any; topic?: any; task?: any; + routing?: any; } export interface Socket { @@ -43,6 +44,7 @@ declare module "rabbit.js" { export class SubSocket extends stream.Readable implements Socket { constructor(channel: string, opts: SocketOptions); connect(source: string, callback?: Function): any; + connect(source: string, topic?: string, callback?: Function): any; setsockopt(opt: string, value: string): any; close(): any; } From dd12757cc7b16ff579f43ba3cb0e8858977d771f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20P=C3=A9rez?= Date: Tue, 22 Mar 2016 19:21:22 +0100 Subject: [PATCH 079/415] missing elementValue(Element) method, meant to return the value in which to apply the constraints out of the Element --- jquery.validation/jquery.validation.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jquery.validation/jquery.validation.d.ts b/jquery.validation/jquery.validation.d.ts index 7527652e80..1225db783d 100644 --- a/jquery.validation/jquery.validation.d.ts +++ b/jquery.validation/jquery.validation.d.ts @@ -213,6 +213,8 @@ declare namespace JQueryValidation * Validates the form, returns true if it is valid, false otherwise. */ form(): boolean; + + elementValue(element: Element): any; invalidElements(): HTMLElement[]; From d59d5bdea31295ff74ce32929da80246a5749580 Mon Sep 17 00:00:00 2001 From: Lou Godmer Date: Wed, 23 Mar 2016 14:23:07 -0700 Subject: [PATCH 080/415] update trackRequestSync api that is added in applicationinsights version 0.15.13 --- applicationinsights/applicationinsights.d.ts | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/applicationinsights/applicationinsights.d.ts b/applicationinsights/applicationinsights.d.ts index 17ca4a479f..96d5773fa5 100644 --- a/applicationinsights/applicationinsights.d.ts +++ b/applicationinsights/applicationinsights.d.ts @@ -341,9 +341,31 @@ interface Client { trackMetric(name: string, value: number, count?:number, min?: number, max?: number, stdDev?: number, properties?: { [key: string]: string; }): void; + + /** + * Log an incoming http request to your server. The request data will be tracked during the response "finish" event if it is successful or the request "error" + * event if it fails. The request duration is automatically calculated as the timespan between when the trackRequest method was called, and when the response "finish" + * or request "error" events were fired. + * @param request The http.ServerRequest object to track + * @param response The http.ServerResponse object for this request + * @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty. + */ trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: { [key: string]: string; }): void; + + /** + * Log an incoming http request to your server. The request data is tracked synchronously rather than waiting for the response "finish"" or request "error"" events. + * Use this if you need your request telemetry to respect custom app insights operation and user context (for example if you set any appInsights.client.context.tags). + * @param request The http.ServerRequest object to track + * @param response The http.ServerResponse object for this request + * @param ellapsedMilliseconds The duration for this request. Defaults to 0. + * @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty. + * @param error An error that was returned for this request if it was unsuccessful. Defaults to null. + */ + trackRequestSync(request: any /*http.ServerRequest */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: { + [key: string]: string;}, error?: any) : void; + /** * Log information about a dependency of your app. Typically used to track the time database calls or outgoing http requests take from your server. * @param name The name of the dependency (i.e. "myDatabse") From c9ad975e6cc4d5ff7911eafde95365097cc12e55 Mon Sep 17 00:00:00 2001 From: aaronbeall Date: Thu, 24 Mar 2016 11:13:39 -0400 Subject: [PATCH 081/415] BaseEvent extend DOM Event to support addEventListener --- sockjs-client/sockjs-client.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sockjs-client/sockjs-client.d.ts b/sockjs-client/sockjs-client.d.ts index 322f821393..0bc7bed08a 100644 --- a/sockjs-client/sockjs-client.d.ts +++ b/sockjs-client/sockjs-client.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare namespace __SockJSClient { - interface BaseEvent { + interface BaseEvent extends Event { type: string; } From 3a4bdab25ba029be91c671276e1661512cb37b65 Mon Sep 17 00:00:00 2001 From: Eugen Podaru Date: Fri, 25 Mar 2016 13:45:32 +0100 Subject: [PATCH 082/415] support AMD require / ES6 import --- text-encoding/text-encoding.d.ts | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/text-encoding/text-encoding.d.ts b/text-encoding/text-encoding.d.ts index 1442ef2a30..08536c5981 100644 --- a/text-encoding/text-encoding.d.ts +++ b/text-encoding/text-encoding.d.ts @@ -32,14 +32,29 @@ declare namespace TextEncoding { interface TextEncodeOptions { stream?: boolean; } + + interface TextEncoderStatic { + (utfLabel?: string, options?: TextEncoderOptions): TextEncoder; + new (utfLabel?: string, options?: TextEncoderOptions): TextEncoder; + } + + interface TextDecoderStatic { + (label?: string, options?: TextDecoderOptions): TextDecoder; + new (label?: string, options?: TextDecoderOptions): TextDecoder; + } + + interface TextEncodingStatic { + TextEncoder: TextEncoderStatic; + TextDecoder: TextDecoderStatic; + } } -declare var TextDecoder: { - (label?: string, options?: TextEncoding.TextDecoderOptions): TextEncoding.TextDecoder; - new (label?: string, options?: TextEncoding.TextDecoderOptions): TextEncoding.TextDecoder; -}; +declare var TextDecoder: TextEncoding.TextDecoderStatic; -declare var TextEncoder: { - (utfLabel?: string, options?: TextEncoding.TextEncoderOptions): TextEncoding.TextEncoder; - new (utfLabel?: string, options?: TextEncoding.TextEncoderOptions): TextEncoding.TextEncoder; -}; +declare var TextEncoder: TextEncoding.TextEncoderStatic; + +declare var TextEncoding: TextEncoding.TextEncodingStatic; + +declare module "text-encoding" { + export = TextEncoding; +} From 81f194ff4468b34b2795e89fcf2a4fe9ad570e0a Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Wed, 30 Mar 2016 18:04:01 +1100 Subject: [PATCH 083/415] Update comments to suite revalidator versions. --- revalidator/revalidator.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/revalidator/revalidator.d.ts b/revalidator/revalidator.d.ts index aaf38ba78f..b41e7cd03e 100644 --- a/revalidator/revalidator.d.ts +++ b/revalidator/revalidator.d.ts @@ -1,7 +1,7 @@ -// Type definitions for axios 0.5.2 +// Type definitions for revalidator 0.3.1 // Definitions by: Jason Turner -// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module Revalidator { interface RevalidatorStatic { From eee669cc9cca1e1fc0f51c70bc17926610fc551e Mon Sep 17 00:00:00 2001 From: delphinus Date: Thu, 31 Mar 2016 00:25:48 +0900 Subject: [PATCH 084/415] Correct return values --- stacktrace-js/stacktrace-js.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stacktrace-js/stacktrace-js.d.ts b/stacktrace-js/stacktrace-js.d.ts index aebd6ddf80..045cf70104 100644 --- a/stacktrace-js/stacktrace-js.d.ts +++ b/stacktrace-js/stacktrace-js.d.ts @@ -49,18 +49,20 @@ declare namespace StackTrace { * * @param {Function} fn to be instrumented * @param {Function} callback function to call with a stack trace on invocation - * @param {Function} errorCallback optional function to call with error if unable to get stack trace. + * @param {Function} errback optional function to call with error if unable to get stack trace. * @param {Object} thisArg optional context object (e.g. window) + * @return {Function} instrumented function */ - export function instrument(fn:() => void, callback:(stackFrames:StackFrame[]) => void, errorCallback:(error:Error) => void, thisArg?:any): void; + export function instrument(fn: TFunc, callback: (stackFrames:StackFrame[]) => void, errback?: (error: Error) => void, thisArg?: any): TFunc; /** * Given a function that has been instrumented, * revert the function to it's original (non-instrumented) state. * * @param fn {Function} + * @return {Function} original function */ - export function deinstrument(fn:() => void): void; + export function deinstrument(fn: TFunc): TFunc; /** * Given an Array of StackFrames, serialize and POST to given URL. From ee10fc38b1acd26ec5f9f484ab11fe2eac1ebc61 Mon Sep 17 00:00:00 2001 From: delphinus Date: Thu, 31 Mar 2016 00:28:23 +0900 Subject: [PATCH 085/415] Correct return values --- stacktrace-js/stacktrace-js.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stacktrace-js/stacktrace-js.d.ts b/stacktrace-js/stacktrace-js.d.ts index 045cf70104..1bb55aa5a7 100644 --- a/stacktrace-js/stacktrace-js.d.ts +++ b/stacktrace-js/stacktrace-js.d.ts @@ -69,7 +69,7 @@ declare namespace StackTrace { * * @param stackframes - Array[StackFrame] * @param url - URL as String - * @return Promise + * @return Promise */ - export function report(stackframes: StackFrame[], url: string): Promise; + export function report(stackframes: StackFrame[], url: string): Promise; } From 371b6dfbf352740dd931d4b5ff95a24886074db5 Mon Sep 17 00:00:00 2001 From: delphinus Date: Thu, 31 Mar 2016 00:28:44 +0900 Subject: [PATCH 086/415] Define stacktrace-js module --- stacktrace-js/stacktrace-js.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stacktrace-js/stacktrace-js.d.ts b/stacktrace-js/stacktrace-js.d.ts index 1bb55aa5a7..c4ed865400 100644 --- a/stacktrace-js/stacktrace-js.d.ts +++ b/stacktrace-js/stacktrace-js.d.ts @@ -73,3 +73,7 @@ declare namespace StackTrace { */ export function report(stackframes: StackFrame[], url: string): Promise; } + +declare module "stacktrace-js" { + export = StackTrace; +} From e42a58381c705d7670176dbc0fac7728c5b3a681 Mon Sep 17 00:00:00 2001 From: delphinus Date: Thu, 31 Mar 2016 00:31:00 +0900 Subject: [PATCH 087/415] Correct definition for options --- stacktrace-js/stacktrace-js.d.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/stacktrace-js/stacktrace-js.d.ts b/stacktrace-js/stacktrace-js.d.ts index c4ed865400..7bf7570fec 100644 --- a/stacktrace-js/stacktrace-js.d.ts +++ b/stacktrace-js/stacktrace-js.d.ts @@ -4,10 +4,21 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace StackTrace { + + export interface SourceCache { + [key: string]: string | Promise; + } + + /** + * Options for StackTrace + * @param filter Function(StackFrame => Boolean) - Only include stack entries matching for which filter returns true + * @param sourceCache Object (String URL => String Source) - Pre-populate source cache to avoid network requests + * @param offline Boolean (default: false) - Set to true to prevent all network requests + */ export interface StackTraceOptions { - filter?: (stackFrame:StackFrame) => boolean; - sourceCache?: { URL:string }; - offline?: boolean; + filter?: (stackFrame: StackFrame) => boolean; + sourceCache?: SourceCache; + offline?: boolean; } export interface StackFrame { From 48f9ebd33917a18720ce81cc2a90938b313e5f8f Mon Sep 17 00:00:00 2001 From: delphinus Date: Thu, 31 Mar 2016 00:31:23 +0900 Subject: [PATCH 088/415] Add methods for StackFrame --- stacktrace-js/stacktrace-js.d.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/stacktrace-js/stacktrace-js.d.ts b/stacktrace-js/stacktrace-js.d.ts index 7bf7570fec..a682189c09 100644 --- a/stacktrace-js/stacktrace-js.d.ts +++ b/stacktrace-js/stacktrace-js.d.ts @@ -22,14 +22,17 @@ declare namespace StackTrace { } export interface StackFrame { - constructor(functionName:string, args:any, fileName:string, lineNumber:number, columnNumber:number): StackFrame; + constructor(functionName: string, args: any, fileName: string, lineNumber: number, columnNumber: number): StackFrame; - functionName?:string; - args?:any; - fileName?:string; - lineNumber?:number; - columnNumber?:number; - toString():string; + functionName: string; + args: any; + fileName: string; + lineNumber: number; + columnNumber: number; + source: string; + isEval: boolean; + isNative: boolean; + toString(): string; } /** From 6d023860d1253397311d708bce3df48d11b4ab2f Mon Sep 17 00:00:00 2001 From: delphinus Date: Thu, 31 Mar 2016 00:31:36 +0900 Subject: [PATCH 089/415] Fix typo --- stacktrace-js/stacktrace-js.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stacktrace-js/stacktrace-js.d.ts b/stacktrace-js/stacktrace-js.d.ts index a682189c09..bc9571eb5a 100644 --- a/stacktrace-js/stacktrace-js.d.ts +++ b/stacktrace-js/stacktrace-js.d.ts @@ -48,7 +48,7 @@ declare namespace StackTrace { * @param options Object for options * @return Array[StackFrame] */ - export function fromError(error:Error, options?:StackTraceOptions): Promise; + export function fromError(error: Error, options?: StackTraceOptions): Promise; /** * Use StackGenerator to generate a backtrace. From b4542d0d5fc8bd5e8595084cacb08c651b7e8d9a Mon Sep 17 00:00:00 2001 From: delphinus Date: Thu, 31 Mar 2016 00:32:18 +0900 Subject: [PATCH 090/415] Add further tests --- stacktrace-js/stacktrace-js-tests.ts | 36 ++++++++++++++++++---------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/stacktrace-js/stacktrace-js-tests.ts b/stacktrace-js/stacktrace-js-tests.ts index c4c9bcf879..04f92f7d2d 100644 --- a/stacktrace-js/stacktrace-js-tests.ts +++ b/stacktrace-js/stacktrace-js-tests.ts @@ -1,24 +1,36 @@ /// -function interestingFn() { +function interestingFn(): string { return 'https://github.com/exceptionless/Exceptionless'; } -var callback = function(stackframes:StackTrace.StackFrame[]) { - var stringifiedStack = stackframes.map(function(sf:StackTrace.StackFrame) { +const callback = (stackframes: StackTrace.StackFrame[]) => { + const stringifiedStack = stackframes.map((sf: StackTrace.StackFrame): string => { + console.log(sf.functionName); + console.log(sf.args); + console.log(sf.fileName); + console.log(sf.lineNumber); + console.log(sf.columnNumber); + console.log(sf.source); + console.log(sf.isEval); + console.log(sf.isNative); return sf.toString(); }).join('\n'); console.log(stringifiedStack); }; -var errorCallback = function(err:Error) { console.log(err.message); }; +const errorCallback = (err: Error) => console.log(err.message); +const logger = (stackframes: StackTrace.StackFrame[]) => console.log(stackframes); +const options: StackTrace.StackTraceOptions = { + filter: (stackframe: StackTrace.StackFrame) => true, + sourceCache: {}, + offline: false +}; +const error = new Error('BOOM!'); -StackTrace.get(); +StackTrace.get(options).then(logger); +StackTrace.fromError(error, options).then(logger); +StackTrace.generateArtificially(options).then(logger); -// Somewhere else... -var error = new Error('BOOM!'); -StackTrace.fromError(error); -StackTrace.generateArtificially(); - -StackTrace.instrument(interestingFn, callback, errorCallback); -StackTrace.deinstrument(interestingFn); +const instrumented: () => string = StackTrace.instrument(interestingFn, callback, errorCallback); +const original: () => string = StackTrace.deinstrument(interestingFn); From f9104f1e24c58134b99e03f3e28d71d1ca50fce4 Mon Sep 17 00:00:00 2001 From: delphinus Date: Thu, 31 Mar 2016 00:40:48 +0900 Subject: [PATCH 091/415] Fix typo --- stacktrace-js/stacktrace-js.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stacktrace-js/stacktrace-js.d.ts b/stacktrace-js/stacktrace-js.d.ts index bc9571eb5a..4f0bac1635 100644 --- a/stacktrace-js/stacktrace-js.d.ts +++ b/stacktrace-js/stacktrace-js.d.ts @@ -67,7 +67,7 @@ declare namespace StackTrace { * @param {Object} thisArg optional context object (e.g. window) * @return {Function} instrumented function */ - export function instrument(fn: TFunc, callback: (stackFrames:StackFrame[]) => void, errback?: (error: Error) => void, thisArg?: any): TFunc; + export function instrument(fn: TFunc, callback: (stackFrames: StackFrame[]) => void, errback?: (error: Error) => void, thisArg?: any): TFunc; /** * Given a function that has been instrumented, From 6324ded3309992b0205fe585f73eaac38eb97b07 Mon Sep 17 00:00:00 2001 From: Gael Magnan de bornier Date: Fri, 1 Apr 2016 11:52:15 +0200 Subject: [PATCH 092/415] Update jwt-simple.d.ts --- jwt-simple/jwt-simple.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jwt-simple/jwt-simple.d.ts b/jwt-simple/jwt-simple.d.ts index 54e41c360e..ea78b13e88 100644 --- a/jwt-simple/jwt-simple.d.ts +++ b/jwt-simple/jwt-simple.d.ts @@ -1,6 +1,6 @@ // Type definitions for jwt-simple v0.5.0 // Project: https://github.com/hokaccha/node-jwt-simple -// Definitions by: Gael Magnan +// Definitions by: Ken Fukuyama , Gael Magnan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "jwt-simple" { /** From a9a77535de002706e1f1106391f1c3df15896dac Mon Sep 17 00:00:00 2001 From: CheCoxshall Date: Fri, 1 Apr 2016 21:41:56 +0100 Subject: [PATCH 093/415] Added type definitions for bootstrap-fileinput --- bootstrap-fileinput/bootstrap-fileinput.d.ts | 1029 ++++++++++++++++++ 1 file changed, 1029 insertions(+) create mode 100644 bootstrap-fileinput/bootstrap-fileinput.d.ts diff --git a/bootstrap-fileinput/bootstrap-fileinput.d.ts b/bootstrap-fileinput/bootstrap-fileinput.d.ts new file mode 100644 index 0000000000..e517ae8d75 --- /dev/null +++ b/bootstrap-fileinput/bootstrap-fileinput.d.ts @@ -0,0 +1,1029 @@ +interface JQuery { + fileinput: (options?: FileInputOptions) => JQuery; +} + +interface FileInputOptions { + /** + Language configuration for the plugin to enable the plugin to display messages for your locale (you must set the ISO code for the language). + You can have multiple language widgets on the same page. + The locale JS file for the language code must be defined as mentioned in the translations section: http://plugins.krajee.com/file-input#translations + */ + language?: string; + /** + Whether to display the file caption. + Defaults to true. + */ + showCaption?: boolean; + /** + Whether to display the file preview. + Defaults to true. + */ + showPreview?: boolean; + /** + Whether to display the file remove/clear button. + Defaults to true. + */ + showRemove?: boolean; + /** + Whether to display the file upload button. + Defaults to true. + This will default to a form submit button, unless the uploadUrl is specified. + */ + showUpload?: boolean; + /** + Whether to display the file upload cancel button. + Defaults to true. + This will be only enabled and displayed when an AJAX upload is in process. + */ + showCancel?: boolean; + /** + Whether to display the close icon in the preview. + Defaults to true. + This will be only parsed when showPreview is true or when you are using the {close} tag in your preview templates. + */ + showClose?: boolean; + /** + Whether to persist display of the uploaded file thumbnails in the preview window (for ajax uploads) until the remove/clear button is pressed. + Defaults to true. + When set to false, a next batch of files selected for upload will clear these thumbnails from preview. + */ + showUploadedThumbs?: boolean; + /** + Whether to automatically replace the files in the preview after the maxFileCount limit is reached and a new set of file(s) is/are selected. + This will only work if a valid maxFileCount is set. + Defaults to false. + */ + autoReplace?: boolean; + /** + Any additional CSS class to append to the caption container. + */ + captionClass?: string; + /** + Any additional CSS class to append to the preview container. + */ + previewClass?: string; + /** + Any additional CSS class to append to the main plugin container. + */ + mainClass?: string; + /** + The initial preview content to be displayed. + You can pass the minimal HTML markup for displaying your image, text, or file. + If set as a string, this will display a single file in the initial preview if there is no delimiter. You can set a delimiter (as defined in initialDelimiter) to show multiple files in initial preview. + If set as an array, it will display all files in the array as an initial preview (useful for multiple file upload scenarios). + The following CSS classes will need to be added for displaying each file type as per the plugin style theme: + image files: Include CSS class file-preview-image + text files: Include CSS class file-preview-text + other files: Include CSS class file-preview-other + */ + initialPreview?: string | any[]; + /** + the count of initial preview items that will be added to the count of files selected in preview. This is applicable when displaying the right caption, when overwriteInitial is set to false. + */ + initialPreviewCount?: number; + /** + the delimiter to be used for splitting the initial preview content as individual file thumbnails (applicable only if initialPreview is passed as a string instead of array). Defaults to *$$*. + */ + initialPreviewDelimiter?: string; + /** + the configuration for setting up important properties for each initialPreview item (that is setup as part of initialPreview). + */ + initialPreviewConfig?: IFileUploadPreviewConfig[]; + /** + whether the delete button will be displayed for each thumbnail that has been created with initialPreview. + */ + initialPreviewShowDelete?: boolean; + /** + whether the file thumbnail should be removed from preview on error. Defaults to false. + */ + removeFromPreviewOnError?: boolean; + /** + this will be a list of tags used in thumbnail templates that will be replaced dynamically within the thumbnail markup, when the thumbnail is rendered. + */ + previewThumbTags?: { [key: string]: string; } + /** + this is an extension of previewThumbTags specifically for initial preview content - but will be configured as an array of objects corresponding to each initial preview thumbnail. The initial preview thumbnails set via initialPreview will read this configuration for replacing tags. + */ + initialPreviewThumbTags?: { [key: string]: string; } + /** + the extra data that will be passed as data to the initial preview delete url/AJAX server call via POST. + This will be overridden by the initialPreviewConfig['extra'] property. + This property is only applicable for ajax deletions in initial preview and when you have set a value for initialPreviewConfig['url'] or deleteUrl. + This can be setup either as an object (associative array of keys and values) or as a function callback. + Note + The ajax delete action will send the following data to server via POST: + key: the key setting as setup in initialPreviewConfig['key'] + any other extra data passed as key: value pairs either via initialPreviewConfig['extra'] OR deleteExtraData if former is not set. + */ + deleteExtraData?: {} | { (): {} }; + /** + the URL for deleting the image/content in the initial preview via AJAX post response. This will be overridden by the initialPreviewConfig['url'] property. + Note + The ajax delete action will send the following data to server via POST: + key: the key setting as setup in initialPreviewConfig['key'] + any other extra data passed as key: value pairs either via initialPreviewConfig['extra'] OR deleteExtraData if former is not set. + */ + deleteUrl?: string; + /** + the initial preview caption text to be displayed. + If you do not set a value here and initialPreview is set to true this will default to "{preview-file-count} files selected", where {preview-file-count} is the count of the files passed in initialPreview. + */ + initialCaption?: string; + /** + whether you wish to overwrite the initial preview content and caption setup. + This defaults to true, whereby, any initialPreview content set will be overwritten, when new file is uploaded or when files are cleared. + Setting it to false will help displaying a saved image or file from database always - useful especially when using the multiple file upload feature. + */ + overwriteInitial?: boolean; + /** + the templates configuration for rendering each part of the layout. + */ + layoutTemplates?: IFileUploadLayoutTemplates; + /** + the templates configuration for rendering each preview file type. + */ + previewTemplates?: IFileUploadPreviewTemplates; + /** + the list of allowed file types for upload. + This by default is set to null which means the plugin supports all file types for upload. + If an invalid file type is found, then a validation error message as set in msgInvalidFileType will be raised. + Note: + You need to be careful in case you are setting both allowedFileTypes and allowedFileExtensions. In this case, the allowedFileTypes property is validated first and generally precedes the allowedFileExtensions setting (and the latter validation maybe skipped). + */ + allowedFileTypes?: ("image" | "html" | "text" | "video" | "audio" | "flash" | "object")[]; + /** + the list of allowed file extensions for upload. + This by default is set to null which means the plugin supports all file extensions for upload. + If an invalid file extension is found, then a validation error message as set in msgInvalidFileExtension will be raised. + Note: + You need to be careful in case you are setting both allowedFileTypes and allowedFileExtensions. In this case, the allowedFileTypes property is validated first and generally precedes the allowedFileExtensions setting (and the latter validation maybe skipped). + */ + allowedFileExtensions?: string[]; + /** + the list of allowed preview types for your widget. + This by default supports all file types for preview. + The plugin by default treats each file as an object if it does not match any of the previous types. + To disable this behavior, you can remove object from the list of allowedPreviewTypes OR fine tune it through allowedPreviewMimeTypes. + To disable content preview for all file-types and show the previewIcon instead as a thumbnail, set this to null, empty, or false. + */ + allowedPreviewTypes?: ("image" | "html" | "text" | "video" | "audio" | "flash" | "object")[]; + /** + the list of allowed mime types for preview. + This is set to null by default which means all possible mime types are allowed. + This setting works in combination with allowedPreviewTypes to filter only the needed file types allowed for preview. + */ + allowedPreviewMimeTypes?: string[]; + /** + the default content / markup to show by default in the preview window whenever the files are cleared or the input is cleared. + This can be useful for use cases like showing the default user profile picture or profile image before upload to overwrite. + This is a bit different from initialPreview in the sense, that the initialPreview content will always be displayed unless it is deleted or overwritten based on overwriteInitial. + The defaultPreviewContent on the other hand will only be shown ONLY on initialization OR whenever you clear the preview. + At other times when files have been selected this will be overwritten temporarily until file(s) selected is/are cleared. + This property can be useful to display for example a default user profile picture (or saved picture) in the preview window unless the user selects a picture. + */ + defaultPreviewContent?: string; + /** + the list of additional custom tags that will be replaced in the layout templates. + */ + customLayoutTags?: {}; + /** + the list of additional custom tags that will be replaced in the preview templates. + */ + customPreviewTags?: {}; + /** + the format settings (width and height) for rendering each preview file type. + */ + previewSettings?: IFileUploadPreviewSettings; + /** + the settings to validate and identify each file type when a file is selected for upload. + This is a list of callbacks, which accepts the file mime type and file name as a parameter. + */ + fileTypeSettings?: IFileUploadFileTypeSettings; + /** + the icon to be shown in each preview file thumbnail when an unreadable file type for preview is detected. Defaults to  . + */ + previewFileIcon?: string; + /** + the CSS class to be applied to the preview file icon container. Defaults to file-icon-4x. + */ + previewFileIconClass?: string; + /** + the preview icon markup settings for each file extension (type). + You need to set this as key: value pairs, where the key corresponds to a file extension (e.g. doc, docx, xls etc.), and the value corresponds to the markup of the icon to be rendered. + If this is not set OR a file extension is not set here, the preview will default to previewFileIcon. + Note that displaying the icons instead of file content is controlled via allowedPreviewTypes and allowedPreviewMimeTypes + */ + previewFileIconSettings?: IFileUploadPreviewFileIconSettings; + /** + the extensions to be auto derived for each file extension (type). + This is useful if you want to set the same icon for multiple file extension types. + You need to set this as `key: value` pairs, where the key corresponds to a file extension as set in previewFileIconSettings (e.g. doc, docx, xls etc.). + The value will be a function callback that accepts the following parameter: + ext: string, the file extension (without the . [dot]) of the file currently selected in the preview. + You can configure the callback to match the set of file extensions (via regex or similar) for each `key` and return a boolean output if the file extension matches. + */ + previewFileExtSettings?: IFileUploadPreviewFileExtSettings; + /** + the CSS class for the each of the button labels for browse, remove, upload, and cancel. + Defaults to hidden-xs, which automatically hides the button labels for small screen devices and renders as smaller iconic buttons to fit to the screen. + */ + buttonLabelClass?: string; + /** + the label to display for the file picker/browse button. Defaults to Browse …. + */ + browseLabel?: string; + /** + the icon to display before the label for the file picker/browse button. Defaults to  . + */ + browseIcon?: string; + /** + the CSS class for the file picker/browse button. Defaults to btn btn-primary. + */ + browseClass?: string; + /** + the label to display for the file remove button. Defaults to Remove. + */ + removeLabel?: string; + /** + the icon to display before the label for the file picker/remove button. Defaults to  . + */ + removeIcon?: string; + /** + the CSS class for the file remove button. Defaults to btn btn-default. + */ + removeClass?: string; + /** + the title to display on hover for the file remove button. Defaults to Clear selected files. + */ + removeTitle?: string; + /** + the label to display for the file upload button. Defaults to Upload. + */ + uploadLabel?: string; + /** + the icon to display before the label for the file upload button. Defaults to  . + */ + uploadIcon?: string; + /** + the CSS class for the file upload button. Defaults to btn btn-default. + */ + uploadClass?: string; + /** + the title to display on hover for the file remove button. + Defaults to Upload selected files. + */ + uploadTitle?: string; + /** + the URL for the upload processing action (typically for ajax based processing). + Defaults to null. + If this is not set or null, then the upload button action will default to form submission. + NOTE: + This is MANDATORY if you want to use advanced features like drag & drop, append/remove files, selectively upload files via ajax etc. + The plugin automatically send $_FILES data to the server with the input `name` attribute as the key if provided. + If input name is not set, the key defaults to file-data. + */ + uploadUrl?: string; + /** + whether the batch upload of multiple files will be asynchronous/in parallel. + Defaults to true. + */ + uploadAsync?: boolean; + /** + the extra data that will be passed as data to the url/AJAX server call via POST. + This property is only applicable for ajax uploads and when you have set a value for uploadUrl. + This can be setup either as an object (associative array of keys and values) or as a function callback. + As an object, it can be set for example as: + { id: 100, value: '100 Details' } + Note that for uploading individual file via thumbnail, the function callback can also receive the thumbnail previewId and index as parameters. These are described below: + previewId: the identifier for the preview file container (only available when uploading each thumbnail file) + index: the zero-based sequential index of the loaded file in the preview list (only available when uploading each thumbnail file) + */ + uploadExtraData?: {} | ((previewId?: string, index?: number) => {}); + /** + the minimum allowed image height in px if you are uploading image files. + Defaults to null which means no limit on image height. + */ + minImageHeight?: number; + /** + the maximum allowed image width in px if you are uploading image files. + Defaults to null which means no limit on image width. + Note that if you set resizeImage property to true, then the entire image will be resized within this width (depending on resizePreference). + */ + maxImageWidth?: number; + /** + the maximum allowed image height in px if you are uploading image files. + Defaults to null which means no limit on image height. + Note that if you set resizeImage property to true, then the entire image will be resized within this height (depending on resizePreference). + */ + maxImageHeight?: number; + /** + whether to add ability to resize uploaded images. Defaults to false. + Note that resizing images requires HTML5 canvas support which is supported on most modern browsers. + In addition, you must include the JavaScript-Canvas-to-Blob plugin by blueimp by including canvas-to-blob.js in your application. + This JS file must be loaded before fileinput.js on the page. + The JavaScript-Canvas-to-Blob source files are available in js/plugins folder of bootstrap-fileinput project page. + The canvas-to-blob.js plugin is a polyfill for canvas.toBlob method and is needed for allowing the resized image files via HTML5 canvas to be returned as a blob + */ + resizeImage?: boolean; + /** + preference to resize the image based on width or height. + Defaults to width. + This property is parsed only when resizeImage is true. + If set to width, the maxImageWidth property is first tested and if image size is greater than this, then the image is resized to maxImageWidth. + The image height is resized and adjusted in the same ratio as width. + In case, the image width is already less than maxImageWidth then the maxImageHeight property is used to resize and width is adjusted in same ratio. + This will behave conversely, when resizePreference is set to height - the maxImageHeight will be first tested against image height and then the rest of steps will be similarly parsed with preference given to height instead of width as before. + */ + resizePreference?: "width" | "height"; + /** + the quality of the resized image. This must be a decimal number between 0.00 to 1.00. + Defaults to 0.92. + */ + resizeImageQuality?: number; + /** + the default image mime type of the converted image after resize. + Defaults to image/jpeg. + */ + resizeDefaultImageType?: string; + /** + the maximum file size for upload in KB. + If set to 0, it means size allowed is unlimited. + Defaults to 0. + */ + maxFileSize?: number; + /** + the minimum number of files allowed for each multiple upload. + If set to 0, it means number of files are optional. + Defaults to 0. + */ + minFileCount?: number; + /** + the maximum number of files allowed for each multiple upload. + If set to 0, it means number of files allowed is unlimited. + Defaults to 0. + */ + maxFileCount?: number; + /** + whether to include initial preview file count (server uploaded files) in validating minFileCount and maxFileCount. + Defaults to false. + */ + validateInitialCount?: boolean; + /** + the message that will be displayed when ZERO files are found. + Defaults to No. + */ + msgNo?: string; + /** + the message that will be displayed within the progress bar when file upload is aborted or cancelled. + Defaults to Cancelled. + */ + msgCancelled?: string; + /** + the title displayed (before the file name) on hover of the zoom button for zooming the file content in a modal window. + This is currently applicable only for text file previews. + Defaults to View details. + */ + msgZoomTitle?: string; + /** + the heading of the modal dialog that displays the zoomed file content. + This is currently applicable only for text file previews. + Defaults to Detailed Preview. + */ + msgZoomModalHeading?: string; + /** + the message to be displayed when the file size exceeds maximum size. + Defaults to: + File "{name}" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB. Please retry your upload! + where: + {name}: will be replaced by the file name being uploaded + {size}: will be replaced by the uploaded file size + {maxSize}: will be replaced by the maxFileSize parameter. + */ + msgSizeTooLarge?: string; + /** + message to be displayed when the file count is less than the minimum count as set in minFileCount. + Defaults to: + You must select at least {n} {files} to upload. Please retry your upload! + where: + {n}: will be replaced by the allowed minimum files as set in minFileCount. + {files}: will be replaced with fileSingle or filePlural properties in locale file depending on the minFileCount. + */ + msgFilesTooLess?: string; + /** + the message to be displayed when the file count exceeds maximum count as set in maxFileCount. + Defaults to: + Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}. Please retry your upload! + where: + {n}: will be replaced by number of files selected for upload + {m}: will be replaced by the allowed maximum files as set in maxFileCount + */ + msgFilesTooMany?: string; + /** + the exception message to be displayed when the file selected is not found by the FileReader. + Defaults to: + File "{name}" not found! + where: + {name}: will be replaced by the file name being uploaded + */ + msgFileNotFound?: string; + /** + the exception message to be displayed when the file selected is not allowed to be accessed due to a security exception. + Defaults to: + Security restrictions prevent reading the file "{name}". + where: + {name}: will be replaced by the file name being uploaded + */ + msgFileSecured?: string; + /** + the exception message to be displayed when the file selected is not readable by the FileReader API. + Defaults to: + File "{name}" is not readable. + where: + {name}: will be replaced by the file name being uploaded + */ + msgFileNotReadable?: string; + /** + the exception message to be displayed when the file preview upload is aborted. + Defaults to: + File preview aborted for "{name}". + where: + {name}: will be replaced by the file name being uploaded + */ + msgFilePreviewAborted?: string; + /** + the exception message to be displayed for any other error when previewing the file. + Defaults to: + An error occurred while reading the file "{name}". + where: + {name}: will be replaced by the file name being uploaded + */ + msgFilePreviewError?: string; + /** + the message to be displayed when the file type is not in one of the file types set in allowedFileTypes. + Defaults to: + Invalid type for file "{name}". Only "{types}" files are supported. + where: + {name}: will be replaced by the file name being uploaded + {types}: will be replaced by the comma separated list of types defined in allowedFileTypes. + */ + msgInvalidFileType?: string; + /** + the message to be displayed when the file type is not in one of the file extensions set in allowedFileExtensions. + Defaults to: + Invalid extension for file "{name}". Only "{extensions}" files are supported. + where: + {name}: will be replaced by the file name being uploaded + {extensions}: will be replaced by the comma separated list of extensions defined in allowedFileExtensions. + */ + msgInvalidFileExtension?: string; + /** + the message to be displayed when an ongoing ajax file upload is aborted by pressing the Cancel button. + Defaults to The file upload was aborted. + If this is set to null or empty, the internal ajax error message will be displayed - Defaults to File Upload Error. + */ + msgUploadAborted?: string; + /** + the exception message to be displayed within the caption container (instead of msgFilesSelected), when a validation error is encountered. + Defaults to File Upload Error. + */ + msgValidationError?: string; + /** + the css class for the validation error message displayed in the caption container. + Defaults to text-danger. + */ + msgValidationErrorClass?: string; + /** + the icon to be displayed before the validation error in the caption container. + Defaults to + */ + msgValidationErrorIcon?: string; + /** + the css class for the error message to be displayed in the preview window when the file size exceeds maxSize. + Defaults to file-error-message. + */ + msgErrorClass?: string; + /** + the message displayed when the files are getting read and loaded for preview. + Defaults to + Loading file {index} of {files} … + The following special variables will be replaced: + {index}: the sequence number of the current file being loaded. + {files}: the total number of files selected for upload. + */ + msgLoading?: string; + /** + the progress message displayed as each file is loaded for preview. + Defaults to: + Loading file {index} of {files} - {name} - {percent}% completed. + The following variables will be replaced: + {index}: the sequence number of the current file being loaded. + {files}: the total number of files selected for upload. + {percent}: the percentage of file read and loaded. + {name}: the name of the current file being loaded. + */ + msgProgress?: string; + /** + the progress message displayed in caption window when multiple (more than one) files are selected. + Defaults to: + {n} files selected. + The following variables will be replaced: + {n}: the number of files selected. + */ + msgSelected?: string; + /** + the message displayed when a folder has been dragged to the drop zone. + Defaults to: + Drag & drop files only! {n} folder(s) dropped were skipped. + The following variables will be replaced: + {n}: the number of folders dropped. + */ + msgFoldersNotAllowed?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its width is less than the minImageWidth setting. + Defaults to: + Width of image file "{name}" must be at least {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the minImageWidth setting. + */ + msgImageWidthSmall?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its height is less than the minImageHeight setting. + Defaults to: + Height of image file "{name}" must be at least {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the minImageHeight setting. + */ + msgImageHeightSmall?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its width exceeds the maxImageWidth setting. + Defaults to: + Width of image file "{name}" cannot exceed {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the maxImageWidth setting. + */ + msgImageWidthLarge?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its height exceeds the maxImageHeight setting. + Defaults to: + Height of image file "{name}" cannot exceed {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the maxImageHeight setting. + */ + msgImageHeightLarge?: string; + /** + the upload progress bar CSS class to be applied when AJAX upload is in process (applicable only for ajax uploads). + Defaults to progress-bar progress-bar-success progress-bar-striped active. + */ + progressClass?: string; + /** + the upload progress bar CSS class to be applied when AJAX upload is in process (applicable only for ajax uploads). + Defaults to progress-bar progress-bar-success progress-bar-striped active. + */ + progressCompleteClass?: string; + /** + the upload progress bar CSS class to be applied when AJAX upload is cancelled or aborted. + Defaults to progress-bar progress-bar-danger. + */ + progressErrorClass?: string; + /** + the type of files that are to be displayed in the preview window. + Defaults to image. + Can be one of the following: + image: Only image type files will be shown in preview. + text: Only text type files will be shown in preview. + any: Both image and text files content will be shown in preview. + Files other than image or text will be displayed as a thumbnail with the filename in the preview window. + */ + previewFileType?: "image" | "text" | "any"; + /** + the icon for zooming the file content in a new modal dialog. + This is currently applicable only for text file previews. + Defaults to + */ + zoomIndicator?: string; + /** + the identifier for the container element displaying the error (e.g. '#id'). + If not set, will default to the container with CSS class kv-fileinput-error inside the preview container (identified by elPreviewContainer). + The msgErrorClass will be automatically appended to this container before displaying the error. + */ + elErrorContainer?: string; + /** + the identifier for the container element containing the caption (e.g. '#id'). + If not set, will default to the container with CSS class file-caption inside the main plugin container. + */ + elCaptionContainer?: string; + /** + the identifier for the container element containing the caption text (e.g. '#id'). + If not set, will default to the container with CSS class file-caption-name inside the main plugin container. + */ + elCaptionText?: string; + /** + the identifier for the container element containing the preview (e.g. '#id'). + If not set, will default to the container with CSS class file-preview inside the main plugin container. + */ + elPreviewContainer?: string; + /** + the identifier for the element containing the preview image thumbnails (e.g. '#id'). + If not set, will default to the container with CSS class file-preview-thumbnails inside the main plugin container. + */ + elPreviewImage?: string; + /** + the identifier for the element containing the preview progress status (e.g. '#id'). + If not set, will default to the container with CSS class file-preview-status inside the main plugin container. + */ + elPreviewStatus?: string; + /** + a callback to convert the filename as a slug string eliminating special characters. + If not set, it will use the plugin's own internal slugDefault method. + This callback function includes the filename as parameter and must return a converted filename string. + */ + slugCallback?: (filename: string) => string; + /** + whether to enable a drag and drop zone for dragging and dropping files to. + This is available only for ajax based uploads. + Defaults to true. + */ + dropZoneEnabled?: boolean; + /** + title to be displayed in the drag and drop zone. + This is available only for ajax based uploads. + Defaults to: + Drag & drop files here …. + */ + dropZoneTitle?: string; + /** + CSS class for the drag & drop zone title. + Defaults to file-drop-zone-title. + */ + dropZoneTitleClass?: string; + /** + configuration for setting up file actions for newly selected file thumbnails in the preview window. + */ + fileActionsettings?: IFileUploadFileActionSettings; + /** + markup for additional action buttons to display within the initial preview thumbnails (for example displaying an image edit button). + The following tag can be used in the markup and will be automatically replaced: + {dataKey}: Will be replaced with the key set within initialPreviewConfig. + */ + otherActionButtons?: string; + /** + the encoding to be used while reading a text file. + Applicable only for previewing text files. + Defaults to UTF-8. + */ + textEncoding?: string; + /** + additional ajax settings to pass to the plugin before submitting the ajax request for upload. + Applicable only for ajax uploads. + This can be useful to pass additional tokens to headers or one can use it for setting other ajax options for advanced cases. + Refer the jQuery ajax documentation for the various settings you can configure. + */ + ajaxSettings?: JQueryAjaxSettings; + /** + additional ajax settings to pass to the plugin before submitting the delete ajax request in each initial preview thumbnail. + Applicable only for ajax uploads. + This can be useful to pass additional tokens to headers or one can use it for setting other ajax options for advanced cases. + Refer the jQuery ajax documentation for the various settings you can configure. + */ + ajaxDeleteSettings?: JQueryAjaxSettings; + /** + whether to show details of the error stack from the server log when an error is encountered via ajax response. + Defaults to true. + */ + showAjaxErrorDetails?: boolean; +} + +interface IFileUploadPreviewConfig { + /** + the caption or filename to display for each initial preview item content. + */ + caption: string; + /** + the CSS width of the image/ content displayed. + */ + width: string; + /** + the URL for deleting the image/ content in the initial preview via AJAX post response.This will default to deleteUrl if not set. + */ + url: string; + /** + the key that will be passed as data to the url via AJAX POST. + */ + key: string | {}; + /** + the additional frame css class to set for the file's thumbnail frame. + */ + frameClass: string; + /** + the HTML attribute settings (set as key:value pairs) for the thumbnail frame. + */ + frameAttr: {}; + /** + the extra data that will be passed as data to the initial preview delete url / AJAX server call via POST.This will default to deleteExtraData if not set. + */ + extra: {} | Function; +} + +interface IFileUploadLayoutTemplates { + /** + the template for rendering the widget with caption. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the mainClass property. + {close}: will be replaced with the close (cross) icon (by default on top right of the preview window). The layout template to control this markup is layoutTemplates.close. + {preview}: the content parsed by the previewTemplate and will be displayed only if showPreview is true. + {caption}: the content parsed by the captionTemplate and will be displayed only if showCaption is true. + {remove}: the file remove/clear button and will be displayed only if showRemove is true. + {upload}: the file upload button and will be displayed only if showUpload is true. + {cancel}: the file upload cancel button that will be displayed when AJAX upload is in process to abort the AJAX upload. + {browse}: the main file browse button to select your files for input. + */ + main1?: string; + /** + the template for rendering the widget without caption. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the mainClass property. + {close}: will be replaced with the close (cross) icon (by default on top right of the preview window). The layout template to control this markup is layoutTemplates.close. + {preview}: the content parsed by the previewTemplate and will be displayed only if showPreview is true. + {caption}: the content parsed by the captionTemplate and will be displayed only if showCaption is true. + {remove}: the file remove/clear button and will be displayed only if showRemove is true. + {upload}: the file upload button and will be displayed only if showUpload is true. + {cancel}: the file upload cancel button that will be displayed when AJAX upload is in process to abort the AJAX upload. + {browse}: the main file browse button to select your files for input. + */ + main2?: string; + /** + the template for rendering the preview. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the previewClass property. + */ + preview?: string; + /** + the icon to render before the caption text. + */ + icon?: string; + /** + the template for rendering the caption. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the captionClass property. + */ + caption?: string; + /** + the template for rendering the modal (for text file preview zooming). + */ + modal?: string; + /** + the template for the progress bar when upload is in progress (for batch/mass uploads and within each preview thumbnail for async/single uploads). + The upload progress bar when displayed within each thumbnail will be wrapped inside a container having a CSS class of `file-thumb-progress`. + The following tags will be parsed and replaced automatically: + {percent}: will be replaced with the upload progress percentage. + */ + progress?: string; + /** + the template for the footer section of each file preview thumbnail. + The following tags will be parsed and replaced automatically: + {actions}: will be replaced with the output of the actions template. + {class}: the CSS class as set in the progressClass or progressCompleteClass property (depending on the progress percentage). + */ + footer?: string; + /** + the template for the file action buttons to be displayed within the thumbnail footer. + The following tags will be parsed and replaced automatically: + {upload}: will be replaced with the output of the actionUpload template. + {delete}: will be replaced with the output of the actionDelete template. + */ + actions?: string; + /** + the template for the file delete action button within the thumbnail footer. + The following tags will be parsed and replaced automatically: + {removeClass}: the css class for the remove button. Will be replaced with the removeClass set within fileActionSettings. + {removeIcon}: the icon for the remove button. Will be replaced with the removeIcon set within fileActionSettings. + {removeTitle}: the title to display on hover for the remove button. Will be replaced with the removeTitle set within fileActionSettings. + {dataUrl}: the URL for deleting the file thumbnail for initialPreview content only. Will be replaced with the url set within initialPreviewConfig. + {dataKey}: the key (additional data) that will be passed to the URL above via POST to the AJAX call. Will be replaced with the key set within initialPreviewConfig. + */ + actionDelete?: string; + /** + the template for the file upload action button within the thumbnail footer. + The following tags will be parsed and replaced automatically: + {uploadClass}: the css class for the upload button. Will be replaced with the uploadClass set within fileActionSettings. + {uploadIcon}: the icon for the upload button. Will be replaced with the uploadIcon set within fileActionSettings. + {uploadTitle}: the title to display on hover for the upload button. Will be replaced with the uploadTitle set within fileActionSettings. + */ + actionUpload?: string; + /** + The template for upload, remove, and cancel buttons. + The following tags will be parsed and replaced automatically: + {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. + {title}: the title to display on button hover. + {css}: the CSS class for the button. This is derived from settings for uploadClass or removeClass or cancelClass. + {status}: the disabled status for the button if available (else will be blank). + {icon}: the button icon as identified by uploadIcon or removeIcon or cancelIcon. + {label}: the button label as identified by uploadLabel or removeLabel or cancelLabel. + */ + btnDefault?: string; + /** + The template for upload button when used with ajax (i.e. when uploadUrl is set). + The following tags will be parsed and replaced automatically: + {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. + {title}: the title to display on button hover. + {css}: the CSS class for the button. This is derived from settings for uploadClass. + {status}: the disabled status for the button if available (else will be blank). + {icon}: the button icon as identified by uploadIcon. + {label}: the button label as identified by uploadLabel. + {href}: applicable only for Upload button for ajax uploads and will be replaced with the uploadUrl property. + */ + btnLink?: string; + /** + The template for the browse button. + {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. + {title}: the title to display on button hover. + {css}: the CSS class for the button. This is derived from settings for browseClass. + {status}: the disabled status for the button if available (else will be blank). + {icon}: the button icon as identified by browseIcon. + {label}: the button label as identified by browseLabel. + */ + btnBrowse?: string; +} + +interface IFileUploadPreviewTemplates { + /** + the preview template for image files. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + image?: string; + /** + the preview template for text files. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + {dialog}: Will be replaced with the JS code to launch the modal dialog. + {zoomTitle}: This will be replaced with the msgZoomTitle property. This is the title that is displayed on hover of the zoom button (which on clicking will display the text file). + {zoomInd}: This will be replaced with the zoomIndicator property. This is the title that is displayed on hover of the zoom button (which on clicking will display the text file). + {heading}: This represents the modal dialog heading title. This will be replaced with the msgZoomModalHeading property. + */ + text?: string; + /** + the preview template for html files. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + html?: string; + /** + the preview template for video files (supported by HTML 5 video tag). + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + video?: string; + /** + the preview template for audio files (supported by HTML 5 audio tag). + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + audio?: string; + /** + the preview template for flash files (supported currently on webkit browsers). + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + flash?: string; + /** + the preview template for all other files - by default treated as object. To disable this behavior, configure the allowedPreviewTypes property. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + object?: string; + /** + this template is used ONLY for rendering the initialPreview markup content passed directly as a raw format. + The following tags will be parsed and replaced automatically: + {content}: will be replaced with the raw HTML markup as set in initialPreview.. + */ + generic?: string; +} + +interface IFileUploadPreviewSettings { + image?: { width?: string; height?: string; }; + html?: { width?: string; height?: string; }; + text?: { width?: string; height?: string; }; + video?: { width?: string; height?: string; }; + audio?: { width?: string; height?: string; }; + flash?: { width?: string; height?: string; }; + object?: { width?: string; height?: string; }; + other?: { width?: string; height?: string; }; +} + +interface IFileUploadFileTypeSettings { + image: (vType: string, vName: string) => boolean; + html: (vType: string, vName: string) => boolean; + text: (vType: string, vName: string) => boolean; + video: (vType: string, vName: string) => boolean; + audio: (vType: string, vName: string) => boolean; + flash: (vType: string, vName: string) => boolean; + object: (vType: string, vName: string) => boolean; + other: (vType: string, vName: string) => boolean; +} + +interface IFileUploadPreviewFileIconSettings { + [key: string]: string; +} + +interface IFileUploadPreviewFileExtSettings { + [key: string]: (ext: string) => boolean; +} + +interface IFileUploadFileActionSettings { + /** + icon for remove button to be displayed in each file thumbnail. + */ + removeIcon: string; + /** + CSS class for the remove button in each file thumbnail. + */ + removeClass: string; + /** + title for remove button in each file thumbnail. + */ + removeTitle: string; + /** + icon for upload button to be displayed in each file thumbnail. + */ + uploadIcon: string; + /** + CSS class for the remove button in each file thumbnail. + */ + uploadClass: string; + /** + title for remove button in each file thumbnail. + */ + uploadTitle: string; + /** + an indicator (HTML markup) for new pending upload displayed in each file thumbnail. + */ + indicatorNew: string; + /** + an indicator (HTML markup) for successful upload displayed in each file thumbnail. + */ + indicatorSuccess: string; + /** + an indicator (HTML markup) for error in upload displayed in each file thumbnail. + */ + indicatorError: string; + /** + an indicator (HTML markup) for ongoing upload displayed in each file thumbnail. + */ + indicatorLoading: string; + /** + title to display on hover of indicator for new pending upload in each file thumbnail. + */ + indicatorNewTitle: string; + /** + title to display on hover of indicator for successful in each file thumbnail. + */ + indicatorSuccessTitle: string; + /** + title to display on hover of indicator for error in upload in each file thumbnail. + */ + indicatorErrorTitle: string; + /** + title to display on hover of indicator for ongoing upload in each file thumbnail. + */ + indicatorLoadingTitle: string; +} \ No newline at end of file From 325de0ff3bdd5dcad22f77a563ebbe533283478e Mon Sep 17 00:00:00 2001 From: CheCoxshall Date: Fri, 1 Apr 2016 22:27:19 +0100 Subject: [PATCH 094/415] Fixed header and Namespacing Also improved interface names. --- bootstrap-fileinput/bootstrap-fileinput.d.ts | 2044 +++++++++--------- 1 file changed, 1026 insertions(+), 1018 deletions(-) diff --git a/bootstrap-fileinput/bootstrap-fileinput.d.ts b/bootstrap-fileinput/bootstrap-fileinput.d.ts index e517ae8d75..e9d6f0e0d3 100644 --- a/bootstrap-fileinput/bootstrap-fileinput.d.ts +++ b/bootstrap-fileinput/bootstrap-fileinput.d.ts @@ -1,1029 +1,1037 @@ -interface JQuery { - fileinput: (options?: FileInputOptions) => JQuery; +// Type definitions for bootstrap-fileinput +// Project: https://github.com/kartik-v/bootstrap-fileinput +// Definitions by: Ché Coxshall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface JQuery { + fileinput: (options?: BootstrapFileInput.FileInputOptions) => JQuery; } -interface FileInputOptions { - /** - Language configuration for the plugin to enable the plugin to display messages for your locale (you must set the ISO code for the language). - You can have multiple language widgets on the same page. - The locale JS file for the language code must be defined as mentioned in the translations section: http://plugins.krajee.com/file-input#translations - */ - language?: string; - /** - Whether to display the file caption. - Defaults to true. - */ - showCaption?: boolean; - /** - Whether to display the file preview. - Defaults to true. - */ - showPreview?: boolean; - /** - Whether to display the file remove/clear button. - Defaults to true. - */ - showRemove?: boolean; - /** - Whether to display the file upload button. - Defaults to true. - This will default to a form submit button, unless the uploadUrl is specified. - */ - showUpload?: boolean; - /** - Whether to display the file upload cancel button. - Defaults to true. - This will be only enabled and displayed when an AJAX upload is in process. - */ - showCancel?: boolean; - /** - Whether to display the close icon in the preview. - Defaults to true. - This will be only parsed when showPreview is true or when you are using the {close} tag in your preview templates. - */ - showClose?: boolean; - /** - Whether to persist display of the uploaded file thumbnails in the preview window (for ajax uploads) until the remove/clear button is pressed. - Defaults to true. - When set to false, a next batch of files selected for upload will clear these thumbnails from preview. - */ - showUploadedThumbs?: boolean; - /** - Whether to automatically replace the files in the preview after the maxFileCount limit is reached and a new set of file(s) is/are selected. - This will only work if a valid maxFileCount is set. - Defaults to false. - */ - autoReplace?: boolean; - /** - Any additional CSS class to append to the caption container. - */ - captionClass?: string; - /** - Any additional CSS class to append to the preview container. - */ - previewClass?: string; - /** - Any additional CSS class to append to the main plugin container. - */ - mainClass?: string; - /** - The initial preview content to be displayed. - You can pass the minimal HTML markup for displaying your image, text, or file. - If set as a string, this will display a single file in the initial preview if there is no delimiter. You can set a delimiter (as defined in initialDelimiter) to show multiple files in initial preview. - If set as an array, it will display all files in the array as an initial preview (useful for multiple file upload scenarios). - The following CSS classes will need to be added for displaying each file type as per the plugin style theme: - image files: Include CSS class file-preview-image - text files: Include CSS class file-preview-text - other files: Include CSS class file-preview-other - */ - initialPreview?: string | any[]; - /** - the count of initial preview items that will be added to the count of files selected in preview. This is applicable when displaying the right caption, when overwriteInitial is set to false. - */ - initialPreviewCount?: number; - /** - the delimiter to be used for splitting the initial preview content as individual file thumbnails (applicable only if initialPreview is passed as a string instead of array). Defaults to *$$*. - */ - initialPreviewDelimiter?: string; - /** - the configuration for setting up important properties for each initialPreview item (that is setup as part of initialPreview). - */ - initialPreviewConfig?: IFileUploadPreviewConfig[]; - /** - whether the delete button will be displayed for each thumbnail that has been created with initialPreview. - */ - initialPreviewShowDelete?: boolean; - /** - whether the file thumbnail should be removed from preview on error. Defaults to false. - */ - removeFromPreviewOnError?: boolean; - /** - this will be a list of tags used in thumbnail templates that will be replaced dynamically within the thumbnail markup, when the thumbnail is rendered. - */ - previewThumbTags?: { [key: string]: string; } - /** - this is an extension of previewThumbTags specifically for initial preview content - but will be configured as an array of objects corresponding to each initial preview thumbnail. The initial preview thumbnails set via initialPreview will read this configuration for replacing tags. - */ - initialPreviewThumbTags?: { [key: string]: string; } - /** - the extra data that will be passed as data to the initial preview delete url/AJAX server call via POST. - This will be overridden by the initialPreviewConfig['extra'] property. - This property is only applicable for ajax deletions in initial preview and when you have set a value for initialPreviewConfig['url'] or deleteUrl. - This can be setup either as an object (associative array of keys and values) or as a function callback. - Note - The ajax delete action will send the following data to server via POST: - key: the key setting as setup in initialPreviewConfig['key'] - any other extra data passed as key: value pairs either via initialPreviewConfig['extra'] OR deleteExtraData if former is not set. - */ - deleteExtraData?: {} | { (): {} }; - /** - the URL for deleting the image/content in the initial preview via AJAX post response. This will be overridden by the initialPreviewConfig['url'] property. - Note - The ajax delete action will send the following data to server via POST: - key: the key setting as setup in initialPreviewConfig['key'] - any other extra data passed as key: value pairs either via initialPreviewConfig['extra'] OR deleteExtraData if former is not set. - */ - deleteUrl?: string; - /** - the initial preview caption text to be displayed. - If you do not set a value here and initialPreview is set to true this will default to "{preview-file-count} files selected", where {preview-file-count} is the count of the files passed in initialPreview. - */ - initialCaption?: string; - /** - whether you wish to overwrite the initial preview content and caption setup. - This defaults to true, whereby, any initialPreview content set will be overwritten, when new file is uploaded or when files are cleared. - Setting it to false will help displaying a saved image or file from database always - useful especially when using the multiple file upload feature. - */ - overwriteInitial?: boolean; - /** - the templates configuration for rendering each part of the layout. - */ - layoutTemplates?: IFileUploadLayoutTemplates; - /** - the templates configuration for rendering each preview file type. - */ - previewTemplates?: IFileUploadPreviewTemplates; - /** - the list of allowed file types for upload. - This by default is set to null which means the plugin supports all file types for upload. - If an invalid file type is found, then a validation error message as set in msgInvalidFileType will be raised. - Note: - You need to be careful in case you are setting both allowedFileTypes and allowedFileExtensions. In this case, the allowedFileTypes property is validated first and generally precedes the allowedFileExtensions setting (and the latter validation maybe skipped). - */ - allowedFileTypes?: ("image" | "html" | "text" | "video" | "audio" | "flash" | "object")[]; - /** - the list of allowed file extensions for upload. - This by default is set to null which means the plugin supports all file extensions for upload. - If an invalid file extension is found, then a validation error message as set in msgInvalidFileExtension will be raised. - Note: - You need to be careful in case you are setting both allowedFileTypes and allowedFileExtensions. In this case, the allowedFileTypes property is validated first and generally precedes the allowedFileExtensions setting (and the latter validation maybe skipped). - */ - allowedFileExtensions?: string[]; - /** - the list of allowed preview types for your widget. - This by default supports all file types for preview. - The plugin by default treats each file as an object if it does not match any of the previous types. - To disable this behavior, you can remove object from the list of allowedPreviewTypes OR fine tune it through allowedPreviewMimeTypes. - To disable content preview for all file-types and show the previewIcon instead as a thumbnail, set this to null, empty, or false. - */ - allowedPreviewTypes?: ("image" | "html" | "text" | "video" | "audio" | "flash" | "object")[]; - /** - the list of allowed mime types for preview. - This is set to null by default which means all possible mime types are allowed. - This setting works in combination with allowedPreviewTypes to filter only the needed file types allowed for preview. - */ - allowedPreviewMimeTypes?: string[]; - /** - the default content / markup to show by default in the preview window whenever the files are cleared or the input is cleared. - This can be useful for use cases like showing the default user profile picture or profile image before upload to overwrite. - This is a bit different from initialPreview in the sense, that the initialPreview content will always be displayed unless it is deleted or overwritten based on overwriteInitial. - The defaultPreviewContent on the other hand will only be shown ONLY on initialization OR whenever you clear the preview. - At other times when files have been selected this will be overwritten temporarily until file(s) selected is/are cleared. - This property can be useful to display for example a default user profile picture (or saved picture) in the preview window unless the user selects a picture. - */ - defaultPreviewContent?: string; - /** - the list of additional custom tags that will be replaced in the layout templates. - */ - customLayoutTags?: {}; - /** - the list of additional custom tags that will be replaced in the preview templates. - */ - customPreviewTags?: {}; - /** - the format settings (width and height) for rendering each preview file type. - */ - previewSettings?: IFileUploadPreviewSettings; - /** - the settings to validate and identify each file type when a file is selected for upload. - This is a list of callbacks, which accepts the file mime type and file name as a parameter. - */ - fileTypeSettings?: IFileUploadFileTypeSettings; - /** - the icon to be shown in each preview file thumbnail when an unreadable file type for preview is detected. Defaults to  . - */ - previewFileIcon?: string; - /** - the CSS class to be applied to the preview file icon container. Defaults to file-icon-4x. - */ - previewFileIconClass?: string; - /** - the preview icon markup settings for each file extension (type). - You need to set this as key: value pairs, where the key corresponds to a file extension (e.g. doc, docx, xls etc.), and the value corresponds to the markup of the icon to be rendered. - If this is not set OR a file extension is not set here, the preview will default to previewFileIcon. - Note that displaying the icons instead of file content is controlled via allowedPreviewTypes and allowedPreviewMimeTypes - */ - previewFileIconSettings?: IFileUploadPreviewFileIconSettings; - /** - the extensions to be auto derived for each file extension (type). - This is useful if you want to set the same icon for multiple file extension types. - You need to set this as `key: value` pairs, where the key corresponds to a file extension as set in previewFileIconSettings (e.g. doc, docx, xls etc.). - The value will be a function callback that accepts the following parameter: - ext: string, the file extension (without the . [dot]) of the file currently selected in the preview. - You can configure the callback to match the set of file extensions (via regex or similar) for each `key` and return a boolean output if the file extension matches. - */ - previewFileExtSettings?: IFileUploadPreviewFileExtSettings; - /** - the CSS class for the each of the button labels for browse, remove, upload, and cancel. - Defaults to hidden-xs, which automatically hides the button labels for small screen devices and renders as smaller iconic buttons to fit to the screen. - */ - buttonLabelClass?: string; - /** - the label to display for the file picker/browse button. Defaults to Browse …. - */ - browseLabel?: string; - /** - the icon to display before the label for the file picker/browse button. Defaults to  . - */ - browseIcon?: string; - /** - the CSS class for the file picker/browse button. Defaults to btn btn-primary. - */ - browseClass?: string; - /** - the label to display for the file remove button. Defaults to Remove. - */ - removeLabel?: string; - /** - the icon to display before the label for the file picker/remove button. Defaults to  . - */ - removeIcon?: string; - /** - the CSS class for the file remove button. Defaults to btn btn-default. - */ - removeClass?: string; - /** - the title to display on hover for the file remove button. Defaults to Clear selected files. - */ - removeTitle?: string; - /** - the label to display for the file upload button. Defaults to Upload. - */ - uploadLabel?: string; - /** - the icon to display before the label for the file upload button. Defaults to  . - */ - uploadIcon?: string; - /** - the CSS class for the file upload button. Defaults to btn btn-default. - */ - uploadClass?: string; - /** - the title to display on hover for the file remove button. - Defaults to Upload selected files. - */ - uploadTitle?: string; - /** - the URL for the upload processing action (typically for ajax based processing). - Defaults to null. - If this is not set or null, then the upload button action will default to form submission. - NOTE: - This is MANDATORY if you want to use advanced features like drag & drop, append/remove files, selectively upload files via ajax etc. - The plugin automatically send $_FILES data to the server with the input `name` attribute as the key if provided. - If input name is not set, the key defaults to file-data. - */ - uploadUrl?: string; - /** - whether the batch upload of multiple files will be asynchronous/in parallel. - Defaults to true. - */ - uploadAsync?: boolean; - /** - the extra data that will be passed as data to the url/AJAX server call via POST. - This property is only applicable for ajax uploads and when you have set a value for uploadUrl. - This can be setup either as an object (associative array of keys and values) or as a function callback. - As an object, it can be set for example as: - { id: 100, value: '100 Details' } - Note that for uploading individual file via thumbnail, the function callback can also receive the thumbnail previewId and index as parameters. These are described below: - previewId: the identifier for the preview file container (only available when uploading each thumbnail file) - index: the zero-based sequential index of the loaded file in the preview list (only available when uploading each thumbnail file) - */ - uploadExtraData?: {} | ((previewId?: string, index?: number) => {}); - /** - the minimum allowed image height in px if you are uploading image files. - Defaults to null which means no limit on image height. - */ - minImageHeight?: number; - /** - the maximum allowed image width in px if you are uploading image files. - Defaults to null which means no limit on image width. - Note that if you set resizeImage property to true, then the entire image will be resized within this width (depending on resizePreference). - */ - maxImageWidth?: number; - /** - the maximum allowed image height in px if you are uploading image files. - Defaults to null which means no limit on image height. - Note that if you set resizeImage property to true, then the entire image will be resized within this height (depending on resizePreference). - */ - maxImageHeight?: number; - /** - whether to add ability to resize uploaded images. Defaults to false. - Note that resizing images requires HTML5 canvas support which is supported on most modern browsers. - In addition, you must include the JavaScript-Canvas-to-Blob plugin by blueimp by including canvas-to-blob.js in your application. - This JS file must be loaded before fileinput.js on the page. - The JavaScript-Canvas-to-Blob source files are available in js/plugins folder of bootstrap-fileinput project page. - The canvas-to-blob.js plugin is a polyfill for canvas.toBlob method and is needed for allowing the resized image files via HTML5 canvas to be returned as a blob - */ - resizeImage?: boolean; - /** - preference to resize the image based on width or height. - Defaults to width. - This property is parsed only when resizeImage is true. - If set to width, the maxImageWidth property is first tested and if image size is greater than this, then the image is resized to maxImageWidth. - The image height is resized and adjusted in the same ratio as width. - In case, the image width is already less than maxImageWidth then the maxImageHeight property is used to resize and width is adjusted in same ratio. - This will behave conversely, when resizePreference is set to height - the maxImageHeight will be first tested against image height and then the rest of steps will be similarly parsed with preference given to height instead of width as before. - */ - resizePreference?: "width" | "height"; - /** - the quality of the resized image. This must be a decimal number between 0.00 to 1.00. - Defaults to 0.92. - */ - resizeImageQuality?: number; - /** - the default image mime type of the converted image after resize. - Defaults to image/jpeg. - */ - resizeDefaultImageType?: string; - /** - the maximum file size for upload in KB. - If set to 0, it means size allowed is unlimited. - Defaults to 0. - */ - maxFileSize?: number; - /** - the minimum number of files allowed for each multiple upload. - If set to 0, it means number of files are optional. - Defaults to 0. - */ - minFileCount?: number; - /** - the maximum number of files allowed for each multiple upload. - If set to 0, it means number of files allowed is unlimited. - Defaults to 0. - */ - maxFileCount?: number; - /** - whether to include initial preview file count (server uploaded files) in validating minFileCount and maxFileCount. - Defaults to false. - */ - validateInitialCount?: boolean; - /** - the message that will be displayed when ZERO files are found. - Defaults to No. - */ - msgNo?: string; - /** - the message that will be displayed within the progress bar when file upload is aborted or cancelled. - Defaults to Cancelled. - */ - msgCancelled?: string; - /** - the title displayed (before the file name) on hover of the zoom button for zooming the file content in a modal window. - This is currently applicable only for text file previews. - Defaults to View details. - */ - msgZoomTitle?: string; - /** - the heading of the modal dialog that displays the zoomed file content. - This is currently applicable only for text file previews. - Defaults to Detailed Preview. - */ - msgZoomModalHeading?: string; - /** - the message to be displayed when the file size exceeds maximum size. - Defaults to: - File "{name}" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB. Please retry your upload! - where: - {name}: will be replaced by the file name being uploaded - {size}: will be replaced by the uploaded file size - {maxSize}: will be replaced by the maxFileSize parameter. - */ - msgSizeTooLarge?: string; - /** - message to be displayed when the file count is less than the minimum count as set in minFileCount. - Defaults to: - You must select at least {n} {files} to upload. Please retry your upload! - where: - {n}: will be replaced by the allowed minimum files as set in minFileCount. - {files}: will be replaced with fileSingle or filePlural properties in locale file depending on the minFileCount. - */ - msgFilesTooLess?: string; - /** - the message to be displayed when the file count exceeds maximum count as set in maxFileCount. - Defaults to: - Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}. Please retry your upload! - where: - {n}: will be replaced by number of files selected for upload - {m}: will be replaced by the allowed maximum files as set in maxFileCount - */ - msgFilesTooMany?: string; - /** - the exception message to be displayed when the file selected is not found by the FileReader. - Defaults to: - File "{name}" not found! - where: - {name}: will be replaced by the file name being uploaded - */ - msgFileNotFound?: string; - /** - the exception message to be displayed when the file selected is not allowed to be accessed due to a security exception. - Defaults to: - Security restrictions prevent reading the file "{name}". - where: - {name}: will be replaced by the file name being uploaded - */ - msgFileSecured?: string; - /** - the exception message to be displayed when the file selected is not readable by the FileReader API. - Defaults to: - File "{name}" is not readable. - where: - {name}: will be replaced by the file name being uploaded - */ - msgFileNotReadable?: string; - /** - the exception message to be displayed when the file preview upload is aborted. - Defaults to: - File preview aborted for "{name}". - where: - {name}: will be replaced by the file name being uploaded - */ - msgFilePreviewAborted?: string; - /** - the exception message to be displayed for any other error when previewing the file. - Defaults to: - An error occurred while reading the file "{name}". - where: - {name}: will be replaced by the file name being uploaded - */ - msgFilePreviewError?: string; - /** - the message to be displayed when the file type is not in one of the file types set in allowedFileTypes. - Defaults to: - Invalid type for file "{name}". Only "{types}" files are supported. - where: - {name}: will be replaced by the file name being uploaded - {types}: will be replaced by the comma separated list of types defined in allowedFileTypes. - */ - msgInvalidFileType?: string; - /** - the message to be displayed when the file type is not in one of the file extensions set in allowedFileExtensions. - Defaults to: - Invalid extension for file "{name}". Only "{extensions}" files are supported. - where: - {name}: will be replaced by the file name being uploaded - {extensions}: will be replaced by the comma separated list of extensions defined in allowedFileExtensions. - */ - msgInvalidFileExtension?: string; - /** - the message to be displayed when an ongoing ajax file upload is aborted by pressing the Cancel button. - Defaults to The file upload was aborted. - If this is set to null or empty, the internal ajax error message will be displayed - Defaults to File Upload Error. - */ - msgUploadAborted?: string; - /** - the exception message to be displayed within the caption container (instead of msgFilesSelected), when a validation error is encountered. - Defaults to File Upload Error. - */ - msgValidationError?: string; - /** - the css class for the validation error message displayed in the caption container. - Defaults to text-danger. - */ - msgValidationErrorClass?: string; - /** - the icon to be displayed before the validation error in the caption container. - Defaults to - */ - msgValidationErrorIcon?: string; - /** - the css class for the error message to be displayed in the preview window when the file size exceeds maxSize. - Defaults to file-error-message. - */ - msgErrorClass?: string; - /** - the message displayed when the files are getting read and loaded for preview. - Defaults to - Loading file {index} of {files} … - The following special variables will be replaced: - {index}: the sequence number of the current file being loaded. - {files}: the total number of files selected for upload. - */ - msgLoading?: string; - /** - the progress message displayed as each file is loaded for preview. - Defaults to: - Loading file {index} of {files} - {name} - {percent}% completed. - The following variables will be replaced: - {index}: the sequence number of the current file being loaded. - {files}: the total number of files selected for upload. - {percent}: the percentage of file read and loaded. - {name}: the name of the current file being loaded. - */ - msgProgress?: string; - /** - the progress message displayed in caption window when multiple (more than one) files are selected. - Defaults to: - {n} files selected. - The following variables will be replaced: - {n}: the number of files selected. - */ - msgSelected?: string; - /** - the message displayed when a folder has been dragged to the drop zone. - Defaults to: - Drag & drop files only! {n} folder(s) dropped were skipped. - The following variables will be replaced: - {n}: the number of folders dropped. - */ - msgFoldersNotAllowed?: string; - /** - the exception message to be displayed when the file selected for preview is an image and its width is less than the minImageWidth setting. - Defaults to: - Width of image file "{name}" must be at least {size} px. - where: - {name}: will be replaced by the file name being uploaded. - {size}: will be replaced by the minImageWidth setting. - */ - msgImageWidthSmall?: string; - /** - the exception message to be displayed when the file selected for preview is an image and its height is less than the minImageHeight setting. - Defaults to: - Height of image file "{name}" must be at least {size} px. - where: - {name}: will be replaced by the file name being uploaded. - {size}: will be replaced by the minImageHeight setting. - */ - msgImageHeightSmall?: string; - /** - the exception message to be displayed when the file selected for preview is an image and its width exceeds the maxImageWidth setting. - Defaults to: - Width of image file "{name}" cannot exceed {size} px. - where: - {name}: will be replaced by the file name being uploaded. - {size}: will be replaced by the maxImageWidth setting. - */ - msgImageWidthLarge?: string; - /** - the exception message to be displayed when the file selected for preview is an image and its height exceeds the maxImageHeight setting. - Defaults to: - Height of image file "{name}" cannot exceed {size} px. - where: - {name}: will be replaced by the file name being uploaded. - {size}: will be replaced by the maxImageHeight setting. - */ - msgImageHeightLarge?: string; - /** - the upload progress bar CSS class to be applied when AJAX upload is in process (applicable only for ajax uploads). - Defaults to progress-bar progress-bar-success progress-bar-striped active. - */ - progressClass?: string; - /** - the upload progress bar CSS class to be applied when AJAX upload is in process (applicable only for ajax uploads). - Defaults to progress-bar progress-bar-success progress-bar-striped active. - */ - progressCompleteClass?: string; - /** - the upload progress bar CSS class to be applied when AJAX upload is cancelled or aborted. - Defaults to progress-bar progress-bar-danger. - */ - progressErrorClass?: string; - /** - the type of files that are to be displayed in the preview window. - Defaults to image. - Can be one of the following: - image: Only image type files will be shown in preview. - text: Only text type files will be shown in preview. - any: Both image and text files content will be shown in preview. - Files other than image or text will be displayed as a thumbnail with the filename in the preview window. - */ - previewFileType?: "image" | "text" | "any"; - /** - the icon for zooming the file content in a new modal dialog. - This is currently applicable only for text file previews. - Defaults to - */ - zoomIndicator?: string; - /** - the identifier for the container element displaying the error (e.g. '#id'). - If not set, will default to the container with CSS class kv-fileinput-error inside the preview container (identified by elPreviewContainer). - The msgErrorClass will be automatically appended to this container before displaying the error. - */ - elErrorContainer?: string; - /** - the identifier for the container element containing the caption (e.g. '#id'). - If not set, will default to the container with CSS class file-caption inside the main plugin container. - */ - elCaptionContainer?: string; - /** - the identifier for the container element containing the caption text (e.g. '#id'). - If not set, will default to the container with CSS class file-caption-name inside the main plugin container. - */ - elCaptionText?: string; - /** - the identifier for the container element containing the preview (e.g. '#id'). - If not set, will default to the container with CSS class file-preview inside the main plugin container. - */ - elPreviewContainer?: string; - /** - the identifier for the element containing the preview image thumbnails (e.g. '#id'). - If not set, will default to the container with CSS class file-preview-thumbnails inside the main plugin container. - */ - elPreviewImage?: string; - /** - the identifier for the element containing the preview progress status (e.g. '#id'). - If not set, will default to the container with CSS class file-preview-status inside the main plugin container. - */ - elPreviewStatus?: string; - /** - a callback to convert the filename as a slug string eliminating special characters. - If not set, it will use the plugin's own internal slugDefault method. - This callback function includes the filename as parameter and must return a converted filename string. - */ - slugCallback?: (filename: string) => string; - /** - whether to enable a drag and drop zone for dragging and dropping files to. - This is available only for ajax based uploads. - Defaults to true. - */ - dropZoneEnabled?: boolean; - /** - title to be displayed in the drag and drop zone. - This is available only for ajax based uploads. - Defaults to: - Drag & drop files here …. - */ - dropZoneTitle?: string; - /** - CSS class for the drag & drop zone title. - Defaults to file-drop-zone-title. - */ - dropZoneTitleClass?: string; - /** - configuration for setting up file actions for newly selected file thumbnails in the preview window. - */ - fileActionsettings?: IFileUploadFileActionSettings; - /** - markup for additional action buttons to display within the initial preview thumbnails (for example displaying an image edit button). - The following tag can be used in the markup and will be automatically replaced: - {dataKey}: Will be replaced with the key set within initialPreviewConfig. - */ - otherActionButtons?: string; - /** - the encoding to be used while reading a text file. - Applicable only for previewing text files. - Defaults to UTF-8. - */ - textEncoding?: string; - /** - additional ajax settings to pass to the plugin before submitting the ajax request for upload. - Applicable only for ajax uploads. - This can be useful to pass additional tokens to headers or one can use it for setting other ajax options for advanced cases. - Refer the jQuery ajax documentation for the various settings you can configure. - */ - ajaxSettings?: JQueryAjaxSettings; - /** - additional ajax settings to pass to the plugin before submitting the delete ajax request in each initial preview thumbnail. - Applicable only for ajax uploads. - This can be useful to pass additional tokens to headers or one can use it for setting other ajax options for advanced cases. - Refer the jQuery ajax documentation for the various settings you can configure. - */ - ajaxDeleteSettings?: JQueryAjaxSettings; - /** - whether to show details of the error stack from the server log when an error is encountered via ajax response. - Defaults to true. - */ - showAjaxErrorDetails?: boolean; -} -interface IFileUploadPreviewConfig { - /** - the caption or filename to display for each initial preview item content. - */ - caption: string; - /** - the CSS width of the image/ content displayed. - */ - width: string; - /** - the URL for deleting the image/ content in the initial preview via AJAX post response.This will default to deleteUrl if not set. - */ - url: string; - /** - the key that will be passed as data to the url via AJAX POST. - */ - key: string | {}; - /** - the additional frame css class to set for the file's thumbnail frame. - */ - frameClass: string; - /** - the HTML attribute settings (set as key:value pairs) for the thumbnail frame. - */ - frameAttr: {}; - /** - the extra data that will be passed as data to the initial preview delete url / AJAX server call via POST.This will default to deleteExtraData if not set. - */ - extra: {} | Function; -} +declare module BootstrapFileInput { + interface FileInputOptions { + /** + Language configuration for the plugin to enable the plugin to display messages for your locale (you must set the ISO code for the language). + You can have multiple language widgets on the same page. + The locale JS file for the language code must be defined as mentioned in the translations section: http://plugins.krajee.com/file-input#translations + */ + language?: string; + /** + Whether to display the file caption. + Defaults to true. + */ + showCaption?: boolean; + /** + Whether to display the file preview. + Defaults to true. + */ + showPreview?: boolean; + /** + Whether to display the file remove/clear button. + Defaults to true. + */ + showRemove?: boolean; + /** + Whether to display the file upload button. + Defaults to true. + This will default to a form submit button, unless the uploadUrl is specified. + */ + showUpload?: boolean; + /** + Whether to display the file upload cancel button. + Defaults to true. + This will be only enabled and displayed when an AJAX upload is in process. + */ + showCancel?: boolean; + /** + Whether to display the close icon in the preview. + Defaults to true. + This will be only parsed when showPreview is true or when you are using the {close} tag in your preview templates. + */ + showClose?: boolean; + /** + Whether to persist display of the uploaded file thumbnails in the preview window (for ajax uploads) until the remove/clear button is pressed. + Defaults to true. + When set to false, a next batch of files selected for upload will clear these thumbnails from preview. + */ + showUploadedThumbs?: boolean; + /** + Whether to automatically replace the files in the preview after the maxFileCount limit is reached and a new set of file(s) is/are selected. + This will only work if a valid maxFileCount is set. + Defaults to false. + */ + autoReplace?: boolean; + /** + Any additional CSS class to append to the caption container. + */ + captionClass?: string; + /** + Any additional CSS class to append to the preview container. + */ + previewClass?: string; + /** + Any additional CSS class to append to the main plugin container. + */ + mainClass?: string; + /** + The initial preview content to be displayed. + You can pass the minimal HTML markup for displaying your image, text, or file. + If set as a string, this will display a single file in the initial preview if there is no delimiter. You can set a delimiter (as defined in initialDelimiter) to show multiple files in initial preview. + If set as an array, it will display all files in the array as an initial preview (useful for multiple file upload scenarios). + The following CSS classes will need to be added for displaying each file type as per the plugin style theme: + image files: Include CSS class file-preview-image + text files: Include CSS class file-preview-text + other files: Include CSS class file-preview-other + */ + initialPreview?: string | any[]; + /** + the count of initial preview items that will be added to the count of files selected in preview. This is applicable when displaying the right caption, when overwriteInitial is set to false. + */ + initialPreviewCount?: number; + /** + the delimiter to be used for splitting the initial preview content as individual file thumbnails (applicable only if initialPreview is passed as a string instead of array). Defaults to *$$*. + */ + initialPreviewDelimiter?: string; + /** + the configuration for setting up important properties for each initialPreview item (that is setup as part of initialPreview). + */ + initialPreviewConfig?: PreviewConfig[]; + /** + whether the delete button will be displayed for each thumbnail that has been created with initialPreview. + */ + initialPreviewShowDelete?: boolean; + /** + whether the file thumbnail should be removed from preview on error. Defaults to false. + */ + removeFromPreviewOnError?: boolean; + /** + this will be a list of tags used in thumbnail templates that will be replaced dynamically within the thumbnail markup, when the thumbnail is rendered. + */ + previewThumbTags?: { [key: string]: string; } + /** + this is an extension of previewThumbTags specifically for initial preview content - but will be configured as an array of objects corresponding to each initial preview thumbnail. The initial preview thumbnails set via initialPreview will read this configuration for replacing tags. + */ + initialPreviewThumbTags?: { [key: string]: string; } + /** + the extra data that will be passed as data to the initial preview delete url/AJAX server call via POST. + This will be overridden by the initialPreviewConfig['extra'] property. + This property is only applicable for ajax deletions in initial preview and when you have set a value for initialPreviewConfig['url'] or deleteUrl. + This can be setup either as an object (associative array of keys and values) or as a function callback. + Note + The ajax delete action will send the following data to server via POST: + key: the key setting as setup in initialPreviewConfig['key'] + any other extra data passed as key: value pairs either via initialPreviewConfig['extra'] OR deleteExtraData if former is not set. + */ + deleteExtraData?: {} | { (): {} }; + /** + the URL for deleting the image/content in the initial preview via AJAX post response. This will be overridden by the initialPreviewConfig['url'] property. + Note + The ajax delete action will send the following data to server via POST: + key: the key setting as setup in initialPreviewConfig['key'] + any other extra data passed as key: value pairs either via initialPreviewConfig['extra'] OR deleteExtraData if former is not set. + */ + deleteUrl?: string; + /** + the initial preview caption text to be displayed. + If you do not set a value here and initialPreview is set to true this will default to "{preview-file-count} files selected", where {preview-file-count} is the count of the files passed in initialPreview. + */ + initialCaption?: string; + /** + whether you wish to overwrite the initial preview content and caption setup. + This defaults to true, whereby, any initialPreview content set will be overwritten, when new file is uploaded or when files are cleared. + Setting it to false will help displaying a saved image or file from database always - useful especially when using the multiple file upload feature. + */ + overwriteInitial?: boolean; + /** + the templates configuration for rendering each part of the layout. + */ + layoutTemplates?: LayoutTemplates; + /** + the templates configuration for rendering each preview file type. + */ + previewTemplates?: PreviewTemplates; + /** + the list of allowed file types for upload. + This by default is set to null which means the plugin supports all file types for upload. + If an invalid file type is found, then a validation error message as set in msgInvalidFileType will be raised. + Note: + You need to be careful in case you are setting both allowedFileTypes and allowedFileExtensions. In this case, the allowedFileTypes property is validated first and generally precedes the allowedFileExtensions setting (and the latter validation maybe skipped). + */ + allowedFileTypes?: ("image" | "html" | "text" | "video" | "audio" | "flash" | "object")[]; + /** + the list of allowed file extensions for upload. + This by default is set to null which means the plugin supports all file extensions for upload. + If an invalid file extension is found, then a validation error message as set in msgInvalidFileExtension will be raised. + Note: + You need to be careful in case you are setting both allowedFileTypes and allowedFileExtensions. In this case, the allowedFileTypes property is validated first and generally precedes the allowedFileExtensions setting (and the latter validation maybe skipped). + */ + allowedFileExtensions?: string[]; + /** + the list of allowed preview types for your widget. + This by default supports all file types for preview. + The plugin by default treats each file as an object if it does not match any of the previous types. + To disable this behavior, you can remove object from the list of allowedPreviewTypes OR fine tune it through allowedPreviewMimeTypes. + To disable content preview for all file-types and show the previewIcon instead as a thumbnail, set this to null, empty, or false. + */ + allowedPreviewTypes?: ("image" | "html" | "text" | "video" | "audio" | "flash" | "object")[]; + /** + the list of allowed mime types for preview. + This is set to null by default which means all possible mime types are allowed. + This setting works in combination with allowedPreviewTypes to filter only the needed file types allowed for preview. + */ + allowedPreviewMimeTypes?: string[]; + /** + the default content / markup to show by default in the preview window whenever the files are cleared or the input is cleared. + This can be useful for use cases like showing the default user profile picture or profile image before upload to overwrite. + This is a bit different from initialPreview in the sense, that the initialPreview content will always be displayed unless it is deleted or overwritten based on overwriteInitial. + The defaultPreviewContent on the other hand will only be shown ONLY on initialization OR whenever you clear the preview. + At other times when files have been selected this will be overwritten temporarily until file(s) selected is/are cleared. + This property can be useful to display for example a default user profile picture (or saved picture) in the preview window unless the user selects a picture. + */ + defaultPreviewContent?: string; + /** + the list of additional custom tags that will be replaced in the layout templates. + */ + customLayoutTags?: {}; + /** + the list of additional custom tags that will be replaced in the preview templates. + */ + customPreviewTags?: {}; + /** + the format settings (width and height) for rendering each preview file type. + */ + previewSettings?: PreviewSettings; + /** + the settings to validate and identify each file type when a file is selected for upload. + This is a list of callbacks, which accepts the file mime type and file name as a parameter. + */ + fileTypeSettings?: FileTypeSettings; + /** + the icon to be shown in each preview file thumbnail when an unreadable file type for preview is detected. Defaults to  . + */ + previewFileIcon?: string; + /** + the CSS class to be applied to the preview file icon container. Defaults to file-icon-4x. + */ + previewFileIconClass?: string; + /** + the preview icon markup settings for each file extension (type). + You need to set this as key: value pairs, where the key corresponds to a file extension (e.g. doc, docx, xls etc.), and the value corresponds to the markup of the icon to be rendered. + If this is not set OR a file extension is not set here, the preview will default to previewFileIcon. + Note that displaying the icons instead of file content is controlled via allowedPreviewTypes and allowedPreviewMimeTypes + */ + previewFileIconSettings?: PreviewFileIconSettings; + /** + the extensions to be auto derived for each file extension (type). + This is useful if you want to set the same icon for multiple file extension types. + You need to set this as `key: value` pairs, where the key corresponds to a file extension as set in previewFileIconSettings (e.g. doc, docx, xls etc.). + The value will be a function callback that accepts the following parameter: + ext: string, the file extension (without the . [dot]) of the file currently selected in the preview. + You can configure the callback to match the set of file extensions (via regex or similar) for each `key` and return a boolean output if the file extension matches. + */ + previewFileExtSettings?: PreviewFileExtSettings; + /** + the CSS class for the each of the button labels for browse, remove, upload, and cancel. + Defaults to hidden-xs, which automatically hides the button labels for small screen devices and renders as smaller iconic buttons to fit to the screen. + */ + buttonLabelClass?: string; + /** + the label to display for the file picker/browse button. Defaults to Browse …. + */ + browseLabel?: string; + /** + the icon to display before the label for the file picker/browse button. Defaults to  . + */ + browseIcon?: string; + /** + the CSS class for the file picker/browse button. Defaults to btn btn-primary. + */ + browseClass?: string; + /** + the label to display for the file remove button. Defaults to Remove. + */ + removeLabel?: string; + /** + the icon to display before the label for the file picker/remove button. Defaults to  . + */ + removeIcon?: string; + /** + the CSS class for the file remove button. Defaults to btn btn-default. + */ + removeClass?: string; + /** + the title to display on hover for the file remove button. Defaults to Clear selected files. + */ + removeTitle?: string; + /** + the label to display for the file upload button. Defaults to Upload. + */ + uploadLabel?: string; + /** + the icon to display before the label for the file upload button. Defaults to  . + */ + uploadIcon?: string; + /** + the CSS class for the file upload button. Defaults to btn btn-default. + */ + uploadClass?: string; + /** + the title to display on hover for the file remove button. + Defaults to Upload selected files. + */ + uploadTitle?: string; + /** + the URL for the upload processing action (typically for ajax based processing). + Defaults to null. + If this is not set or null, then the upload button action will default to form submission. + NOTE: + This is MANDATORY if you want to use advanced features like drag & drop, append/remove files, selectively upload files via ajax etc. + The plugin automatically send $_FILES data to the server with the input `name` attribute as the key if provided. + If input name is not set, the key defaults to file-data. + */ + uploadUrl?: string; + /** + whether the batch upload of multiple files will be asynchronous/in parallel. + Defaults to true. + */ + uploadAsync?: boolean; + /** + the extra data that will be passed as data to the url/AJAX server call via POST. + This property is only applicable for ajax uploads and when you have set a value for uploadUrl. + This can be setup either as an object (associative array of keys and values) or as a function callback. + As an object, it can be set for example as: + { id: 100, value: '100 Details' } + Note that for uploading individual file via thumbnail, the function callback can also receive the thumbnail previewId and index as parameters. These are described below: + previewId: the identifier for the preview file container (only available when uploading each thumbnail file) + index: the zero-based sequential index of the loaded file in the preview list (only available when uploading each thumbnail file) + */ + uploadExtraData?: {} | ((previewId?: string, index?: number) => {}); + /** + the minimum allowed image height in px if you are uploading image files. + Defaults to null which means no limit on image height. + */ + minImageHeight?: number; + /** + the maximum allowed image width in px if you are uploading image files. + Defaults to null which means no limit on image width. + Note that if you set resizeImage property to true, then the entire image will be resized within this width (depending on resizePreference). + */ + maxImageWidth?: number; + /** + the maximum allowed image height in px if you are uploading image files. + Defaults to null which means no limit on image height. + Note that if you set resizeImage property to true, then the entire image will be resized within this height (depending on resizePreference). + */ + maxImageHeight?: number; + /** + whether to add ability to resize uploaded images. Defaults to false. + Note that resizing images requires HTML5 canvas support which is supported on most modern browsers. + In addition, you must include the JavaScript-Canvas-to-Blob plugin by blueimp by including canvas-to-blob.js in your application. + This JS file must be loaded before fileinput.js on the page. + The JavaScript-Canvas-to-Blob source files are available in js/plugins folder of bootstrap-fileinput project page. + The canvas-to-blob.js plugin is a polyfill for canvas.toBlob method and is needed for allowing the resized image files via HTML5 canvas to be returned as a blob + */ + resizeImage?: boolean; + /** + preference to resize the image based on width or height. + Defaults to width. + This property is parsed only when resizeImage is true. + If set to width, the maxImageWidth property is first tested and if image size is greater than this, then the image is resized to maxImageWidth. + The image height is resized and adjusted in the same ratio as width. + In case, the image width is already less than maxImageWidth then the maxImageHeight property is used to resize and width is adjusted in same ratio. + This will behave conversely, when resizePreference is set to height - the maxImageHeight will be first tested against image height and then the rest of steps will be similarly parsed with preference given to height instead of width as before. + */ + resizePreference?: "width" | "height"; + /** + the quality of the resized image. This must be a decimal number between 0.00 to 1.00. + Defaults to 0.92. + */ + resizeImageQuality?: number; + /** + the default image mime type of the converted image after resize. + Defaults to image/jpeg. + */ + resizeDefaultImageType?: string; + /** + the maximum file size for upload in KB. + If set to 0, it means size allowed is unlimited. + Defaults to 0. + */ + maxFileSize?: number; + /** + the minimum number of files allowed for each multiple upload. + If set to 0, it means number of files are optional. + Defaults to 0. + */ + minFileCount?: number; + /** + the maximum number of files allowed for each multiple upload. + If set to 0, it means number of files allowed is unlimited. + Defaults to 0. + */ + maxFileCount?: number; + /** + whether to include initial preview file count (server uploaded files) in validating minFileCount and maxFileCount. + Defaults to false. + */ + validateInitialCount?: boolean; + /** + the message that will be displayed when ZERO files are found. + Defaults to No. + */ + msgNo?: string; + /** + the message that will be displayed within the progress bar when file upload is aborted or cancelled. + Defaults to Cancelled. + */ + msgCancelled?: string; + /** + the title displayed (before the file name) on hover of the zoom button for zooming the file content in a modal window. + This is currently applicable only for text file previews. + Defaults to View details. + */ + msgZoomTitle?: string; + /** + the heading of the modal dialog that displays the zoomed file content. + This is currently applicable only for text file previews. + Defaults to Detailed Preview. + */ + msgZoomModalHeading?: string; + /** + the message to be displayed when the file size exceeds maximum size. + Defaults to: + File "{name}" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB. Please retry your upload! + where: + {name}: will be replaced by the file name being uploaded + {size}: will be replaced by the uploaded file size + {maxSize}: will be replaced by the maxFileSize parameter. + */ + msgSizeTooLarge?: string; + /** + message to be displayed when the file count is less than the minimum count as set in minFileCount. + Defaults to: + You must select at least {n} {files} to upload. Please retry your upload! + where: + {n}: will be replaced by the allowed minimum files as set in minFileCount. + {files}: will be replaced with fileSingle or filePlural properties in locale file depending on the minFileCount. + */ + msgFilesTooLess?: string; + /** + the message to be displayed when the file count exceeds maximum count as set in maxFileCount. + Defaults to: + Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}. Please retry your upload! + where: + {n}: will be replaced by number of files selected for upload + {m}: will be replaced by the allowed maximum files as set in maxFileCount + */ + msgFilesTooMany?: string; + /** + the exception message to be displayed when the file selected is not found by the FileReader. + Defaults to: + File "{name}" not found! + where: + {name}: will be replaced by the file name being uploaded + */ + msgFileNotFound?: string; + /** + the exception message to be displayed when the file selected is not allowed to be accessed due to a security exception. + Defaults to: + Security restrictions prevent reading the file "{name}". + where: + {name}: will be replaced by the file name being uploaded + */ + msgFileSecured?: string; + /** + the exception message to be displayed when the file selected is not readable by the FileReader API. + Defaults to: + File "{name}" is not readable. + where: + {name}: will be replaced by the file name being uploaded + */ + msgFileNotReadable?: string; + /** + the exception message to be displayed when the file preview upload is aborted. + Defaults to: + File preview aborted for "{name}". + where: + {name}: will be replaced by the file name being uploaded + */ + msgFilePreviewAborted?: string; + /** + the exception message to be displayed for any other error when previewing the file. + Defaults to: + An error occurred while reading the file "{name}". + where: + {name}: will be replaced by the file name being uploaded + */ + msgFilePreviewError?: string; + /** + the message to be displayed when the file type is not in one of the file types set in allowedFileTypes. + Defaults to: + Invalid type for file "{name}". Only "{types}" files are supported. + where: + {name}: will be replaced by the file name being uploaded + {types}: will be replaced by the comma separated list of types defined in allowedFileTypes. + */ + msgInvalidFileType?: string; + /** + the message to be displayed when the file type is not in one of the file extensions set in allowedFileExtensions. + Defaults to: + Invalid extension for file "{name}". Only "{extensions}" files are supported. + where: + {name}: will be replaced by the file name being uploaded + {extensions}: will be replaced by the comma separated list of extensions defined in allowedFileExtensions. + */ + msgInvalidFileExtension?: string; + /** + the message to be displayed when an ongoing ajax file upload is aborted by pressing the Cancel button. + Defaults to The file upload was aborted. + If this is set to null or empty, the internal ajax error message will be displayed - Defaults to File Upload Error. + */ + msgUploadAborted?: string; + /** + the exception message to be displayed within the caption container (instead of msgFilesSelected), when a validation error is encountered. + Defaults to File Upload Error. + */ + msgValidationError?: string; + /** + the css class for the validation error message displayed in the caption container. + Defaults to text-danger. + */ + msgValidationErrorClass?: string; + /** + the icon to be displayed before the validation error in the caption container. + Defaults to + */ + msgValidationErrorIcon?: string; + /** + the css class for the error message to be displayed in the preview window when the file size exceeds maxSize. + Defaults to file-error-message. + */ + msgErrorClass?: string; + /** + the message displayed when the files are getting read and loaded for preview. + Defaults to + Loading file {index} of {files} … + The following special variables will be replaced: + {index}: the sequence number of the current file being loaded. + {files}: the total number of files selected for upload. + */ + msgLoading?: string; + /** + the progress message displayed as each file is loaded for preview. + Defaults to: + Loading file {index} of {files} - {name} - {percent}% completed. + The following variables will be replaced: + {index}: the sequence number of the current file being loaded. + {files}: the total number of files selected for upload. + {percent}: the percentage of file read and loaded. + {name}: the name of the current file being loaded. + */ + msgProgress?: string; + /** + the progress message displayed in caption window when multiple (more than one) files are selected. + Defaults to: + {n} files selected. + The following variables will be replaced: + {n}: the number of files selected. + */ + msgSelected?: string; + /** + the message displayed when a folder has been dragged to the drop zone. + Defaults to: + Drag & drop files only! {n} folder(s) dropped were skipped. + The following variables will be replaced: + {n}: the number of folders dropped. + */ + msgFoldersNotAllowed?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its width is less than the minImageWidth setting. + Defaults to: + Width of image file "{name}" must be at least {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the minImageWidth setting. + */ + msgImageWidthSmall?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its height is less than the minImageHeight setting. + Defaults to: + Height of image file "{name}" must be at least {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the minImageHeight setting. + */ + msgImageHeightSmall?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its width exceeds the maxImageWidth setting. + Defaults to: + Width of image file "{name}" cannot exceed {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the maxImageWidth setting. + */ + msgImageWidthLarge?: string; + /** + the exception message to be displayed when the file selected for preview is an image and its height exceeds the maxImageHeight setting. + Defaults to: + Height of image file "{name}" cannot exceed {size} px. + where: + {name}: will be replaced by the file name being uploaded. + {size}: will be replaced by the maxImageHeight setting. + */ + msgImageHeightLarge?: string; + /** + the upload progress bar CSS class to be applied when AJAX upload is in process (applicable only for ajax uploads). + Defaults to progress-bar progress-bar-success progress-bar-striped active. + */ + progressClass?: string; + /** + the upload progress bar CSS class to be applied when AJAX upload is in process (applicable only for ajax uploads). + Defaults to progress-bar progress-bar-success progress-bar-striped active. + */ + progressCompleteClass?: string; + /** + the upload progress bar CSS class to be applied when AJAX upload is cancelled or aborted. + Defaults to progress-bar progress-bar-danger. + */ + progressErrorClass?: string; + /** + the type of files that are to be displayed in the preview window. + Defaults to image. + Can be one of the following: + image: Only image type files will be shown in preview. + text: Only text type files will be shown in preview. + any: Both image and text files content will be shown in preview. + Files other than image or text will be displayed as a thumbnail with the filename in the preview window. + */ + previewFileType?: "image" | "text" | "any"; + /** + the icon for zooming the file content in a new modal dialog. + This is currently applicable only for text file previews. + Defaults to + */ + zoomIndicator?: string; + /** + the identifier for the container element displaying the error (e.g. '#id'). + If not set, will default to the container with CSS class kv-fileinput-error inside the preview container (identified by elPreviewContainer). + The msgErrorClass will be automatically appended to this container before displaying the error. + */ + elErrorContainer?: string; + /** + the identifier for the container element containing the caption (e.g. '#id'). + If not set, will default to the container with CSS class file-caption inside the main plugin container. + */ + elCaptionContainer?: string; + /** + the identifier for the container element containing the caption text (e.g. '#id'). + If not set, will default to the container with CSS class file-caption-name inside the main plugin container. + */ + elCaptionText?: string; + /** + the identifier for the container element containing the preview (e.g. '#id'). + If not set, will default to the container with CSS class file-preview inside the main plugin container. + */ + elPreviewContainer?: string; + /** + the identifier for the element containing the preview image thumbnails (e.g. '#id'). + If not set, will default to the container with CSS class file-preview-thumbnails inside the main plugin container. + */ + elPreviewImage?: string; + /** + the identifier for the element containing the preview progress status (e.g. '#id'). + If not set, will default to the container with CSS class file-preview-status inside the main plugin container. + */ + elPreviewStatus?: string; + /** + a callback to convert the filename as a slug string eliminating special characters. + If not set, it will use the plugin's own internal slugDefault method. + This callback function includes the filename as parameter and must return a converted filename string. + */ + slugCallback?: (filename: string) => string; + /** + whether to enable a drag and drop zone for dragging and dropping files to. + This is available only for ajax based uploads. + Defaults to true. + */ + dropZoneEnabled?: boolean; + /** + title to be displayed in the drag and drop zone. + This is available only for ajax based uploads. + Defaults to: + Drag & drop files here …. + */ + dropZoneTitle?: string; + /** + CSS class for the drag & drop zone title. + Defaults to file-drop-zone-title. + */ + dropZoneTitleClass?: string; + /** + configuration for setting up file actions for newly selected file thumbnails in the preview window. + */ + fileActionsettings?: FileActionSettings; + /** + markup for additional action buttons to display within the initial preview thumbnails (for example displaying an image edit button). + The following tag can be used in the markup and will be automatically replaced: + {dataKey}: Will be replaced with the key set within initialPreviewConfig. + */ + otherActionButtons?: string; + /** + the encoding to be used while reading a text file. + Applicable only for previewing text files. + Defaults to UTF-8. + */ + textEncoding?: string; + /** + additional ajax settings to pass to the plugin before submitting the ajax request for upload. + Applicable only for ajax uploads. + This can be useful to pass additional tokens to headers or one can use it for setting other ajax options for advanced cases. + Refer the jQuery ajax documentation for the various settings you can configure. + */ + ajaxSettings?: JQueryAjaxSettings; + /** + additional ajax settings to pass to the plugin before submitting the delete ajax request in each initial preview thumbnail. + Applicable only for ajax uploads. + This can be useful to pass additional tokens to headers or one can use it for setting other ajax options for advanced cases. + Refer the jQuery ajax documentation for the various settings you can configure. + */ + ajaxDeleteSettings?: JQueryAjaxSettings; + /** + whether to show details of the error stack from the server log when an error is encountered via ajax response. + Defaults to true. + */ + showAjaxErrorDetails?: boolean; + } -interface IFileUploadLayoutTemplates { - /** - the template for rendering the widget with caption. - The following tags will be parsed and replaced automatically: - {class}: the CSS class as set in the mainClass property. - {close}: will be replaced with the close (cross) icon (by default on top right of the preview window). The layout template to control this markup is layoutTemplates.close. - {preview}: the content parsed by the previewTemplate and will be displayed only if showPreview is true. - {caption}: the content parsed by the captionTemplate and will be displayed only if showCaption is true. - {remove}: the file remove/clear button and will be displayed only if showRemove is true. - {upload}: the file upload button and will be displayed only if showUpload is true. - {cancel}: the file upload cancel button that will be displayed when AJAX upload is in process to abort the AJAX upload. - {browse}: the main file browse button to select your files for input. - */ - main1?: string; - /** - the template for rendering the widget without caption. - The following tags will be parsed and replaced automatically: - {class}: the CSS class as set in the mainClass property. - {close}: will be replaced with the close (cross) icon (by default on top right of the preview window). The layout template to control this markup is layoutTemplates.close. - {preview}: the content parsed by the previewTemplate and will be displayed only if showPreview is true. - {caption}: the content parsed by the captionTemplate and will be displayed only if showCaption is true. - {remove}: the file remove/clear button and will be displayed only if showRemove is true. - {upload}: the file upload button and will be displayed only if showUpload is true. - {cancel}: the file upload cancel button that will be displayed when AJAX upload is in process to abort the AJAX upload. - {browse}: the main file browse button to select your files for input. - */ - main2?: string; - /** - the template for rendering the preview. - The following tags will be parsed and replaced automatically: - {class}: the CSS class as set in the previewClass property. - */ - preview?: string; - /** - the icon to render before the caption text. - */ - icon?: string; - /** - the template for rendering the caption. - The following tags will be parsed and replaced automatically: - {class}: the CSS class as set in the captionClass property. - */ - caption?: string; - /** - the template for rendering the modal (for text file preview zooming). - */ - modal?: string; - /** - the template for the progress bar when upload is in progress (for batch/mass uploads and within each preview thumbnail for async/single uploads). - The upload progress bar when displayed within each thumbnail will be wrapped inside a container having a CSS class of `file-thumb-progress`. - The following tags will be parsed and replaced automatically: - {percent}: will be replaced with the upload progress percentage. - */ - progress?: string; - /** - the template for the footer section of each file preview thumbnail. - The following tags will be parsed and replaced automatically: - {actions}: will be replaced with the output of the actions template. - {class}: the CSS class as set in the progressClass or progressCompleteClass property (depending on the progress percentage). - */ - footer?: string; - /** - the template for the file action buttons to be displayed within the thumbnail footer. - The following tags will be parsed and replaced automatically: - {upload}: will be replaced with the output of the actionUpload template. - {delete}: will be replaced with the output of the actionDelete template. - */ - actions?: string; - /** - the template for the file delete action button within the thumbnail footer. - The following tags will be parsed and replaced automatically: - {removeClass}: the css class for the remove button. Will be replaced with the removeClass set within fileActionSettings. - {removeIcon}: the icon for the remove button. Will be replaced with the removeIcon set within fileActionSettings. - {removeTitle}: the title to display on hover for the remove button. Will be replaced with the removeTitle set within fileActionSettings. - {dataUrl}: the URL for deleting the file thumbnail for initialPreview content only. Will be replaced with the url set within initialPreviewConfig. - {dataKey}: the key (additional data) that will be passed to the URL above via POST to the AJAX call. Will be replaced with the key set within initialPreviewConfig. - */ - actionDelete?: string; - /** - the template for the file upload action button within the thumbnail footer. - The following tags will be parsed and replaced automatically: - {uploadClass}: the css class for the upload button. Will be replaced with the uploadClass set within fileActionSettings. - {uploadIcon}: the icon for the upload button. Will be replaced with the uploadIcon set within fileActionSettings. - {uploadTitle}: the title to display on hover for the upload button. Will be replaced with the uploadTitle set within fileActionSettings. - */ - actionUpload?: string; - /** - The template for upload, remove, and cancel buttons. - The following tags will be parsed and replaced automatically: - {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. - {title}: the title to display on button hover. - {css}: the CSS class for the button. This is derived from settings for uploadClass or removeClass or cancelClass. - {status}: the disabled status for the button if available (else will be blank). - {icon}: the button icon as identified by uploadIcon or removeIcon or cancelIcon. - {label}: the button label as identified by uploadLabel or removeLabel or cancelLabel. - */ - btnDefault?: string; - /** - The template for upload button when used with ajax (i.e. when uploadUrl is set). - The following tags will be parsed and replaced automatically: - {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. - {title}: the title to display on button hover. - {css}: the CSS class for the button. This is derived from settings for uploadClass. - {status}: the disabled status for the button if available (else will be blank). - {icon}: the button icon as identified by uploadIcon. - {label}: the button label as identified by uploadLabel. - {href}: applicable only for Upload button for ajax uploads and will be replaced with the uploadUrl property. - */ - btnLink?: string; - /** - The template for the browse button. - {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. - {title}: the title to display on button hover. - {css}: the CSS class for the button. This is derived from settings for browseClass. - {status}: the disabled status for the button if available (else will be blank). - {icon}: the button icon as identified by browseIcon. - {label}: the button label as identified by browseLabel. - */ - btnBrowse?: string; -} + interface PreviewConfig { + /** + the caption or filename to display for each initial preview item content. + */ + caption: string; + /** + the CSS width of the image/ content displayed. + */ + width: string; + /** + the URL for deleting the image/ content in the initial preview via AJAX post response.This will default to deleteUrl if not set. + */ + url: string; + /** + the key that will be passed as data to the url via AJAX POST. + */ + key: string | {}; + /** + the additional frame css class to set for the file's thumbnail frame. + */ + frameClass: string; + /** + the HTML attribute settings (set as key:value pairs) for the thumbnail frame. + */ + frameAttr: {}; + /** + the extra data that will be passed as data to the initial preview delete url / AJAX server call via POST.This will default to deleteExtraData if not set. + */ + extra: {} | Function; + } -interface IFileUploadPreviewTemplates { - /** - the preview template for image files. - The following tags will be parsed and replaced automatically: - {previewId}: will be replaced with the generated identifier for the preview frame container. - {data}: will be replaced with the data source for each preview type. - {width}: will be replaced with the width for the file type as set in previewSettings. - {height}: will be replaced with the height for the file type as set in previewSettings. - {caption}: will be replaced with the file name. - {type}: will be replaced with the file type. - */ - image?: string; - /** - the preview template for text files. - The following tags will be parsed and replaced automatically: - {previewId}: will be replaced with the generated identifier for the preview frame container. - {data}: will be replaced with the data source for each preview type. - {width}: will be replaced with the width for the file type as set in previewSettings. - {height}: will be replaced with the height for the file type as set in previewSettings. - {caption}: will be replaced with the file name. - {type}: will be replaced with the file type. - {dialog}: Will be replaced with the JS code to launch the modal dialog. - {zoomTitle}: This will be replaced with the msgZoomTitle property. This is the title that is displayed on hover of the zoom button (which on clicking will display the text file). - {zoomInd}: This will be replaced with the zoomIndicator property. This is the title that is displayed on hover of the zoom button (which on clicking will display the text file). - {heading}: This represents the modal dialog heading title. This will be replaced with the msgZoomModalHeading property. - */ - text?: string; - /** - the preview template for html files. - The following tags will be parsed and replaced automatically: - {previewId}: will be replaced with the generated identifier for the preview frame container. - {data}: will be replaced with the data source for each preview type. - {width}: will be replaced with the width for the file type as set in previewSettings. - {height}: will be replaced with the height for the file type as set in previewSettings. - {caption}: will be replaced with the file name. - {type}: will be replaced with the file type. - */ - html?: string; - /** - the preview template for video files (supported by HTML 5 video tag). - The following tags will be parsed and replaced automatically: - {previewId}: will be replaced with the generated identifier for the preview frame container. - {data}: will be replaced with the data source for each preview type. - {width}: will be replaced with the width for the file type as set in previewSettings. - {height}: will be replaced with the height for the file type as set in previewSettings. - {caption}: will be replaced with the file name. - {type}: will be replaced with the file type. - */ - video?: string; - /** - the preview template for audio files (supported by HTML 5 audio tag). - The following tags will be parsed and replaced automatically: - {previewId}: will be replaced with the generated identifier for the preview frame container. - {data}: will be replaced with the data source for each preview type. - {width}: will be replaced with the width for the file type as set in previewSettings. - {height}: will be replaced with the height for the file type as set in previewSettings. - {caption}: will be replaced with the file name. - {type}: will be replaced with the file type. - */ - audio?: string; - /** - the preview template for flash files (supported currently on webkit browsers). - The following tags will be parsed and replaced automatically: - {previewId}: will be replaced with the generated identifier for the preview frame container. - {data}: will be replaced with the data source for each preview type. - {width}: will be replaced with the width for the file type as set in previewSettings. - {height}: will be replaced with the height for the file type as set in previewSettings. - {caption}: will be replaced with the file name. - {type}: will be replaced with the file type. - */ - flash?: string; - /** - the preview template for all other files - by default treated as object. To disable this behavior, configure the allowedPreviewTypes property. - The following tags will be parsed and replaced automatically: - {previewId}: will be replaced with the generated identifier for the preview frame container. - {data}: will be replaced with the data source for each preview type. - {width}: will be replaced with the width for the file type as set in previewSettings. - {height}: will be replaced with the height for the file type as set in previewSettings. - {caption}: will be replaced with the file name. - {type}: will be replaced with the file type. - */ - object?: string; - /** - this template is used ONLY for rendering the initialPreview markup content passed directly as a raw format. - The following tags will be parsed and replaced automatically: - {content}: will be replaced with the raw HTML markup as set in initialPreview.. - */ - generic?: string; -} + interface LayoutTemplates { + /** + the template for rendering the widget with caption. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the mainClass property. + {close}: will be replaced with the close (cross) icon (by default on top right of the preview window). The layout template to control this markup is layoutTemplates.close. + {preview}: the content parsed by the previewTemplate and will be displayed only if showPreview is true. + {caption}: the content parsed by the captionTemplate and will be displayed only if showCaption is true. + {remove}: the file remove/clear button and will be displayed only if showRemove is true. + {upload}: the file upload button and will be displayed only if showUpload is true. + {cancel}: the file upload cancel button that will be displayed when AJAX upload is in process to abort the AJAX upload. + {browse}: the main file browse button to select your files for input. + */ + main1?: string; + /** + the template for rendering the widget without caption. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the mainClass property. + {close}: will be replaced with the close (cross) icon (by default on top right of the preview window). The layout template to control this markup is layoutTemplates.close. + {preview}: the content parsed by the previewTemplate and will be displayed only if showPreview is true. + {caption}: the content parsed by the captionTemplate and will be displayed only if showCaption is true. + {remove}: the file remove/clear button and will be displayed only if showRemove is true. + {upload}: the file upload button and will be displayed only if showUpload is true. + {cancel}: the file upload cancel button that will be displayed when AJAX upload is in process to abort the AJAX upload. + {browse}: the main file browse button to select your files for input. + */ + main2?: string; + /** + the template for rendering the preview. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the previewClass property. + */ + preview?: string; + /** + the icon to render before the caption text. + */ + icon?: string; + /** + the template for rendering the caption. + The following tags will be parsed and replaced automatically: + {class}: the CSS class as set in the captionClass property. + */ + caption?: string; + /** + the template for rendering the modal (for text file preview zooming). + */ + modal?: string; + /** + the template for the progress bar when upload is in progress (for batch/mass uploads and within each preview thumbnail for async/single uploads). + The upload progress bar when displayed within each thumbnail will be wrapped inside a container having a CSS class of `file-thumb-progress`. + The following tags will be parsed and replaced automatically: + {percent}: will be replaced with the upload progress percentage. + */ + progress?: string; + /** + the template for the footer section of each file preview thumbnail. + The following tags will be parsed and replaced automatically: + {actions}: will be replaced with the output of the actions template. + {class}: the CSS class as set in the progressClass or progressCompleteClass property (depending on the progress percentage). + */ + footer?: string; + /** + the template for the file action buttons to be displayed within the thumbnail footer. + The following tags will be parsed and replaced automatically: + {upload}: will be replaced with the output of the actionUpload template. + {delete}: will be replaced with the output of the actionDelete template. + */ + actions?: string; + /** + the template for the file delete action button within the thumbnail footer. + The following tags will be parsed and replaced automatically: + {removeClass}: the css class for the remove button. Will be replaced with the removeClass set within fileActionSettings. + {removeIcon}: the icon for the remove button. Will be replaced with the removeIcon set within fileActionSettings. + {removeTitle}: the title to display on hover for the remove button. Will be replaced with the removeTitle set within fileActionSettings. + {dataUrl}: the URL for deleting the file thumbnail for initialPreview content only. Will be replaced with the url set within initialPreviewConfig. + {dataKey}: the key (additional data) that will be passed to the URL above via POST to the AJAX call. Will be replaced with the key set within initialPreviewConfig. + */ + actionDelete?: string; + /** + the template for the file upload action button within the thumbnail footer. + The following tags will be parsed and replaced automatically: + {uploadClass}: the css class for the upload button. Will be replaced with the uploadClass set within fileActionSettings. + {uploadIcon}: the icon for the upload button. Will be replaced with the uploadIcon set within fileActionSettings. + {uploadTitle}: the title to display on hover for the upload button. Will be replaced with the uploadTitle set within fileActionSettings. + */ + actionUpload?: string; + /** + The template for upload, remove, and cancel buttons. + The following tags will be parsed and replaced automatically: + {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. + {title}: the title to display on button hover. + {css}: the CSS class for the button. This is derived from settings for uploadClass or removeClass or cancelClass. + {status}: the disabled status for the button if available (else will be blank). + {icon}: the button icon as identified by uploadIcon or removeIcon or cancelIcon. + {label}: the button label as identified by uploadLabel or removeLabel or cancelLabel. + */ + btnDefault?: string; + /** + The template for upload button when used with ajax (i.e. when uploadUrl is set). + The following tags will be parsed and replaced automatically: + {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. + {title}: the title to display on button hover. + {css}: the CSS class for the button. This is derived from settings for uploadClass. + {status}: the disabled status for the button if available (else will be blank). + {icon}: the button icon as identified by uploadIcon. + {label}: the button label as identified by uploadLabel. + {href}: applicable only for Upload button for ajax uploads and will be replaced with the uploadUrl property. + */ + btnLink?: string; + /** + The template for the browse button. + {type}: the HTML button type, defaults to button for most buttons and submit for form based uploads. + {title}: the title to display on button hover. + {css}: the CSS class for the button. This is derived from settings for browseClass. + {status}: the disabled status for the button if available (else will be blank). + {icon}: the button icon as identified by browseIcon. + {label}: the button label as identified by browseLabel. + */ + btnBrowse?: string; + } -interface IFileUploadPreviewSettings { - image?: { width?: string; height?: string; }; - html?: { width?: string; height?: string; }; - text?: { width?: string; height?: string; }; - video?: { width?: string; height?: string; }; - audio?: { width?: string; height?: string; }; - flash?: { width?: string; height?: string; }; - object?: { width?: string; height?: string; }; - other?: { width?: string; height?: string; }; -} + interface PreviewTemplates { + /** + the preview template for image files. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + image?: string; + /** + the preview template for text files. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + {dialog}: Will be replaced with the JS code to launch the modal dialog. + {zoomTitle}: This will be replaced with the msgZoomTitle property. This is the title that is displayed on hover of the zoom button (which on clicking will display the text file). + {zoomInd}: This will be replaced with the zoomIndicator property. This is the title that is displayed on hover of the zoom button (which on clicking will display the text file). + {heading}: This represents the modal dialog heading title. This will be replaced with the msgZoomModalHeading property. + */ + text?: string; + /** + the preview template for html files. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + html?: string; + /** + the preview template for video files (supported by HTML 5 video tag). + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + video?: string; + /** + the preview template for audio files (supported by HTML 5 audio tag). + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + audio?: string; + /** + the preview template for flash files (supported currently on webkit browsers). + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + flash?: string; + /** + the preview template for all other files - by default treated as object. To disable this behavior, configure the allowedPreviewTypes property. + The following tags will be parsed and replaced automatically: + {previewId}: will be replaced with the generated identifier for the preview frame container. + {data}: will be replaced with the data source for each preview type. + {width}: will be replaced with the width for the file type as set in previewSettings. + {height}: will be replaced with the height for the file type as set in previewSettings. + {caption}: will be replaced with the file name. + {type}: will be replaced with the file type. + */ + object?: string; + /** + this template is used ONLY for rendering the initialPreview markup content passed directly as a raw format. + The following tags will be parsed and replaced automatically: + {content}: will be replaced with the raw HTML markup as set in initialPreview.. + */ + generic?: string; + } -interface IFileUploadFileTypeSettings { - image: (vType: string, vName: string) => boolean; - html: (vType: string, vName: string) => boolean; - text: (vType: string, vName: string) => boolean; - video: (vType: string, vName: string) => boolean; - audio: (vType: string, vName: string) => boolean; - flash: (vType: string, vName: string) => boolean; - object: (vType: string, vName: string) => boolean; - other: (vType: string, vName: string) => boolean; -} + interface PreviewSettings { + image?: { width?: string; height?: string; }; + html?: { width?: string; height?: string; }; + text?: { width?: string; height?: string; }; + video?: { width?: string; height?: string; }; + audio?: { width?: string; height?: string; }; + flash?: { width?: string; height?: string; }; + object?: { width?: string; height?: string; }; + other?: { width?: string; height?: string; }; + } -interface IFileUploadPreviewFileIconSettings { - [key: string]: string; -} + interface FileTypeSettings { + image: (vType: string, vName: string) => boolean; + html: (vType: string, vName: string) => boolean; + text: (vType: string, vName: string) => boolean; + video: (vType: string, vName: string) => boolean; + audio: (vType: string, vName: string) => boolean; + flash: (vType: string, vName: string) => boolean; + object: (vType: string, vName: string) => boolean; + other: (vType: string, vName: string) => boolean; + } -interface IFileUploadPreviewFileExtSettings { - [key: string]: (ext: string) => boolean; -} + interface PreviewFileIconSettings { + [key: string]: string; + } -interface IFileUploadFileActionSettings { - /** - icon for remove button to be displayed in each file thumbnail. - */ - removeIcon: string; - /** - CSS class for the remove button in each file thumbnail. - */ - removeClass: string; - /** - title for remove button in each file thumbnail. - */ - removeTitle: string; - /** - icon for upload button to be displayed in each file thumbnail. - */ - uploadIcon: string; - /** - CSS class for the remove button in each file thumbnail. - */ - uploadClass: string; - /** - title for remove button in each file thumbnail. - */ - uploadTitle: string; - /** - an indicator (HTML markup) for new pending upload displayed in each file thumbnail. - */ - indicatorNew: string; - /** - an indicator (HTML markup) for successful upload displayed in each file thumbnail. - */ - indicatorSuccess: string; - /** - an indicator (HTML markup) for error in upload displayed in each file thumbnail. - */ - indicatorError: string; - /** - an indicator (HTML markup) for ongoing upload displayed in each file thumbnail. - */ - indicatorLoading: string; - /** - title to display on hover of indicator for new pending upload in each file thumbnail. - */ - indicatorNewTitle: string; - /** - title to display on hover of indicator for successful in each file thumbnail. - */ - indicatorSuccessTitle: string; - /** - title to display on hover of indicator for error in upload in each file thumbnail. - */ - indicatorErrorTitle: string; - /** - title to display on hover of indicator for ongoing upload in each file thumbnail. - */ - indicatorLoadingTitle: string; + interface PreviewFileExtSettings { + [key: string]: (ext: string) => boolean; + } + + interface FileActionSettings { + /** + icon for remove button to be displayed in each file thumbnail. + */ + removeIcon: string; + /** + CSS class for the remove button in each file thumbnail. + */ + removeClass: string; + /** + title for remove button in each file thumbnail. + */ + removeTitle: string; + /** + icon for upload button to be displayed in each file thumbnail. + */ + uploadIcon: string; + /** + CSS class for the remove button in each file thumbnail. + */ + uploadClass: string; + /** + title for remove button in each file thumbnail. + */ + uploadTitle: string; + /** + an indicator (HTML markup) for new pending upload displayed in each file thumbnail. + */ + indicatorNew: string; + /** + an indicator (HTML markup) for successful upload displayed in each file thumbnail. + */ + indicatorSuccess: string; + /** + an indicator (HTML markup) for error in upload displayed in each file thumbnail. + */ + indicatorError: string; + /** + an indicator (HTML markup) for ongoing upload displayed in each file thumbnail. + */ + indicatorLoading: string; + /** + title to display on hover of indicator for new pending upload in each file thumbnail. + */ + indicatorNewTitle: string; + /** + title to display on hover of indicator for successful in each file thumbnail. + */ + indicatorSuccessTitle: string; + /** + title to display on hover of indicator for error in upload in each file thumbnail. + */ + indicatorErrorTitle: string; + /** + title to display on hover of indicator for ongoing upload in each file thumbnail. + */ + indicatorLoadingTitle: string; + } } \ No newline at end of file From a1a15346625f2f8d009d6e468d3025b2813ddedd Mon Sep 17 00:00:00 2001 From: CheCoxshall Date: Fri, 1 Apr 2016 22:31:39 +0100 Subject: [PATCH 095/415] Added JQuery Reference --- bootstrap-fileinput/bootstrap-fileinput.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap-fileinput/bootstrap-fileinput.d.ts b/bootstrap-fileinput/bootstrap-fileinput.d.ts index e9d6f0e0d3..fadfadd612 100644 --- a/bootstrap-fileinput/bootstrap-fileinput.d.ts +++ b/bootstrap-fileinput/bootstrap-fileinput.d.ts @@ -3,6 +3,8 @@ // Definitions by: Ché Coxshall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + interface JQuery { fileinput: (options?: BootstrapFileInput.FileInputOptions) => JQuery; } From ff0f1a4bd30f6070676e76a7b9c9adbc7bab57f9 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 4 Apr 2016 12:34:53 +1000 Subject: [PATCH 096/415] added basic test file. --- revalidator/revalidator-test.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 revalidator/revalidator-test.ts diff --git a/revalidator/revalidator-test.ts b/revalidator/revalidator-test.ts new file mode 100644 index 0000000000..3ad56947dc --- /dev/null +++ b/revalidator/revalidator-test.ts @@ -0,0 +1,4 @@ + +import * as revalidator from 'revalidator'; + +// revalidator.revalidate(values, this.state.validationSchema, null) \ No newline at end of file From adcaa9534f785587096c787f98a990cb1bbb1072 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 4 Apr 2016 12:35:41 +1000 Subject: [PATCH 097/415] Name update. --- revalidator/{revalidator-test.ts => revalidator-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename revalidator/{revalidator-test.ts => revalidator-tests.ts} (100%) diff --git a/revalidator/revalidator-test.ts b/revalidator/revalidator-tests.ts similarity index 100% rename from revalidator/revalidator-test.ts rename to revalidator/revalidator-tests.ts From e1b48ff99402b979d316472d1daeb2ce51061731 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 4 Apr 2016 12:43:53 +1000 Subject: [PATCH 098/415] Update documentation spec. Update test to include ES5 typescript import. --- revalidator/revalidator-tests.ts | 3 +-- revalidator/revalidator.d.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/revalidator/revalidator-tests.ts b/revalidator/revalidator-tests.ts index 3ad56947dc..cc04ed882e 100644 --- a/revalidator/revalidator-tests.ts +++ b/revalidator/revalidator-tests.ts @@ -1,4 +1,3 @@ - -import * as revalidator from 'revalidator'; +/// // revalidator.revalidate(values, this.state.validationSchema, null) \ No newline at end of file diff --git a/revalidator/revalidator.d.ts b/revalidator/revalidator.d.ts index b41e7cd03e..3d011f2f99 100644 --- a/revalidator/revalidator.d.ts +++ b/revalidator/revalidator.d.ts @@ -1,5 +1,5 @@ // Type definitions for revalidator 0.3.1 - +// Project: https://github.com/flatiron/revalidator // Definitions by: Jason Turner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 177e37a21b894e7b84e480b1602e403de535b808 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 4 Apr 2016 12:46:43 +1000 Subject: [PATCH 099/415] Removed white space in name. --- revalidator/revalidator.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/revalidator/revalidator.d.ts b/revalidator/revalidator.d.ts index 3d011f2f99..93d2e105a5 100644 --- a/revalidator/revalidator.d.ts +++ b/revalidator/revalidator.d.ts @@ -1,6 +1,6 @@ // Type definitions for revalidator 0.3.1 // Project: https://github.com/flatiron/revalidator -// Definitions by: Jason Turner +// Definitions by: Jason Turner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module Revalidator { From b171677b5a1d9090d6b39c602dcaf8ed5f44f4c4 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 4 Apr 2016 12:49:00 +1000 Subject: [PATCH 100/415] whitespace fixup --- revalidator/revalidator.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/revalidator/revalidator.d.ts b/revalidator/revalidator.d.ts index 93d2e105a5..4b6511f959 100644 --- a/revalidator/revalidator.d.ts +++ b/revalidator/revalidator.d.ts @@ -1,6 +1,6 @@ // Type definitions for revalidator 0.3.1 // Project: https://github.com/flatiron/revalidator -// Definitions by: Jason Turner +// Definitions by: Jason Turner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module Revalidator { From 518321e8e56797447adcdae5942db0f3c3699030 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 4 Apr 2016 12:59:02 +1000 Subject: [PATCH 101/415] Added basic schema information. --- revalidator/revalidator.d.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/revalidator/revalidator.d.ts b/revalidator/revalidator.d.ts index 4b6511f959..b06bf7cce9 100644 --- a/revalidator/revalidator.d.ts +++ b/revalidator/revalidator.d.ts @@ -5,7 +5,34 @@ declare module Revalidator { interface RevalidatorStatic { - validate(object: any, schema: any, options: any): any; + validate(object: any, schema: ISchema, options: any): IReturnMessage; + } + + interface IReturnMessage { + valid: boolean; + errors: string[]; + } + + interface ISchema { + required?: boolean; + type: string; + pattern?: any; + maxLength?: number; + minLength?: number; + minimum?: number; + maximum?: number; + allowEmpty: boolean; + exclusiveMinimum: number; + exclusiveMaximum?: number; + divisibleBy?: number; + minItems?: number; + maxItems?: number; + uniqueItems?: boolean; + enum?: any; + format?: string; + conform?: (data) => boolean; + depdendencies?: string; + } } From 2a6fd2e66684be68a5d0998829431c55e16a8c77 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 4 Apr 2016 13:03:54 +1000 Subject: [PATCH 102/415] updated based on feedback. --- revalidator/revalidator-tests.ts | 2 +- revalidator/revalidator.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/revalidator/revalidator-tests.ts b/revalidator/revalidator-tests.ts index cc04ed882e..b65c9f971b 100644 --- a/revalidator/revalidator-tests.ts +++ b/revalidator/revalidator-tests.ts @@ -1,3 +1,3 @@ /// -// revalidator.revalidate(values, this.state.validationSchema, null) \ No newline at end of file +revalidator.validate(null, null, null); \ No newline at end of file diff --git a/revalidator/revalidator.d.ts b/revalidator/revalidator.d.ts index b06bf7cce9..c1e03207b4 100644 --- a/revalidator/revalidator.d.ts +++ b/revalidator/revalidator.d.ts @@ -30,7 +30,7 @@ declare module Revalidator { uniqueItems?: boolean; enum?: any; format?: string; - conform?: (data) => boolean; + conform?: (data:any) => boolean; depdendencies?: string; } From 9a474d26f5dbed29d3ad93d80207356db090504a Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 4 Apr 2016 14:41:09 +1000 Subject: [PATCH 103/415] Updated error interface from simple strings. --- revalidator/revalidator.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/revalidator/revalidator.d.ts b/revalidator/revalidator.d.ts index c1e03207b4..63f492e9c3 100644 --- a/revalidator/revalidator.d.ts +++ b/revalidator/revalidator.d.ts @@ -8,9 +8,14 @@ declare module Revalidator { validate(object: any, schema: ISchema, options: any): IReturnMessage; } + interface IErrrorProperty { + property: string; + message: string; + } + interface IReturnMessage { valid: boolean; - errors: string[]; + errors: IErrrorProperty[]; } interface ISchema { @@ -40,4 +45,4 @@ declare var revalidator: Revalidator.RevalidatorStatic; declare module "revalidator" { export = revalidator; -} +} \ No newline at end of file From 13be4bad06dacc4c4243a50ad383c2a9e68b6e50 Mon Sep 17 00:00:00 2001 From: Stefan Loikkanen Date: Tue, 5 Apr 2016 11:44:35 +0200 Subject: [PATCH 104/415] Added optional callback for close function --- ws/ws.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ws/ws.d.ts b/ws/ws.d.ts index 83ba9dec92..d9a1338d21 100644 --- a/ws/ws.d.ts +++ b/ws/ws.d.ts @@ -110,7 +110,7 @@ declare module "ws" { constructor(options?: IServerOptions, callback?: Function); - close(): void; + close(cb?: () => {}): void; handleUpgrade(request: http.ServerRequest, socket: net.Socket, upgradeHead: Buffer, callback: (client: WebSocket) => void): void; From 62e1efd40289dc0e43e48a8da3f7f67081aba509 Mon Sep 17 00:00:00 2001 From: hellopao Date: Wed, 6 Apr 2016 10:31:21 +0800 Subject: [PATCH 105/415] add definitions for koa-favicon --- koa-favicon/koa-favicon-tests.ts | 11 ++++++++++ koa-favicon/koa-favicon.d.ts | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 koa-favicon/koa-favicon-tests.ts create mode 100644 koa-favicon/koa-favicon.d.ts diff --git a/koa-favicon/koa-favicon-tests.ts b/koa-favicon/koa-favicon-tests.ts new file mode 100644 index 0000000000..5f2e0ac3f0 --- /dev/null +++ b/koa-favicon/koa-favicon-tests.ts @@ -0,0 +1,11 @@ +/// +/// + +import * as Koa from "koa"; +import favicon = require("koa-favicon"); + +const app = new Koa(); + +app.use(favicon(__dirname + "/public/favicon.ico")); + +app.listen(80) \ No newline at end of file diff --git a/koa-favicon/koa-favicon.d.ts b/koa-favicon/koa-favicon.d.ts new file mode 100644 index 0000000000..618683fc76 --- /dev/null +++ b/koa-favicon/koa-favicon.d.ts @@ -0,0 +1,35 @@ +// Type definitions for koa-favicon v2.x +// Project: https://github.com/koajs/favicon +// Definitions by: Jerry Chin +// Definitions: https://github.com/hellopao/DefinitelyTyped + +/* =================== USAGE =================== + + import favicon = require("koa-favicon"); + var Koa = require('koa'); + + var app = new Koa(); + app.use(favicon(__dirname + '/public/favicon.ico')); + + =============================================== */ + +/// + +declare module "koa-favicon" { + + import * as Koa from "koa"; + + /** + * Returns a middleware serving the favicon found on the given path. + */ + function favicon(path: string, options?: { + + /** + * cache-control max-age directive in ms, defaulting to 1 day. + */ + maxage?: number; + + }): { (ctx: Koa.Context, next?: () => any): any }; + + export = favicon; +} From e0f099ceb4832670df7cb31305d80aaa87f7ad5b Mon Sep 17 00:00:00 2001 From: hellopao Date: Thu, 7 Apr 2016 10:25:53 +0800 Subject: [PATCH 106/415] add difinitions for koa-compress --- koa-compress/koa-compress-tests.ts | 16 ++++++++++++ koa-compress/koa-compress.d.ts | 41 ++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 koa-compress/koa-compress-tests.ts create mode 100644 koa-compress/koa-compress.d.ts diff --git a/koa-compress/koa-compress-tests.ts b/koa-compress/koa-compress-tests.ts new file mode 100644 index 0000000000..564fd53e2c --- /dev/null +++ b/koa-compress/koa-compress-tests.ts @@ -0,0 +1,16 @@ +/// +/// + +import * as Koa from "koa"; +import compress = require("koa-compress"); + +const app = new Koa(); + +app.use(compress({ + filter: (ctype) => { + return /text/i.test(ctype) + }, + threshold: 2048 +})); + +app.listen(80) \ No newline at end of file diff --git a/koa-compress/koa-compress.d.ts b/koa-compress/koa-compress.d.ts new file mode 100644 index 0000000000..3a6b7e09e1 --- /dev/null +++ b/koa-compress/koa-compress.d.ts @@ -0,0 +1,41 @@ +// Type definitions for koa-compress v2.x +// Project: https://github.com/koajs/compress +// Definitions by: Jerry Chin +// Definitions: https://github.com/hellopao/DefinitelyTyped + +/* =================== USAGE =================== + + import compress = require("koa-compress"); + var Koa = require('koa'); + + var app = new Koa(); + app.use(compress()); + + =============================================== */ +/// +/// + +declare module "koa-compress" { + + import * as Koa from "koa"; + import * as zlib from "zlib"; + + interface ICompressOptions extends zlib.ZlibOptions { + /** + * An optional function that checks the response content type to decide whether to compress. By default, it uses compressible. + */ + filter?: (content_type: string) => boolean; + + /** + * Minimum response size in bytes to compress. Default 1024 bytes or 1kb. + */ + threshold?: number + } + + /** + * Compress middleware for Koa + */ + function compress(options?: ICompressOptions): { (ctx: Koa.Context, next?: () => any): any }; + + export = compress; +} From 00e8cf6e000aa1d70fb21bd1da6456c62136e231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Z=C3=BCger?= Date: Fri, 8 Apr 2016 10:59:34 +0200 Subject: [PATCH 107/415] added svgRendering property to Html2CanvasOptions interface --- html2canvas/html2canvas.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/html2canvas/html2canvas.d.ts b/html2canvas/html2canvas.d.ts index 101815ec47..1d5fd82fe7 100644 --- a/html2canvas/html2canvas.d.ts +++ b/html2canvas/html2canvas.d.ts @@ -36,6 +36,9 @@ declare namespace Html2Canvas { /** Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy. */ useCORS?: boolean; + + /** Use svg powered rendering where available (FF11+). */ + svgRendering?: boolean; /** Callback providing the rendered canvas element after rendering */ onrendered?(canvas: HTMLCanvasElement): void; From 4aed26de3226553d767d1a5ff65296f3e89c2077 Mon Sep 17 00:00:00 2001 From: Xie Jingyang <136419808@qq.com> Date: Sat, 9 Apr 2016 22:30:11 +0800 Subject: [PATCH 108/415] Create echarts.d.ts some properties not complete --- echarts/echarts.d.ts | 111 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 echarts/echarts.d.ts diff --git a/echarts/echarts.d.ts b/echarts/echarts.d.ts new file mode 100644 index 0000000000..09f04ca6ef --- /dev/null +++ b/echarts/echarts.d.ts @@ -0,0 +1,111 @@ +// Type definitions for echarts +// Project: http://echarts.baidu.com/ +// Definitions by: Xie Jingyang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace ECharts { + function init(dom:HTMLDivElement|HTMLCanvasElement, theme?:Object|string, opts?:{ + devicePixelRatio?: number + renderer?: string + }): ECharts; + function connect(group:string|Array); + function disConnect(group:string); + function dispose(target: ECharts|HTMLDivElement|HTMLCanvasElement); + function getInstanceByDom(target: HTMLDivElement|HTMLCanvasElement); + function registerMap(mapName: string, geoJson: Object, specialAreas?: Object); + function registerTheme(themeName: string, theme: Object); + + class ECharts { + group:string; + setOption(option: EChartOption, notMerge?: boolean, notRefreshImmediately?: boolean) + getWidth(): number + getHeight(): number + getDom(): HTMLCanvasElement|HTMLDivElement + getOption(): Object + resize() + dispatchAction(payload: Object) + on(eventName: string, handler: Function, context?: Object) + off(eventName: string, handler?: Function) + showLoading(type?: string, opts?: Object) + hideLoading() + getDataURL(opts: { + // 导出的格式,可选 png, jpeg + type?: string, + // 导出的图片分辨率比例,默认为 1。 + pixelRatio?: number, + // 导出的图片背景色,默认使用 option 里的 backgroundColor + backgroundColor?: string + }):string + getConnectedDataURL(opts: { + // 导出的格式,可选 png, jpeg + type: string, + // 导出的图片分辨率比例,默认为 1。 + pixelRatio: number, + // 导出的图片背景色,默认使用 option 里的 backgroundColor + backgroundColor: string + }): string + clear() + isDisposed(): boolean + dispose() + } + + interface EChartOption { + title?: EChartTitleOption + legend?: Object, + grid?: Object, + xAxis?: Object, + yAxis?: Object, + polar?: Object, + radiusAxis?: Object, + angleAxis?: Object, + radar?: Object, + dataZoom?: Array, + visualMap?: Array, + tooltip?: Object, + toolbox?: Object, + geo?: Object, + parallel?: Object, + parallelAxis?: Object, + timeline?: Object, + series?: Array, + color?: Array, + backgroundColor?: string, + textStyle?: Object, + animation?: boolean, + animationDuration?: number, + animationEasing?: string, + animationDurationUpdate?: number, + animationEasingUpdate?: string + } + + interface EChartTitleOption { + show?: boolean; + text?: string; + link?: string, + target?: string, + textStyle?: Object, + subtext?: string, + sublink?: string, + subtarget?: string, + subtextStyle?: Object, + padding?: number, + itemGap?: number, + zlevel?: number, + z?: number, + left?: string, + top?: string, + right?: string, + bottom?: string, + backgroundColor?: string, + borderColor?: string, + borderWidth?: number, + shadowBlur?: number, + shadowColor?: number, + shadowOffsetX?: number, + shadowOffsetY?: number, + } +} + +declare module "echarts" { + export = ECharts; +} From 3305eb6f74a2de17d208dfaaa20d69cfb912f871 Mon Sep 17 00:00:00 2001 From: Xie Jingyang <136419808@qq.com> Date: Sat, 9 Apr 2016 22:44:19 +0800 Subject: [PATCH 109/415] Update echarts.d.ts --- echarts/echarts.d.ts | 70 +++++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 24 deletions(-) diff --git a/echarts/echarts.d.ts b/echarts/echarts.d.ts index 09f04ca6ef..f460a9eaca 100644 --- a/echarts/echarts.d.ts +++ b/echarts/echarts.d.ts @@ -7,28 +7,46 @@ declare namespace ECharts { function init(dom:HTMLDivElement|HTMLCanvasElement, theme?:Object|string, opts?:{ devicePixelRatio?: number renderer?: string - }): ECharts; - function connect(group:string|Array); - function disConnect(group:string); - function dispose(target: ECharts|HTMLDivElement|HTMLCanvasElement); - function getInstanceByDom(target: HTMLDivElement|HTMLCanvasElement); - function registerMap(mapName: string, geoJson: Object, specialAreas?: Object); - function registerTheme(themeName: string, theme: Object); + }):ECharts; + + function connect(group:string|Array):void; + + function disConnect(group:string):void; + + function dispose(target:ECharts|HTMLDivElement|HTMLCanvasElement):void; + + function getInstanceByDom(target:HTMLDivElement|HTMLCanvasElement):void; + + function registerMap(mapName:string, geoJson:Object, specialAreas?:Object):void; + + function registerTheme(themeName:string, theme:Object):void; class ECharts { group:string; - setOption(option: EChartOption, notMerge?: boolean, notRefreshImmediately?: boolean) - getWidth(): number - getHeight(): number - getDom(): HTMLCanvasElement|HTMLDivElement - getOption(): Object - resize() - dispatchAction(payload: Object) - on(eventName: string, handler: Function, context?: Object) - off(eventName: string, handler?: Function) - showLoading(type?: string, opts?: Object) - hideLoading() - getDataURL(opts: { + + setOption(option:EChartOption, notMerge?:boolean, notRefreshImmediately?:boolean):void + + getWidth():number + + getHeight():number + + getDom():HTMLCanvasElement|HTMLDivElement + + getOption():Object + + resize():void + + dispatchAction(payload:Object):void + + on(eventName:string, handler:Function, context?:Object):void + + off(eventName:string, handler?:Function):void + + showLoading(type?:string, opts?:Object):void + + hideLoading():void + + getDataURL(opts:{ // 导出的格式,可选 png, jpeg type?: string, // 导出的图片分辨率比例,默认为 1。 @@ -36,17 +54,21 @@ declare namespace ECharts { // 导出的图片背景色,默认使用 option 里的 backgroundColor backgroundColor?: string }):string - getConnectedDataURL(opts: { + + getConnectedDataURL(opts:{ // 导出的格式,可选 png, jpeg type: string, // 导出的图片分辨率比例,默认为 1。 pixelRatio: number, // 导出的图片背景色,默认使用 option 里的 backgroundColor backgroundColor: string - }): string - clear() - isDisposed(): boolean - dispose() + }):string + + clear():void + + isDisposed():boolean + + dispose():void } interface EChartOption { From 8a9ea7db630d55ebfb3733b390baa498b0998f0e Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Tue, 12 Apr 2016 13:47:35 +0200 Subject: [PATCH 110/415] Backbone: Make doesn't exists anymore. See changelog from for version 0.9.10 (View#make has been removed. You'll need to use $ directly to construct DOM elements now.) --- backbone/backbone-global.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/backbone/backbone-global.d.ts b/backbone/backbone-global.d.ts index be849cee04..4c8cf514ba 100644 --- a/backbone/backbone-global.d.ts +++ b/backbone/backbone-global.d.ts @@ -368,7 +368,6 @@ declare namespace Backbone { $(selector: any): JQuery; render(): View; remove(): View; - make(tagName: any, attributes?: any, content?: any): any; delegateEvents(events?: EventsHash): any; delegate(eventName: string, selector: string, listener: Function): View; undelegateEvents(): any; From 03022b7d8f0edbc86a9bbb1948c5df780e715ed8 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Tue, 12 Apr 2016 14:06:44 +0200 Subject: [PATCH 111/415] Backbone: Model#change doesn't exist either #8951 --- backbone/backbone-global.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/backbone/backbone-global.d.ts b/backbone/backbone-global.d.ts index 4c8cf514ba..704d4ada83 100644 --- a/backbone/backbone-global.d.ts +++ b/backbone/backbone-global.d.ts @@ -146,7 +146,6 @@ declare namespace Backbone { /*private*/ set(attributeName: string, value: any, options?: ModelSetOptions): Model; set(obj: any, options?: ModelSetOptions): Model; - change(): any; changedAttributes(attributes?: any): any[]; clear(options?: Silenceable): any; clone(): Model; From 90c84c80e0211af88700d122c54f526a63800f2c Mon Sep 17 00:00:00 2001 From: Seteh Date: Tue, 12 Apr 2016 15:42:20 +0300 Subject: [PATCH 112/415] Update to 15.2.9 --- devextreme/devextreme-15.2.7.d.ts | 7429 +++++++++++++++++++++++++++++ devextreme/devextreme.d.ts | 68 +- 2 files changed, 7470 insertions(+), 27 deletions(-) create mode 100644 devextreme/devextreme-15.2.7.d.ts diff --git a/devextreme/devextreme-15.2.7.d.ts b/devextreme/devextreme-15.2.7.d.ts new file mode 100644 index 0000000000..df967b19f3 --- /dev/null +++ b/devextreme/devextreme-15.2.7.d.ts @@ -0,0 +1,7429 @@ +// Type definitions for DevExtreme 15.2.7 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace DevExpress { + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ + export function registerModelForValidation(model: Object) : void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** Specifies whether or not the entire application/site supports right-to-left representation. */ + export var rtlEnabled: boolean; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + export function requestAnimationFrame(callback: Function): number; + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** Used to get URLs that vary in a locally running application and the application running on production. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns a local or a productional URL depending on how the application is currently running. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: string; + /** The element within which the widget is positioned. */ + boundary?: Element; + /** A string value holding horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: string; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: string; + /** The target element that the widget is positioned against. */ + of?: HTMLElement; + /** A string value holding horizontal and vertical offset in pixels, separated by a space (e.g., "5 -10"). */ + offset?: string; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(url: string); + constructor(data: Array); + constructor(options: CustomStoreOptions); + constructor(options: DataSourceOptions); + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): JQueryPromise>; + /** Clears currently loaded DataSource items and calls the load() method. */ + reload(): JQueryPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(expr: Object): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + async: boolean; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + keyType?: any; + /** Specifies whether or not dates found in the response are deserialized. */ + deserializeDates?: boolean; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Filters the current Query data. */ + filter(predicate: (item: any) => boolean): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare namespace DevExpress.ui { + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate and how to apply the validation result. */ + adapter?: Object; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: Object; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated dataSource.paginate.md + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + /** A handler for the cut event. */ + onCut?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + /** A handler for the input event. */ + onInput?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + focusStateEnabled?: boolean; + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether to enable or disable scrolling. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + /** Holds the list of selected values. */ + values?: Array; + /** A read-only option that holds the last selected value. */ + value?: Object; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + buttons?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object defining animation options of the widget. */ + animation?: fx.AnimationOptions; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + onContentReady?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + /** The "mode" attribute value of the actual HTML input element representing the widget. */ + mode?: string; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route or when creating a widget if it initially contains markers or routes. */ + autoAdjust?: boolean; + center?: { + /** The latitude location displayed in the center of the widget. */ + lat?: number; + /** The longitude location displayed in the center of the widget. */ + lng?: number; + }; + /** A handler for the click event. */ + onClick?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + /** An object defining widget animation options. */ + animation?: fx.AnimationOptions; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated pageLoadMode.md + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + /** This section lists the data source fields that are used in a default template for lookup drop-down items. */ + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + onSelectAllChanged?: Function; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + /** A format used to display date/time information. */ + format?: string; + /** A Globalize format string specifying the date display format. */ + formatString?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use 'pickerType' option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use 'pickerType' option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The latest date the widget allows to select. */ + max?: Date; + /** The earliest date the widget allows to select. */ + min?: Date; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidget { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** A handler for the itemTitleHold event. */ + onItemTitleHold?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: File; + /** Holds the File instances representing files selected in the widget. */ + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormEmptyItem extends dxFormItem { + /** Specifies the form item name. */ + name?: string; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifies which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering the group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + /** Specifies a badge text for the tab. */ + badge?: string; + /** A Boolean value specifying whether or not the tab can respond to user interaction. */ + disabled?: boolean; + /** Specifies the icon to be displayed on the tab. */ + icon?: string; + /** The template to be used for rendering the tab. */ + tabTemplate?: any; + /** The template to be used for rendering the tab content. */ + template?: any; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for required fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies the message that is shown for end-users a required field value is not specified. */ + requiredMessage?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + onContentReady?: Function; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxForm): JQuery; +} + +declare namespace DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + /** Specifies the current menu position. */ + menuPosition?: string; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + buttonIconSrc?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + hoverStateEnabled?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** This section lists the data source fields that are used in a default template for drop-down menu items. */ + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare namespace DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the initial sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Specifies the data field against which the header items of this field should be sorted. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies a display format for field values. */ + format?: string; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies a precision for formatted field values. */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the header cell of a row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare namespace DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: Date; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurrent appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the 'useColorAsDefault' property instead + */ + mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** The name of the appointment object field that specifies a resource of this kind. */ + field?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** Specifies whether or not an end-user can scroll the view horizontally. */ + horizontalScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; + /** Specifies the name of the data source item field that defines the start of an appointment. */ + startDateExpr?: string; + /** Specifies the name of the data source item field that defines the ending of an appointment. */ + endDateExpr?: string; + /** Specifies the name of the data source item field that holds the subject of an appointment. */ + textExpr?: string; + /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ + descriptionExpr?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ + allDayExpr?: string; + /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ + recurrenceRuleExpr?: string; + /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ + recurrenceExceptionExpr?: string; + /** Specifies whether filtering is performed on the server or client side. */ + remoteFiltering?: boolean; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time. */ + scrollToTime(hours: number, minutes: number): void; + /** Displays the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean): void; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ + expandedExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * Specifies whether or not a check box is displayed at each tree view item. + * @deprecated Use the showCheckBoxesMode option instead. + */ + showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; + /** + * Specifies whether the "Select All" check box is displayed over the tree view. + * @deprecated Use the showCheckBoxesMode option instead. + */ + selectAllEnabled?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: any; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelected event. */ + onItemSelected?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** Specifies whether or not an item becomes selected if an end-user clicks it. */ + selectionByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + } + export class dxMenuBase extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay in submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; + } + export interface dxDataGridRow { + /** The data object represented by the row. */ + data: Object; + /** The key of the data object represented by the row. */ + key: any; + /** The visible index of the row. */ + rowIndex: number; + /** The type of the row. */ + rowType: string; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: string; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for the header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; + /** Specifies a precision for formatted values displayed in a column. */ + precision?: number; + /** Specifies a filter operation applied to a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + editMode?: string; + editEnabled?: boolean; + insertEnabled?: boolean; + removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the editMode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + }; + /** Specifies options that configure the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: boolean; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: boolean; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + /** Specifies whether to enable two-way data binding. */ + twoWayBindingEnabled?: boolean; + /** A handler for the rowClick event. */ + onRowClick?: any; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Specifies options for exporting grid data. */ + export?: { + /** Indicates if the export feature is enabled in the grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + exportTo?: string; + /** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */ + exportToExcel?: string; + /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ + excelFormat?: string; + /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ + selectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (state: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + }>; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): void; + /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow() method instead. + */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): void; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; + }; + /** The Load panel configuration options. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Specifies options for exporting pivot grid data. */ + export?: { + /** Indicates whether the export feature is enabled for the pivot grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare namespace DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare namespace DevExpress.viz.core { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies the opacity of the tooltip's border. */ + opacity?: number; + } + export interface Font { + /** Specifies the font color for a strip label. */ + color?: string; + /** Specifies the font family for a strip label. */ + family?: string; + /** Specifies the font opacity for a strip label. */ + opacity?: number; + /** Specifies the font size for a strip label. */ + size?: any; + /** Specifies the font weight for the text displayed in strips. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ + bottom?: number; + /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ + left?: number; + /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ + right?: number; + /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ + top?: number; + } + export interface Size { + /** Specifies the width of the widget. */ + width?: number; + /** Specifies the height of the widget. */ + height?: number; + } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the widget title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies the widget title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding widget elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: viz.core.DashedBorderWithOpacity; + /** Specifies a color for the tooltip. */ + color?: string; + /** Specifies the z-index for tooltips. */ + zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ + container?: any; + /** Specifies text and appearance of a set of tooltips. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies font options for the text displayed by the tooltip. */ + font?: Font; + /** Specifies a format for the text displayed by the tooltip. */ + format?: string; + /** Specifies the opacity of a tooltip. */ + opacity?: number; + /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + paddingLeftRight?: number; + /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + paddingTopBottom?: number; + /** Specifies a precision for formatted values displayed by the tooltip. */ + precision?: number; + /** Specifies options of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Specifies a color for the loading indicator background. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator text. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies a text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions extends DOMComponentOptions { + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + } +} +declare namespace DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): boolean; + /** Provides information about the selection state of a point. */ + isSelected(): boolean; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label of a series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: string; + /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: string; + position?: string; + /** Specifies a precision for formatted point values displayed in point labels. */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show a label when the point has a zero value. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + alignment?: string; + /** Specifies how to shift point labels horizontally from their initial positions. */ + horizontalOffset?: number; + /** Specifies how to shift point labels vertically from their initial positions. */ + verticalOffset?: number; + /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + /** An object defining the label configuration options for a series in the dxChart widget. */ + label?: ChartSeriesConfigLabel; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /**

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

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

Sets a color for a point when it is selected.

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

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

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

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

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

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

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

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

*/ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ + adjustOnZoom?: boolean; + /** Specifies argument axis options for the dxChart widget. */ + argumentAxis?: ChartArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxChart widget. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** An object defining the configuration options that are common for all panes in the dxChart widget. */ + commonPaneSettings?: CommonPane; + /** An object defining the configuration options that are common for all series of the dxChart widget. */ + commonSeriesSettings?: CommonSeriesSettings; + /** An object that specifies the appearance options of the chart crosshair. */ + crosshair?: { + /** Specifies a color for the crosshair lines. */ + color?: string; + /** Specifies a dash style for the crosshair lines. */ + dashStyle?: string; + /** Specifies whether to enable the crosshair or not. */ + enabled?: boolean; + /** Specifies the opacity of the crosshair lines. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Specifies the appearance of the horizontal crosshair line. */ + horizontalLine?: CrosshaierWithLabel; + /** Specifies the appearance of the vertical crosshair line. */ + verticalLine?: CrosshaierWithLabel; + /** Specifies the options of the crosshair labels. */ + label?: { + /** Specifies a color for the background of the crosshair labels. */ + backgroundColor?: string; + /** Specifies whether the crosshair labels are visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the crosshair labels. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair labels. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + }; + /** Specifies a default pane for the chart's series. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Defines the dxChart widget's pane(s). */ + panes?: Array; + /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + /** Specifies options for dxChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: ChartTooltip; + /** Specifies value axis options for the dxChart widget. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + /** A widget used to embed charts into HTML JS applications. */ + export class dxChart extends BaseChart { + constructor(element: JQuery, options?: dxChartOptions); + constructor(element: Element, options?: dxChartOptions); + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Specifies whether the label of the horizontal crosshair line is visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair label that accompany the horizontal line. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends BaseChart { + constructor(element: JQuery, options?: dxPolarChartOptions); + constructor(element: Element, options?: dxPolarChartOptions); + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; + } + /** A circular chart widget for HTML JS applications. */ + export class dxPieChart extends BaseChart { + constructor(element: JQuery, options?: dxPieChartOptions); + constructor(element: Element, options?: dxPieChartOptions); + /** + * Provides access to the dxPieChart series. + * @deprecated ..\..\BaseChart\3 Methods\getAllSeries().md + */ + getSeries(): PieSeries; + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; +} +declare namespace DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** + * Specifies an array of custom minor ticks. + * @deprecated ..\customMinorTicks.md + */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This functionality in not more available + */ + showCalculatedTicks?: boolean; + /** + * Specifies an interval between minor ticks. + * @deprecated ..\minorTickInterval.md + */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated ..\label\overlappingBehavior\useAutoArrangement.md + */ + useTicksAutoArrangement?: boolean; + } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This functionality in not more available + */ + hideFirstLabel?: boolean; + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This functionality in not more available + */ + hideFirstTick?: boolean; + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This functionality in not more available + */ + hideLastLabel?: boolean; + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This functionality in not more available + */ + hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** + * Specifies options of the gauge's major ticks. + * @deprecated ..\tick\tick.md + */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleMinorTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: string; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by an indicator. */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: Array; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** + * Specifies a subtitle for the widget. + * @deprecated ..\..\..\BaseGauge\1 Configuration\title\subtitle\subtitle.md + */ + subtitle?: { + /** + * Specifies font options for the subtitle. + * @deprecated ..\..\title\subtitle\font\font.md + */ + font?: viz.core.Font; + /** + * Specifies a text for the subtitle. + * @deprecated ..\title\subtitle\text.md + */ + text?: string; + }; + /** Specifies a title for a gauge. */ + title?: { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** + * Specifies a title's position on the gauge. + * @deprecated basegaugeoptions_title_verticalAlignment and basegaugeoptions_title_horizontalAlignment + */ + position?: string; + /** Specifies the distance between the title and surrounding gauge elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies the gauge title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the gauge title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + }; + /** Specifies options for gauge tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ + margin?: viz.core.Margins; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxLinearGaugeOptions); + constructor(element: Element, options?: dxLinearGaugeOptions); + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxCircularGaugeOptions); + constructor(element: Element, options?: dxCircularGaugeOptions); + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: string; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by labels. */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: string; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxBarGaugeOptions); + constructor(element: Element, options?: dxBarGaugeOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws the widget. */ + render(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; +} +declare namespace DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies a title for the range selector. */ + title?: viz.core.Title; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ + margin?: viz.core.Margins; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** + * Specifies an interval between major ticks. + * @deprecated ..\tickInterval\tickInterval.md + */ + majorTickInterval?: any; + /** Specifies an interval between axis ticks. */ + tickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: string; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** + * Indicates whether or not to show minor ticks on the scale. + * @deprecated minorTick\visible.md + */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + /** Specifies options of the range selector's minor ticks. */ + minorTick?: { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies in pixels the size of the dxRangeSelector widget. */ + size?: viz.core.Size; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: string; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the 'paddingTopBottom' and 'paddingLeftRight' options instead + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the 'placeholderHeight' and 'indent' options instead + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** Specifies a precision for the formatted value displayed in slider markers. */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxRangeSelectorOptions); + constructor(element: Element, options?: dxRangeSelectorOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; +} +declare namespace DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the "Layer Element" instead + */ + export interface Area { + /** + * Contains the element type. + * @deprecated ..\..\Layer\2 Fields\type.md + */ + type: string; + /** + * Return the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ + attribute(name: string): any; + /** + * Provides information about the selection state of an area. + * @deprecated Use the "selected()" method of the Layer Element + */ + selected(): boolean; + /** + * Sets a new selection state for an area. + * @deprecated Use the "selected(state)" method of the Layer Element + */ + selected(state: boolean): void; + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the "Layer Element" instead + */ + export interface Marker { + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text with the "attribute" method (using the "layers.label.dataField" value) + */ + text: string; + /** + * Contains the type of the element. + * @deprecated ..\..\Layer\2 Fields\type.md + */ + type: string; + /** + * Contains the URL of an image map marker. + * @deprecated Get the url with the "attribute" method (using the "layers.dataField" value) + */ + url: string; + /** + * Contains the value of a bubble map marker. + * @deprecated Get the value with the "attribute" method (using the "layers.dataField" value) + */ + value: number; + /** + * Contains the values of a pie map marker. + * @deprecated Get the values with the "attribute" method (using the "layers.dataField" value) + */ + values: Array; + /** + * Returns the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ + attribute(name: string): any; + /** + * Returns the coordinates of a specific marker. + * @deprecated ..\..\Layer Element\3 Methods\coordinates().md + */ + coordinates(): Array; + /** + * Provides information about the selection state of a marker. + * @deprecated Use the "selected()" method of the Layer Element + */ + selected(): boolean; + /** + * Sets a new selection state for a marker. + * @deprecated Use the "selected(state)" method of the Layer Element + */ + selected(state: boolean): void; + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ + applySettings(settings: any): void; + } + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer. */ + data?: any; + /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ + borderWidth?: number; + /** Specifies a color for the border of the layer elements. */ + borderColor?: string; + /** Specifies a color for layer elements. */ + color?: string; + /** Specifies a color for the border of the layer element when it is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for a layer element when it is hovered over. */ + hoveredColor?: string; + /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint layer elements with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring of layer elements. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; + /** Specifies marker label options. */ + label?: { + /** The name of the data attribute containing marker texts. */ + dataField?: string; + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated ..\layers\customize.md + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated ..\..\layers\label\dataField.md + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated ..\layers\palette.md + */ + palette?: any; + /** + * Specifies the number of colors in a palette. + * @deprecated ..\layers\paletteSize.md + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated ..\layers\colorGroupingField.md + */ + colorGroupingField?: string; + /** + * Specifies a color for the area border when the area is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated ..\layers\customize.md + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Enables marker labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\maxSize.md + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\minSize.md + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\opacity.md + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated ..\layers\size.md + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated ..\layers\elementType.md + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated ..\layers\palette.md + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated ..\layers\colorGroupingField.md + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated ..\layers\sizeGroups.md + */ + sizeGroups?: Array; + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated ..\layers\sizeGroupingField.md + */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { + /** + * An object specifying options for the map areas. + * @deprecated Use the 'layers' option instead + */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the Control_Bar. */ + opacity?: number; + }; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** + * Specifies a data source for the map area. + * @deprecated Use the 'layers.data' option instead + */ + mapData?: any; + /** + * Specifies a data source for the map markers. + * @deprecated Use the 'layers.data' option instead + */ + markers?: any; + /** + * An object specifying options for the map markers. + * @deprecated Use the 'layers' option instead + */ + markerSettings?: MarkerSettings; + /** Specifies the size of the dxVectorMap widget. */ + size?: viz.core.Size; + /** Specifies a title for the vector map. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + component: dxVectorMap; + element: Element; + zoomFactor: number; + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the 'onClick' option instead + */ + onAreaClick?: any; + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the 'onSelectionChanged' option instead + */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** + * A handler for the markerClick event. + * @deprecated Use the 'onClick' option instead + */ + onMarkerClick?: any; + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the 'onSelecitonChanged' option instead + */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } + } + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxVectorMapOptions); + constructor(element: Element, options?: dxVectorMapOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ + clearAreaSelection(): void; + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the 'getElements' method on a layer instead + */ + getAreas(): Array; + /** + * Returns an array with all the map markers. + * @deprecated Use the 'getElements' method on a layer instead + */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; +} +declare namespace DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { + /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of the widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + /** Redraws a widget. */ + render(): void; + } + export interface dxBulletOptions extends BaseSparkline { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + /** A bullet graph widget. */ + export class dxBullet extends BaseSparkline { + constructor(element: JQuery, options?: dxBulletOptions); + constructor(element: Element, options?: dxBulletOptions); + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: Array; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } + /** A sparkline widget. */ + export class dxSparkline extends BaseSparkline { + constructor(element: JQuery, options?: dxSparklineOptions); + constructor(element: Element, options?: dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; +} diff --git a/devextreme/devextreme.d.ts b/devextreme/devextreme.d.ts index df967b19f3..3a7d42e05a 100644 --- a/devextreme/devextreme.d.ts +++ b/devextreme/devextreme.d.ts @@ -1,11 +1,11 @@ -// Type definitions for DevExtreme 15.2.7 +// Type definitions for DevExtreme 15.2.9 // Project: http://js.devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare namespace DevExpress { +declare module DevExpress { /** A mixin that provides a capability to fire and subscribe to events. */ export interface EventsMixin { /** Subscribes to a specified event. */ @@ -427,6 +427,9 @@ declare namespace DevExpress { /** A handler for the loadError event. */ onLoadError?: (e?: Error) => void; } + export interface OperationPromise extends JQueryPromise { + operationId: number; + } /** An object that provides access to a data web service or local data storage for collection container widgets. */ export class DataSource implements EventsMixin { constructor(url: string); @@ -454,9 +457,9 @@ declare namespace DevExpress { /** Returns the key expression. */ key(): any; /** Starts loading data. */ - load(): JQueryPromise>; + load(): OperationPromise>; /** Clears currently loaded DataSource items and calls the load() method. */ - reload(): JQueryPromise>; + reload(): OperationPromise>; /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ loadOptions(): Object; /** Returns the current pageSize option value. */ @@ -499,6 +502,7 @@ declare namespace DevExpress { store(): Store; /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ totalCount(): number; + cancel(operationId: number): boolean; on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; on(eventName: "changed", eventHandler: () => void): DataSource; @@ -831,7 +835,7 @@ declare namespace DevExpress { export function registerPalette(paletteName: string, palette: Object): void; } } -declare namespace DevExpress.ui { +declare module DevExpress.ui { export interface dxValidatorOptions extends DOMComponentOptions { /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ validationRules?: Array; @@ -1369,7 +1373,7 @@ declare namespace DevExpress.ui { constructor(element: Element, options?: dxMultiViewOptions); } export interface dxMapOptions extends WidgetOptions { - /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route or when creating a widget if it initially contains markers or routes. */ + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ autoAdjust?: boolean; center?: { /** The latitude location displayed in the center of the widget. */ @@ -2157,7 +2161,7 @@ declare namespace DevExpress.ui { requiredMark?: string; /** The text displayed for optional fields. */ optionalMark?: string; - /** Specifies the message that is shown for end-users a required field value is not specified. */ + /** Specifies the message that is shown for end-users if a required field value is not specified. */ requiredMessage?: string; /** Specifies whether or not the total validation summary is displayed on the form. */ showValidationSummary?: boolean; @@ -2406,10 +2410,10 @@ interface JQuery { dxForm(options: "instance"): DevExpress.ui.dxForm; dxForm(options: string): any; dxForm(options: string, ...params: any[]): any; - dxForm(options: DevExpress.ui.dxForm): JQuery; + dxForm(options: DevExpress.ui.dxFormOptions): JQuery; } -declare namespace DevExpress.ui { +declare module DevExpress.ui { export interface dxTileViewOptions extends CollectionWidgetOptions { /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ activeStateEnabled?: boolean; @@ -2646,7 +2650,7 @@ interface JQuery { dxDropDownMenu(options: string, ...params: any[]): any; dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; } -declare namespace DevExpress.data { +declare module DevExpress.data { export interface XmlaStoreOptions { /** The HTTP address to an XMLA OLAP server. */ url?: string; @@ -2693,11 +2697,11 @@ declare namespace DevExpress.data { groupName?: string; /** The index of the field within a group. */ groupIndex?: number; - /** Specifies the initial sort order of field values. */ + /** Specifies the sort order of field values. */ sortOrder?: string; /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ sortBy?: string; - /** Specifies the data field against which the header items of this field should be sorted. */ + /** Sorts the header items of this field by the summary values of another field. */ sortBySummaryField?: string; /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ sortBySummaryPath?: Array; @@ -2843,7 +2847,7 @@ declare namespace DevExpress.data { off(eventName: string, eventHandler: Function): PivotGridDataSource; } } -declare namespace DevExpress.ui { +declare module DevExpress.ui { export interface dxSchedulerOptions extends WidgetOptions { /** Specifies a date displayed on the current scheduler view by default. */ currentDate?: Date; @@ -2873,7 +2877,7 @@ declare namespace DevExpress.ui { showAllDayPanel?: boolean; /** Specifies cell duration in minutes. */ cellDuration?: number; - /** Specifies the edit mode for recurrent appointments. */ + /** Specifies the edit mode for recurring appointments. */ recurrenceEditMode?: string; /** Specifies which editing operations an end-user can perform on appointments. */ editing?: { @@ -2963,10 +2967,10 @@ declare namespace DevExpress.ui { updateAppointment(target: Object, appointment: Object): void; /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ deleteAppointment(appointment: Object): void; - /** Scrolls the scheduler work space to the specified time. */ - scrollToTime(hours: number, minutes: number): void; - /** Displays the Appointment Details popup. */ - showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean): void; + /** Scrolls the scheduler work space to the specified time of the specified day. */ + scrollToTime(hours: number, minutes: number, date: Date): void; + /** Displayes the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; } export interface dxColorBoxOptions extends dxDropDownEditorOptions { /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ @@ -3771,6 +3775,8 @@ declare namespace DevExpress.ui { summaryType?: string; /** Specifies a format for the summary item value. */ valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; }>; /** Specifies items of the total summary. */ totalItems?: Array<{ @@ -3797,7 +3803,11 @@ declare namespace DevExpress.ui { summaryType?: string; /** Specifies a format for the summary item value. */ valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; }>; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ calculateCustomSummary?: (options: { component: dxDataGrid; @@ -4037,7 +4047,7 @@ declare namespace DevExpress.ui { /** The string to display as an Export to Excel file context menu item. */ exportToExcel?: string; }; - /** The Load panel configuration options. */ + /** Specifies options configuring the load panel. */ loadPanel?: { /** Enables or disables the load panel. */ enabled?: boolean; @@ -4189,7 +4199,7 @@ interface JQuery { dxScheduler(options: string, ...params: any[]): any; dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; } -declare namespace DevExpress.framework { +declare module DevExpress.framework { /** An object used to store information on the views displayed in an application. */ export class ViewCache { viewRemoved: JQueryCallback; @@ -4471,7 +4481,7 @@ declare namespace DevExpress.framework { } } } -declare namespace DevExpress.viz.core { +declare module DevExpress.viz.core { /** * Applies a theme for the entire page with several DevExtreme visualization widgets. * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. @@ -4707,7 +4717,7 @@ declare namespace DevExpress.viz.core { svg(): string; } } -declare namespace DevExpress.viz.charts { +declare module DevExpress.viz.charts { /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ export interface BaseSeries { /** Provides information about the state of the series object. */ @@ -5738,6 +5748,8 @@ declare namespace DevExpress.viz.charts { equalBarWidth?: boolean; /** Specifies a common bar width as a percentage from 0 to 1. */ barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; } export interface Legend extends AdvancedLegend { /** Specifies whether the legend is located outside or inside the chart's plot. */ @@ -5799,7 +5811,7 @@ declare namespace DevExpress.viz.charts { customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; } }; - /** Specifies a default pane for the chart's series. */ + /** Specifies a default pane for the chart series. */ defaultPane?: string; /** Specifies a coefficient determining the diameter of the largest bubble. */ maxBubbleSize?: number; @@ -5956,7 +5968,7 @@ interface JQuery { dxPolarChart(methodName: string, ...params: any[]): any; dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; } -declare namespace DevExpress.viz.gauges { +declare module DevExpress.viz.gauges { export interface BaseRangeContainer { /** Specifies a range container's background color. */ backgroundColor?: string; @@ -6373,7 +6385,7 @@ interface JQuery { dxBarGauge(methodName: string, ...params: any[]): any; dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; } -declare namespace DevExpress.viz.rangeSelector { +declare module DevExpress.viz.rangeSelector { export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { /** Specifies the options for the range selector's background. */ background?: { @@ -6425,6 +6437,8 @@ declare namespace DevExpress.viz.rangeSelector { equalBarWidth?: boolean; /** Specifies a common bar width as a percentage from 0 to 1. */ barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ palette?: any; /** An object defining the chart’s series. */ @@ -6667,7 +6681,7 @@ interface JQuery { dxRangeSelector(methodName: string, ...params: any[]): any; dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; } -declare namespace DevExpress.viz.map { +declare module DevExpress.viz.map { /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ export interface MapLayer { /** The name of the layer. */ @@ -7306,7 +7320,7 @@ interface JQuery { dxVectorMap(methodName: string, ...params: any[]): any; dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; } -declare namespace DevExpress.viz.sparklines { +declare module DevExpress.viz.sparklines { export interface SparklineTooltip extends viz.core.Tooltip { /** * Specifies how a tooltip is horizontally aligned relative to the graph. From bf0242c3095537ecd471e22004688bcd97292bad Mon Sep 17 00:00:00 2001 From: hellopao Date: Wed, 13 Apr 2016 09:34:38 +0800 Subject: [PATCH 113/415] Update koa-compress.d.ts rename the interface --- koa-compress/koa-compress.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koa-compress/koa-compress.d.ts b/koa-compress/koa-compress.d.ts index 3a6b7e09e1..c4cd2af582 100644 --- a/koa-compress/koa-compress.d.ts +++ b/koa-compress/koa-compress.d.ts @@ -20,7 +20,7 @@ declare module "koa-compress" { import * as Koa from "koa"; import * as zlib from "zlib"; - interface ICompressOptions extends zlib.ZlibOptions { + interface CompressOptions extends zlib.ZlibOptions { /** * An optional function that checks the response content type to decide whether to compress. By default, it uses compressible. */ @@ -35,7 +35,7 @@ declare module "koa-compress" { /** * Compress middleware for Koa */ - function compress(options?: ICompressOptions): { (ctx: Koa.Context, next?: () => any): any }; + function compress(options?: CompressOptions): { (ctx: Koa.Context, next?: () => any): any }; export = compress; } From d0d3a04eadb51b6c725d4163c0e51c7dfa9e5d11 Mon Sep 17 00:00:00 2001 From: cw882 Date: Wed, 13 Apr 2016 16:17:34 +0100 Subject: [PATCH 114/415] Update pathjs.d.ts Typo. Changed rescure to rescue --- pathjs/pathjs.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pathjs/pathjs.d.ts b/pathjs/pathjs.d.ts index dd81115df7..6b6193b222 100644 --- a/pathjs/pathjs.d.ts +++ b/pathjs/pathjs.d.ts @@ -35,7 +35,7 @@ interface IPath { root(path: string): void; - rescure(fn: Function): void; + rescue(fn: Function): void; history: IPathHistory; @@ -50,4 +50,4 @@ interface IPath { routes: IPathRoutes } -declare var Path: IPath; \ No newline at end of file +declare var Path: IPath; From 65349c521af7101550c1cfa4b00f242d56300c9c Mon Sep 17 00:00:00 2001 From: fernandocanocapdepon Date: Thu, 14 Apr 2016 08:11:41 +0200 Subject: [PATCH 115/415] Object like parameter in Bitmap contructor --- easeljs/easeljs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easeljs/easeljs.d.ts b/easeljs/easeljs.d.ts index a76e72b350..3ddeabdef9 100644 --- a/easeljs/easeljs.d.ts +++ b/easeljs/easeljs.d.ts @@ -43,7 +43,7 @@ declare namespace createjs { export class Bitmap extends DisplayObject { - constructor(imageOrUrl: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | string); + constructor(imageOrUrl: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | Object | string); // properties image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement; From 953909b32fd3f372845d719f6cfa1979f7757566 Mon Sep 17 00:00:00 2001 From: "Remo H. Jansen" Date: Fri, 15 Apr 2016 02:00:20 +0100 Subject: [PATCH 116/415] Fixed issue in type definitions --- redux-immutable/redux-immutable.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/redux-immutable/redux-immutable.d.ts b/redux-immutable/redux-immutable.d.ts index 21c9096846..df0f3745af 100644 --- a/redux-immutable/redux-immutable.d.ts +++ b/redux-immutable/redux-immutable.d.ts @@ -3,6 +3,8 @@ // Definitions by: Pedro Pereira // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + declare module "redux-immutable" { - export function combineReducers(reducers : Object): Object; -} \ No newline at end of file + export function combineReducers(reducers : Object): Redux.Reducer; +} From 7879e9ca3fef01d7169590126b080cfd5f940c04 Mon Sep 17 00:00:00 2001 From: Atanas Atanasov Date: Sun, 17 Apr 2016 18:14:51 +0300 Subject: [PATCH 117/415] Create grid.d.ts --- gijgo/grid.d.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 gijgo/grid.d.ts diff --git a/gijgo/grid.d.ts b/gijgo/grid.d.ts new file mode 100644 index 0000000000..5a5faf4840 --- /dev/null +++ b/gijgo/grid.d.ts @@ -0,0 +1,4 @@ +// Type definitions for Gijgo v0.6.2 +// Project: http://gijgo.com +// Definitions by: Atanas Atanasov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 2fa4349bcc080ff6e8ca2ad6fbe022244839b46a Mon Sep 17 00:00:00 2001 From: gcroteau Date: Wed, 20 Apr 2016 16:11:22 -0400 Subject: [PATCH 118/415] Changed declare namespace turf to declare module turf --- turf/turf.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turf/turf.d.ts b/turf/turf.d.ts index 6ed1d617a3..00ad1dbeb5 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -5,7 +5,7 @@ /// -declare namespace turf { +declare module turf { ////////////////////////////////////////////////////// // Aggregation ////////////////////////////////////////////////////// From 883efbaf351963ee373edd7cfeb55b7864eea688 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 22 Apr 2016 23:33:16 +0930 Subject: [PATCH 119/415] added material-design-lite definition and tests --- .../material-design-lite-tests.ts | 38 ++++++ .../material-design-lite.d.ts | 128 ++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 material-design-lite/material-design-lite-tests.ts create mode 100644 material-design-lite/material-design-lite.d.ts diff --git a/material-design-lite/material-design-lite-tests.ts b/material-design-lite/material-design-lite-tests.ts new file mode 100644 index 0000000000..afbf5faf15 --- /dev/null +++ b/material-design-lite/material-design-lite-tests.ts @@ -0,0 +1,38 @@ +// Test file for Google Maps JavaScript API Definition file +/// + +componentHandler.upgradeDom(); +componentHandler.upgradeDom('MaterialButton'); +componentHandler.upgradeDom('MaterialButton', 'mdl-button'); + +componentHandler.upgradeElement(document.createElement('div')); +componentHandler.upgradeElement(document.getElementById('id')); +componentHandler.upgradeElement(document.getElementsByTagName('button')[0], 'MaterialButton'); + +componentHandler.upgradeElements(document.getElementsByTagName('div')); +componentHandler.upgradeElements([document.createElement('div')]); +componentHandler.upgradeElements(document.querySelectorAll('div.mdl-button')); + +componentHandler.upgradeAllRegistered(); + +componentHandler.registerUpgradedCallback('MaterialButton', function(element : HTMLElement) {}); + +componentHandler.register({ + constructor: function(element: HTMLElement) {}, + classAsString: 'MaterialCheese', + cssClass: 'mdl-cheese' +}); +componentHandler.register({ + constructor: function(element: HTMLElement) {}, + classAsString: 'MaterialFoo', + cssClass: 'mdl-foo', + widget: true +}); +componentHandler.register({ + constructor: function(element: HTMLElement) {}, + classAsString: 'MaterialFoo', + cssClass: 'mdl-foo', + widget: 'FooBar' +}); + +componentHandler.downgradeElements(document.querySelectorAll('div')); diff --git a/material-design-lite/material-design-lite.d.ts b/material-design-lite/material-design-lite.d.ts new file mode 100644 index 0000000000..11b93ea792 --- /dev/null +++ b/material-design-lite/material-design-lite.d.ts @@ -0,0 +1,128 @@ +// Type definitions for material-design-lite v1.1.3 +// Project: https://getmdl.io +// Definitions by: Brad Zacher +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module MaterialDesignLite { + interface ComponentHandler { + /** + * Searches existing DOM for elements of our component type and upgrades them + * if they have not already been upgraded. + */ + upgradeDom() : void; + /** + * Searches existing DOM for elements of our component type and upgrades them + * if they have not already been upgraded. + * + * @param {string} jsClass the programatic name of the element class we + * need to create a new instance of. + */ + upgradeDom(jsClass : string) : void; + /** + * Searches existing DOM for elements of our component type and upgrades them + * if they have not already been upgraded. + * + * @param {string} jsClass the programatic name of the element class we + * need to create a new instance of. + * @param {string} cssClass the name of the CSS class elements of this + * type will have. + */ + upgradeDom(jsClass : string, cssClass : string) : void; + + /** + * Upgrades a specific element rather than all in the DOM. + * + * @param {!Element} element The element we wish to upgrade. + */ + upgradeElement(element : HTMLElement) : void; + /** + * Upgrades a specific element rather than all in the DOM. + * + * @param {!Element} element The element we wish to upgrade. + * @param {string} jsClass Optional name of the class we want to upgrade + * the element to. + */ + upgradeElement(element : HTMLElement, jsClass : string) : void; + + /** + * Upgrades a specific list of elements rather than all in the DOM. + * + * @param {!Element} elements + * The elements we wish to upgrade. + */ + upgradeElements(elements : HTMLElement) : void; + /** + * Upgrades a specific list of elements rather than all in the DOM. + * + * @param {!Array} elements + * The elements we wish to upgrade. + */ + upgradeElements(elements : Array) : void; + /** + * Upgrades a specific list of elements rather than all in the DOM. + * + * @param {!NodeList} elements + * The elements we wish to upgrade. + */ + upgradeElements(elements : NodeList) : void; + /** + * Upgrades a specific list of elements rather than all in the DOM. + * + * @param {!HTMLCollection} elements + * The elements we wish to upgrade. + */ + upgradeElements(elements : HTMLCollection) : void; + + /** + * Upgrades all registered components found in the current DOM. This is + * automatically called on window load. + */ + upgradeAllRegistered() : void; + + /** + * Allows user to be alerted to any upgrades that are performed for a given + * component type + * + * @param {string} jsClass The class name of the MDL component we wish + * to hook into for any upgrades performed. + * @param {function(!HTMLElement)} callback The function to call upon an + * upgrade. This function should expect 1 parameter - the HTMLElement which + * got upgraded. + */ + registerUpgradedCallback(jsClass : string, callback : (element : HTMLElement) => any) : void; + + /** + * Registers a class for future use and attempts to upgrade existing DOM. + * + * @param {componentHandler.ComponentConfigPublic} config the registration configuration + */ + register(config : ComponentConfigPublic) : void; + + /** + * Downgrade either a given node, an array of nodes, or a NodeList. + * + * @param {!Node} nodes The list of nodes. + */ + downgradeElements(nodes : Node) : void; + /** + * Downgrade either a given node, an array of nodes, or a NodeList. + * + * @param {!Array} nodes The list of nodes. + */ + downgradeElements(nodes : Array) : void; + /** + * Downgrade either a given node, an array of nodes, or a NodeList. + * + * @param {!NodeList} nodes The list of nodes. + */ + downgradeElements(nodes : NodeList) : void; + } + interface ComponentConfigPublic { + constructor(element : HTMLElement) : void; + classAsString : string; + cssClass : string; + widget? : string | boolean; + } +} + +declare var componentHandler : MaterialDesignLite.ComponentHandler; \ No newline at end of file From fc60df8e926bc640727dd347de64360debda5417 Mon Sep 17 00:00:00 2001 From: yihuax Date: Fri, 22 Apr 2016 14:10:53 -0700 Subject: [PATCH 120/415] Updated Word APIs with correct version numbers and V1.3 Beta APIs --- office-js/office-js.d.ts | 2477 ++++++++++++++++++++++++++++++++++---- 1 file changed, 2223 insertions(+), 254 deletions(-) diff --git a/office-js/office-js.d.ts b/office-js/office-js.d.ts index 6761ab646c..e855776380 100644 --- a/office-js/office-js.d.ts +++ b/office-js/office-js.d.ts @@ -8596,13 +8596,12 @@ declare namespace Excel { function run(batch: (context: Excel.RequestContext) => OfficeExtension.IPromise): OfficeExtension.IPromise; } - declare namespace Word { /** * * The Application object. * - * [Api set: WordApi ] + * [Api set: WordApiDesktop 1.3 Beta] */ class Application extends OfficeExtension.ClientObject { /** @@ -8611,9 +8610,13 @@ declare namespace Word { * * @param base64File Optional. The base64 encoded .docx file. The default value is null. * - * [Api set: WordApi ] + * [Api set: WordApiDesktop 1.3 Beta] */ - createDoc(base64File?: string): Word.Document; + createDocument(base64File?: string): Word.Document; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Create a new instance of Word.Application object */ @@ -8623,85 +8626,124 @@ declare namespace Word { * * Represents the body of a document or a section. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class Body extends OfficeExtension.ClientObject { private m_contentControls; private m_font; private m_inlinePictures; + private m_lists; private m_paragraphs; + private m_parentBody; private m_parentContentControl; private m_style; + private m_tables; private m_text; + private m_type; private m__ReferenceId; /** * - * Gets the collection of rich text content control objects that are in the body. Read-only. + * Gets the collection of rich text content control objects in the body. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ contentControls: Word.ContentControlCollection; /** * - * Gets the text format of the body. Use this to get and set font name, size, color, and other properties. Read-only. + * Gets the text format of the body. Use this to get and set font name, size, color and other properties. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ font: Word.Font; /** * - * Gets the collection of inlinePicture objects that are in the body. The collection does not include floating images. Read-only. + * Gets the collection of inlinePicture objects in the body. The collection does not include floating images. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ inlinePictures: Word.InlinePictureCollection; /** * - * Gets the collection of paragraph objects that are in the body. Read-only. + * Gets the collection of list objects in the body. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] + */ + lists: Word.ListCollection; + /** + * + * Gets the collection of paragraph objects in the body. Read-only. + * + * [Api set: WordApi 1.1] */ paragraphs: Word.ParagraphCollection; + /** + * + * Gets the parent body of the body. For example, a table cell body's parent body could be a header. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentBody: Word.Body; /** * * Gets the content control that contains the body. Returns null if there isn't a parent content control. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ parentContentControl: Word.ContentControl; + /** + * + * Gets the collection of table objects in the body. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + tables: Word.TableCollection; /** * * Gets or sets the style used for the body. This is the name of the pre-installed or custom style. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ style: string; /** * * Gets the text of the body. Use the insertText method to insert text. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ text: string; + /** + * + * Gets the type of the body. The type can be 'MainDoc', 'Section', 'Header', 'Footer', or 'TableCell'. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + type: string; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; /** * * Clears the contents of the body object. The user can perform the undo operation on the cleared content. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ clear(): void; /** * * Gets the HTML representation of the body object. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getHtml(): OfficeExtension.ClientResult; /** * * Gets the OOXML (Office Open XML) representation of the body object. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getOoxml(): OfficeExtension.ClientResult; /** @@ -8710,7 +8752,7 @@ declare namespace Word { * * @param rangeLocation Optional. The range location can be 'Whole', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ getRange(rangeLocation?: string): Word.Range; /** @@ -8720,14 +8762,14 @@ declare namespace Word { * @param breakType Required. The break type to add to the body. * @param insertLocation Required. The value can be 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertBreak(breakType: string, insertLocation: string): void; /** * * Wraps the body object with a Rich Text content control. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertContentControl(): Word.ContentControl; /** @@ -8737,7 +8779,7 @@ declare namespace Word { * @param base64File Required. The base64 encoded content of a .docx file. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertFileFromBase64(base64File: string, insertLocation: string): Word.Range; /** @@ -8747,7 +8789,7 @@ declare namespace Word { * @param html Required. The HTML to be inserted in the document. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertHtml(html: string, insertLocation: string): Word.Range; /** @@ -8757,7 +8799,7 @@ declare namespace Word { * @param base64EncodedImage Required. The base64 encoded image to be inserted in the body. * @param insertLocation Required. The value can be 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: string): Word.InlinePicture; /** @@ -8767,7 +8809,7 @@ declare namespace Word { * @param ooxml Required. The OOXML to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertOoxml(ooxml: string, insertLocation: string): Word.Range; /** @@ -8777,9 +8819,21 @@ declare namespace Word { * @param paragraphText Required. The paragraph text to be inserted. * @param insertLocation Required. The value can be 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; + /** + * + * Inserts a table with the specified number of rows and columns. The insertLocation value can be 'Start' or 'End'. + * + * @param rowCount Required. The number of rows in the table. + * @param columnCount Required. The number of columns in the table. + * @param insertLocation Required. The value can be 'Start' or 'End'. + * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. + * + * [Api set: WordApi 1.3 Beta] + */ + insertTable(rowCount: number, columnCount: number, insertLocation: string, values?: Array>): Word.Table; /** * * Inserts text into the body at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. @@ -8787,7 +8841,7 @@ declare namespace Word { * @param text Required. Text to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertText(text: string, insertLocation: string): Word.Range; /** @@ -8797,7 +8851,7 @@ declare namespace Word { * @param searchText Required. The search text. * @param searchOptions Optional. Options for the search. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean; @@ -8815,31 +8869,25 @@ declare namespace Word { * * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ select(selectionMode?: string): void; - /** - * - * Splits the body into child ranges by using delimiters. - * - * @param delimiters Required. The delimiters as an array of strings. - * @param multiParagraphs Optional. Indicates whether a returned child range can cover multiple paragraphs. Default is false which indicates the paragraph boundaries are also used as delimiters. - * @param trimDelimiters Optional. Indicates whether to trim delimiters from the ranges in the range collection. Default is false which indicates that the delimiters are included in the ranges returned in the range collection. - * @param trimWhitespace Optional. Indicates whether to trim whitespace characters (spaces, tabs and column breaks) from the start and end of the ranges returned in the range collection. Default is false which indicates that whitespace characters at the start and end of the ranges are included in the range collection. - * - * [Api set: WordApi ] + _KeepReference(): void; + /** Handle results returned from the document + * @private */ - splitTextRanges(delimiters: Array, multiParagraphs?: boolean, trimDelimiters?: boolean, trimWhitespace?: boolean): Word.RangeCollection; + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.Body; + _initReferenceId(value: string): void; } /** * * Represents a content control. Content controls are bounded and potentially labeled regions in a document that serve as containers for specific types of content. Individual content controls may contain contents such as images, tables, or paragraphs of formatted text. Currently, only rich text content controls are supported. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class ContentControl extends OfficeExtension.ClientObject { private m_appearance; @@ -8850,11 +8898,16 @@ declare namespace Word { private m_font; private m_id; private m_inlinePictures; + private m_lists; private m_paragraphs; private m_parentContentControl; + private m_parentTable; + private m_parentTableCell; private m_placeholderText; private m_removeWhenEdited; private m_style; + private m_subtype; + private m_tables; private m_tag; private m_text; private m_title; @@ -8864,126 +8917,168 @@ declare namespace Word { * * Gets the collection of content control objects in the content control. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ contentControls: Word.ContentControlCollection; /** * * Gets the text format of the content control. Use this to get and set font name, size, color, and other properties. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ font: Word.Font; /** * * Gets the collection of inlinePicture objects in the content control. The collection does not include floating images. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ inlinePictures: Word.InlinePictureCollection; + /** + * + * Gets the collection of list objects in the content control. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + lists: Word.ListCollection; /** * * Get the collection of paragraph objects in the content control. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ paragraphs: Word.ParagraphCollection; /** * * Gets the content control that contains the content control. Returns null if there isn't a parent content control. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ parentContentControl: Word.ContentControl; + /** + * + * Gets the table that contains the content control. Returns null if it is not contained in a table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTable: Word.Table; + /** + * + * Gets the table cell that contains the content control. Returns null if it is not contained in a table cell. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTableCell: Word.TableCell; + /** + * + * Gets the collection of table objects in the content control. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + tables: Word.TableCollection; /** * * Gets or sets the appearance of the content control. The value can be 'boundingBox', 'tags' or 'hidden'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ appearance: string; /** * * Gets or sets a value that indicates whether the user can delete the content control. Mutually exclusive with removeWhenEdited. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ cannotDelete: boolean; /** * * Gets or sets a value that indicates whether the user can edit the contents of the content control. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ cannotEdit: boolean; /** * - * Gets or sets the color of the content control. Color is set in '#RRGGBB' format or by using the color name. + * Gets or sets the color of the content control. Color is specified in '#RRGGBB' format or by using the color name. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ color: string; /** * * Gets an integer that represents the content control identifier. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ id: number; /** * * Gets or sets the placeholder text of the content control. Dimmed text will be displayed when the content control is empty. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ placeholderText: string; /** * * Gets or sets a value that indicates whether the content control is removed after it is edited. Mutually exclusive with cannotDelete. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ removeWhenEdited: boolean; /** * * Gets or sets the style used for the content control. This is the name of the pre-installed or custom style. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ style: string; + /** + * + * Gets the content control subtype. The subtype can be 'RichTextInline', 'RichTextParagraphs', 'RichTextTableCell', 'RichTextTableRow' and 'RichTextTable' for rich text content controls. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + subtype: string; /** * * Gets or sets a tag to identify a content control. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ tag: string; /** * * Gets the text of the content control. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ text: string; /** * * Gets or sets the title for a content control. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ title: string; /** * * Gets the content control type. Only rich text content controls are supported currently. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ type: string; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; /** * * Clears the contents of the content control. The user can perform the undo operation on the cleared content. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ clear(): void; /** @@ -8992,21 +9087,21 @@ declare namespace Word { * * @param keepContent Required. Indicates whether the content should be deleted with the content control. If keepContent is set to true, the content is not deleted. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ delete(keepContent: boolean): void; /** * * Gets the HTML representation of the content control object. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getHtml(): OfficeExtension.ClientResult; /** * * Gets the Office Open XML (OOXML) representation of the content control object. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getOoxml(): OfficeExtension.ClientResult; /** @@ -9015,17 +9110,27 @@ declare namespace Word { * * @param rangeLocation Optional. The range location can be 'Whole', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ getRange(rangeLocation?: string): Word.Range; /** * - * Inserts a break at the specified location in the main document. The insertLocation value can be 'Start', 'End', 'Before' or 'After'. + * Gets the text ranges in the content control by using punctuation marks and/or space character. + * + * @param punctuationMarks Required. The punctuation marks and/or space character as an array of strings. + * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. + * + * [Api set: WordApi 1.3 Beta] + */ + getTextRanges(punctuationMarks: Array, trimSpacing?: boolean): Word.RangeCollection; + /** + * + * Inserts a break at the specified location in the main document. The insertLocation value can be 'Start', 'End', 'Before' or 'After'. This method cannot be used with 'RichTextTable', 'RichTextTableRow' and 'RichTextTableCell' content controls. * * @param breakType Required. Type of break. * @param insertLocation Required. The value can be 'Start', 'End', 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertBreak(breakType: string, insertLocation: string): void; /** @@ -9033,9 +9138,9 @@ declare namespace Word { * Inserts a document into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * * @param base64File Required. The base64 encoded content of a .docx file. - * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. + * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. 'Replace' cannot be used with 'RichTextTable' and 'RichTextTableRow' content controls. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertFileFromBase64(base64File: string, insertLocation: string): Word.Range; /** @@ -9043,9 +9148,9 @@ declare namespace Word { * Inserts HTML into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * * @param html Required. The HTML to be inserted in to the content control. - * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. + * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. 'Replace' cannot be used with 'RichTextTable' and 'RichTextTableRow' content controls. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertHtml(html: string, insertLocation: string): Word.Range; /** @@ -9053,9 +9158,9 @@ declare namespace Word { * Inserts an inline picture into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * * @param base64EncodedImage Required. The base64 encoded image to be inserted in the content control. - * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. + * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. 'Replace' cannot be used with 'RichTextTable' and 'RichTextTableRow' content controls. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: string): Word.InlinePicture; /** @@ -9063,9 +9168,9 @@ declare namespace Word { * Inserts OOXML into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * * @param ooxml Required. The OOXML to be inserted in to the content control. - * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. + * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. 'Replace' cannot be used with 'RichTextTable' and 'RichTextTableRow' content controls. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertOoxml(ooxml: string, insertLocation: string): Word.Range; /** @@ -9073,19 +9178,31 @@ declare namespace Word { * Inserts a paragraph at the specified location. The insertLocation value can be 'Start', 'End', 'Before' or 'After'. * * @param paragraphText Required. The paragrph text to be inserted. - * @param insertLocation Required. The value can be 'Start', 'End', 'Before' or 'After'. + * @param insertLocation Required. The value can be 'Start', 'End', 'Before' or 'After'. 'Before' and 'After' cannot be used with 'RichTextTable', 'RichTextTableRow' and 'RichTextTableCell' content controls. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; + /** + * + * Inserts a table with the specified number of rows and columns into, or next to, a content control. The insertLocation value can be 'Start', 'End', 'Before' or 'After'. + * + * @param rowCount Required. The number of rows in the table. + * @param columnCount Required. The number of columns in the table. + * @param insertLocation Required. The value can be 'Start', 'End', 'Before' or 'After'. 'Before' and 'After' cannot be used with 'RichTextTable', 'RichTextTableRow' and 'RichTextTableCell' content controls. + * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. + * + * [Api set: WordApi 1.3 Beta] + */ + insertTable(rowCount: number, columnCount: number, insertLocation: string, values?: Array>): Word.Table; /** * * Inserts text into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * * @param text Required. The text to be inserted in to the content control. - * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. + * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. 'Replace' cannot be used with 'RichTextTable' and 'RichTextTableRow' content controls. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertText(text: string, insertLocation: string): Word.Range; /** @@ -9095,7 +9212,7 @@ declare namespace Word { * @param searchText Required. The search text. * @param searchOptions Optional. Options for the search. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean; @@ -9113,7 +9230,7 @@ declare namespace Word { * * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ select(selectionMode?: string): void; /** @@ -9121,36 +9238,57 @@ declare namespace Word { * Splits the content control into child ranges by using delimiters. * * @param delimiters Required. The delimiters as an array of strings. - * @param multiParagraphs Optional. Indicates whether a returned child range can cover multiple paragraphs. Default is false which indicates the paragraph boundaries are also used as delimiters. + * @param multiParagraphs Optional. Indicates whether a returned child range can cover multiple paragraphs. Default is false which indicates that the paragraph boundaries are also used as delimiters. * @param trimDelimiters Optional. Indicates whether to trim delimiters from the ranges in the range collection. Default is false which indicates that the delimiters are included in the ranges returned in the range collection. - * @param trimWhitespace Optional. Indicates whether to trim whitespace characters (spaces, tabs and column breaks) from the start and end of the ranges returned in the range collection. Default is false which indicates that whitespace characters at the start and end of the ranges are included in the range collection. + * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ - splitTextRanges(delimiters: Array, multiParagraphs?: boolean, trimDelimiters?: boolean, trimWhitespace?: boolean): Word.RangeCollection; + split(delimiters: Array, multiParagraphs?: boolean, trimDelimiters?: boolean, trimSpacing?: boolean): Word.RangeCollection; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.ContentControl; + _initReferenceId(value: string): void; } /** * * Contains a collection of ContentControl objects. Content controls are bounded and potentially labeled regions in a document that serve as containers for specific types of content. Individual content controls may contain contents such as images, tables, or paragraphs of formatted text. Currently, only rich text content controls are supported. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class ContentControlCollection extends OfficeExtension.ClientObject { + private m_first; private m__ReferenceId; private m__items; + /** + * + * Gets the first content control in this collection. Read-only. + * + * [Api set: WordApiDesktop 1.3 Beta] + */ + first: Word.ContentControl; /** Gets the loaded child items in this collection. */ items: Array; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; /** * * Gets a content control by its identifier. * * @param id Required. A content control identifier. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getById(id: number): Word.ContentControl; /** @@ -9159,7 +9297,7 @@ declare namespace Word { * * @param tag Required. A tag set on a content control. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getByTag(tag: string): Word.ContentControlCollection; /** @@ -9168,28 +9306,43 @@ declare namespace Word { * * @param title Required. The title of a content control. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getByTitle(title: string): Word.ContentControlCollection; + /** + * + * Gets the content controls that have the specified types and/or subtypes. + * + * @param types Required. An array of content control types and/or subtypes. + * + * [Api set: WordApiDesktop 1.3 Beta] + */ + getByTypes(types: Array): Word.ContentControlCollection; /** * * Gets a content control by its index in the collection. * * @param index The index * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getItem(index: number): Word.ContentControl; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.ContentControlCollection; + _initReferenceId(value: string): void; } /** * * The Document object is the top level object. A Document object contains one or more sections, content controls, and the body that contains the contents of the document. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class Document extends OfficeExtension.ClientObject { private m_body; @@ -9199,63 +9352,80 @@ declare namespace Word { private m__ReferenceId; /** * - * Gets the body of the document. The body is the text that excludes headers, footers, footnotes, textboxes, etc.. Read-only. + * Gets the body object of the document. The body is the text that excludes headers, footers, footnotes, textboxes, etc.. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ body: Word.Body; /** * - * Gets the collection of content control objects that are in the current document. This includes content controls in the body of the document, headers, footers, textboxes, etc.. Read-only. + * Gets the collection of content control objects in the current document. This includes content controls in the body of the document, headers, footers, textboxes, etc.. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ contentControls: Word.ContentControlCollection; /** * - * Gets the collection of section objects that are in the document. Read-only. + * Gets the collection of section objects in the document. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ sections: Word.SectionCollection; /** * * Indicates whether the changes in the document have been saved. A value of true indicates that the document hasn't changed since it was saved. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ saved: boolean; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; /** * * Gets the current selection of the document. Multiple selections are not supported. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getSelection(): Word.Range; /** * * Open the document. * - * [Api set: WordApi ] + * [Api set: WordApiDesktop 1.3 Beta] */ open(): void; /** * * Saves the document. This will use the Word default file naming convention if the document has not been saved before. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ save(): void; + _GetObjectByReferenceId(referenceId: string): OfficeExtension.ClientResult; + _GetObjectTypeNameByReferenceId(referenceId: string): OfficeExtension.ClientResult; + _KeepReference(): void; + _RemoveAllReferences(): void; + _RemoveReference(referenceId: string): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.Document; + _initReferenceId(value: string): void; } /** * * Represents a font. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class Font extends OfficeExtension.ClientObject { private m_bold; @@ -9274,89 +9444,102 @@ declare namespace Word { * * Gets or sets a value that indicates whether the font is bold. True if the font is formatted as bold, otherwise, false. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ bold: boolean; /** * * Gets or sets the color for the specified font. You can provide the value in the '#RRGGBB' format or the color name. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ color: string; /** * * Gets or sets a value that indicates whether the font has a double strike through. True if the font is formatted as double strikethrough text, otherwise, false. * - * [Api set: WordApi ] + * [Api set: WordApiDesktop 1.3 Beta] */ doubleStrikeThrough: boolean; /** * * Gets or sets the highlight color for the specified font. You can provide the value as either in the '#RRGGBB' format or the color name. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ highlightColor: string; /** * * Gets or sets a value that indicates whether the font is italicized. True if the font is italicized, otherwise, false. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ italic: boolean; /** * * Gets or sets a value that represents the name of the font. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ name: string; /** * * Gets or sets a value that represents the font size in points. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ size: number; /** * * Gets or sets a value that indicates whether the font has a strike through. True if the font is formatted as strikethrough text, otherwise, false. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ strikeThrough: boolean; /** * * Gets or sets a value that indicates whether the font is a subscript. True if the font is formatted as subscript, otherwise, false. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ subscript: boolean; /** * * Gets or sets a value that indicates whether the font is a superscript. True if the font is formatted as superscript, otherwise, false. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ superscript: boolean; /** * * Gets or sets a value that indicates the font's underline type. 'None' if the font is not underlined. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ underline: string; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.Font; + _initReferenceId(value: string): void; } /** * * Represents an inline picture. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class InlinePicture extends OfficeExtension.ClientObject { private m_altTextDescription; @@ -9365,86 +9548,124 @@ declare namespace Word { private m_hyperlink; private m_imageFormat; private m_lockAspectRatio; + private m_next; private m_paragraph; private m_parentContentControl; + private m_parentTable; + private m_parentTableCell; private m_width; private m__Id; private m__ReferenceId; + /** + * + * Gets the next inline image. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + next: Word.InlinePicture; /** * * Gets the paragraph that contains the inline image. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ paragraph: Word.Paragraph; /** * * Gets the content control that contains the inline image. Returns null if there isn't a parent content control. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ parentContentControl: Word.ContentControl; + /** + * + * Gets the table that contains the inline image. Returns null if it is not contained in a table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTable: Word.Table; + /** + * + * Gets the table cell that contains the inline image. Returns null if it is not contained in a table cell. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTableCell: Word.TableCell; /** * * Gets or sets a string that represents the alternative text associated with the inline image * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ altTextDescription: string; /** * * Gets or sets a string that contains the title for the inline image. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ altTextTitle: string; /** * * Gets or sets a number that describes the height of the inline image. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ height: number; /** * * Gets or sets the hyperlink associated with the inline image. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ hyperlink: string; /** * * Gets the format of the inline image. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ imageFormat: string; /** * * Gets or sets a value that indicates whether the inline image retains its original proportions when you resize it. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ lockAspectRatio: boolean; /** * * Gets or sets a number that describes the width of the inline image. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ width: number; + /** + * + * ID + * + * [Api set: WordApi] + */ + _Id: number; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; /** * * Deletes the inline picture from the document. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ delete(): void; /** * * Gets the base64 encoded string representation of the inline image. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getBase64ImageSrc(): OfficeExtension.ClientResult; /** @@ -9453,7 +9674,7 @@ declare namespace Word { * * @param rangeLocation Optional. The range location can be 'Whole', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ getRange(rangeLocation?: string): Word.Range; /** @@ -9463,14 +9684,14 @@ declare namespace Word { * @param breakType Required. The break type to add. * @param insertLocation Required. The value can be 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ insertBreak(breakType: string, insertLocation: string): void; /** * * Wraps the inline picture with a rich text content control. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertContentControl(): Word.ContentControl; /** @@ -9480,7 +9701,7 @@ declare namespace Word { * @param base64File Required. The base64 encoded content of a .docx file. * @param insertLocation Required. The value can be 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ insertFileFromBase64(base64File: string, insertLocation: string): Word.Range; /** @@ -9490,7 +9711,7 @@ declare namespace Word { * @param html Required. The HTML to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ insertHtml(html: string, insertLocation: string): Word.Range; /** @@ -9500,7 +9721,7 @@ declare namespace Word { * @param base64EncodedImage Required. The base64 encoded image to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: string): Word.InlinePicture; /** @@ -9510,7 +9731,7 @@ declare namespace Word { * @param ooxml Required. The OOXML to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ insertOoxml(ooxml: string, insertLocation: string): Word.Range; /** @@ -9520,7 +9741,7 @@ declare namespace Word { * @param paragraphText Required. The paragraph text to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; /** @@ -9530,7 +9751,7 @@ declare namespace Word { * @param text Required. Text to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ insertText(text: string, insertLocation: string): Word.Range; /** @@ -9539,35 +9760,257 @@ declare namespace Word { * * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ select(selectionMode?: string): void; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.InlinePicture; + _initReferenceId(value: string): void; } /** * * Contains a collection of [inlinePicture](inlinePicture.md) objects. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class InlinePictureCollection extends OfficeExtension.ClientObject { + private m_first; private m__ReferenceId; private m__items; + /** + * + * Gets the first inline image in this collection. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + first: Word.InlinePicture; /** Gets the loaded child items in this collection. */ items: Array; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Gets an inline picture object by its index in the collection. + * + * @param index A number that identifies the index location of an inline picture object. + * + * [Api set: WordApi 1.1] + */ + _GetItem(index: number): Word.InlinePicture; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.InlinePictureCollection; + _initReferenceId(value: string): void; + } + /** + * + * Contains a collection of [paragraph](paragraph.md) objects. + * + * [Api set: WordApi 1.3 Beta] + */ + class List extends OfficeExtension.ClientObject { + private m_format; + private m_id; + private m__ReferenceId; + /** + * + * An object that represents the list format. + * + * [Api set: WordApi 1.3 Beta] + */ + format: Word.ListFormat; + /** + * + * Gets the list's id. + * + * [Api set: WordApi 1.3 Beta] + */ + id: number; + _ReferenceId: string; + /** + * + * Gets the paragraphs in the list. + * + * @param topLevelOnly Optional. Indicates whether to get all paragraphs, or just the top level paragraphs. The default is false that specifies to get all paragraphs. + * + * [Api set: WordApi 1.3 Beta] + */ + getParagraphs(topLevelOnly?: boolean): Word.ParagraphCollection; + /** + * + * Inserts a paragraph at the specified location. The insertLocation value can be 'Start', 'End', 'Before' or 'After'. + * + * @param paragraphText Required. The paragraph text to be inserted. + * @param insertLocation Required. The value can be 'Start', 'End', 'Before' or 'After'. + * + * [Api set: WordApi 1.3 Beta] + */ + insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.List; + _initReferenceId(value: string): void; + } + /** + * + * Contains a collection of [list](list.md) objects. + * + * [Api set: WordApi 1.3 Beta] + */ + class ListCollection extends OfficeExtension.ClientObject { + private m_first; + private m__ReferenceId; + private m__items; + /** + * + * Gets the first list in this collection. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + first: Word.List; + /** Gets the loaded child items in this collection. */ + items: Array; + _ReferenceId: string; + /** + * + * Gets a list by its identifier. + * + * @param id Required. A list identifier. + * + * [Api set: WordApi 1.3 Beta] + */ + getById(id: number): Word.List; + /** + * + * Gets a list object by its index in the collection. + * + * @param index A number that identifies the index location of a list object. + * + * [Api set: WordApi 1.3 Beta] + */ + _GetItem(index: number): Word.List; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.ListCollection; + _initReferenceId(value: string): void; + } + /** + * + * Represents a list's format. + * + * [Api set: WordApi 1.3 Beta] + */ + class ListFormat extends OfficeExtension.ClientObject { + private m_levelTypes; + private m__ReferenceId; + /** + * + * Gets all 9 level types in the list. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + levelTypes: Array; + _ReferenceId: string; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.ListFormat; + _initReferenceId(value: string): void; + } + /** + * + * Represents the paragraph list item format. + * + * [Api set: WordApi 1.3 Beta] + */ + class ListItem extends OfficeExtension.ClientObject { + private m_listString; + private m_siblingIndex; + private m__ReferenceId; + /** + * + * Gets the list item bullet or number as a string. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + listString: string; + /** + * + * Gets the list item order number in relation to its siblings. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + siblingIndex: number; + _ReferenceId: string; + /** + * + * Gets the list item parent, or the closest ancestor if the parent does not exist. + * + * @param parentOnly Optional. Specified only the list item's parent will be returned. The default is false that specifies to get the lowest ancestor. + * + * [Api set: WordApiDesktop 1.3 Beta] + */ + getAncestor(parentOnly?: boolean): Word.Paragraph; + /** + * + * Gets all descendant list items of the list item. + * + * @param directChildrenOnly Optional. Specified only the list item's direct children will be returned. The default is false that indicates to get all descendant items. + * + * [Api set: WordApiDesktop 1.3 Beta] + */ + getDescendants(directChildrenOnly?: boolean): Word.ParagraphCollection; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.ListItem; + _initReferenceId(value: string): void; } /** * * Represents a single paragraph in a selection, range, content control, or document body. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class Paragraph extends OfficeExtension.ClientObject { private m_alignment; @@ -9579,161 +10022,239 @@ declare namespace Word { private m_lineSpacing; private m_lineUnitAfter; private m_lineUnitBefore; + private m_list; + private m_listItem; private m_listLevel; + private m_next; private m_outlineLevel; + private m_parentBody; private m_parentContentControl; + private m_parentTable; + private m_parentTableCell; + private m_previous; private m_rightIndent; private m_spaceAfter; private m_spaceBefore; private m_style; + private m_tableNestingLevel; private m_text; private m__Id; private m__ReferenceId; /** * - * Gets the collection of content control objects that are in the paragraph. Read-only. + * Gets the collection of content control objects in the paragraph. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ contentControls: Word.ContentControlCollection; /** * * Gets the text format of the paragraph. Use this to get and set font name, size, color, and other properties. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ font: Word.Font; /** * - * Gets the collection of inlinePicture objects that are in the paragraph. The collection does not include floating images. Read-only. + * Gets the collection of inlinePicture objects in the paragraph. The collection does not include floating images. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ inlinePictures: Word.InlinePictureCollection; + /** + * + * Gets the List to which this paragraph belongs. Returns null if the paragraph is not in a list. + * + * [Api set: WordApi 1.3 Beta] + */ + list: Word.List; + /** + * + * Gets the ListItem for the paragraph. Returns null if the paragraph is not part of a list. + * + * [Api set: WordApi 1.3 Beta] + */ + listItem: Word.ListItem; + /** + * + * Gets the next paragraph. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + next: Word.Paragraph; + /** + * + * Gets the parent body of the paragraph. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentBody: Word.Body; /** * * Gets the content control that contains the paragraph. Returns null if there isn't a parent content control. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ parentContentControl: Word.ContentControl; + /** + * + * Gets the table that contains the paragraph. Returns null if it is not contained in a table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTable: Word.Table; + /** + * + * Gets the table cell that contains the paragraph. Returns null if it is not contained in a table cell. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTableCell: Word.TableCell; + /** + * + * Gets the previous paragraph. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + previous: Word.Paragraph; /** * * Gets or sets the alignment for a paragraph. The value can be 'left', 'centered', 'right', or 'justified'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ alignment: string; /** * * Gets or sets the value, in points, for a first line or hanging indent. Use a positive value to set a first-line indent, and use a negative value to set a hanging indent. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ firstLineIndent: number; /** * * Gets or sets the left indent value, in points, for the paragraph. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ leftIndent: number; /** * * Gets or sets the line spacing, in points, for the specified paragraph. In the Word UI, this value is divided by 12. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ lineSpacing: number; /** * * Gets or sets the amount of spacing, in grid lines. after the paragraph. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ lineUnitAfter: number; /** * * Gets or sets the amount of spacing, in grid lines, before the paragraph. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ lineUnitBefore: number; /** * - * Gets or sets the list level of the paragraph. + * Gets or sets the list level of the paragraph. Set to -1 to make the paragraph appear outside of a list. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ listLevel: number; /** * * Gets or sets the outline level for the paragraph. * - * [Api set: WordApi ] + * [Api set: WordApiDesktop 1.3 Beta] */ outlineLevel: number; /** * * Gets or sets the right indent value, in points, for the paragraph. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ rightIndent: number; /** * * Gets or sets the spacing, in points, after the paragraph. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ spaceAfter: number; /** * * Gets or sets the spacing, in points, before the paragraph. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ spaceBefore: number; /** * * Gets or sets the style used for the paragraph. This is the name of the pre-installed or custom style. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ style: string; + /** + * + * Gets the level of the paragraph's table. It returns 0 if the paragraph is not in a table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + tableNestingLevel: number; /** * * Gets the text of the paragraph. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ text: string; + /** + * + * ID + * + * [Api set: WordApi] + */ + _Id: number; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; /** * * Clears the contents of the paragraph object. The user can perform the undo operation on the cleared content. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ clear(): void; /** * * Deletes the paragraph and its content from the document. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ delete(): void; /** * * Gets the HTML representation of the paragraph object. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getHtml(): OfficeExtension.ClientResult; /** * * Gets the Office Open XML (OOXML) representation of the paragraph object. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getOoxml(): OfficeExtension.ClientResult; /** @@ -9742,9 +10263,19 @@ declare namespace Word { * * @param rangeLocation Optional. The range location can be 'Whole', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ getRange(rangeLocation?: string): Word.Range; + /** + * + * Gets the text ranges in the paragraph by using punctuation marks and/or space character. + * + * @param punctuationMarks Required. The punctuation marks and/or space character as an array of strings. + * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. + * + * [Api set: WordApi 1.3 Beta] + */ + getTextRanges(punctuationMarks: Array, trimSpacing?: boolean): Word.RangeCollection; /** * * Inserts a break at the specified location in the main document. The insertLocation value can be 'Before' or 'After'. @@ -9752,14 +10283,14 @@ declare namespace Word { * @param breakType Required. The break type to add to the document. * @param insertLocation Required. The value can be 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertBreak(breakType: string, insertLocation: string): void; /** * * Wraps the paragraph object with a rich text content control. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertContentControl(): Word.ContentControl; /** @@ -9769,7 +10300,7 @@ declare namespace Word { * @param base64File Required. The base64 encoded content of a .docx file. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertFileFromBase64(base64File: string, insertLocation: string): Word.Range; /** @@ -9779,7 +10310,7 @@ declare namespace Word { * @param html Required. The HTML to be inserted in the paragraph. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertHtml(html: string, insertLocation: string): Word.Range; /** @@ -9789,7 +10320,7 @@ declare namespace Word { * @param base64EncodedImage Required. The base64 encoded image to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: string): Word.InlinePicture; /** @@ -9799,7 +10330,7 @@ declare namespace Word { * @param ooxml Required. The OOXML to be inserted in the paragraph. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertOoxml(ooxml: string, insertLocation: string): Word.Range; /** @@ -9809,9 +10340,21 @@ declare namespace Word { * @param paragraphText Required. The paragraph text to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; + /** + * + * Inserts a table with the specified number of rows and columns. The insertLocation value can be 'Before' or 'After'. + * + * @param rowCount Required. The number of rows in the table. + * @param columnCount Required. The number of columns in the table. + * @param insertLocation Required. The value can be 'Before' or 'After'. + * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. + * + * [Api set: WordApi 1.3 Beta] + */ + insertTable(rowCount: number, columnCount: number, insertLocation: string, values?: Array>): Word.Table; /** * * Inserts text into the paragraph at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. @@ -9819,7 +10362,7 @@ declare namespace Word { * @param text Required. Text to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertText(text: string, insertLocation: string): Word.Range; /** @@ -9829,7 +10372,7 @@ declare namespace Word { * @param searchText Required. The search text. * @param searchOptions Optional. Options for the search. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean; @@ -9847,7 +10390,7 @@ declare namespace Word { * * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ select(selectionMode?: string): void; /** @@ -9856,110 +10399,223 @@ declare namespace Word { * * @param delimiters Required. The delimiters as an array of strings. * @param trimDelimiters Optional. Indicates whether to trim delimiters from the ranges in the range collection. Default is false which indicates that the delimiters are included in the ranges returned in the range collection. - * @param trimWhitespace Optional. Indicates whether to trim whitespace characters (spaces, tabs and column breaks) from the start and end of the ranges returned in the range collection. Default is false which indicates that whitespace characters at the start and end of the ranges are included in the range collection. + * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ - splitTextRanges(delimiters: Array, trimDelimiters?: boolean, trimWhitespace?: boolean): Word.RangeCollection; + split(delimiters: Array, trimDelimiters?: boolean, trimSpacing?: boolean): Word.RangeCollection; + /** + * + * Uses the paragraph to start a new list. + * + * [Api set: WordApi 1.3 Beta] + */ + startNewList(): Word.List; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.Paragraph; + _initReferenceId(value: string): void; } /** * * Contains a collection of [paragraph](paragraph.md) objects. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class ParagraphCollection extends OfficeExtension.ClientObject { + private m_first; + private m_last; private m__ReferenceId; private m__items; + /** + * + * Gets the first paragraph in this collection. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + first: Word.Paragraph; + /** + * + * Gets the last paragraph in this collection. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + last: Word.Paragraph; /** Gets the loaded child items in this collection. */ items: Array; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Gets a paragraph object by its index in the collection. + * + * @param index A number that identifies the index location of a paragraph object. + * + * [Api set: WordApi 1.1] + */ + _GetItem(index: number): Word.Paragraph; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.ParagraphCollection; + _initReferenceId(value: string): void; } /** * * Represents a contiguous area in a document. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class Range extends OfficeExtension.ClientObject { private m_contentControls; private m_font; + private m_hyperlink; private m_inlinePictures; private m_isEmpty; + private m_lists; private m_paragraphs; + private m_parentBody; private m_parentContentControl; + private m_parentTable; + private m_parentTableCell; private m_style; + private m_tables; private m_text; private m__Id; private m__ReferenceId; /** * - * Gets the collection of content control objects that are in the range. Read-only. + * Gets the collection of content control objects in the range. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ contentControls: Word.ContentControlCollection; /** * * Gets the text format of the range. Use this to get and set font name, size, color, and other properties. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ font: Word.Font; /** * - * Gets the collection of inline picture objects that are in the range. Read-only. + * Gets the collection of inline picture objects in the range. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ inlinePictures: Word.InlinePictureCollection; /** * - * Gets the collection of paragraph objects that are in the range. Read-only. + * Gets the collection of list objects in the range. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] + */ + lists: Word.ListCollection; + /** + * + * Gets the collection of paragraph objects in the range. Read-only. + * + * [Api set: WordApi 1.1] */ paragraphs: Word.ParagraphCollection; + /** + * + * Gets the parent body of the range. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentBody: Word.Body; /** * * Gets the content control that contains the range. Returns null if there isn't a parent content control. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ parentContentControl: Word.ContentControl; + /** + * + * Gets the table that contains the range. Returns null if it is not contained in a table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTable: Word.Table; + /** + * + * Gets the table cell that contains the range. Returns null if it is not contained in a table cell. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTableCell: Word.TableCell; + /** + * + * Gets the collection of table objects in the range. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + tables: Word.TableCollection; + /** + * + * Gets the first hyperlink in the range, or sets a hyperlink on the range. Existing hyperlinks in this range are deleted when you set a new hyperlink. + * + * [Api set: WordApi 1.3 Beta] + */ + hyperlink: string; /** * * Checks whether the range length is zero. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ isEmpty: boolean; /** * * Gets or sets the style used for the range. This is the name of the pre-installed or custom style. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ style: string; /** * * Gets the text of the range. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ text: string; + /** + * + * ID + * + * [Api set: WordApi] + */ + _Id: number; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; /** * * Clears the contents of the range object. The user can perform the undo operation on the cleared content. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ clear(): void; /** @@ -9968,14 +10624,14 @@ declare namespace Word { * * @param range Required. The range to compare with this range. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ compareLocationWith(range: Word.Range): OfficeExtension.ClientResult; /** * * Deletes the range and its content from the document. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ delete(): void; /** @@ -9984,21 +10640,38 @@ declare namespace Word { * * @param range Required. Another range. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ expandTo(range: Word.Range): void; /** * * Gets the HTML representation of the range object. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getHtml(): OfficeExtension.ClientResult; + /** + * + * Gets hyperlink child ranges within the range. + * + * [Api set: WordApi 1.3 Beta] + */ + getHyperlinkRanges(): Word.RangeCollection; + /** + * + * Gets the next text range by using punctuation marks and/or space character. + * + * @param punctuationMarks Required. The punctuation marks and/or space character as an array of strings. + * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the returned range. Default is false which indicates that spacing characters at the start and end of the range are included. + * + * [Api set: WordApi 1.3 Beta] + */ + getNextTextRange(punctuationMarks: Array, trimSpacing?: boolean): Word.Range; /** * * Gets the OOXML representation of the range object. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getOoxml(): OfficeExtension.ClientResult; /** @@ -10007,9 +10680,19 @@ declare namespace Word { * * @param rangeLocation Optional. The range location can be 'Whole', 'Start' or 'End'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ getRange(rangeLocation?: string): Word.Range; + /** + * + * Gets the text child ranges in the range by using punctuation marks and/or space character. + * + * @param punctuationMarks Required. The punctuation marks and/or space character as an array of strings. + * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. + * + * [Api set: WordApi 1.3 Beta] + */ + getTextRanges(punctuationMarks: Array, trimSpacing?: boolean): Word.RangeCollection; /** * * Inserts a break at the specified location in the main document. The insertLocation value can be 'Replace', 'Before' or 'After'. @@ -10017,14 +10700,14 @@ declare namespace Word { * @param breakType Required. The break type to add. * @param insertLocation Required. The value can be 'Replace', 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertBreak(breakType: string, insertLocation: string): void; /** * * Wraps the range object with a rich text content control. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertContentControl(): Word.ContentControl; /** @@ -10034,7 +10717,7 @@ declare namespace Word { * @param base64File Required. The base64 encoded content of a .docx file. * @param insertLocation Required. The value can be 'Replace', 'Start', 'End', 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertFileFromBase64(base64File: string, insertLocation: string): Word.Range; /** @@ -10044,7 +10727,7 @@ declare namespace Word { * @param html Required. The HTML to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start', 'End', 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertHtml(html: string, insertLocation: string): Word.Range; /** @@ -10054,7 +10737,7 @@ declare namespace Word { * @param base64EncodedImage Required. The base64 encoded image to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start', 'End', 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.2] */ insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: string): Word.InlinePicture; /** @@ -10064,7 +10747,7 @@ declare namespace Word { * @param ooxml Required. The OOXML to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start', 'End', 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertOoxml(ooxml: string, insertLocation: string): Word.Range; /** @@ -10074,9 +10757,21 @@ declare namespace Word { * @param paragraphText Required. The paragraph text to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; + /** + * + * Inserts a table with the specified number of rows and columns. The insertLocation value can be 'Before' or 'After'. + * + * @param rowCount Required. The number of rows in the table. + * @param columnCount Required. The number of columns in the table. + * @param insertLocation Required. The value can be 'Before' or 'After'. + * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. + * + * [Api set: WordApi 1.3 Beta] + */ + insertTable(rowCount: number, columnCount: number, insertLocation: string, values?: Array>): Word.Table; /** * * Inserts text at the specified location. The insertLocation value can be 'Replace', 'Start', 'End', 'Before' or 'After'. @@ -10084,16 +10779,16 @@ declare namespace Word { * @param text Required. Text to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start', 'End', 'Before' or 'After'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ insertText(text: string, insertLocation: string): Word.Range; /** * - * Shrink the range to the intersection of the range with another range. + * Shrinks the range to the intersection of the range with another range. * * @param range Required. Another range. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ intersectWith(range: Word.Range): void; /** @@ -10103,7 +10798,7 @@ declare namespace Word { * @param searchText Required. The search text. * @param searchOptions Optional. Options for the search. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean; @@ -10121,7 +10816,7 @@ declare namespace Word { * * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ select(selectionMode?: string): void; /** @@ -10129,39 +10824,75 @@ declare namespace Word { * Splits the range into child ranges by using delimiters. * * @param delimiters Required. The delimiters as an array of strings. - * @param multiParagraphs Optional. Indicates whether a returned child range can cover multiple paragraphs. Default is false which indicates the paragraph boundaries are also used as delimiters. + * @param multiParagraphs Optional. Indicates whether a returned child range can cover multiple paragraphs. Default is false which indicates that the paragraph boundaries are also used as delimiters. * @param trimDelimiters Optional. Indicates whether to trim delimiters from the ranges in the range collection. Default is false which indicates that the delimiters are included in the ranges returned in the range collection. - * @param trimWhitespace Optional. Indicates whether to trim whitespace characters (spaces, tabs and column breaks) from the start and end of the child ranges returned in the range collection. Default is false which indicates that whitespace characters at the start and end of the child ranges are included in the range collection. + * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ - splitTextRanges(delimiters: Array, multiParagraphs?: boolean, trimDelimiters?: boolean, trimWhitespace?: boolean): Word.RangeCollection; + split(delimiters: Array, multiParagraphs?: boolean, trimDelimiters?: boolean, trimSpacing?: boolean): Word.RangeCollection; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.Range; + _initReferenceId(value: string): void; } /** * * Contains a collection of [range](range.md) objects. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ class RangeCollection extends OfficeExtension.ClientObject { + private m_first; private m__ReferenceId; private m__items; + /** + * + * Gets the first range in this collection. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + first: Word.Range; /** Gets the loaded child items in this collection. */ items: Array; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Gets a range object by its index in the collection. + * + * @param index A number that identifies the index location of a range object. + * + * [Api set: WordApi 1.3 Beta] + */ + _GetItem(index: number): Word.Range; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.RangeCollection; + _initReferenceId(value: string): void; } /** * * Specifies the options to be included in a search operation. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class SearchOptions extends OfficeExtension.ClientObject { private m_ignorePunct; @@ -10177,58 +10908,62 @@ declare namespace Word { * * Gets or sets a value that indicates whether to ignore all punctuation characters between words. Corresponds to the Ignore punctuation check box in the Find and Replace dialog box. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ ignorePunct: boolean; /** * * Gets or sets a value that indicates whether to ignore all whitespace between words. Corresponds to the Ignore whitespace characters check box in the Find and Replace dialog box. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ ignoreSpace: boolean; /** * * Gets or sets a value that indicates whether to perform a case sensitive search. Corresponds to the Match case check box in the Find and Replace dialog box (Edit menu). * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ matchCase: boolean; /** * * Gets or sets a value that indicates whether to match words that begin with the search string. Corresponds to the Match prefix check box in the Find and Replace dialog box. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ matchPrefix: boolean; /** * * Gets or sets a value that indicates whether to find words that sound similar to the search string. Corresponds to the Sounds like check box in the Find and Replace dialog box * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ matchSoundsLike: boolean; /** * * Gets or sets a value that indicates whether to match words that end with the search string. Corresponds to the Match suffix check box in the Find and Replace dialog box. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ matchSuffix: boolean; /** * * Gets or sets a value that indicates whether to find operation only entire words, not text that is part of a larger word. Corresponds to the Find whole words only check box in the Find and Replace dialog box. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ matchWholeWord: boolean; /** * * Gets or sets a value that indicates whether the search will be performed using special search operators. Corresponds to the Use wildcards check box in the Find and Replace dialog box. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ matchWildcards: boolean; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -10242,42 +10977,94 @@ declare namespace Word { * * Contains a collection of [range](range.md) objects as a result of a search operation. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class SearchResultCollection extends OfficeExtension.ClientObject { + private m_first; private m__ReferenceId; private m__items; + /** + * + * Gets the first searched result in this collection. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + first: Word.Range; /** Gets the loaded child items in this collection. */ items: Array; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Gets a range object by its index in the collection. + * + * @param index A number that identifies the index location of a range object. + * + * [Api set: WordApi 1.1] + */ + _GetItem(index: number): Word.Range; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.SearchResultCollection; + _initReferenceId(value: string): void; } /** * * Represents a section in a Word document. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class Section extends OfficeExtension.ClientObject { private m_body; + private m_next; private m__Id; private m__ReferenceId; /** * - * Gets the body of the section. This does not include the header/footer and other section metadata. Read-only. + * Gets the body object of the section. This does not include the header/footer and other section metadata. Read-only. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ body: Word.Body; + /** + * + * Gets the next section. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + next: Word.Section; + /** + * + * ID + * + * [Api set: WordApi] + */ + _Id: number; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; /** * * Gets one of the section's footers. * * @param type Required. The type of footer to return. This value can be: 'primary', 'firstPage' or 'evenPages'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getFooter(type: string): Word.Body; /** @@ -10286,46 +11073,1157 @@ declare namespace Word { * * @param type Required. The type of header to return. This value can be: 'primary', 'firstPage' or 'evenPages'. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ getHeader(type: string): Word.Body; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.Section; + _initReferenceId(value: string): void; } /** * * Contains the collection of the document's [section](section.md) objects. * - * [Api set: WordApi ] + * [Api set: WordApi 1.1] */ class SectionCollection extends OfficeExtension.ClientObject { + private m_first; private m__ReferenceId; private m__items; + /** + * + * Gets the first section in this collection. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + first: Word.Section; /** Gets the loaded child items in this collection. */ items: Array; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Gets a section object by its index in the collection. + * + * @param index A number that identifies the index location of a section object. + * + * [Api set: WordApi 1.1] + */ + _GetItem(index: number): Word.Section; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ load(option?: string | string[] | OfficeExtension.LoadOption): Word.SectionCollection; + _initReferenceId(value: string): void; } /** * - * ContentControl types + * Represents a table in a Word document. * - * [Api set: WordApi ] + * [Api set: WordApi 1.3 Beta] */ - namespace ContentControlType { + class Table extends OfficeExtension.ClientObject { + private m_cellPaddingBottom; + private m_cellPaddingLeft; + private m_cellPaddingRight; + private m_cellPaddingTop; + private m_font; + private m_headerRowCount; + private m_height; + private m_isUniform; + private m_nestingLevel; + private m_next; + private m_paragraphAfter; + private m_paragraphBefore; + private m_parentContentControl; + private m_parentTable; + private m_parentTableCell; + private m_rowCount; + private m_rows; + private m_shadingColor; + private m_style; + private m_styleBandedColumns; + private m_styleBandedRows; + private m_styleFirstColumn; + private m_styleLastColumn; + private m_styleTotalRow; + private m_tables; + private m_values; + private m_verticalAlignment; + private m_width; + private m__Id; + private m__ReferenceId; + /** + * + * Gets the font. Use this to get and set font name, size, color, and other properties. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + font: Word.Font; + /** + * + * Gets the next table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + next: Word.Table; + /** + * + * Gets the paragraph after the table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + paragraphAfter: Word.Paragraph; + /** + * + * Gets the paragraph before the table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + paragraphBefore: Word.Paragraph; + /** + * + * Gets the content control that contains the table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentContentControl: Word.ContentControl; + /** + * + * Gets the table that contains this table. Returns null if it is not contained in a table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTable: Word.Table; + /** + * + * Gets the table cell that contains this table. Returns null if it is not contained in a table cell. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTableCell: Word.TableCell; + /** + * + * Gets all of the table rows. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + rows: Word.TableRowCollection; + /** + * + * Gets the child tables nested one level deeper. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + tables: Word.TableCollection; + /** + * + * Gets and sets the default bottom cell padding in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingBottom: number; + /** + * + * Gets and sets the default left cell padding in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingLeft: number; + /** + * + * Gets and sets the default right cell padding in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingRight: number; + /** + * + * Gets and sets the default top cell padding in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingTop: number; + /** + * + * Gets and sets the number of header rows. + * + * [Api set: WordApi 1.3 Beta] + */ + headerRowCount: number; + /** + * + * Gets the height of the table in points. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + height: number; + /** + * + * Indicates whether all of the table rows are uniform. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + isUniform: boolean; + /** + * + * Gets the nesting level of the table. Top-level tables have level 1. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + nestingLevel: number; + /** + * + * Gets the number of rows in the table. + * + * [Api set: WordApi 1.3 Beta] + */ + rowCount: number; + /** + * + * Gets and sets the shading color. + * + * [Api set: WordApi 1.3 Beta] + */ + shadingColor: string; + /** + * + * Gets and sets the name of the table style. + * + * [Api set: WordApi 1.3 Beta] + */ + style: string; + /** + * + * Gets and sets whether the table has banded columns. + * + * [Api set: WordApi 1.3 Beta] + */ + styleBandedColumns: boolean; + /** + * + * Gets and sets whether the table has banded rows. + * + * [Api set: WordApi 1.3 Beta] + */ + styleBandedRows: boolean; + /** + * + * Gets and sets whether the table has a first column with a special style. + * + * [Api set: WordApi 1.3 Beta] + */ + styleFirstColumn: boolean; + /** + * + * Gets and sets whether the table has a last column with a special style. + * + * [Api set: WordApi 1.3 Beta] + */ + styleLastColumn: boolean; + /** + * + * Gets and sets whether the table has a total (last) row with a special style. + * + * [Api set: WordApi 1.3 Beta] + */ + styleTotalRow: boolean; + /** + * + * Gets and sets the text values in the table, as a 2D Javascript array. + * + * [Api set: WordApi 1.3 Beta] + */ + values: Array>; + /** + * + * Gets and sets the vertical alignment of every cell in the table. + * + * [Api set: WordApi 1.3 Beta] + */ + verticalAlignment: string; + /** + * + * Gets and sets the width of the table in points. + * + * [Api set: WordApi 1.3 Beta] + */ + width: number; + /** + * + * ID + * + * [Api set: WordApi] + */ + _Id: number; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Adds columns to the start or end of the table, using the first or last existing column as a template. This is applicable to uniform tables. The string values, if specified, are set in the newly inserted rows. + * + * @param insertLocation Required. It can be 'Start' or 'End', corresponding to the appropriate side of the table. + * @param columnCount Required. Number of columns to add. + * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. + * + * [Api set: WordApi 1.3 Beta] + */ + addColumns(insertLocation: string, columnCount: number, values?: Array>): void; + /** + * + * Adds rows to the start or end of the table, using the first or last existing row as a template. The string values, if specified, are set in the newly inserted rows. + * + * @param insertLocation Required. It can be 'Start' or 'End'. + * @param rowCount Required. Number of rows to add. + * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. + * + * [Api set: WordApi 1.3 Beta] + */ + addRows(insertLocation: string, rowCount: number, values?: Array>): void; + /** + * + * Autofits the table columns to the width of their contents. + * + * [Api set: WordApi 1.3 Beta] + */ + autoFitContents(): void; + /** + * + * Autofits the table columns to the width of the window. + * + * [Api set: WordApi 1.3 Beta] + */ + autoFitWindow(): void; + /** + * + * Clears the contents of the table. + * + * [Api set: WordApi 1.3 Beta] + */ + clear(): void; + /** + * + * Deletes the entire table. + * + * [Api set: WordApi 1.3 Beta] + */ + delete(): void; + /** + * + * Deletes specific columns. This is applicable to uniform tables. + * + * @param columnIndex Required. The first column to delete. + * @param columnCount Optional. The number of columns to delete. Default 1. + * + * [Api set: WordApi 1.3 Beta] + */ + deleteColumns(columnIndex: number, columnCount?: number): void; + /** + * + * Deletes specific rows. + * + * @param rowIndex Required. The first row to delete. + * @param rowCount Optional. The number of rows to delete. Default 1. + * + * [Api set: WordApi 1.3 Beta] + */ + deleteRows(rowIndex: number, rowCount?: number): void; + /** + * + * Distributes the column widths evenly. + * + * [Api set: WordApi 1.3 Beta] + */ + distributeColumns(): void; + /** + * + * Distributes the row heights evenly. + * + * [Api set: WordApi 1.3 Beta] + */ + distributeRows(): void; + /** + * + * Gets the border style for the specified border. + * + * @param borderLocation Required. The border location. + * + * [Api set: WordApi 1.3 Beta] + */ + getBorderStyle(borderLocation: string): Word.TableBorderStyle; + /** + * + * Gets the table cell at a specified row and column. + * + * @param rowIndex Required. The index of the row. + * @param cellIndex Required. The index of the cell in the row. + * + * [Api set: WordApi 1.3 Beta] + */ + getCell(rowIndex: number, cellIndex: number): Word.TableCell; + /** + * + * Gets the range that contains this table, or the range at the start or end of the table. + * + * @param rangeLocation Optional. The range location can be 'Whole', 'Start' or 'End'. + * + * [Api set: WordApi 1.3 Beta] + */ + getRange(rangeLocation: string): Word.Range; + /** + * + * Inserts a content control on the table. + * + * [Api set: WordApi 1.3 Beta] + */ + insertContentControl(): Word.ContentControl; + /** + * + * Inserts a paragraph at the specified location. The insertLocation value can be 'Before' or 'After'. + * + * @param paragraphText Required. The paragraph text to be inserted. + * @param insertLocation Required. The value can be 'Before' or 'After'. + * + * [Api set: WordApi 1.3 Beta] + */ + insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; + /** + * + * Inserts a table with the specified number of rows and columns. The insertLocation value can be 'Before' or 'After'. + * + * @param rowCount Required. The number of rows in the table. + * @param columnCount Required. The number of columns in the table. + * @param insertLocation Required. The value can be 'Before' or 'After'. + * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. + * + * [Api set: WordApi 1.3 Beta] + */ + insertTable(rowCount: number, columnCount: number, insertLocation: string, values?: Array>): Word.Table; + /** + * + * Merges the cells bounded inclusively by a first and last cell. + * + * @param topRow Required. The row of the first cell + * @param firstCell Required. The index of the first cell in its row + * @param bottomRow Required. The row of the last cell + * @param lastCell Required. The index of the last cell in its row + * + * [Api set: WordApiDesktop 1.3 Beta] + */ + mergeCells(topRow: number, firstCell: number, bottomRow: number, lastCell: number): Word.TableCell; + /** + * + * Performs a search with the specified searchOptions on the scope of the table object. The search results are a collection of range objects. + * + * @param searchText Required. The search text. + * @param searchOptions Optional. Options for the search. + * + * [Api set: WordApi 1.3 Beta] + */ + search(searchText: string, searchOptions?: Word.SearchOptions | { + ignorePunct?: boolean; + ignoreSpace?: boolean; + matchCase?: boolean; + matchPrefix?: boolean; + matchSoundsLike?: boolean; + matchSuffix?: boolean; + matchWholeWord?: boolean; + matchWildcards?: boolean; + }): Word.SearchResultCollection; + /** + * + * Selects the table, or the position at the start or end of the table, and navigates the Word UI to it. + * + * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. + * + * [Api set: WordApi 1.3 Beta] + */ + select(selectionMode?: string): void; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.Table; + _initReferenceId(value: string): void; + } + /** + * + * Contains the collection of the document's Table objects. + * + * [Api set: WordApi 1.3 Beta] + */ + class TableCollection extends OfficeExtension.ClientObject { + private m_first; + private m__ReferenceId; + private m__items; + /** + * + * Gets the first table in this collection. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + first: Word.Table; + /** Gets the loaded child items in this collection. */ + items: Array; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Gets a table object by its index in the collection. + * + * @param index A number that identifies the index location of a table object. + * + * [Api set: WordApi 1.3 Beta] + */ + _GetItem(index: number): Word.Table; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.TableCollection; + _initReferenceId(value: string): void; + } + /** + * + * Represents a row in a Word document. + * + * [Api set: WordApi 1.3 Beta] + */ + class TableRow extends OfficeExtension.ClientObject { + private m_cellCount; + private m_cellPaddingBottom; + private m_cellPaddingLeft; + private m_cellPaddingRight; + private m_cellPaddingTop; + private m_cells; + private m_font; + private m_isHeader; + private m_next; + private m_parentTable; + private m_preferredHeight; + private m_rowIndex; + private m_shadingColor; + private m_values; + private m_verticalAlignment; + private m__Id; + private m__ReferenceId; + /** + * + * Gets cells. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + cells: Word.TableCellCollection; + /** + * + * Gets the font. Use this to get and set font name, size, color, and other properties. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + font: Word.Font; + /** + * + * Gets the next row. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + next: Word.TableRow; + /** + * + * Gets parent table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTable: Word.Table; + /** + * + * Gets the number of cells in the row. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + cellCount: number; + /** + * + * Gets and sets the default bottom cell padding for the row in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingBottom: number; + /** + * + * Gets and sets the default left cell padding for the row in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingLeft: number; + /** + * + * Gets and sets the default right cell padding for the row in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingRight: number; + /** + * + * Gets and sets the default top cell padding for the row in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingTop: number; + /** + * + * Gets a value that indicates whether the row is a header row. Read-only. To set the number of header rows, use HeaderRowCount on the Table object. + * + * [Api set: WordApi 1.3 Beta] + */ + isHeader: boolean; + /** + * + * Gets and sets the preferred height of the row in points. + * + * [Api set: WordApi 1.3 Beta] + */ + preferredHeight: number; + /** + * + * Gets the index of the row in its parent table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + rowIndex: number; + /** + * + * Gets and sets the shading color. + * + * [Api set: WordApi 1.3 Beta] + */ + shadingColor: string; + /** + * + * Gets and sets the text values in the row, as a 1D Javascript array. + * + * [Api set: WordApi 1.3 Beta] + */ + values: Array; + /** + * + * Gets and sets the vertical alignment of the cells in the row. + * + * [Api set: WordApi 1.3 Beta] + */ + verticalAlignment: string; + /** + * + * ID + * + * [Api set: WordApi] + */ + _Id: number; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Clears the contents of the row. + * + * [Api set: WordApi 1.3 Beta] + */ + clear(): void; + /** + * + * Deletes the entire row. + * + * [Api set: WordApi 1.3 Beta] + */ + delete(): void; + /** + * + * Gets the border style of the cells in the row. + * + * @param borderLocation Required. The border location. + * + * [Api set: WordApi 1.3 Beta] + */ + getBorderStyle(borderLocation: string): Word.TableBorderStyle; + /** + * + * Inserts rows using this row as a template. If values are specified, inserts the values into the new rows. + * + * @param insertLocation Where the new rows should be inserted, relative to the current row. It can be 'Before' or 'After'. Required. + * @param rowCount Required. Number of rows to add + * @param values Strings to insert in the new rows, specified as a 2D array. The number of cells in each row must not exceed the number of cells in the existing row. Optional. + * + * [Api set: WordApi 1.3 Beta] + */ + insertRows(insertLocation: string, rowCount: number, values?: Array>): void; + /** + * + * Merges the row into one cell. + * + * [Api set: WordApiDesktop 1.3 Beta] + */ + merge(): Word.TableCell; + /** + * + * Performs a search with the specified searchOptions on the scope of the row. The search results are a collection of range objects. + * + * @param searchText Required. The search text. + * @param searchOptions Optional. Options for the search. + * + * [Api set: WordApi 1.3 Beta] + */ + search(searchText: string, searchOptions?: Word.SearchOptions | { + ignorePunct?: boolean; + ignoreSpace?: boolean; + matchCase?: boolean; + matchPrefix?: boolean; + matchSoundsLike?: boolean; + matchSuffix?: boolean; + matchWholeWord?: boolean; + matchWildcards?: boolean; + }): Word.SearchResultCollection; + /** + * + * Selects the row and navigates the Word UI to it. + * + * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. + * + * [Api set: WordApi 1.3 Beta] + */ + select(selectionMode?: string): void; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.TableRow; + _initReferenceId(value: string): void; + } + /** + * + * Contains the collection of the document's TableRow objects. + * + * [Api set: WordApi 1.3 Beta] + */ + class TableRowCollection extends OfficeExtension.ClientObject { + private m_first; + private m__ReferenceId; + private m__items; + /** + * + * Gets the first row in this collection. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + first: Word.TableRow; + /** Gets the loaded child items in this collection. */ + items: Array; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Gets a table row object by its index in the collection. + * + * @param index A number that identifies the index location of a table row object. + * + * [Api set: WordApi 1.3 Beta] + */ + _GetItem(index: number): Word.TableRow; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.TableRowCollection; + _initReferenceId(value: string): void; + } + /** + * + * Represents a table cell in a Word document. + * + * [Api set: WordApi 1.3 Beta] + */ + class TableCell extends OfficeExtension.ClientObject { + private m_body; + private m_cellIndex; + private m_cellPaddingBottom; + private m_cellPaddingLeft; + private m_cellPaddingRight; + private m_cellPaddingTop; + private m_columnWidth; + private m_next; + private m_parentRow; + private m_parentTable; + private m_rowIndex; + private m_shadingColor; + private m_value; + private m_verticalAlignment; + private m_width; + private m__Id; + private m__ReferenceId; + /** + * + * Gets the body object of the cell. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + body: Word.Body; + /** + * + * Gets the next cell. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + next: Word.TableCell; + /** + * + * Gets the parent row of the cell. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentRow: Word.TableRow; + /** + * + * Gets the parent table of the cell. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + parentTable: Word.Table; + /** + * + * Gets the index of the cell in its row. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + cellIndex: number; + /** + * + * Gets and sets the bottom padding of the cell in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingBottom: number; + /** + * + * Gets and sets the left padding of the cell in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingLeft: number; + /** + * + * Gets and sets the right padding of the cell in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingRight: number; + /** + * + * Gets and sets the top padding of the cell in points. + * + * [Api set: WordApi 1.3 Beta] + */ + cellPaddingTop: number; + /** + * + * Gets and sets the width of the cell's column in points. This is applicable to uniform tables. + * + * [Api set: WordApi 1.3 Beta] + */ + columnWidth: number; + /** + * + * Gets the index of the cell's row in the table. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + rowIndex: number; + /** + * + * Gets or sets the shading color of the cell. Color is specified in "#RRGGBB" format or by using the color name. + * + * [Api set: WordApi 1.3 Beta] + */ + shadingColor: string; + /** + * + * Gets and sets the text of the cell. + * + * [Api set: WordApi 1.3 Beta] + */ + value: string; + /** + * + * Gets and sets the vertical alignment of the cell. + * + * [Api set: WordApi 1.3 Beta] + */ + verticalAlignment: string; + /** + * + * Gets the width of the cell in points. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + width: number; + /** + * + * ID + * + * [Api set: WordApi] + */ + _Id: number; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Deletes the column containing this cell. This is applicable to uniform tables. + * + * [Api set: WordApi 1.3 Beta] + */ + deleteColumn(): void; + /** + * + * Deletes the row containing this cell. + * + * [Api set: WordApi 1.3 Beta] + */ + deleteRow(): void; + /** + * + * Gets the border style for the specified border. + * + * @param borderLocation Required. The border location. + * + * [Api set: WordApi 1.3 Beta] + */ + getBorderStyle(borderLocation: string): Word.TableBorderStyle; + /** + * + * Adds columns to the left or right of the cell, using the cell's column as a template. This is applicable to uniform tables. The string values, if specified, are set in the newly inserted rows. + * + * @param insertLocation Required. It can be 'Before' or 'After'. + * @param columnCount Required. Number of columns to add + * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. + * + * [Api set: WordApi 1.3 Beta] + */ + insertColumns(insertLocation: string, columnCount: number, values?: Array>): void; + /** + * + * Inserts rows above or below the cell, using the cell's row as a template. The string values, if specified, are set in the newly inserted rows. + * + * @param insertLocation Required. It can be 'Before' or 'After'. + * @param rowCount Required. Number of rows to add. + * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. + * + * [Api set: WordApi 1.3 Beta] + */ + insertRows(insertLocation: string, rowCount: number, values?: Array>): void; + /** + * + * Adds columns to the left or right of the cell, using the existing column as a template. The string values, if specified, are set in the newly inserted rows. + * + * @param rowCount Required. The number of rows to split into. Must be a divisor of the number of underlying rows. + * @param columnCount Required. The number of columns to split into. + * + * [Api set: WordApiDesktop 1.3 Beta] + */ + split(rowCount: number, columnCount: number): void; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.TableCell; + _initReferenceId(value: string): void; + } + /** + * + * Contains the collection of the document's TableCell objects. + * + * [Api set: WordApi 1.3 Beta] + */ + class TableCellCollection extends OfficeExtension.ClientObject { + private m_first; + private m__ReferenceId; + private m__items; + /** + * + * Gets the first table cell in this collection. Read-only. + * + * [Api set: WordApi 1.3 Beta] + */ + first: Word.TableCell; + /** Gets the loaded child items in this collection. */ + items: Array; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + /** + * + * Gets a table cell object by its index in the collection. + * + * @param index A number that identifies the index location of a table cell object. + * + * [Api set: WordApi 1.3 Beta] + */ + _GetItem(index: number): Word.TableCell; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.TableCellCollection; + _initReferenceId(value: string): void; + } + /** + * + * Specifies the border style + * + * [Api set: WordApi 1.3 Beta] + */ + class TableBorderStyle extends OfficeExtension.ClientObject { + private m_color; + private m_type; + private m_width; + private m__ReferenceId; + /** + * + * Gets or sets the table border color, as a hex value or name. + * + * [Api set: WordApi 1.3 Beta] + */ + color: string; + /** + * + * Gets or sets the type of the table border style. + * + * [Api set: WordApi 1.3 Beta] + */ + type: string; + /** + * + * Gets or sets the width, in points, of the table border style. + * + * [Api set: WordApi 1.3 Beta] + */ + width: number; + /** + * + * ReferenceId + * + * [Api set: WordApi] + */ + _ReferenceId: string; + _KeepReference(): void; + /** Handle results returned from the document + * @private + */ + _handleResult(value: any): void; + /** + * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. + */ + load(option?: string | string[] | OfficeExtension.LoadOption): Word.TableBorderStyle; + _initReferenceId(value: string): void; + } + /** + * + * Specifies supported content control types and subtypes. + * + * [Api set: WordApi] + */ + module ContentControlType { + var unknown: string; + var richTextInline: string; + var richTextParagraphs: string; + var richTextTableCell: string; + var richTextTableRow: string; + var richTextTable: string; + var plainTextInline: string; + var plainTextParagraph: string; + var picture: string; + var buildingBlockGallery: string; + var checkBox: string; + var comboBox: string; + var dropDownList: string; + var datePicker: string; + var repeatingSection: string; var richText: string; + var plainText: string; } /** * * ContentControl appearance * - * [Api set: WordApi ] + * [Api set: WordApi] */ - namespace ContentControlAppearance { + module ContentControlAppearance { var boundingBox: string; var tags: string; var hidden: string; @@ -10334,9 +12232,9 @@ declare namespace Word { * * Underline types * - * [Api set: WordApi ] + * [Api set: WordApi] */ - namespace UnderlineType { + module UnderlineType { var none: string; var single: string; var word: string; @@ -10351,9 +12249,9 @@ declare namespace Word { var wave: string; } /** - * [Api set: WordApi ] + * [Api set: WordApi] */ - namespace BreakType { + module BreakType { var page: string; var column: string; var next: string; @@ -10369,9 +12267,9 @@ declare namespace Word { * * The insertion location types * - * [Api set: WordApi ] + * [Api set: WordApi] */ - namespace InsertLocation { + module InsertLocation { var before: string; var after: string; var start: string; @@ -10379,9 +12277,9 @@ declare namespace Word { var replace: string; } /** - * [Api set: WordApi ] + * [Api set: WordApi] */ - namespace Alignment { + module Alignment { var unknown: string; var left: string; var centered: string; @@ -10389,25 +12287,36 @@ declare namespace Word { var justified: string; } /** - * [Api set: WordApi ] + * [Api set: WordApi] */ - namespace HeaderFooterType { + module HeaderFooterType { var primary: string; var firstPage: string; var evenPages: string; } /** - * [Api set: WordApi ] + * [Api set: WordApi] */ - namespace SelectionMode { + module BodyType { + var unknown: string; + var mainDoc: string; + var section: string; + var header: string; + var footer: string; + var tableCell: string; + } + /** + * [Api set: WordApi] + */ + module SelectionMode { var select: string; var start: string; var end: string; } /** - * [Api set: WordApi ] + * [Api set: WordApi] */ - namespace ImageFormat { + module ImageFormat { var unsupported: string; var undefined: string; var bmp: string; @@ -10423,17 +12332,17 @@ declare namespace Word { var pdf: string; } /** - * [Api set: WordApi ] + * [Api set: WordApi] */ - namespace RangeLocation { + module RangeLocation { var whole: string; var start: string; var end: string; } /** - * [Api set: WordApi ] + * [Api set: WordApi] */ - namespace LocationRelation { + module LocationRelation { var unrelated: string; var equal: string; var containsStart: string; @@ -10449,7 +12358,69 @@ declare namespace Word { var overlapsAfter: string; var after: string; } - namespace ErrorCodes { + /** + * [Api set: WordApi] + */ + module BorderLocation { + var top: string; + var left: string; + var bottom: string; + var right: string; + var insideHorizontal: string; + var insideVertical: string; + var inside: string; + var outside: string; + var all: string; + } + /** + * [Api set: WordApi] + */ + module BorderType { + var mixed: string; + var none: string; + var single: string; + var thick: string; + var double: string; + var hairline: string; + var dotted: string; + var dashed: string; + var dotDashed: string; + var dot2Dashed: string; + var triple: string; + var thinThickSmall: string; + var thickThinSmall: string; + var thinThickThinSmall: string; + var thinThickMed: string; + var thickThinMed: string; + var thinThickThinMed: string; + var thinThickLarge: string; + var thickThinLarge: string; + var thinThickThinLarge: string; + var wave: string; + var doubleWave: string; + var dashedSmall: string; + var dashDotStroked: string; + var threeDEmboss: string; + var threeDEngrave: string; + } + /** + * [Api set: WordApi] + */ + module VerticalAlignment { + var mixed: string; + var top: string; + var center: string; + var bottom: string; + } + /** + * [Api set: WordApi] + */ + module ListLevelType { + var bullet: string; + var number: string; + var picture: string; + } + module ErrorCodes { var accessDenied: string; var generalException: string; var invalidArgument: string; @@ -10463,10 +12434,8 @@ declare namespace Word { */ class RequestContext extends OfficeExtension.ClientRequestContext { private m_document; - private m_application; constructor(url?: string); document: Document; - application: Application; } /** * Executes a batch script that performs actions on the Word object model. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. From c2ca2ca89828b48cb979f3c6ee432f220b909b79 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 23 Apr 2016 10:48:56 +0930 Subject: [PATCH 121/415] adding react-mdl --- react-mdl/react-mdl-tests.tsx | 1044 +++++++++++++++++++++++++++++++++ react-mdl/react-mdl.d.ts | 606 +++++++++++++++++++ 2 files changed, 1650 insertions(+) create mode 100644 react-mdl/react-mdl-tests.tsx create mode 100644 react-mdl/react-mdl.d.ts diff --git a/react-mdl/react-mdl-tests.tsx b/react-mdl/react-mdl-tests.tsx new file mode 100644 index 0000000000..eb9981092a --- /dev/null +++ b/react-mdl/react-mdl-tests.tsx @@ -0,0 +1,1044 @@ +// Test file for react-mdl Definition file +/// + +import React = require('react'); +import {Badge, + FABButton, Button, IconButton, + Card, CardActions, CardTitle, CardText, CardMenu, CardMedia, + Checkbox, + DataTable, TableHeader, Table, + Dialog, DialogTitle, DialogContent, DialogActions, + Grid, Cell, + Icon, IconToggle, + Layout, Header, Navigation, Drawer, Content, HeaderRow, HeaderTabs, Footer, FooterDropDownSection, FooterLinkList, FooterSection, + List, ListItem, ListItemContent, ListItemAction, + Menu, MenuItem, + ProgressBar, + RadioGroup, Radio, + Slider, + Snackbar, + Spinner, + Switch, + Tabs, Tab, + Textfield, + Tooltip} from 'react-mdl'; + +// all tests are from the examples provided here: https://tleunen.github.io/react-mdl/ + +// Badge tests +React.createClass({ + render: function() { + return ( +
+ {/* Number badge on icon */} + + + + + {/* Icon badge on icon */} + + + + + {/* Number badge on text */} + Inbox + + {/* Icon badge without background on text */} + Mood +
+ ); + } +}); + +// Button tests +React.createClass({ + render: function() { + return ( +
+ {/* Colored FAB button */} + + + + + {/* Colored FAB button with ripple */} + + + + + {/* FAB button */} + + + + + {/* FAB button with ripple */} + + + + + {/* Disabled FAB button */} + + + + + {/* Mini FAB button */} + + + + + {/* Colored Mini FAB button */} + + + + + {/* Raised button */} + + + {/* Raised button with ripple */} + + + {/* Disabled Raised button */} + + + {/* Colored Raised button */} + + + {/* Accent-colored button without ripple */} + + + {/* Accent-colored button with ripple */} + + + {/* Flat button */} + + + {/* Flat button with ripple */} + + + {/* Disabled flat button */} + + + {/* Primary colored flat button */} + + + {/* Accent-colored flat button */} + + + {/* Icon button */} + + + {/* Colored Icon button */} + +
+ ); + } +}) + +// Card tests +React.createClass({ + render: function() { + return ( +
+ + Welcome + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Mauris sagittis pellentesque lacus eleifend lacinia... + + + + + + + + + + + Update + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Aenan convallis. + + + + + + + + + + + Image.jpg + + + + + + +

+ Featured event:
+ May 24, 2016
+ 7-11pm +

+
+ + +
+ +
+
+
+ ); + } +}); + +// Checkbox tests +React.createClass({ + render: function() { + return ( +
+ + + +
+ ); + } +}); + +// DataTable tests +React.createClass({ + render: function() { + return ( +
+ + Material + Quantity + `\$${price.toFixed(2)}`} tooltip="Price pet unit">Price + + + + Material + Quantity + `\$${price.toFixed(2)}`} tooltip="Price pet unit">Price + + + + (isAsc ? a : b).match(/\((.*)\)/)[1].localeCompare((isAsc ? b : a).match(/\((.*)\)/)[1])} + tooltip="The amazing material name" + > + Material + + + Quantity + + `\$${price.toFixed(2)}`} + tooltip="Price pet unit" + > + Price + +
+
+ ); + } +}); + +// Dialog tests +React.createClass({ + render: function() { + return ( +
+
+ + + Allow data collection? + +

Allowing us to collect data will let us get you the information you want faster.

+
+ + + + +
+
+ +
+ + + Allow this site to collect usage data to improve your experience? + +

Allowing us to collect data will let us get you the information you want faster.

+
+ + + + +
+
+ +
+ + + Allow data collection? + +

Allowing us to collect data will let us get you the information you want faster.

+
+ + + + +
+
+
+ ); + } +}); + +// Grid tests +React.createClass({ + render: function() { + return ( +
+
+ + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 4 + 4 + 4 + + + 6 + 4 + 2 + + + 6 (8 tablet) + 4 (6 tablet) + 2 (4 phone) + +
+
+ ); + } +}); + +// IconToggle tests +React.createClass({ + render: function() { + return ( +
+ + + +
+ ); + } +}); + +// Layout tests +React.createClass({ + render: function() { + return ( +
+ {/* Uses a transparent header that draws on top of the layout's background */} +
+ +
+ + Link + Link + Link + Link + +
+ + + Link + Link + Link + Link + + + +
+
+ + {/* No header, and the drawer stays open on larger screens (fixed drawer). */} +
+ + + + Link + Link + Link + Link + + + + +
+ + {/* Always shows a header, even in smaller screens. */} +
+ +
Area / The Title}> + + Link + Link + Link + Link + +
+ + + Link + Link + Link + Link + + + +
+
+ + {/* The drawer is always open in large screens. The header is always shown, even in small screens. */} +
+ +
+ {}} + label="Search" + expandable + expandableIcon="search" + /> +
+ + + Link + Link + Link + Link + + + +
+
+ + {/* Uses a header that scrolls with the text, rather than staying locked at the top */} +
+ +
+ + Link + Link + Link + Link + +
+ + + Link + Link + Link + Link + + + +
+ + +
+ + {/* Uses a header that contracts as the page scrolls down. */} +
+ +
+ + {}} + label="Search" + expandable + expandableIcon="search" + /> + + + + Link + Link + Link + Link + + +
+ + + Link + Link + Link + Link + + + +
+ + +
+ + {/* Hide the top part of the header when scrolling down */} +
+ +
+ + {}} + label="Search" + expandable + expandableIcon="search" + /> + + + + Link + Link + Link + Link + + +
+ + + Link + Link + Link + Link + + + +
+ + +
+ +
+ +
+ + this.setState({ activeTab: tabId })}> + Tab1 + Tab2 + Tab3 + Tab4 + Tab5 + Tab6 + +
+ + +
Content for the tab: {this.state.activeTab}
+
+
+
+ + {/* Simple header with fixed tabs. */} +
+ +
+ + {}}> + Tab1 + Tab2 + Tab3 + +
+ + +
You can add logic to update the content of this container based on the "activeTab" receive in the `onChange` callback.
+
+
+
+ + + + +
+ ); + } +}); + +// List tests +React.createClass({ + render: function() { + return ( +
+ + Bryan Cranston + Aaron Paul + Bob Odenkirk + + + + + Bryan Cranston + + + Aaron Paul + + + Bob Odenkirk + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + +
+ ); + } +}); + +// Menu tests +React.createClass({ + render: function() { + return ( +
+ {/* Lower left */} +
+ + + Some Action + Another Action + Disabled Action + Yet Another Action + +
+ + {/* Lower right */} +
+ + + Some Action + Another Action + Disabled Action + Yet Another Action + +
+ + {/* Top left */} +
+ + + Some Action + Another Action + Disabled Action + Yet Another Action + +
+ + {/* Top right */} +
+ + + Some Action + Another Action + Disabled Action + Yet Another Action + +
+
+ ); + } +}); + +// ProgressBar tests +React.createClass({ + render: function() { + return ( +
+ {/* Simple Progress Bar */} + + + {/* Progress Bar with Indeterminate Progress */} + + + {/* Progress Bar with Buffering */} + +
+ ); + } +}); + +// Radio tests +React.createClass({ + render: function() { + return ( +
+ + Ripple option + Other option + + + + Ripple option + Other option + +
+ ); + } +}); + +// Slider tests +React.createClass({ + render: function() { + return ( +
+ {/* Default slider */} + + + {/* Slider with initial value */} + +
+ ); + } +}); + +// Snackbar tests +React.createClass({ + render: function() { + return ( +
+
+ + Button color changed. +
+ +
+ + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce varius luctus quam. Fusce quis blandit libero. Donec accumsan nunc lectus, vel blandit diam bibendum ac. Integer faucibus, lorem et convallis fermentum, diam dolor imperdiet mi, nec iaculis risus mauris id elit. Vivamus vel eros dapibus, molestie ante ut, vestibulum sem. + +
+
+ ); + } +}); + +// Spinner tests +React.createClass({ + render: function() { + return ( +
+ {/* Simple spinner */} + + + {/* Single color spinner */} + +
+ ); + } +}); + +// Switch tests +React.createClass({ + render: function() { + return ( +
+ Ripple switch + + Switch +
+ ); + } +}); + +// Tab tests +React.createClass({ + render: function() { + return ( +
+
+ this.setState({ activeTab: tabId })} ripple> + Starks + Lannisters + Targaryens + +
+
Content for the tab: {this.state.activeTab}
+
+
+
+ ); + } +}); + +// Textfield tests +React.createClass({ + render: function() { + return ( +
+ {/* Simple textfield */} + {}} + label="Text..." + style={{width: '200px'}} + /> + + {/* Numeric textfield */} + {}} + pattern="-?[0-9]*(\.[0-9]+)?" + error="Input is not a number!" + label="Number..." + style={{width: '200px'}} + /> + + {/* Textfield with floating label */} + {}} + label="Text..." + floatingLabel + style={{width: '200px'}} + /> + + {/* Numeric Textfield with floating label */} + {}} + pattern="-?[0-9]*(\.[0-9]+)?" + error="Input is not a number!" + label="Number..." + floatingLabel + /> +
+ ); + } +}); + +// Tooltip tests +React.createClass({ + render: function() { + return ( +
+ {/* Simple tooltip */} + + + + + {/* Large Tooltip */} + + + + + {/* Rich Tooltip */} + Upload file.zip}> + + + + {/* Multiline Tooltip */} + Share your content
via social media}> + +
+ + {/* Right Tooltip */} + + + + + {/* Left Tooltip */} + + + + + {/* Top Tooltip */} + + + + + {/* Bottom Tooltip */} + + + +
+ ); + } +}); diff --git a/react-mdl/react-mdl.d.ts b/react-mdl/react-mdl.d.ts new file mode 100644 index 0000000000..86516b75f0 --- /dev/null +++ b/react-mdl/react-mdl.d.ts @@ -0,0 +1,606 @@ +// Type definitions for react-mdl 1.5.3 +// Project: https://github.com/tleunen/react-mdl +// Definitions by: Brad Zacher +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace __ReactMDL { + import React = __React; + + type __MDLClassProps = React.ClassAttributes; + type __MDLOtherProps = React.HTMLProps; + class __MDLComponent

extends React.Component {} + class __MDLBasicComponent extends __MDLComponent<__MDLOtherProps> {} + + interface ShadowedComponent { + shadow ?: number; + } + interface RippleComponent { + ripple ?: boolean; + } + interface CustomRenderedComponent { + component ?: string | JSX.Element | Function; + } + + + // HTMLAttributes (minus the 'data', 'icon', 'label', 'name', 'rows', 'size', 'title', 'value' attributes) + interface MDLHTMLAttributes { + // React-specific Attributes + defaultChecked?: boolean; + defaultValue?: string | string[]; + + // Standard HTML Attributes + accept?: string; + acceptCharset?: string; + accessKey?: string; + action?: string; + allowFullScreen?: boolean; + allowTransparency?: boolean; + alt?: string; + async?: boolean; + autoComplete?: string; + autoFocus?: boolean; + autoPlay?: boolean; + capture?: boolean; + cellPadding?: number | string; + cellSpacing?: number | string; + charSet?: string; + challenge?: string; + checked?: boolean; + classID?: string; + className?: string; + cols?: number; + colSpan?: number; + content?: string; + contentEditable?: boolean; + contextMenu?: string; + controls?: boolean; + coords?: string; + crossOrigin?: string; + dateTime?: string; + default?: boolean; + defer?: boolean; + dir?: string; + disabled?: boolean; + download?: any; + draggable?: boolean; + encType?: string; + form?: string; + formAction?: string; + formEncType?: string; + formMethod?: string; + formNoValidate?: boolean; + formTarget?: string; + frameBorder?: number | string; + headers?: string; + height?: number | string; + hidden?: boolean; + high?: number; + href?: string; + hrefLang?: string; + htmlFor?: string; + httpEquiv?: string; + id?: string; + inputMode?: string; + integrity?: string; + is?: string; + keyParams?: string; + keyType?: string; + kind?: string; + lang?: string; + list?: string; + loop?: boolean; + low?: number; + manifest?: string; + marginHeight?: number; + marginWidth?: number; + max?: number | string; + maxLength?: number; + media?: string; + mediaGroup?: string; + method?: string; + min?: number | string; + minLength?: number; + multiple?: boolean; + muted?: boolean; + nonce?: string; + noValidate?: boolean; + open?: boolean; + optimum?: number; + pattern?: string; + placeholder?: string; + poster?: string; + preload?: string; + radioGroup?: string; + readOnly?: boolean; + rel?: string; + required?: boolean; + reversed?: boolean; + role?: string; + rowSpan?: number; + sandbox?: string; + scope?: string; + scoped?: boolean; + scrolling?: string; + seamless?: boolean; + selected?: boolean; + shape?: string; + sizes?: string; + span?: number; + spellCheck?: boolean; + src?: string; + srcDoc?: string; + srcLang?: string; + srcSet?: string; + start?: number; + step?: number | string; + style?: React.CSSProperties; + summary?: string; + tabIndex?: number; + target?: string; + type?: string; + useMap?: string; + width?: number | string; + wmode?: string; + wrap?: string; + + // RDFa Attributes + about?: string; + datatype?: string; + inlist?: any; + prefix?: string; + property?: string; + resource?: string; + typeof?: string; + vocab?: string; + + // Non-standard Attributes + autoCapitalize?: string; + autoCorrect?: string; + autoSave?: string; + color?: string; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + itemID?: string; + itemRef?: string; + results?: number; + security?: string; + unselectable?: boolean; + + // Allows aria- and data- Attributes + [key: string]: any; + } + // DOMAttributes (minus 'onClick', 'onChange') + interface MDLDOMAttributes { + // DOMAttributes (minus onClick) + children?: React.ReactNode; + dangerouslySetInnerHTML?: { + __html: string; + }; + + // Clipboard Events + onCopy?: React.ClipboardEventHandler; + onCut?: React.ClipboardEventHandler; + onPaste?: React.ClipboardEventHandler; + + // Composition Events + onCompositionEnd?: React.CompositionEventHandler; + onCompositionStart?: React.CompositionEventHandler; + onCompositionUpdate?: React.CompositionEventHandler; + + // Focus Events + onFocus?: React.FocusEventHandler; + onBlur?: React.FocusEventHandler; + + // Form Events + onInput?: React.FormEventHandler; + onSubmit?: React.FormEventHandler; + + // Image Events + onLoad?: React.ReactEventHandler; + onError?: React.ReactEventHandler; // also a Media Event + + // Keyboard Events + onKeyDown?: React.KeyboardEventHandler; + onKeyPress?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; + + // Media Events + onAbort?: React.ReactEventHandler; + onCanPlay?: React.ReactEventHandler; + onCanPlayThrough?: React.ReactEventHandler; + onDurationChange?: React.ReactEventHandler; + onEmptied?: React.ReactEventHandler; + onEncrypted?: React.ReactEventHandler; + onEnded?: React.ReactEventHandler; + onLoadedData?: React.ReactEventHandler; + onLoadedMetadata?: React.ReactEventHandler; + onLoadStart?: React.ReactEventHandler; + onPause?: React.ReactEventHandler; + onPlay?: React.ReactEventHandler; + onPlaying?: React.ReactEventHandler; + onProgress?: React.ReactEventHandler; + onRateChange?: React.ReactEventHandler; + onSeeked?: React.ReactEventHandler; + onSeeking?: React.ReactEventHandler; + onStalled?: React.ReactEventHandler; + onSuspend?: React.ReactEventHandler; + onTimeUpdate?: React.ReactEventHandler; + onVolumeChange?: React.ReactEventHandler; + onWaiting?: React.ReactEventHandler; + + // MouseEvents + onContextMenu?: React.MouseEventHandler; + onDoubleClick?: React.MouseEventHandler; + onDrag?: React.DragEventHandler; + onDragEnd?: React.DragEventHandler; + onDragEnter?: React.DragEventHandler; + onDragExit?: React.DragEventHandler; + onDragLeave?: React.DragEventHandler; + onDragOver?: React.DragEventHandler; + onDragStart?: React.DragEventHandler; + onDrop?: React.DragEventHandler; + onMouseDown?: React.MouseEventHandler; + onMouseEnter?: React.MouseEventHandler; + onMouseLeave?: React.MouseEventHandler; + onMouseMove?: React.MouseEventHandler; + onMouseOut?: React.MouseEventHandler; + onMouseOver?: React.MouseEventHandler; + onMouseUp?: React.MouseEventHandler; + + // Selection Events + onSelect?: React.ReactEventHandler; + + // Touch Events + onTouchCancel?: React.TouchEventHandler; + onTouchEnd?: React.TouchEventHandler; + onTouchMove?: React.TouchEventHandler; + onTouchStart?: React.TouchEventHandler; + + // UI Events + onScroll?: React.UIEventHandler; + + // Wheel Events + onWheel?: React.WheelEventHandler; + } + + + + interface BadgeProps extends __MDLClassProps { + text: string | number; + className ?: string; + noBackground ?: boolean; + overlap ?: boolean; + } + class Badge extends __MDLComponent {} + + + interface ButtonProps extends __MDLOtherProps, RippleComponent, CustomRenderedComponent { + accent ?: boolean; + colored ?: boolean; + primary ?: boolean; + } + interface StandardButtonProps extends ButtonProps { + raised ?: boolean; + } + interface FABButtonProps extends ButtonProps { + mini ?: boolean; + } + interface IconButtonProps extends ButtonProps { + name ?: string; + raised ?: boolean; + } + class Button extends __MDLComponent {} + class FABButton extends __MDLComponent {} + class IconButton extends __MDLComponent {} + + + interface CardProps extends __MDLOtherProps, ShadowedComponent {} + interface CardActionProps extends __MDLOtherProps { + border ?: boolean; + } + interface CardTitleProps extends __MDLOtherProps { + expand ?: boolean; + } + class Card extends __MDLComponent {} + class CardActions extends __MDLComponent {} + class CardTitle extends __MDLComponent {} + class CardText extends __MDLBasicComponent {} + class CardMenu extends __MDLBasicComponent {} + class CardMedia extends __MDLBasicComponent {} + + + interface CheckboxProps extends __MDLOtherProps, RippleComponent { + checked ?: boolean; + disabled ?: boolean; + label ?: string; + } + class Checkbox extends __MDLComponent {} + + interface UndecoratedTableProps extends __MDLClassProps, MDLHTMLAttributes, React.DOMAttributes, ShadowedComponent { + rows: Array; + rowKeyColumn ?: string; + + name ?: string; + title ?: string; + } + interface TableProps extends UndecoratedTableProps { + sortable ?: boolean; + selectable ?: boolean; + onSelectionChanged ?: (row : any) => any; + } + interface TableHeaderProps extends __MDLClassProps, MDLHTMLAttributes, MDLDOMAttributes { + name : string; + title ?: string; + cellFormatter ?: (value : any, row : any, index : number) => React.ReactNode; + numeric ?: boolean; + nosort ?: boolean; + onClick ?: (e : React.MouseEvent, name : string) => any; + sortFn ?: (a : any, b : any, isAsc : boolean) => number; + tooltip ?: React.ReactNode; + } + class Table extends __MDLComponent {} + class TableHeader extends __MDLComponent {} + class UndecoratedTable extends __MDLComponent {} + class DataTable extends Table {} + + + interface DialogProps extends __MDLOtherProps { + open ?: boolean; + } + interface DialogActionsProps extends __MDLOtherProps { + fullWidth ?: boolean; + } + interface DialogTitleProps extends __MDLOtherProps, CustomRenderedComponent {} + class Dialog extends __MDLComponent {} + class DialogActions extends __MDLComponent {} + class DialogTitle extends __MDLComponent {} + class DialogContent extends __MDLBasicComponent {} + + + interface GridProps extends __MDLOtherProps, CustomRenderedComponent, ShadowedComponent { + noSpacing ?: boolean; + } + interface CellProps extends __MDLOtherProps, CustomRenderedComponent, ShadowedComponent { + col : number; + align ?: string; + phone ?: number; + tablet ?: number; + hideDesktop ?: boolean; + hidePhone ?: boolean; + hideTablet ?: boolean; + } + class Grid extends __MDLComponent {} + class Cell extends __MDLComponent {} + + + interface IconProps extends __MDLOtherProps { + name : string; + } + class Icon extends __MDLComponent {} + + + interface IconToggleProps extends __MDLOtherProps, RippleComponent { + name : string; + checked ?: boolean; + disabled ?: boolean; + } + class IconToggle extends __MDLComponent {} + + + interface ContentProps extends __MDLOtherProps, CustomRenderedComponent {} + interface DrawerProps extends __MDLOtherProps { + title ?: string; + } + interface HeaderProps extends __MDLOtherProps { + title ?: string; + scroll ?: boolean; + seamed ?: boolean; + transparent ?: boolean; + waterfall ?: boolean; + hideTop ?: boolean; + } + interface HeaderRowProps extends __MDLOtherProps { + title ?: string; + } + interface HeaderTabsProps extends __MDLOtherProps, RippleComponent { + activeTab ?: number; + onChange ?: React.FormEventHandler; + } + interface LayoutProps extends __MDLOtherProps { + fixedDrawer ?: boolean; + fixedHeader ?: boolean; + fixedTabse ?: boolean; + } + interface NavigationProps extends __MDLOtherProps {} + class Content extends __MDLComponent {} + class Drawer extends __MDLComponent {} + class Header extends __MDLComponent {} + class HeaderRow extends __MDLComponent {} + class HeaderTabs extends __MDLComponent {} + class Layout extends __MDLComponent {} + class Navigation extends __MDLComponent {} + class Spacer extends __MDLBasicComponent {} + + interface FooterProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + + title ?: string; + } + interface FooterDropDownSectionProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + title : React.ReactNode; + } + interface FooterLinkListProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + + title ?: string; + } + interface FooterSectionProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + type ?: string; + logo ?: React.ReactNode; + + title ?: string; + } + class Footer extends __MDLComponent {} + class FooterDropDownSection extends __MDLComponent {} + class FooterLinkList extends __MDLComponent {} + class FooterSection extends __MDLComponent {} + + interface ListItemProps extends __MDLOtherProps { + twoLine ?: boolean; + threeLine ?: boolean; + } + interface ListItemActionProps extends __MDLOtherProps { + info ?: string; + } + interface ListItemContentProps extends MDLHTMLAttributes, React.DOMAttributes { + avatar ?: string | JSX.Element; + icon ?: string | JSX.Element; + subtitle ?: React.ReactNode; + useBodyClass ?: boolean; + } + class List extends __MDLBasicComponent {} + class ListItem extends __MDLComponent {} + class ListItemAction extends __MDLComponent {} + class ListItemContent extends __MDLComponent {} + + + interface MenuProps extends __MDLOtherProps, RippleComponent { + target : string; + align ?: string; + valign ?: string; + } + class Menu extends __MDLComponent {} + class MenuItem extends __MDLBasicComponent {} + + + interface ProgressBarProps extends __MDLOtherProps { + buffer ?: number; + indeterminate ?: boolean; + progress ?: number; + } + class ProgressBar extends __MDLComponent {} + + + interface RadioProps extends MDLHTMLAttributes, React.DOMAttributes, RippleComponent { + value : string | number; + checked ?: boolean; + disabled ?: boolean; + name ?: string; + onChange ?: React.FormEventHandler; + label ?: string; + } + interface RadioGroupProps extends MDLHTMLAttributes, React.DOMAttributes { + name : string; + value : string | number; + childContainer ?: string; + container ?: string; + onChange ?: React.FormEventHandler; + label ?: string; + } + class Radio extends __MDLComponent {} + class RadioGroup extends __MDLComponent {} + + + interface SliderProps extends MDLHTMLAttributes, React.DOMAttributes { + max : number; + min : number; + onChange ?: React.FormEventHandler; + value ?: number; + } + class Slider extends __MDLComponent {} + + + interface SnackbarProps extends __MDLOtherProps { + active : boolean; + onTimeout : () => any; + action ?: string; + onActionClick ?: React.MouseEventHandler; + timeout ?: number; + } + class Snackbar extends __MDLComponent {} + + + interface SpinnerProps extends __MDLOtherProps { + singleColor ?: boolean; + } + class Spinner extends __MDLComponent {} + + + interface SwitchProps extends __MDLOtherProps, RippleComponent { + checked ?: boolean; + disabled ?: boolean; + onChange ?: React.FormEventHandler; + } + class Switch extends __MDLComponent {} + + + interface TabProps extends __MDLOtherProps, CustomRenderedComponent { + active ?: boolean; + cssPrefix ?: string; + onTabClick ?: (tabId : number) => any; + tabId ?: number; + } + interface TabBarProps extends MDLHTMLAttributes, MDLDOMAttributes { + cssPrefix : string; + activeTab ?: number; + onChange ?: (tabId : number) => any; + + name ?: string; + title ?: string; + onClick ?: React.MouseEventHandler; + } + interface TabsProps extends MDLHTMLAttributes, MDLDOMAttributes { + activeTab ?: number; + onChange ?: (tabId : number) => any; + tabBarProps ?: TabBarProps; + + name ?: string; + title ?: string; + onClick ?: React.MouseEventHandler; + } + class Tab extends __MDLComponent {} + class TabBar extends __MDLComponent {} + class Tabs extends __MDLComponent {} + + + interface TextfieldProps extends MDLHTMLAttributes, React.DOMAttributes { + label : string; + disabled ?: boolean; + error ?: React.ReactNode; + expandable ?: boolean; + expandableIcon ?: string; + floatingLabel ?: boolean; + id ?: string; + inputClassName ?: string; + maxRows ?: number; + onChange ?: React.FormEventHandler; + pattern ?: string; + required ?: boolean; + rows ?: number; + value ?: string | number; + + name ?: string; + title ?: string; + } + class Textfield extends __MDLComponent {} + + + interface TooltipProps extends MDLHTMLAttributes, React.DOMAttributes { + label : React.ReactNode; + large ?: boolean; + position ?: string; + + name ?: string; + title ?: string; + } + class Tooltip extends __MDLComponent {} +} + +declare module 'react-mdl' { + export = __ReactMDL; +} \ No newline at end of file From aa672a5f5f5ac5da6c6db1a4afc3235f499893e3 Mon Sep 17 00:00:00 2001 From: Atanas Atanasov Date: Sat, 23 Apr 2016 23:00:44 +0300 Subject: [PATCH 122/415] Update grid.d.ts --- gijgo/grid.d.ts | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/gijgo/grid.d.ts b/gijgo/grid.d.ts index 5a5faf4840..ff5802482f 100644 --- a/gijgo/grid.d.ts +++ b/gijgo/grid.d.ts @@ -2,3 +2,49 @@ // Project: http://gijgo.com // Definitions by: Atanas Atanasov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface DataGridPager { + limit: number; + sizes: Array +} + +interface DataGridColumn { + title?: any; + field?: any; + align?: string; + type?: string; + icon?: string; + tooltip?: string; + events?: any; + sortable?: boolean; + width?: number; + headerCssClass?: string; +} + +interface DataGridSettings { + title?: string; + dataSource?: any; + primaryKey?: any; + selectionType?: string; + selectionMethod?: string; + uiLibrary?: string; + autoLoad?: boolean; + pager?: DataGridPager; + params?: any; + notFoundText?: string; + minWidth?: number; + columns?: Array; + defaultColumnSettings?: DataGridColumn; +} + +interface DataGrid extends JQuery { + reload(params?: Params): void; + getById(id: number): Entity; + getAll(): Entity[]; + setSelected(id: number, value: any): void; +} + +interface JQuery { + grid(settings: DataGridSettings): DataGrid; + grid(settings: DataGridSettings): DataGrid; +} From 133be9545aa135391539aa95b428c9b59b2898ac Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sun, 24 Apr 2016 14:17:03 +0930 Subject: [PATCH 123/415] fixed es6 compilation by chanigng import i don't know why git is saying that every line changed... --- react-mdl/react-mdl-tests.tsx | 2087 ++++++++++++++++----------------- react-mdl/react-mdl.d.ts | 1210 +++++++++---------- 2 files changed, 1648 insertions(+), 1649 deletions(-) diff --git a/react-mdl/react-mdl-tests.tsx b/react-mdl/react-mdl-tests.tsx index eb9981092a..8efcebee52 100644 --- a/react-mdl/react-mdl-tests.tsx +++ b/react-mdl/react-mdl-tests.tsx @@ -1,1044 +1,1043 @@ -// Test file for react-mdl Definition file -/// - -import React = require('react'); -import {Badge, - FABButton, Button, IconButton, - Card, CardActions, CardTitle, CardText, CardMenu, CardMedia, - Checkbox, - DataTable, TableHeader, Table, - Dialog, DialogTitle, DialogContent, DialogActions, - Grid, Cell, - Icon, IconToggle, - Layout, Header, Navigation, Drawer, Content, HeaderRow, HeaderTabs, Footer, FooterDropDownSection, FooterLinkList, FooterSection, - List, ListItem, ListItemContent, ListItemAction, - Menu, MenuItem, - ProgressBar, - RadioGroup, Radio, - Slider, - Snackbar, - Spinner, - Switch, - Tabs, Tab, - Textfield, - Tooltip} from 'react-mdl'; - -// all tests are from the examples provided here: https://tleunen.github.io/react-mdl/ - -// Badge tests -React.createClass({ - render: function() { - return ( -

- {/* Number badge on icon */} - - - - - {/* Icon badge on icon */} - - - - - {/* Number badge on text */} - Inbox - - {/* Icon badge without background on text */} - Mood -
- ); - } -}); - -// Button tests -React.createClass({ - render: function() { - return ( -
- {/* Colored FAB button */} - - - - - {/* Colored FAB button with ripple */} - - - - - {/* FAB button */} - - - - - {/* FAB button with ripple */} - - - - - {/* Disabled FAB button */} - - - - - {/* Mini FAB button */} - - - - - {/* Colored Mini FAB button */} - - - - - {/* Raised button */} - - - {/* Raised button with ripple */} - - - {/* Disabled Raised button */} - - - {/* Colored Raised button */} - - - {/* Accent-colored button without ripple */} - - - {/* Accent-colored button with ripple */} - - - {/* Flat button */} - - - {/* Flat button with ripple */} - - - {/* Disabled flat button */} - - - {/* Primary colored flat button */} - - - {/* Accent-colored flat button */} - - - {/* Icon button */} - - - {/* Colored Icon button */} - -
- ); - } -}) - -// Card tests -React.createClass({ - render: function() { - return ( -
- - Welcome - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Mauris sagittis pellentesque lacus eleifend lacinia... - - - - - - - - - - - Update - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Aenan convallis. - - - - - - - - - - - Image.jpg - - - - - - -

- Featured event:
- May 24, 2016
- 7-11pm -

-
- - -
- -
-
-
- ); - } -}); - -// Checkbox tests -React.createClass({ - render: function() { - return ( -
- - - -
- ); - } -}); - -// DataTable tests -React.createClass({ - render: function() { - return ( -
- - Material - Quantity - `\$${price.toFixed(2)}`} tooltip="Price pet unit">Price - - - - Material - Quantity - `\$${price.toFixed(2)}`} tooltip="Price pet unit">Price - - - - (isAsc ? a : b).match(/\((.*)\)/)[1].localeCompare((isAsc ? b : a).match(/\((.*)\)/)[1])} - tooltip="The amazing material name" - > - Material - - - Quantity - - `\$${price.toFixed(2)}`} - tooltip="Price pet unit" - > - Price - -
-
- ); - } -}); - -// Dialog tests -React.createClass({ - render: function() { - return ( -
-
- - - Allow data collection? - -

Allowing us to collect data will let us get you the information you want faster.

-
- - - - -
-
- -
- - - Allow this site to collect usage data to improve your experience? - -

Allowing us to collect data will let us get you the information you want faster.

-
- - - - -
-
- -
- - - Allow data collection? - -

Allowing us to collect data will let us get you the information you want faster.

-
- - - - -
-
-
- ); - } -}); - -// Grid tests -React.createClass({ - render: function() { - return ( -
-
- - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 4 - 4 - 4 - - - 6 - 4 - 2 - - - 6 (8 tablet) - 4 (6 tablet) - 2 (4 phone) - -
-
- ); - } -}); - -// IconToggle tests -React.createClass({ - render: function() { - return ( -
- - - -
- ); - } -}); - -// Layout tests -React.createClass({ - render: function() { - return ( -
- {/* Uses a transparent header that draws on top of the layout's background */} -
- -
- - Link - Link - Link - Link - -
- - - Link - Link - Link - Link - - - -
-
- - {/* No header, and the drawer stays open on larger screens (fixed drawer). */} -
- - - - Link - Link - Link - Link - - - - -
- - {/* Always shows a header, even in smaller screens. */} -
- -
Area / The Title}> - - Link - Link - Link - Link - -
- - - Link - Link - Link - Link - - - -
-
- - {/* The drawer is always open in large screens. The header is always shown, even in small screens. */} -
- -
- {}} - label="Search" - expandable - expandableIcon="search" - /> -
- - - Link - Link - Link - Link - - - -
-
- - {/* Uses a header that scrolls with the text, rather than staying locked at the top */} -
- -
- - Link - Link - Link - Link - -
- - - Link - Link - Link - Link - - - -
- - -
- - {/* Uses a header that contracts as the page scrolls down. */} -
- -
- - {}} - label="Search" - expandable - expandableIcon="search" - /> - - - - Link - Link - Link - Link - - -
- - - Link - Link - Link - Link - - - -
- - -
- - {/* Hide the top part of the header when scrolling down */} -
- -
- - {}} - label="Search" - expandable - expandableIcon="search" - /> - - - - Link - Link - Link - Link - - -
- - - Link - Link - Link - Link - - - -
- - -
- -
- -
- - this.setState({ activeTab: tabId })}> - Tab1 - Tab2 - Tab3 - Tab4 - Tab5 - Tab6 - -
- - -
Content for the tab: {this.state.activeTab}
-
-
-
- - {/* Simple header with fixed tabs. */} -
- -
- - {}}> - Tab1 - Tab2 - Tab3 - -
- - -
You can add logic to update the content of this container based on the "activeTab" receive in the `onChange` callback.
-
-
-
- - - - -
- ); - } -}); - -// List tests -React.createClass({ - render: function() { - return ( -
- - Bryan Cranston - Aaron Paul - Bob Odenkirk - - - - - Bryan Cranston - - - Aaron Paul - - - Bob Odenkirk - - - - - - Bryan Cranston - - - - - - Aaron Paul - - - - - - Bob Odenkirk - - - - - - - - - Bryan Cranston - - - - - - Aaron Paul - - - - - - Bob Odenkirk - - - - - - - - - Bryan Cranston - - - - - - Aaron Paul - - - - - - Bob Odenkirk - - - - - - - - - Bryan Cranston - - - - - - Aaron Paul - - - - - - Bob Odenkirk - - - - - -
- ); - } -}); - -// Menu tests -React.createClass({ - render: function() { - return ( -
- {/* Lower left */} -
- - - Some Action - Another Action - Disabled Action - Yet Another Action - -
- - {/* Lower right */} -
- - - Some Action - Another Action - Disabled Action - Yet Another Action - -
- - {/* Top left */} -
- - - Some Action - Another Action - Disabled Action - Yet Another Action - -
- - {/* Top right */} -
- - - Some Action - Another Action - Disabled Action - Yet Another Action - -
-
- ); - } -}); - -// ProgressBar tests -React.createClass({ - render: function() { - return ( -
- {/* Simple Progress Bar */} - - - {/* Progress Bar with Indeterminate Progress */} - - - {/* Progress Bar with Buffering */} - -
- ); - } -}); - -// Radio tests -React.createClass({ - render: function() { - return ( -
- - Ripple option - Other option - - - - Ripple option - Other option - -
- ); - } -}); - -// Slider tests -React.createClass({ - render: function() { - return ( -
- {/* Default slider */} - - - {/* Slider with initial value */} - -
- ); - } -}); - -// Snackbar tests -React.createClass({ - render: function() { - return ( -
-
- - Button color changed. -
- -
- - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce varius luctus quam. Fusce quis blandit libero. Donec accumsan nunc lectus, vel blandit diam bibendum ac. Integer faucibus, lorem et convallis fermentum, diam dolor imperdiet mi, nec iaculis risus mauris id elit. Vivamus vel eros dapibus, molestie ante ut, vestibulum sem. - -
-
- ); - } -}); - -// Spinner tests -React.createClass({ - render: function() { - return ( -
- {/* Simple spinner */} - - - {/* Single color spinner */} - -
- ); - } -}); - -// Switch tests -React.createClass({ - render: function() { - return ( -
- Ripple switch - - Switch -
- ); - } -}); - -// Tab tests -React.createClass({ - render: function() { - return ( -
-
- this.setState({ activeTab: tabId })} ripple> - Starks - Lannisters - Targaryens - -
-
Content for the tab: {this.state.activeTab}
-
-
-
- ); - } -}); - -// Textfield tests -React.createClass({ - render: function() { - return ( -
- {/* Simple textfield */} - {}} - label="Text..." - style={{width: '200px'}} - /> - - {/* Numeric textfield */} - {}} - pattern="-?[0-9]*(\.[0-9]+)?" - error="Input is not a number!" - label="Number..." - style={{width: '200px'}} - /> - - {/* Textfield with floating label */} - {}} - label="Text..." - floatingLabel - style={{width: '200px'}} - /> - - {/* Numeric Textfield with floating label */} - {}} - pattern="-?[0-9]*(\.[0-9]+)?" - error="Input is not a number!" - label="Number..." - floatingLabel - /> -
- ); - } -}); - -// Tooltip tests -React.createClass({ - render: function() { - return ( -
- {/* Simple tooltip */} - - - - - {/* Large Tooltip */} - - - - - {/* Rich Tooltip */} - Upload file.zip}> - - - - {/* Multiline Tooltip */} - Share your content
via social media}> - -
- - {/* Right Tooltip */} - - - - - {/* Left Tooltip */} - - - - - {/* Top Tooltip */} - - - - - {/* Bottom Tooltip */} - - - -
- ); - } -}); +// Test file for react-mdl Definition file +/// + +import {Badge, + FABButton, Button, IconButton, + Card, CardActions, CardTitle, CardText, CardMenu, CardMedia, + Checkbox, + DataTable, TableHeader, Table, + Dialog, DialogTitle, DialogContent, DialogActions, + Grid, Cell, + Icon, IconToggle, + Layout, Header, Navigation, Drawer, Content, HeaderRow, HeaderTabs, Footer, FooterDropDownSection, FooterLinkList, FooterSection, + List, ListItem, ListItemContent, ListItemAction, + Menu, MenuItem, + ProgressBar, + RadioGroup, Radio, + Slider, + Snackbar, + Spinner, + Switch, + Tabs, Tab, + Textfield, + Tooltip} from 'react-mdl'; + +// all tests are from the examples provided here: https://tleunen.github.io/react-mdl/ + +// Badge tests +React.createClass({ + render: function() { + return ( +
+ {/* Number badge on icon */} + + + + + {/* Icon badge on icon */} + + + + + {/* Number badge on text */} + Inbox + + {/* Icon badge without background on text */} + Mood +
+ ); + } +}); + +// Button tests +React.createClass({ + render: function() { + return ( +
+ {/* Colored FAB button */} + + + + + {/* Colored FAB button with ripple */} + + + + + {/* FAB button */} + + + + + {/* FAB button with ripple */} + + + + + {/* Disabled FAB button */} + + + + + {/* Mini FAB button */} + + + + + {/* Colored Mini FAB button */} + + + + + {/* Raised button */} + + + {/* Raised button with ripple */} + + + {/* Disabled Raised button */} + + + {/* Colored Raised button */} + + + {/* Accent-colored button without ripple */} + + + {/* Accent-colored button with ripple */} + + + {/* Flat button */} + + + {/* Flat button with ripple */} + + + {/* Disabled flat button */} + + + {/* Primary colored flat button */} + + + {/* Accent-colored flat button */} + + + {/* Icon button */} + + + {/* Colored Icon button */} + +
+ ); + } +}) + +// Card tests +React.createClass({ + render: function() { + return ( +
+ + Welcome + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Mauris sagittis pellentesque lacus eleifend lacinia... + + + + + + + + + + + Update + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Aenan convallis. + + + + + + + + + + + Image.jpg + + + + + + +

+ Featured event:
+ May 24, 2016
+ 7-11pm +

+
+ + +
+ +
+
+
+ ); + } +}); + +// Checkbox tests +React.createClass({ + render: function() { + return ( +
+ + + +
+ ); + } +}); + +// DataTable tests +React.createClass({ + render: function() { + return ( +
+ + Material + Quantity + `\$${price.toFixed(2)}`} tooltip="Price pet unit">Price + + + + Material + Quantity + `\$${price.toFixed(2)}`} tooltip="Price pet unit">Price + + + + (isAsc ? a : b).match(/\((.*)\)/)[1].localeCompare((isAsc ? b : a).match(/\((.*)\)/)[1])} + tooltip="The amazing material name" + > + Material + + + Quantity + + `\$${price.toFixed(2)}`} + tooltip="Price pet unit" + > + Price + +
+
+ ); + } +}); + +// Dialog tests +React.createClass({ + render: function() { + return ( +
+
+ + + Allow data collection? + +

Allowing us to collect data will let us get you the information you want faster.

+
+ + + + +
+
+ +
+ + + Allow this site to collect usage data to improve your experience? + +

Allowing us to collect data will let us get you the information you want faster.

+
+ + + + +
+
+ +
+ + + Allow data collection? + +

Allowing us to collect data will let us get you the information you want faster.

+
+ + + + +
+
+
+ ); + } +}); + +// Grid tests +React.createClass({ + render: function() { + return ( +
+
+ + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 4 + 4 + 4 + + + 6 + 4 + 2 + + + 6 (8 tablet) + 4 (6 tablet) + 2 (4 phone) + +
+
+ ); + } +}); + +// IconToggle tests +React.createClass({ + render: function() { + return ( +
+ + + +
+ ); + } +}); + +// Layout tests +React.createClass({ + render: function() { + return ( +
+ {/* Uses a transparent header that draws on top of the layout's background */} +
+ +
+ + Link + Link + Link + Link + +
+ + + Link + Link + Link + Link + + + +
+
+ + {/* No header, and the drawer stays open on larger screens (fixed drawer). */} +
+ + + + Link + Link + Link + Link + + + + +
+ + {/* Always shows a header, even in smaller screens. */} +
+ +
Area / The Title}> + + Link + Link + Link + Link + +
+ + + Link + Link + Link + Link + + + +
+
+ + {/* The drawer is always open in large screens. The header is always shown, even in small screens. */} +
+ +
+ {}} + label="Search" + expandable + expandableIcon="search" + /> +
+ + + Link + Link + Link + Link + + + +
+
+ + {/* Uses a header that scrolls with the text, rather than staying locked at the top */} +
+ +
+ + Link + Link + Link + Link + +
+ + + Link + Link + Link + Link + + + +
+ + +
+ + {/* Uses a header that contracts as the page scrolls down. */} +
+ +
+ + {}} + label="Search" + expandable + expandableIcon="search" + /> + + + + Link + Link + Link + Link + + +
+ + + Link + Link + Link + Link + + + +
+ + +
+ + {/* Hide the top part of the header when scrolling down */} +
+ +
+ + {}} + label="Search" + expandable + expandableIcon="search" + /> + + + + Link + Link + Link + Link + + +
+ + + Link + Link + Link + Link + + + +
+ + +
+ +
+ +
+ + this.setState({ activeTab: tabId })}> + Tab1 + Tab2 + Tab3 + Tab4 + Tab5 + Tab6 + +
+ + +
Content for the tab: {this.state.activeTab}
+
+
+
+ + {/* Simple header with fixed tabs. */} +
+ +
+ + {}}> + Tab1 + Tab2 + Tab3 + +
+ + +
You can add logic to update the content of this container based on the "activeTab" receive in the `onChange` callback.
+
+
+
+ + + + +
+ ); + } +}); + +// List tests +React.createClass({ + render: function() { + return ( +
+ + Bryan Cranston + Aaron Paul + Bob Odenkirk + + + + + Bryan Cranston + + + Aaron Paul + + + Bob Odenkirk + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + +
+ ); + } +}); + +// Menu tests +React.createClass({ + render: function() { + return ( +
+ {/* Lower left */} +
+ + + Some Action + Another Action + Disabled Action + Yet Another Action + +
+ + {/* Lower right */} +
+ + + Some Action + Another Action + Disabled Action + Yet Another Action + +
+ + {/* Top left */} +
+ + + Some Action + Another Action + Disabled Action + Yet Another Action + +
+ + {/* Top right */} +
+ + + Some Action + Another Action + Disabled Action + Yet Another Action + +
+
+ ); + } +}); + +// ProgressBar tests +React.createClass({ + render: function() { + return ( +
+ {/* Simple Progress Bar */} + + + {/* Progress Bar with Indeterminate Progress */} + + + {/* Progress Bar with Buffering */} + +
+ ); + } +}); + +// Radio tests +React.createClass({ + render: function() { + return ( +
+ + Ripple option + Other option + + + + Ripple option + Other option + +
+ ); + } +}); + +// Slider tests +React.createClass({ + render: function() { + return ( +
+ {/* Default slider */} + + + {/* Slider with initial value */} + +
+ ); + } +}); + +// Snackbar tests +React.createClass({ + render: function() { + return ( +
+
+ + Button color changed. +
+ +
+ + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce varius luctus quam. Fusce quis blandit libero. Donec accumsan nunc lectus, vel blandit diam bibendum ac. Integer faucibus, lorem et convallis fermentum, diam dolor imperdiet mi, nec iaculis risus mauris id elit. Vivamus vel eros dapibus, molestie ante ut, vestibulum sem. + +
+
+ ); + } +}); + +// Spinner tests +React.createClass({ + render: function() { + return ( +
+ {/* Simple spinner */} + + + {/* Single color spinner */} + +
+ ); + } +}); + +// Switch tests +React.createClass({ + render: function() { + return ( +
+ Ripple switch + + Switch +
+ ); + } +}); + +// Tab tests +React.createClass({ + render: function() { + return ( +
+
+ this.setState({ activeTab: tabId })} ripple> + Starks + Lannisters + Targaryens + +
+
Content for the tab: {this.state.activeTab}
+
+
+
+ ); + } +}); + +// Textfield tests +React.createClass({ + render: function() { + return ( +
+ {/* Simple textfield */} + {}} + label="Text..." + style={{width: '200px'}} + /> + + {/* Numeric textfield */} + {}} + pattern="-?[0-9]*(\.[0-9]+)?" + error="Input is not a number!" + label="Number..." + style={{width: '200px'}} + /> + + {/* Textfield with floating label */} + {}} + label="Text..." + floatingLabel + style={{width: '200px'}} + /> + + {/* Numeric Textfield with floating label */} + {}} + pattern="-?[0-9]*(\.[0-9]+)?" + error="Input is not a number!" + label="Number..." + floatingLabel + /> +
+ ); + } +}); + +// Tooltip tests +React.createClass({ + render: function() { + return ( +
+ {/* Simple tooltip */} + + + + + {/* Large Tooltip */} + + + + + {/* Rich Tooltip */} + Upload file.zip}> + + + + {/* Multiline Tooltip */} + Share your content
via social media}> + +
+ + {/* Right Tooltip */} + + + + + {/* Left Tooltip */} + + + + + {/* Top Tooltip */} + + + + + {/* Bottom Tooltip */} + + + +
+ ); + } +}); diff --git a/react-mdl/react-mdl.d.ts b/react-mdl/react-mdl.d.ts index 86516b75f0..56d688c7f4 100644 --- a/react-mdl/react-mdl.d.ts +++ b/react-mdl/react-mdl.d.ts @@ -1,606 +1,606 @@ -// Type definitions for react-mdl 1.5.3 -// Project: https://github.com/tleunen/react-mdl -// Definitions by: Brad Zacher -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace __ReactMDL { - import React = __React; - - type __MDLClassProps = React.ClassAttributes; - type __MDLOtherProps = React.HTMLProps; - class __MDLComponent

extends React.Component {} - class __MDLBasicComponent extends __MDLComponent<__MDLOtherProps> {} - - interface ShadowedComponent { - shadow ?: number; - } - interface RippleComponent { - ripple ?: boolean; - } - interface CustomRenderedComponent { - component ?: string | JSX.Element | Function; - } - - - // HTMLAttributes (minus the 'data', 'icon', 'label', 'name', 'rows', 'size', 'title', 'value' attributes) - interface MDLHTMLAttributes { - // React-specific Attributes - defaultChecked?: boolean; - defaultValue?: string | string[]; - - // Standard HTML Attributes - accept?: string; - acceptCharset?: string; - accessKey?: string; - action?: string; - allowFullScreen?: boolean; - allowTransparency?: boolean; - alt?: string; - async?: boolean; - autoComplete?: string; - autoFocus?: boolean; - autoPlay?: boolean; - capture?: boolean; - cellPadding?: number | string; - cellSpacing?: number | string; - charSet?: string; - challenge?: string; - checked?: boolean; - classID?: string; - className?: string; - cols?: number; - colSpan?: number; - content?: string; - contentEditable?: boolean; - contextMenu?: string; - controls?: boolean; - coords?: string; - crossOrigin?: string; - dateTime?: string; - default?: boolean; - defer?: boolean; - dir?: string; - disabled?: boolean; - download?: any; - draggable?: boolean; - encType?: string; - form?: string; - formAction?: string; - formEncType?: string; - formMethod?: string; - formNoValidate?: boolean; - formTarget?: string; - frameBorder?: number | string; - headers?: string; - height?: number | string; - hidden?: boolean; - high?: number; - href?: string; - hrefLang?: string; - htmlFor?: string; - httpEquiv?: string; - id?: string; - inputMode?: string; - integrity?: string; - is?: string; - keyParams?: string; - keyType?: string; - kind?: string; - lang?: string; - list?: string; - loop?: boolean; - low?: number; - manifest?: string; - marginHeight?: number; - marginWidth?: number; - max?: number | string; - maxLength?: number; - media?: string; - mediaGroup?: string; - method?: string; - min?: number | string; - minLength?: number; - multiple?: boolean; - muted?: boolean; - nonce?: string; - noValidate?: boolean; - open?: boolean; - optimum?: number; - pattern?: string; - placeholder?: string; - poster?: string; - preload?: string; - radioGroup?: string; - readOnly?: boolean; - rel?: string; - required?: boolean; - reversed?: boolean; - role?: string; - rowSpan?: number; - sandbox?: string; - scope?: string; - scoped?: boolean; - scrolling?: string; - seamless?: boolean; - selected?: boolean; - shape?: string; - sizes?: string; - span?: number; - spellCheck?: boolean; - src?: string; - srcDoc?: string; - srcLang?: string; - srcSet?: string; - start?: number; - step?: number | string; - style?: React.CSSProperties; - summary?: string; - tabIndex?: number; - target?: string; - type?: string; - useMap?: string; - width?: number | string; - wmode?: string; - wrap?: string; - - // RDFa Attributes - about?: string; - datatype?: string; - inlist?: any; - prefix?: string; - property?: string; - resource?: string; - typeof?: string; - vocab?: string; - - // Non-standard Attributes - autoCapitalize?: string; - autoCorrect?: string; - autoSave?: string; - color?: string; - itemProp?: string; - itemScope?: boolean; - itemType?: string; - itemID?: string; - itemRef?: string; - results?: number; - security?: string; - unselectable?: boolean; - - // Allows aria- and data- Attributes - [key: string]: any; - } - // DOMAttributes (minus 'onClick', 'onChange') - interface MDLDOMAttributes { - // DOMAttributes (minus onClick) - children?: React.ReactNode; - dangerouslySetInnerHTML?: { - __html: string; - }; - - // Clipboard Events - onCopy?: React.ClipboardEventHandler; - onCut?: React.ClipboardEventHandler; - onPaste?: React.ClipboardEventHandler; - - // Composition Events - onCompositionEnd?: React.CompositionEventHandler; - onCompositionStart?: React.CompositionEventHandler; - onCompositionUpdate?: React.CompositionEventHandler; - - // Focus Events - onFocus?: React.FocusEventHandler; - onBlur?: React.FocusEventHandler; - - // Form Events - onInput?: React.FormEventHandler; - onSubmit?: React.FormEventHandler; - - // Image Events - onLoad?: React.ReactEventHandler; - onError?: React.ReactEventHandler; // also a Media Event - - // Keyboard Events - onKeyDown?: React.KeyboardEventHandler; - onKeyPress?: React.KeyboardEventHandler; - onKeyUp?: React.KeyboardEventHandler; - - // Media Events - onAbort?: React.ReactEventHandler; - onCanPlay?: React.ReactEventHandler; - onCanPlayThrough?: React.ReactEventHandler; - onDurationChange?: React.ReactEventHandler; - onEmptied?: React.ReactEventHandler; - onEncrypted?: React.ReactEventHandler; - onEnded?: React.ReactEventHandler; - onLoadedData?: React.ReactEventHandler; - onLoadedMetadata?: React.ReactEventHandler; - onLoadStart?: React.ReactEventHandler; - onPause?: React.ReactEventHandler; - onPlay?: React.ReactEventHandler; - onPlaying?: React.ReactEventHandler; - onProgress?: React.ReactEventHandler; - onRateChange?: React.ReactEventHandler; - onSeeked?: React.ReactEventHandler; - onSeeking?: React.ReactEventHandler; - onStalled?: React.ReactEventHandler; - onSuspend?: React.ReactEventHandler; - onTimeUpdate?: React.ReactEventHandler; - onVolumeChange?: React.ReactEventHandler; - onWaiting?: React.ReactEventHandler; - - // MouseEvents - onContextMenu?: React.MouseEventHandler; - onDoubleClick?: React.MouseEventHandler; - onDrag?: React.DragEventHandler; - onDragEnd?: React.DragEventHandler; - onDragEnter?: React.DragEventHandler; - onDragExit?: React.DragEventHandler; - onDragLeave?: React.DragEventHandler; - onDragOver?: React.DragEventHandler; - onDragStart?: React.DragEventHandler; - onDrop?: React.DragEventHandler; - onMouseDown?: React.MouseEventHandler; - onMouseEnter?: React.MouseEventHandler; - onMouseLeave?: React.MouseEventHandler; - onMouseMove?: React.MouseEventHandler; - onMouseOut?: React.MouseEventHandler; - onMouseOver?: React.MouseEventHandler; - onMouseUp?: React.MouseEventHandler; - - // Selection Events - onSelect?: React.ReactEventHandler; - - // Touch Events - onTouchCancel?: React.TouchEventHandler; - onTouchEnd?: React.TouchEventHandler; - onTouchMove?: React.TouchEventHandler; - onTouchStart?: React.TouchEventHandler; - - // UI Events - onScroll?: React.UIEventHandler; - - // Wheel Events - onWheel?: React.WheelEventHandler; - } - - - - interface BadgeProps extends __MDLClassProps { - text: string | number; - className ?: string; - noBackground ?: boolean; - overlap ?: boolean; - } - class Badge extends __MDLComponent {} - - - interface ButtonProps extends __MDLOtherProps, RippleComponent, CustomRenderedComponent { - accent ?: boolean; - colored ?: boolean; - primary ?: boolean; - } - interface StandardButtonProps extends ButtonProps { - raised ?: boolean; - } - interface FABButtonProps extends ButtonProps { - mini ?: boolean; - } - interface IconButtonProps extends ButtonProps { - name ?: string; - raised ?: boolean; - } - class Button extends __MDLComponent {} - class FABButton extends __MDLComponent {} - class IconButton extends __MDLComponent {} - - - interface CardProps extends __MDLOtherProps, ShadowedComponent {} - interface CardActionProps extends __MDLOtherProps { - border ?: boolean; - } - interface CardTitleProps extends __MDLOtherProps { - expand ?: boolean; - } - class Card extends __MDLComponent {} - class CardActions extends __MDLComponent {} - class CardTitle extends __MDLComponent {} - class CardText extends __MDLBasicComponent {} - class CardMenu extends __MDLBasicComponent {} - class CardMedia extends __MDLBasicComponent {} - - - interface CheckboxProps extends __MDLOtherProps, RippleComponent { - checked ?: boolean; - disabled ?: boolean; - label ?: string; - } - class Checkbox extends __MDLComponent {} - - interface UndecoratedTableProps extends __MDLClassProps, MDLHTMLAttributes, React.DOMAttributes, ShadowedComponent { - rows: Array; - rowKeyColumn ?: string; - - name ?: string; - title ?: string; - } - interface TableProps extends UndecoratedTableProps { - sortable ?: boolean; - selectable ?: boolean; - onSelectionChanged ?: (row : any) => any; - } - interface TableHeaderProps extends __MDLClassProps, MDLHTMLAttributes, MDLDOMAttributes { - name : string; - title ?: string; - cellFormatter ?: (value : any, row : any, index : number) => React.ReactNode; - numeric ?: boolean; - nosort ?: boolean; - onClick ?: (e : React.MouseEvent, name : string) => any; - sortFn ?: (a : any, b : any, isAsc : boolean) => number; - tooltip ?: React.ReactNode; - } - class Table extends __MDLComponent {} - class TableHeader extends __MDLComponent {} - class UndecoratedTable extends __MDLComponent {} - class DataTable extends Table {} - - - interface DialogProps extends __MDLOtherProps { - open ?: boolean; - } - interface DialogActionsProps extends __MDLOtherProps { - fullWidth ?: boolean; - } - interface DialogTitleProps extends __MDLOtherProps, CustomRenderedComponent {} - class Dialog extends __MDLComponent {} - class DialogActions extends __MDLComponent {} - class DialogTitle extends __MDLComponent {} - class DialogContent extends __MDLBasicComponent {} - - - interface GridProps extends __MDLOtherProps, CustomRenderedComponent, ShadowedComponent { - noSpacing ?: boolean; - } - interface CellProps extends __MDLOtherProps, CustomRenderedComponent, ShadowedComponent { - col : number; - align ?: string; - phone ?: number; - tablet ?: number; - hideDesktop ?: boolean; - hidePhone ?: boolean; - hideTablet ?: boolean; - } - class Grid extends __MDLComponent {} - class Cell extends __MDLComponent {} - - - interface IconProps extends __MDLOtherProps { - name : string; - } - class Icon extends __MDLComponent {} - - - interface IconToggleProps extends __MDLOtherProps, RippleComponent { - name : string; - checked ?: boolean; - disabled ?: boolean; - } - class IconToggle extends __MDLComponent {} - - - interface ContentProps extends __MDLOtherProps, CustomRenderedComponent {} - interface DrawerProps extends __MDLOtherProps { - title ?: string; - } - interface HeaderProps extends __MDLOtherProps { - title ?: string; - scroll ?: boolean; - seamed ?: boolean; - transparent ?: boolean; - waterfall ?: boolean; - hideTop ?: boolean; - } - interface HeaderRowProps extends __MDLOtherProps { - title ?: string; - } - interface HeaderTabsProps extends __MDLOtherProps, RippleComponent { - activeTab ?: number; - onChange ?: React.FormEventHandler; - } - interface LayoutProps extends __MDLOtherProps { - fixedDrawer ?: boolean; - fixedHeader ?: boolean; - fixedTabse ?: boolean; - } - interface NavigationProps extends __MDLOtherProps {} - class Content extends __MDLComponent {} - class Drawer extends __MDLComponent {} - class Header extends __MDLComponent {} - class HeaderRow extends __MDLComponent {} - class HeaderTabs extends __MDLComponent {} - class Layout extends __MDLComponent {} - class Navigation extends __MDLComponent {} - class Spacer extends __MDLBasicComponent {} - - interface FooterProps extends MDLHTMLAttributes, React.DOMAttributes { - size ?: string; - - title ?: string; - } - interface FooterDropDownSectionProps extends MDLHTMLAttributes, React.DOMAttributes { - size ?: string; - title : React.ReactNode; - } - interface FooterLinkListProps extends MDLHTMLAttributes, React.DOMAttributes { - size ?: string; - - title ?: string; - } - interface FooterSectionProps extends MDLHTMLAttributes, React.DOMAttributes { - size ?: string; - type ?: string; - logo ?: React.ReactNode; - - title ?: string; - } - class Footer extends __MDLComponent {} - class FooterDropDownSection extends __MDLComponent {} - class FooterLinkList extends __MDLComponent {} - class FooterSection extends __MDLComponent {} - - interface ListItemProps extends __MDLOtherProps { - twoLine ?: boolean; - threeLine ?: boolean; - } - interface ListItemActionProps extends __MDLOtherProps { - info ?: string; - } - interface ListItemContentProps extends MDLHTMLAttributes, React.DOMAttributes { - avatar ?: string | JSX.Element; - icon ?: string | JSX.Element; - subtitle ?: React.ReactNode; - useBodyClass ?: boolean; - } - class List extends __MDLBasicComponent {} - class ListItem extends __MDLComponent {} - class ListItemAction extends __MDLComponent {} - class ListItemContent extends __MDLComponent {} - - - interface MenuProps extends __MDLOtherProps, RippleComponent { - target : string; - align ?: string; - valign ?: string; - } - class Menu extends __MDLComponent {} - class MenuItem extends __MDLBasicComponent {} - - - interface ProgressBarProps extends __MDLOtherProps { - buffer ?: number; - indeterminate ?: boolean; - progress ?: number; - } - class ProgressBar extends __MDLComponent {} - - - interface RadioProps extends MDLHTMLAttributes, React.DOMAttributes, RippleComponent { - value : string | number; - checked ?: boolean; - disabled ?: boolean; - name ?: string; - onChange ?: React.FormEventHandler; - label ?: string; - } - interface RadioGroupProps extends MDLHTMLAttributes, React.DOMAttributes { - name : string; - value : string | number; - childContainer ?: string; - container ?: string; - onChange ?: React.FormEventHandler; - label ?: string; - } - class Radio extends __MDLComponent {} - class RadioGroup extends __MDLComponent {} - - - interface SliderProps extends MDLHTMLAttributes, React.DOMAttributes { - max : number; - min : number; - onChange ?: React.FormEventHandler; - value ?: number; - } - class Slider extends __MDLComponent {} - - - interface SnackbarProps extends __MDLOtherProps { - active : boolean; - onTimeout : () => any; - action ?: string; - onActionClick ?: React.MouseEventHandler; - timeout ?: number; - } - class Snackbar extends __MDLComponent {} - - - interface SpinnerProps extends __MDLOtherProps { - singleColor ?: boolean; - } - class Spinner extends __MDLComponent {} - - - interface SwitchProps extends __MDLOtherProps, RippleComponent { - checked ?: boolean; - disabled ?: boolean; - onChange ?: React.FormEventHandler; - } - class Switch extends __MDLComponent {} - - - interface TabProps extends __MDLOtherProps, CustomRenderedComponent { - active ?: boolean; - cssPrefix ?: string; - onTabClick ?: (tabId : number) => any; - tabId ?: number; - } - interface TabBarProps extends MDLHTMLAttributes, MDLDOMAttributes { - cssPrefix : string; - activeTab ?: number; - onChange ?: (tabId : number) => any; - - name ?: string; - title ?: string; - onClick ?: React.MouseEventHandler; - } - interface TabsProps extends MDLHTMLAttributes, MDLDOMAttributes { - activeTab ?: number; - onChange ?: (tabId : number) => any; - tabBarProps ?: TabBarProps; - - name ?: string; - title ?: string; - onClick ?: React.MouseEventHandler; - } - class Tab extends __MDLComponent {} - class TabBar extends __MDLComponent {} - class Tabs extends __MDLComponent {} - - - interface TextfieldProps extends MDLHTMLAttributes, React.DOMAttributes { - label : string; - disabled ?: boolean; - error ?: React.ReactNode; - expandable ?: boolean; - expandableIcon ?: string; - floatingLabel ?: boolean; - id ?: string; - inputClassName ?: string; - maxRows ?: number; - onChange ?: React.FormEventHandler; - pattern ?: string; - required ?: boolean; - rows ?: number; - value ?: string | number; - - name ?: string; - title ?: string; - } - class Textfield extends __MDLComponent {} - - - interface TooltipProps extends MDLHTMLAttributes, React.DOMAttributes { - label : React.ReactNode; - large ?: boolean; - position ?: string; - - name ?: string; - title ?: string; - } - class Tooltip extends __MDLComponent {} -} - -declare module 'react-mdl' { - export = __ReactMDL; +// Type definitions for react-mdl 1.5.3 +// Project: https://github.com/tleunen/react-mdl +// Definitions by: Brad Zacher +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace __ReactMDL { + import React = __React; + + type __MDLClassProps = React.ClassAttributes; + type __MDLOtherProps = React.HTMLProps; + class __MDLComponent

extends React.Component {} + class __MDLBasicComponent extends __MDLComponent<__MDLOtherProps> {} + + interface ShadowedComponent { + shadow ?: number; + } + interface RippleComponent { + ripple ?: boolean; + } + interface CustomRenderedComponent { + component ?: string | JSX.Element | Function; + } + + + // HTMLAttributes (minus the 'data', 'icon', 'label', 'name', 'rows', 'size', 'title', 'value' attributes) + interface MDLHTMLAttributes { + // React-specific Attributes + defaultChecked?: boolean; + defaultValue?: string | string[]; + + // Standard HTML Attributes + accept?: string; + acceptCharset?: string; + accessKey?: string; + action?: string; + allowFullScreen?: boolean; + allowTransparency?: boolean; + alt?: string; + async?: boolean; + autoComplete?: string; + autoFocus?: boolean; + autoPlay?: boolean; + capture?: boolean; + cellPadding?: number | string; + cellSpacing?: number | string; + charSet?: string; + challenge?: string; + checked?: boolean; + classID?: string; + className?: string; + cols?: number; + colSpan?: number; + content?: string; + contentEditable?: boolean; + contextMenu?: string; + controls?: boolean; + coords?: string; + crossOrigin?: string; + dateTime?: string; + default?: boolean; + defer?: boolean; + dir?: string; + disabled?: boolean; + download?: any; + draggable?: boolean; + encType?: string; + form?: string; + formAction?: string; + formEncType?: string; + formMethod?: string; + formNoValidate?: boolean; + formTarget?: string; + frameBorder?: number | string; + headers?: string; + height?: number | string; + hidden?: boolean; + high?: number; + href?: string; + hrefLang?: string; + htmlFor?: string; + httpEquiv?: string; + id?: string; + inputMode?: string; + integrity?: string; + is?: string; + keyParams?: string; + keyType?: string; + kind?: string; + lang?: string; + list?: string; + loop?: boolean; + low?: number; + manifest?: string; + marginHeight?: number; + marginWidth?: number; + max?: number | string; + maxLength?: number; + media?: string; + mediaGroup?: string; + method?: string; + min?: number | string; + minLength?: number; + multiple?: boolean; + muted?: boolean; + nonce?: string; + noValidate?: boolean; + open?: boolean; + optimum?: number; + pattern?: string; + placeholder?: string; + poster?: string; + preload?: string; + radioGroup?: string; + readOnly?: boolean; + rel?: string; + required?: boolean; + reversed?: boolean; + role?: string; + rowSpan?: number; + sandbox?: string; + scope?: string; + scoped?: boolean; + scrolling?: string; + seamless?: boolean; + selected?: boolean; + shape?: string; + sizes?: string; + span?: number; + spellCheck?: boolean; + src?: string; + srcDoc?: string; + srcLang?: string; + srcSet?: string; + start?: number; + step?: number | string; + style?: React.CSSProperties; + summary?: string; + tabIndex?: number; + target?: string; + type?: string; + useMap?: string; + width?: number | string; + wmode?: string; + wrap?: string; + + // RDFa Attributes + about?: string; + datatype?: string; + inlist?: any; + prefix?: string; + property?: string; + resource?: string; + typeof?: string; + vocab?: string; + + // Non-standard Attributes + autoCapitalize?: string; + autoCorrect?: string; + autoSave?: string; + color?: string; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + itemID?: string; + itemRef?: string; + results?: number; + security?: string; + unselectable?: boolean; + + // Allows aria- and data- Attributes + [key: string]: any; + } + // DOMAttributes (minus 'onClick', 'onChange') + interface MDLDOMAttributes { + // DOMAttributes (minus onClick) + children?: React.ReactNode; + dangerouslySetInnerHTML?: { + __html: string; + }; + + // Clipboard Events + onCopy?: React.ClipboardEventHandler; + onCut?: React.ClipboardEventHandler; + onPaste?: React.ClipboardEventHandler; + + // Composition Events + onCompositionEnd?: React.CompositionEventHandler; + onCompositionStart?: React.CompositionEventHandler; + onCompositionUpdate?: React.CompositionEventHandler; + + // Focus Events + onFocus?: React.FocusEventHandler; + onBlur?: React.FocusEventHandler; + + // Form Events + onInput?: React.FormEventHandler; + onSubmit?: React.FormEventHandler; + + // Image Events + onLoad?: React.ReactEventHandler; + onError?: React.ReactEventHandler; // also a Media Event + + // Keyboard Events + onKeyDown?: React.KeyboardEventHandler; + onKeyPress?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; + + // Media Events + onAbort?: React.ReactEventHandler; + onCanPlay?: React.ReactEventHandler; + onCanPlayThrough?: React.ReactEventHandler; + onDurationChange?: React.ReactEventHandler; + onEmptied?: React.ReactEventHandler; + onEncrypted?: React.ReactEventHandler; + onEnded?: React.ReactEventHandler; + onLoadedData?: React.ReactEventHandler; + onLoadedMetadata?: React.ReactEventHandler; + onLoadStart?: React.ReactEventHandler; + onPause?: React.ReactEventHandler; + onPlay?: React.ReactEventHandler; + onPlaying?: React.ReactEventHandler; + onProgress?: React.ReactEventHandler; + onRateChange?: React.ReactEventHandler; + onSeeked?: React.ReactEventHandler; + onSeeking?: React.ReactEventHandler; + onStalled?: React.ReactEventHandler; + onSuspend?: React.ReactEventHandler; + onTimeUpdate?: React.ReactEventHandler; + onVolumeChange?: React.ReactEventHandler; + onWaiting?: React.ReactEventHandler; + + // MouseEvents + onContextMenu?: React.MouseEventHandler; + onDoubleClick?: React.MouseEventHandler; + onDrag?: React.DragEventHandler; + onDragEnd?: React.DragEventHandler; + onDragEnter?: React.DragEventHandler; + onDragExit?: React.DragEventHandler; + onDragLeave?: React.DragEventHandler; + onDragOver?: React.DragEventHandler; + onDragStart?: React.DragEventHandler; + onDrop?: React.DragEventHandler; + onMouseDown?: React.MouseEventHandler; + onMouseEnter?: React.MouseEventHandler; + onMouseLeave?: React.MouseEventHandler; + onMouseMove?: React.MouseEventHandler; + onMouseOut?: React.MouseEventHandler; + onMouseOver?: React.MouseEventHandler; + onMouseUp?: React.MouseEventHandler; + + // Selection Events + onSelect?: React.ReactEventHandler; + + // Touch Events + onTouchCancel?: React.TouchEventHandler; + onTouchEnd?: React.TouchEventHandler; + onTouchMove?: React.TouchEventHandler; + onTouchStart?: React.TouchEventHandler; + + // UI Events + onScroll?: React.UIEventHandler; + + // Wheel Events + onWheel?: React.WheelEventHandler; + } + + + + interface BadgeProps extends __MDLClassProps { + text: string | number; + className ?: string; + noBackground ?: boolean; + overlap ?: boolean; + } + class Badge extends __MDLComponent {} + + + interface ButtonProps extends __MDLOtherProps, RippleComponent, CustomRenderedComponent { + accent ?: boolean; + colored ?: boolean; + primary ?: boolean; + } + interface StandardButtonProps extends ButtonProps { + raised ?: boolean; + } + interface FABButtonProps extends ButtonProps { + mini ?: boolean; + } + interface IconButtonProps extends ButtonProps { + name ?: string; + raised ?: boolean; + } + class Button extends __MDLComponent {} + class FABButton extends __MDLComponent {} + class IconButton extends __MDLComponent {} + + + interface CardProps extends __MDLOtherProps, ShadowedComponent {} + interface CardActionProps extends __MDLOtherProps { + border ?: boolean; + } + interface CardTitleProps extends __MDLOtherProps { + expand ?: boolean; + } + class Card extends __MDLComponent {} + class CardActions extends __MDLComponent {} + class CardTitle extends __MDLComponent {} + class CardText extends __MDLBasicComponent {} + class CardMenu extends __MDLBasicComponent {} + class CardMedia extends __MDLBasicComponent {} + + + interface CheckboxProps extends __MDLOtherProps, RippleComponent { + checked ?: boolean; + disabled ?: boolean; + label ?: string; + } + class Checkbox extends __MDLComponent {} + + interface UndecoratedTableProps extends __MDLClassProps, MDLHTMLAttributes, React.DOMAttributes, ShadowedComponent { + rows: Array; + rowKeyColumn ?: string; + + name ?: string; + title ?: string; + } + interface TableProps extends UndecoratedTableProps { + sortable ?: boolean; + selectable ?: boolean; + onSelectionChanged ?: (row : any) => any; + } + interface TableHeaderProps extends __MDLClassProps, MDLHTMLAttributes, MDLDOMAttributes { + name : string; + title ?: string; + cellFormatter ?: (value : any, row : any, index : number) => React.ReactNode; + numeric ?: boolean; + nosort ?: boolean; + onClick ?: (e : React.MouseEvent, name : string) => any; + sortFn ?: (a : any, b : any, isAsc : boolean) => number; + tooltip ?: React.ReactNode; + } + class Table extends __MDLComponent {} + class TableHeader extends __MDLComponent {} + class UndecoratedTable extends __MDLComponent {} + class DataTable extends Table {} + + + interface DialogProps extends __MDLOtherProps { + open ?: boolean; + } + interface DialogActionsProps extends __MDLOtherProps { + fullWidth ?: boolean; + } + interface DialogTitleProps extends __MDLOtherProps, CustomRenderedComponent {} + class Dialog extends __MDLComponent {} + class DialogActions extends __MDLComponent {} + class DialogTitle extends __MDLComponent {} + class DialogContent extends __MDLBasicComponent {} + + + interface GridProps extends __MDLOtherProps, CustomRenderedComponent, ShadowedComponent { + noSpacing ?: boolean; + } + interface CellProps extends __MDLOtherProps, CustomRenderedComponent, ShadowedComponent { + col : number; + align ?: string; + phone ?: number; + tablet ?: number; + hideDesktop ?: boolean; + hidePhone ?: boolean; + hideTablet ?: boolean; + } + class Grid extends __MDLComponent {} + class Cell extends __MDLComponent {} + + + interface IconProps extends __MDLOtherProps { + name : string; + } + class Icon extends __MDLComponent {} + + + interface IconToggleProps extends __MDLOtherProps, RippleComponent { + name : string; + checked ?: boolean; + disabled ?: boolean; + } + class IconToggle extends __MDLComponent {} + + + interface ContentProps extends __MDLOtherProps, CustomRenderedComponent {} + interface DrawerProps extends __MDLOtherProps { + title ?: string; + } + interface HeaderProps extends __MDLOtherProps { + title ?: string; + scroll ?: boolean; + seamed ?: boolean; + transparent ?: boolean; + waterfall ?: boolean; + hideTop ?: boolean; + } + interface HeaderRowProps extends __MDLOtherProps { + title ?: string; + } + interface HeaderTabsProps extends __MDLOtherProps, RippleComponent { + activeTab ?: number; + onChange ?: React.FormEventHandler; + } + interface LayoutProps extends __MDLOtherProps { + fixedDrawer ?: boolean; + fixedHeader ?: boolean; + fixedTabse ?: boolean; + } + interface NavigationProps extends __MDLOtherProps {} + class Content extends __MDLComponent {} + class Drawer extends __MDLComponent {} + class Header extends __MDLComponent {} + class HeaderRow extends __MDLComponent {} + class HeaderTabs extends __MDLComponent {} + class Layout extends __MDLComponent {} + class Navigation extends __MDLComponent {} + class Spacer extends __MDLBasicComponent {} + + interface FooterProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + + title ?: string; + } + interface FooterDropDownSectionProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + title : React.ReactNode; + } + interface FooterLinkListProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + + title ?: string; + } + interface FooterSectionProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + type ?: string; + logo ?: React.ReactNode; + + title ?: string; + } + class Footer extends __MDLComponent {} + class FooterDropDownSection extends __MDLComponent {} + class FooterLinkList extends __MDLComponent {} + class FooterSection extends __MDLComponent {} + + interface ListItemProps extends __MDLOtherProps { + twoLine ?: boolean; + threeLine ?: boolean; + } + interface ListItemActionProps extends __MDLOtherProps { + info ?: string; + } + interface ListItemContentProps extends MDLHTMLAttributes, React.DOMAttributes { + avatar ?: string | JSX.Element; + icon ?: string | JSX.Element; + subtitle ?: React.ReactNode; + useBodyClass ?: boolean; + } + class List extends __MDLBasicComponent {} + class ListItem extends __MDLComponent {} + class ListItemAction extends __MDLComponent {} + class ListItemContent extends __MDLComponent {} + + + interface MenuProps extends __MDLOtherProps, RippleComponent { + target : string; + align ?: string; + valign ?: string; + } + class Menu extends __MDLComponent {} + class MenuItem extends __MDLBasicComponent {} + + + interface ProgressBarProps extends __MDLOtherProps { + buffer ?: number; + indeterminate ?: boolean; + progress ?: number; + } + class ProgressBar extends __MDLComponent {} + + + interface RadioProps extends MDLHTMLAttributes, React.DOMAttributes, RippleComponent { + value : string | number; + checked ?: boolean; + disabled ?: boolean; + name ?: string; + onChange ?: React.FormEventHandler; + label ?: string; + } + interface RadioGroupProps extends MDLHTMLAttributes, React.DOMAttributes { + name : string; + value : string | number; + childContainer ?: string; + container ?: string; + onChange ?: React.FormEventHandler; + label ?: string; + } + class Radio extends __MDLComponent {} + class RadioGroup extends __MDLComponent {} + + + interface SliderProps extends MDLHTMLAttributes, React.DOMAttributes { + max : number; + min : number; + onChange ?: React.FormEventHandler; + value ?: number; + } + class Slider extends __MDLComponent {} + + + interface SnackbarProps extends __MDLOtherProps { + active : boolean; + onTimeout : () => any; + action ?: string; + onActionClick ?: React.MouseEventHandler; + timeout ?: number; + } + class Snackbar extends __MDLComponent {} + + + interface SpinnerProps extends __MDLOtherProps { + singleColor ?: boolean; + } + class Spinner extends __MDLComponent {} + + + interface SwitchProps extends __MDLOtherProps, RippleComponent { + checked ?: boolean; + disabled ?: boolean; + onChange ?: React.FormEventHandler; + } + class Switch extends __MDLComponent {} + + + interface TabProps extends __MDLOtherProps, CustomRenderedComponent { + active ?: boolean; + cssPrefix ?: string; + onTabClick ?: (tabId : number) => any; + tabId ?: number; + } + interface TabBarProps extends MDLHTMLAttributes, MDLDOMAttributes { + cssPrefix : string; + activeTab ?: number; + onChange ?: (tabId : number) => any; + + name ?: string; + title ?: string; + onClick ?: React.MouseEventHandler; + } + interface TabsProps extends MDLHTMLAttributes, MDLDOMAttributes { + activeTab ?: number; + onChange ?: (tabId : number) => any; + tabBarProps ?: TabBarProps; + + name ?: string; + title ?: string; + onClick ?: React.MouseEventHandler; + } + class Tab extends __MDLComponent {} + class TabBar extends __MDLComponent {} + class Tabs extends __MDLComponent {} + + + interface TextfieldProps extends MDLHTMLAttributes, React.DOMAttributes { + label : string; + disabled ?: boolean; + error ?: React.ReactNode; + expandable ?: boolean; + expandableIcon ?: string; + floatingLabel ?: boolean; + id ?: string; + inputClassName ?: string; + maxRows ?: number; + onChange ?: React.FormEventHandler; + pattern ?: string; + required ?: boolean; + rows ?: number; + value ?: string | number; + + name ?: string; + title ?: string; + } + class Textfield extends __MDLComponent {} + + + interface TooltipProps extends MDLHTMLAttributes, React.DOMAttributes { + label : React.ReactNode; + large ?: boolean; + position ?: string; + + name ?: string; + title ?: string; + } + class Tooltip extends __MDLComponent {} +} + +declare module 'react-mdl' { + export = __ReactMDL; } \ No newline at end of file From 1a9ae17cbfab09dcd46bf93f5eebee650aa65f5b Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sun, 24 Apr 2016 14:17:43 +0930 Subject: [PATCH 124/415] fixed es6 compilation --- react-mdl/react-mdl-tests.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/react-mdl/react-mdl-tests.tsx b/react-mdl/react-mdl-tests.tsx index 8efcebee52..1e7fd19b0c 100644 --- a/react-mdl/react-mdl-tests.tsx +++ b/react-mdl/react-mdl-tests.tsx @@ -1,6 +1,7 @@ // Test file for react-mdl Definition file /// +import * as React from 'react'; import {Badge, FABButton, Button, IconButton, Card, CardActions, CardTitle, CardText, CardMenu, CardMedia, From 42a3162e0b18c74be82cbf1330197eed408e1229 Mon Sep 17 00:00:00 2001 From: spiffytech Date: Tue, 26 Apr 2016 13:00:27 -0400 Subject: [PATCH 125/415] Joi: support alternatives() without parameters. Fix alternatives() not returning interface with try() member. --- joi/joi-tests.ts | 3 +++ joi/joi.d.ts | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/joi/joi-tests.ts b/joi/joi-tests.ts index a00543fe4e..bfb039eced 100644 --- a/joi/joi-tests.ts +++ b/joi/joi-tests.ts @@ -732,6 +732,9 @@ namespace common { // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- +schema = Joi.alternatives(); +schema = Joi.alternatives().try(schemaArr); + schema = Joi.alternatives(schemaArr); schema = Joi.alternatives(schema, anySchema, boolSchema); diff --git a/joi/joi.d.ts b/joi/joi.d.ts index d9ee7c20d1..6b9d1dbefa 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -747,8 +747,9 @@ declare module 'joi' { /** * Generates a type that will match one of the provided alternative schemas */ - export function alternatives(types: Schema[]): Schema; - export function alternatives(type1: Schema, type2: Schema, ...types: Schema[]): Schema; + export function alternatives(): AlternativesSchema; + export function alternatives(types: Schema[]): AlternativesSchema; + export function alternatives(type1: Schema, type2: Schema, ...types: Schema[]): AlternativesSchema; /** * Validates a value using the given schema and options. From 748690dd90f6a45dfedc875f04eb62976cffcc9d Mon Sep 17 00:00:00 2001 From: spiffytech Date: Tue, 26 Apr 2016 13:12:33 -0400 Subject: [PATCH 126/415] Joi: support non-array variant of alternatives().try() --- joi/joi-tests.ts | 1 + joi/joi.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/joi/joi-tests.ts b/joi/joi-tests.ts index bfb039eced..f12552ead1 100644 --- a/joi/joi-tests.ts +++ b/joi/joi-tests.ts @@ -734,6 +734,7 @@ namespace common { schema = Joi.alternatives(); schema = Joi.alternatives().try(schemaArr); +schema = Joi.alternatives().try(schema, schema); schema = Joi.alternatives(schemaArr); schema = Joi.alternatives(schema, anySchema, boolSchema); diff --git a/joi/joi.d.ts b/joi/joi.d.ts index 6b9d1dbefa..8f9fa6db95 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -691,6 +691,7 @@ declare module 'joi' { export interface AlternativesSchema extends AnySchema { try(schemas: Schema[]): AlternativesSchema; + try(type1: Schema, type2: Schema, ...types: Schema[]): AlternativesSchema; when(ref: string, options: WhenOptions): AlternativesSchema; when(ref: Reference, options: WhenOptions): AlternativesSchema; } From 9d139b8fa6c2bbf0bb151e5a1521ebc50418a367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luiz=20dos=20Santos?= Date: Thu, 28 Apr 2016 10:28:35 -0300 Subject: [PATCH 127/415] Add type definitions for RxJS bindings for Node --- rx-node/rx.node-tests.ts | 52 +++++++++++++++++++++++++++ rx-node/rx.node.d.ts | 77 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 rx-node/rx.node-tests.ts create mode 100644 rx-node/rx.node.d.ts diff --git a/rx-node/rx.node-tests.ts b/rx-node/rx.node-tests.ts new file mode 100644 index 0000000000..254ef6e242 --- /dev/null +++ b/rx-node/rx.node-tests.ts @@ -0,0 +1,52 @@ +// Type definitions for RxJS bindings for Node +// Project: https://github.com/Reactive-Extensions/rx-node +// Definitions by: Andre Luiz dos Santos +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +import RxNode = require('rx-node'); + +{ + var source = Rx.Observable.return(42); + var emitter = RxNode.toEventEmitter(source, 'data'); + + emitter.on('data', function(data: number) { + console.log('Data: ' + data); + }); + + emitter.on('end', function() { + console.log('End'); + }); + + // Ensure to call publish to fire events from the observable + emitter.publish(); +} +{ + var subscription = RxNode.fromStream(process.stdin, 'end') + .subscribe(function(x) { console.log(x); }); +} +{ + var subscription = RxNode.fromReadableStream(process.stdin) + .subscribe(function(x) { console.log(x); }); +} +{ + var readline = require('readline'); + var fs = require('fs'); + + var rl = readline.createInterface({ + input: fs.createReadStream('sample.txt') + }); + + var subscription = RxNode.fromReadLineStream(rl) + .subscribe(function(x) { console.log(x); }); +} +{ + var subscription = RxNode.fromWritableStream(process.stdout) + .subscribe(function(x) { console.log(x); }); +} +{ + var source = Rx.Observable.range(0, 5); + var subscription = RxNode.writeToStream(source, process.stdout, 'utf8'); +} diff --git a/rx-node/rx.node.d.ts b/rx-node/rx.node.d.ts new file mode 100644 index 0000000000..14af714359 --- /dev/null +++ b/rx-node/rx.node.d.ts @@ -0,0 +1,77 @@ +// Type definitions for RxJS bindings for Node +// Project: https://github.com/Reactive-Extensions/rx-node +// Definitions by: Andre Luiz dos Santos +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare namespace RxNode { + + export interface PublishableEventEmitter extends NodeJS.EventEmitter { + publish(): void; + } + + /** + * Converts the given observable sequence to an event emitter with the given event name. + * The errors are handled on the 'error' event and completion on the 'end' event. + * You must call publish in order to invoke the subscription on the Observable sequence. + * @param {Observable} observable The observable sequence to convert to an EventEmitter. + * @param {String} eventName The event name to emit onNext calls. + * @returns {EventEmitter} An EventEmitter which emits the given eventName for each onNext call in addition to 'error' and 'end' events. + */ + function toEventEmitter(observable: Rx.Observable, eventName: string): RxNode.PublishableEventEmitter; + + /** + * Converts a flowing stream to an Observable sequence. + * @param {Stream} stream A stream to convert to a observable sequence. + * @param {String} [finishEventName] Event that notifies about closed stream. ("end" by default) + * @param {String} [dataEventName] Event that notifies about incoming data. ("data" by default) + * @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and finish events like `end` or `finish`. + */ + function fromStream(stream: NodeJS.ReadableStream, finishEventName?: string, dataEventName?: string): Rx.Observable; + + /** + * Converts a flowing readable stream to an Observable sequence. + * @param {Stream} stream A stream to convert to a observable sequence. + * @param {String} [dataEventName] Event that notifies about incoming data. ("data" by default) + * @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and 'end' events. + */ + function fromReadableStream(stream: NodeJS.ReadableStream, dataEventName?: string): Rx.Observable; + + /** + * Converts a flowing readline stream to an Observable sequence. + * @param {Stream} stream A stream to convert to a observable sequence. + * @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and 'end' events. + */ + function fromReadLineStream(stream: NodeJS.ReadableStream): Rx.Observable; + + /** + * Converts a flowing writeable stream to an Observable sequence. + * @param {Stream} stream A stream to convert to a observable sequence. + * @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and 'finish' events. + */ + function fromWritableStream(stream: NodeJS.WritableStream): Rx.Observable; + + /** + * Converts a flowing transform stream to an Observable sequence. + * @param {Stream} stream A stream to convert to a observable sequence. + * @param {String} [dataEventName] Event that notifies about incoming data. ("data" by default) + * @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and 'finish' events. + */ + function fromTransformStream(stream: NodeJS.ReadWriteStream, dataEventName?: string): Rx.Observable; + + /** + * Writes an observable sequence to a stream + * @param {Observable} observable Observable sequence to write to a stream. + * @param {Stream} stream The stream to write to. + * @param {String} [encoding] The encoding of the item to write. + * @returns {Disposable} The subscription handle. + */ + function writeToStream(observable: Rx.Observable, stream: NodeJS.WritableStream, encoding: string): Rx.Disposable; + +} + +declare module "rx-node" { + export = RxNode; +} From ed57459c850839fefe5aad6d7b0de12b958afd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luiz=20dos=20Santos?= Date: Thu, 28 Apr 2016 12:04:03 -0300 Subject: [PATCH 128/415] Remove import from test file to compile with --target es6 --- rx-node/rx.node-tests.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/rx-node/rx.node-tests.ts b/rx-node/rx.node-tests.ts index 254ef6e242..b5450e9945 100644 --- a/rx-node/rx.node-tests.ts +++ b/rx-node/rx.node-tests.ts @@ -6,8 +6,6 @@ /// /// -import RxNode = require('rx-node'); - { var source = Rx.Observable.return(42); var emitter = RxNode.toEventEmitter(source, 'data'); From a1433356ad561652fa76872bd7e3ac628e8bfe87 Mon Sep 17 00:00:00 2001 From: Atanas Atanasov Date: Sat, 30 Apr 2016 14:15:09 +0300 Subject: [PATCH 129/415] Update grid.d.ts --- gijgo/grid.d.ts | 137 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 105 insertions(+), 32 deletions(-) diff --git a/gijgo/grid.d.ts b/gijgo/grid.d.ts index ff5802482f..5864f2efd6 100644 --- a/gijgo/grid.d.ts +++ b/gijgo/grid.d.ts @@ -3,48 +3,121 @@ // Definitions by: Atanas Atanasov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -interface DataGridPager { +interface GridPager { limit: number; - sizes: Array + sizes: Array; + leftControls?: any; + rightControls?: any; } -interface DataGridColumn { - title?: any; - field?: any; +interface GridColumn { align?: string; - type?: string; - icon?: string; - tooltip?: string; + cssClass?: string; + decimalDigits?: number; + editor?: any; events?: any; - sortable?: boolean; - width?: number; + field?: string; + format?: string; headerCssClass?: string; -} - -interface DataGridSettings { - title?: string; - dataSource?: any; - primaryKey?: any; - selectionType?: string; - selectionMethod?: string; - uiLibrary?: string; - autoLoad?: boolean; - pager?: DataGridPager; - params?: any; - notFoundText?: string; + hidden?: boolean; + icon?: string; minWidth?: number; - columns?: Array; - defaultColumnSettings?: DataGridColumn; + priority?: number; + sortable?: boolean; + stopPropagation?: boolean; + title?: any; + tmpl?: string; + tooltip?: string; + type?: string; + width?: number; } -interface DataGrid extends JQuery { - reload(params?: Params): void; - getById(id: number): Entity; - getAll(): Entity[]; - setSelected(id: number, value: any): void; +interface GridDefaultParams { + direction?: string; + limit?: string; + page?: string; + sortBy?: string; +} + +interface GridMapping { + dataField?: string; + totalRecordsField?: string; +} + +interface GridSettings { + //Configuration options + autoGenerateColumns?: boolean; + autoLoad?: boolean; + columns?: Array; + dataSource?: any; + defaultColumnSettings?: GridColumn; + defaultParams?: GridDefaultParams; + detailTemplate?: string; + fontSize?: string; + mapping?: string; + minWidth?: number; + notFoundText?: string; + pager?: GridPager; + primaryKey?: string; + resizableColumns?: boolean; + resizeCheckInterval?: number; + responsive?: boolean; + selectionMethod?: string; + selectionType?: string; + showHiddenColumnsAsDetails?: boolean; + title?: string; + toolbarTemplate?: string; + uiLibrary?: string; + width?: number; + params?: any; + + //Events + beforeEmptyRowInsert(e: any, $row: JQuery); + cellDataBound(e: any, $wrapper: JQuery, id: string, column: GridColumn, record: Entity); + cellDataChanged(e: any, $cell: JQuery, column: GridColumn, record: Entity, oldValue: any, newValue: any); + columnHide(e: any, column: GridColumn); + columnShow(e: any, column: GridColumn); + dataBinding(e: any, records: Array); + dataBound(e: any, records: Array, totalRecords: number); + destroying(e: any); + detailCollapse(e: any, detailWrapper: JQuery, record: Entity); + detailExpand(e: any, detailWrapper: JQuery, record: Entity); + initialized(e: any); + pageChanging(e: any, newPage: number); + pageSizeChange(e: any, newPage: number); + resize(e: any, newWidth: number, oldWidth: number); + rowDataBound(e: any, $row: JQuery, id: string, record: Entity); + rowRemoving(e: any, $row: JQuery, id: string, record: Entity); + rowSelect(e: any, $row: JQuery, id: string, record: Entity); + rowUnselect(e: any, $row: JQuery, id: string, record: Entity); +} + +interface Grid extends JQuery { + addRow(record: Entity): Grid; + clear(showNotFoundText?: boolean): Grid; + count(): number; + destroy(keepTableTag?: boolean, keepWrapperTag?: boolean): void; + //get(position: number): Entity; //TODO: rename to getByPosition to avoid conflicts with jquery.get + getAll(): Array; + getById(id: string): Entity; + getChanges(): Array; + getSelected(): string; + getSelections(): Array; + hideColumn(field: string): Grid; + makeResponsive(): void; + reload(params?: Params): Grid; + removeRow(id: string): Grid; + render(response: any): Grid; + selectAll(): Grid; + setSelected(id: string): Grid; + showColumn(field: string): Grid; + title(text: any): any; + unSelectAll(): Grid; + updateRow(id: string, record: Entity): Grid; } interface JQuery { - grid(settings: DataGridSettings): DataGrid; - grid(settings: DataGridSettings): DataGrid; + grid(settings: GridSettings): Grid; + grid(settings: GridSettings): Grid; + grid(settings: GridSettings): Grid; } From fbe96b9a971ede4e42aab0a839ca533f6ffd7b12 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sun, 1 May 2016 15:58:24 +0200 Subject: [PATCH 130/415] Jasmine: Document `Env.throwOnExpectationFailure` --- jasmine/jasmine.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index aa3acdfbf8..8f7e725195 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -179,6 +179,7 @@ declare namespace jasmine { addCustomEqualityTester(equalityTester: CustomEqualityTester): void; addMatchers(matchers: CustomMatcherFactories): void; specFilter(spec: Spec): boolean; + throwOnExpectationFailure(value: boolean): void; } interface FakeTimer { From d659fd52710b61078776be74a7604bd98a2398fd Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 4 May 2016 12:07:27 +0930 Subject: [PATCH 131/415] added o.js --- o.js/o.js-tests.ts | 151 +++++++++++++++++++++++++++++++++++++++++++++ o.js/o.js.d.ts | 70 +++++++++++++++++++++ 2 files changed, 221 insertions(+) create mode 100644 o.js/o.js-tests.ts create mode 100644 o.js/o.js.d.ts diff --git a/o.js/o.js-tests.ts b/o.js/o.js-tests.ts new file mode 100644 index 0000000000..9ef2f05606 --- /dev/null +++ b/o.js/o.js-tests.ts @@ -0,0 +1,151 @@ +/// + +import o = require('o.js'); + +interface Product { + ID : number; + Name : string; + Description : string; + ReleaseDate : string; + DiscontinuedDate : Date; + Rating: number; + Price: number; +} +interface Category { + ID : number; + Name : string; +} + +// copy pasta all the examples from the readme! + +o('http://services.odata.org/V4/OData/OData.svc/Products') + .get(function(data) { + console.log(data); //returns an array of Product data + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products') + .take(5) + .skip(2) + .get(function(data) { + console.log(data); //An array of 5 products skiped by 2 + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products') + .find(':0') + .route('Product/Detail/:0/:1',function(data) { + console.log('Route Product/Detail/'+this.param[0]+'/'+this.param[1]+' triggered. Result:'); + console.log(data); + }); + + + +var oHandler = o('http://services.odata.org/V4/OData/OData.svc/Products'); +//do somehtting +oHandler.find(1); +// do some more................ +//get the data +oHandler.get(function(data) { + console.log(data); + //or the saved var also contains the data: + console.log(oHandler.data); +}); + + + +Q.all([ + o('http://services.odata.org/V4/OData/OData.svc/Products(4)').get(), + o('http://services.odata.org/V4/OData/OData.svc/Categories').take(2).get() +]).then(function(oHandlerArray) { + //The oHandler array contains the Product oHandler and the Group oHandler: + console.log(oHandlerArray[0].data); // 1 Product with id 4 + console.log(oHandlerArray[1].data.length); // 2 Categories +}); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products(2)') + .get() + .then(function(oHandler) { + console.log(oHandler.data); + }).fail(function(ex) { + console.log(ex); + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products') + .post({Name:'Example 1',Description:'a'}) + .post({Name:'Example 2',Description:'b'}) + .save(function(data) { + console.log("Two Products added"); + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products(1)') + .patch({Name:'NewName'}) + .save(function(data) { + console.log("Product Name changed"); + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products(1)') + .remove() + .save(function(data) { + console.log("Product deleted"); + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products(1)') + .ref('Categories', 2) + .save(function(data) { + console.log("Product(1) associated with Categories(2)"); + }); + + + +o('http://services.odata.org/V4/OData/OData.svc/Products') + .find(2) + .get() + .then(function(oHandler) { + oHandler.data.Name="NewName"; + return(o.save()); + }).then(function(oHandler) { + console.log(oHandler.data.Name); //NewName + }).fail(function(ex) { + console.log("error"); + }); + + + +// set an endpoint +o().config({ + endpoint:'http://services.odata.org/V4/OData/OData.svc' +}); +// after you have set an endpoint, you can shorten your queries: +o('Products').get(function(data) { + //same result like the first exmple on this page +}); + + + +//basic config +o().config({ + endpoint:null, // your odata endpoint for the service + json:true, // currently only json is supported + version:4, // oData version (currently supported version 4. However most also work with version 3.) + strictMode:true, // strict mode throws exception, non strict mode only logs them + start:null, // a function which is executed on loading + ready:null, // a function which is executed on ready + error:null, // a function which is executed on error + headers:[], // a array of additional headers e.g.: [{name:'headername',value:'headervalue'}] + username:null, // a basic auth username + password:null, // a basic auth password + isAsync:true //set this to false to make synced (a)jax calls. (dosn't work with basic auth!) +}); \ No newline at end of file diff --git a/o.js/o.js.d.ts b/o.js/o.js.d.ts new file mode 100644 index 0000000000..aebf0d3ead --- /dev/null +++ b/o.js/o.js.d.ts @@ -0,0 +1,70 @@ +// Type definitions for o.js +// Project: https://github.com/janhommes/o.js +// Definitions by: Matteo Antony Mistretta , Brad Zacher +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface Options { + endpoint : string + json ?: boolean + version ?: number + strictMode ?: boolean + start ?: () => any + ready ?: () => any + error ?: () => any + headers ?: string[] + username ?: string + password ?: string + isAsync ?: boolean +} + +interface OHandler { + inlinecount : number + data : T + + config(options ?: Options) : OHandler + + get(callback ?: (data : T) => void) : Q.Promise> + save(callback ?: (data : T) => void) : Q.Promise> + + route(path : string, callback ?: (data : T) => void) + + find(selector : string|number) : OHandler + + top(quantity : number) : OHandler + take(quantity : number) : OHandler + skip(quantity : number) : OHandler + first() : OHandler + + filter(filter : string) : OHandler + where(filter : string) : OHandler + any(filter : string, resource : string) : OHandler + search(columns : string[], term : string) : OHandler + + orderBy(column : string, direction ?: boolean) : OHandler + orderByDesc(column : string) : OHandler + + count() : OHandler + inlineCount(paramName ?: string) : OHandler + + batch(resource : string) : OHandler + expand(resource : string) : OHandler + ref(resource : string, id : string|number) : OHandler + + post(params : any) : OHandler + patch(params : any) : OHandler + put(params : any) : OHandler + + remove(params ?: any) : OHandler +} + +interface OFn extends OHandler { + (options ?: string | Options) : OHandler +} + +declare var o : OFn<{}>; + +declare module 'o.js' { + export = o +} \ No newline at end of file From e53fff78e250bbfd9d109163200ca85f5e98f979 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 4 May 2016 12:37:13 +0930 Subject: [PATCH 132/415] added some additional functionality found in src added version num --- o.js/o.js.d.ts | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/o.js/o.js.d.ts b/o.js/o.js.d.ts index aebf0d3ead..d92614a0c0 100644 --- a/o.js/o.js.d.ts +++ b/o.js/o.js.d.ts @@ -1,4 +1,4 @@ -// Type definitions for o.js +// Type definitions for o.js v0.2.2 // Project: https://github.com/janhommes/o.js // Definitions by: Matteo Antony Mistretta , Brad Zacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -24,11 +24,23 @@ interface OHandler { data : T config(options ?: Options) : OHandler + progress(callback : () => any) : OHandler get(callback ?: (data : T) => void) : Q.Promise> save(callback ?: (data : T) => void) : Q.Promise> + + post(params : any) : OHandler + patch(params : any) : OHandler + put(params : any) : OHandler + remove(params ?: any) : OHandler - route(path : string, callback ?: (data : T) => void) + routes(path : string, callback ?: (data : T) => void) : OHandler + route(path : string, callback ?: (data : T) => void) : OHandler + triggerRoute(hash : string) : OHandler + beforeRouting(callback : (routeParams : any) => boolean) : OHandler + + isEndpoint() : boolean + loading(startFn : () => any | boolean, endFn : () => any) : OHandler find(selector : string|number) : OHandler @@ -37,6 +49,10 @@ interface OHandler { skip(quantity : number) : OHandler first() : OHandler + include(column : string, data : string) : OHandler + exclude(column : string, data : string) : OHandler + filterByList(column : string, data : string) : OHandler + filter(filter : string) : OHandler where(filter : string) : OHandler any(filter : string, resource : string) : OHandler @@ -44,19 +60,16 @@ interface OHandler { orderBy(column : string, direction ?: boolean) : OHandler orderByDesc(column : string) : OHandler + select(selectStr : string) : OHandler count() : OHandler inlineCount(paramName ?: string) : OHandler batch(resource : string) : OHandler expand(resource : string) : OHandler - ref(resource : string, id : string|number) : OHandler - - post(params : any) : OHandler - patch(params : any) : OHandler - put(params : any) : OHandler - - remove(params ?: any) : OHandler + ref(resource : string, id : string | number) : OHandler + removeRef(resource : string, id : string | number) : OHandler + deleteRef(resource : string, id : string | number) : OHandler } interface OFn extends OHandler { From 5db72154fd1882bc3ac6c3ea24e50c49985fdcae Mon Sep 17 00:00:00 2001 From: delphinus Date: Thu, 5 May 2016 20:51:36 +0900 Subject: [PATCH 133/415] Add methods derived from underscore.js --- backbone/backbone-global.d.ts | 102 ++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 42 deletions(-) diff --git a/backbone/backbone-global.d.ts b/backbone/backbone-global.d.ts index b42b6208ad..d87e5d33f2 100644 --- a/backbone/backbone-global.d.ts +++ b/backbone/backbone-global.d.ts @@ -172,8 +172,12 @@ declare namespace Backbone { invert(): any; pick(keys: string[]): any; pick(...keys: string[]): any; + pick(fn: (value: any, key: any, object: any) => any): any; omit(keys: string[]): any; omit(...keys: string[]): any; + omit(fn: (value: any, key: any, object: any) => any): any; + chain(): any; + isEmpty(): boolean; } class Collection extends ModelBase { @@ -222,58 +226,72 @@ declare namespace Backbone { private _removeReference(model: TModel): void; private _onModelEvent(event: string, model: TModel, collection: Collection, options: any): void; + /** + * Return a shallow copy of this collection's models, using the same options as native Array#slice. + */ + slice(min: number, max?: number): TModel[]; + // mixins from underscore - all(iterator: (element: TModel, index: number) => boolean, context?: any): boolean; - any(iterator: (element: TModel, index: number) => boolean, context?: any): boolean; - collect(iterator: (element: TModel, index: number, context?: any) => any[], context?: any): any[]; + all(iterator?: _.ListIterator, context?: any): boolean; + any(iterator?: _.ListIterator, context?: any): boolean; chain(): any; - contains(value: any): boolean; - countBy(iterator: (element: TModel, index: number) => any): _.Dictionary; - countBy(attribute: string): _.Dictionary; - detect(iterator: (item: any) => boolean, context?: any): any; // ??? - drop(): TModel; - drop(n: number): TModel[]; - each(iterator: (element: TModel, index: number, list?: any) => void, context?: any): any; - every(iterator: (element: TModel, index: number) => boolean, context?: any): boolean; - filter(iterator: (element: TModel, index: number) => boolean, context?: any): TModel[]; - find(iterator: (element: TModel, index: number) => boolean, context?: any): TModel; + collect(iterator: _.ListIterator, context?: any): TResult[]; + contains(value: TModel): boolean; + countBy(iterator?: _.ListIterator): _.Dictionary; + countBy(iterator: string): _.Dictionary; + detect(iterator: _.ListIterator, context?: any): TModel; + difference(others: TModel[]): TModel[]; + drop(n?: number): TModel[]; + each(iterator: _.ListIterator, context?: any): TModel[]; + every(iterator: _.ListIterator, context?: any): boolean; + filter(iterator: _.ListIterator, context?: any): TModel[]; + find(iterator: _.ListIterator, context?: any): TModel; + findIndex(predicate: _.ListIterator, context?: any): number; + findLastIndex(predicate: _.ListIterator, context?: any): number; first(): TModel; first(n: number): TModel[]; - foldl(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any; - forEach(iterator: (element: TModel, index: number, list?: any) => void, context?: any): any; - groupBy(iterator: (element: TModel, index: number) => string, context?: any): _.Dictionary; - groupBy(attribute: string, context?: any): _.Dictionary; - include(value: any): boolean; - indexOf(element: TModel, isSorted?: boolean): number; + foldl(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + foldr(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + forEach(iterator: _.ListIterator, context?: any): TModel[]; + groupBy(iterator: _.ListIterator, context?: any): _.Dictionary; + groupBy(iterator: string, context?: any): _.Dictionary; + head(): TModel; + head(n: number): TModel[]; + include(value: TModel): boolean; + includes(value: TModel): boolean; + indexBy(iterator: _.ListIterator, context?: any): _.Dictionary; + indexBy(iterator: string, context?: any): _.Dictionary; + indexOf(value: TModel, isSorted?: boolean): number; initial(): TModel; initial(n: number): TModel[]; - inject(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any; - isEmpty(object: any): boolean; - invoke(methodName: string, args?: any[]): any; + inject(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + invoke(methodName: string, ...args: any[]): any; + isEmpty(): boolean; last(): TModel; last(n: number): TModel[]; - lastIndexOf(element: TModel, fromIndex?: number): number; - map(iterator: (element: TModel, index: number, context?: any) => any, context?: any): any[]; - max(iterator?: (element: TModel, index: number) => any, context?: any): TModel; - min(iterator?: (element: TModel, index: number) => any, context?: any): TModel; - reduce(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any; - select(iterator: any, context?: any): any[]; + lastIndexOf(value: TModel, from?: number): number; + map(iterator: _.ListIterator, context?: any): TResult[]; + max(iterator?: _.ListIterator, context?: any): TModel; + min(iterator?: _.ListIterator, context?: any): TModel; + partition(iterator: _.ListIterator): TModel[][]; + reduce(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + reduceRight(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + reject(iterator: _.ListIterator, context?: any): TModel[]; + rest(n?: number): TModel[]; + sample(): TModel; + sample(n: number): TModel[]; + select(iterator: _.ListIterator, context?: any): TModel[]; + shuffle(): TModel[]; size(): number; - shuffle(): any[]; - slice(min: number, max?: number): TModel[]; - some(iterator: (element: TModel, index: number) => boolean, context?: any): boolean; - sortBy(iterator: (element: TModel, index: number) => number, context?: any): TModel[]; - sortBy(attribute: string, context?: any): TModel[]; - sortedIndex(element: TModel, iterator?: (element: TModel, index: number) => number): number; - reduceRight(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any[]; - reject(iterator: (element: TModel, index: number) => boolean, context?: any): TModel[]; - rest(): TModel; - rest(n: number): TModel[]; - tail(): TModel; - tail(n: number): TModel[]; - toArray(): any[]; - without(...values: any[]): TModel[]; + some(iterator?: _.ListIterator, context?: any): boolean; + sortBy(iterator?: _.ListIterator, context?: any): TModel[]; + sortBy(iterator: string, context?: any): TModel[]; + tail(n?: number): TModel[]; + take(): TModel; + take(n: number): TModel[]; + toArray(): TModel[]; + without(...values: TModel[]): TModel[]; } class Router extends Events { From c36f13d2e1fffac4f389c9b4b9c2f38994698b57 Mon Sep 17 00:00:00 2001 From: delphinus Date: Thu, 5 May 2016 20:58:13 +0900 Subject: [PATCH 134/415] Add tests for methods derived from underscore.js --- backbone/backbone-tests.ts | 91 ++++++++++++++++++++++++++ backbone/backbone-with-lodash-tests.ts | 91 ++++++++++++++++++++++++++ 2 files changed, 182 insertions(+) diff --git a/backbone/backbone-tests.ts b/backbone/backbone-tests.ts index 3669a6c4e1..6d4a988ded 100644 --- a/backbone/backbone-tests.ts +++ b/backbone/backbone-tests.ts @@ -90,6 +90,25 @@ function test_models() { note.set({ title: "March 20", content: "In his eyes she eclipses..." }); note.set("title", "A Scandal in Bohemia"); + + let strings: string[] + let value: any; + let values: any[]; + let bool: boolean; + + // underscore methods + strings = note.keys(); + values = note.values(); + values = note.pairs(); + values = note.invert(); + value = note.pick("foo"); + value = note.pick("foo", "bar"); + value = note.pick((value: any, key: any, object: any) => true); + value = note.omit("foo"); + value = note.omit("foo", "bar"); + value = note.omit((value: any, key: any, object: any) => true); + value = note.chain().pick().omit().value(); + bool = note.isEmpty(); } class Employee extends Backbone.Model { @@ -161,6 +180,78 @@ function test_collection() { book.get("published") === true); var alphabetical = books.sortBy((book: Book): number => null); + + let one: Book; + let models: Book[]; + let bool: boolean; + let numDict: _.Dictionary; + let modelDict: _.Dictionary; + let modelsDict: _.Dictionary; + let num: number; + + models = books.slice(1); + models = books.slice(1, 3); + + // underscore methods + bool = books.all((value: Book, index: number, list: Book[]) => true); + bool = books.any((value: Book, index: number, list: Book[]) => true); + bool = books.chain().any((value: Book, index: number, list: Book[]) => true).value(); + models = books.collect((value: Book, index: number, list: Book[]) => value); + bool = books.contains(book1); + numDict = books.countBy((value: Book, index: number, list: Book[]) => true); + numDict = books.countBy("foo"); + one = books.detect((value: Book, index: number, list: Book[]) => true); + models = books.difference([book1]); + models = books.drop(); + models = books.each((value: Book, index: number, list: Book[]) => true); + bool = books.every((value: Book, index: number, list: Book[]) => true); + models = books.filter((value: Book, index: number, list: Book[]) => true); + one = books.find((value: Book, index: number, list: Book[]) => true); + num = books.findIndex((value: Book, index: number, list: Book[]) => true); + num = books.findLastIndex((value: Book, index: number, list: Book[]) => true); + one = books.first(); + models = books.first(3); + models = books.foldl((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.foldr((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.forEach((value: Book, index: number, list: Book[]) => true); + modelsDict = books.groupBy((value: Book, index: number, list: Book[]) => true); + modelsDict = books.groupBy("foo"); + one = books.head(); + models = books.head(3); + bool = books.include(book1); + bool = books.includes(book1); + modelDict = books.indexBy((value: Book, index: number, list: Book[]) => true); + modelDict = books.indexBy("foo"); + num = books.indexOf(book1, true); + one = books.initial(); + models = books.initial(3); + models = books.inject((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + one = books.invoke("at", 3); + bool = books.isEmpty(); + one = books.last(); + models = books.last(3); + num = books.lastIndexOf(book1, 3); + models = books.map((value: Book, index: number, list: Book[]) => value); + one = books.max((value: Book, index: number, list: Book[]) => value); + one = books.min((value: Book, index: number, list: Book[]) => value); + [models] = books.partition((value: Book, index: number, list: Book[]) => true); + models = books.reduce((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.reduceRight((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.reject((value: Book, index: number, list: Book[]) => true); + models = books.rest(3); + one = books.sample(); + models = books.sample(3); + models = books.select((value: Book, index: number, list: Book[]) => true); + models = books.shuffle(); + num = books.size(); + bool = books.some((value: Book, index: number, list: Book[]) => true); + models = books.sortBy((value: Book, index: number, list: Book[]) => value); + models = books.sortBy("foo"); + models = books.tail(3); + one = books.take(); + models = books.take(3); + models = books.toArray(); + models = books.without(book1, book1); } ////////// diff --git a/backbone/backbone-with-lodash-tests.ts b/backbone/backbone-with-lodash-tests.ts index e0b04880bf..0ac4efe375 100644 --- a/backbone/backbone-with-lodash-tests.ts +++ b/backbone/backbone-with-lodash-tests.ts @@ -91,6 +91,25 @@ function test_models() { note.set({ title: "March 20", content: "In his eyes she eclipses..." }); note.set("title", "A Scandal in Bohemia"); + + let strings: string[] + let value: any; + let values: any[]; + let bool: boolean; + + // underscore methods + strings = note.keys(); + values = note.values(); + values = note.pairs(); + values = note.invert(); + value = note.pick("foo"); + value = note.pick("foo", "bar"); + value = note.pick((value: any, key: any, object: any) => true); + value = note.omit("foo"); + value = note.omit("foo", "bar"); + value = note.omit((value: any, key: any, object: any) => true); + value = note.chain().pick().omit().value(); + bool = note.isEmpty(); } class Employee extends Backbone.Model { @@ -152,6 +171,78 @@ function test_collection() { book.get("published") === true); var alphabetical = books.sortBy((book: Book): number => null); + + let one: Book; + let models: Book[]; + let bool: boolean; + let numDict: _.Dictionary; + let modelDict: _.Dictionary; + let modelsDict: _.Dictionary; + let num: number; + + models = books.slice(1); + models = books.slice(1, 3); + + // underscore methods + bool = books.all((value: Book, index: number, list: Book[]) => true); + bool = books.any((value: Book, index: number, list: Book[]) => true); + bool = books.chain().any((value: Book, index: number, list: Book[]) => true).value(); + models = books.collect((value: Book, index: number, list: Book[]) => value); + bool = books.contains(book1); + numDict = books.countBy((value: Book, index: number, list: Book[]) => true); + numDict = books.countBy("foo"); + one = books.detect((value: Book, index: number, list: Book[]) => true); + models = books.difference([book1]); + models = books.drop(); + models = books.each((value: Book, index: number, list: Book[]) => true); + bool = books.every((value: Book, index: number, list: Book[]) => true); + models = books.filter((value: Book, index: number, list: Book[]) => true); + one = books.find((value: Book, index: number, list: Book[]) => true); + num = books.findIndex((value: Book, index: number, list: Book[]) => true); + num = books.findLastIndex((value: Book, index: number, list: Book[]) => true); + one = books.first(); + models = books.first(3); + models = books.foldl((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.foldr((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.forEach((value: Book, index: number, list: Book[]) => true); + modelsDict = books.groupBy((value: Book, index: number, list: Book[]) => true); + modelsDict = books.groupBy("foo"); + one = books.head(); + models = books.head(3); + bool = books.include(book1); + bool = books.includes(book1); + modelDict = books.indexBy((value: Book, index: number, list: Book[]) => true); + modelDict = books.indexBy("foo"); + num = books.indexOf(book1, true); + one = books.initial(); + models = books.initial(3); + models = books.inject((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + one = books.invoke("at", 3); + bool = books.isEmpty(); + one = books.last(); + models = books.last(3); + num = books.lastIndexOf(book1, 3); + models = books.map((value: Book, index: number, list: Book[]) => value); + one = books.max((value: Book, index: number, list: Book[]) => value); + one = books.min((value: Book, index: number, list: Book[]) => value); + [models] = books.partition((value: Book, index: number, list: Book[]) => true); + models = books.reduce((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.reduceRight((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); + models = books.reject((value: Book, index: number, list: Book[]) => true); + models = books.rest(3); + one = books.sample(); + models = books.sample(3); + models = books.select((value: Book, index: number, list: Book[]) => true); + models = books.shuffle(); + num = books.size(); + bool = books.some((value: Book, index: number, list: Book[]) => true); + models = books.sortBy((value: Book, index: number, list: Book[]) => value); + models = books.sortBy("foo"); + models = books.tail(3); + one = books.take(); + models = books.take(3); + models = books.toArray(); + models = books.without(book1, book1); } ////////// From 0c76f1f3c57f76a60f7865763e122dfe46f6e7b3 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 6 May 2016 09:09:11 +0930 Subject: [PATCH 135/415] updated to be an encapsulated ghost module --- o.js/o.js-tests.ts | 2 +- o.js/o.js.d.ts | 146 ++++++++++++++++++++++----------------------- 2 files changed, 74 insertions(+), 74 deletions(-) diff --git a/o.js/o.js-tests.ts b/o.js/o.js-tests.ts index 9ef2f05606..b9ffc1b065 100644 --- a/o.js/o.js-tests.ts +++ b/o.js/o.js-tests.ts @@ -1,6 +1,6 @@ /// -import o = require('o.js'); +import * as o from 'o.js'; interface Product { ID : number; diff --git a/o.js/o.js.d.ts b/o.js/o.js.d.ts index d92614a0c0..d0d53dce88 100644 --- a/o.js/o.js.d.ts +++ b/o.js/o.js.d.ts @@ -5,79 +5,79 @@ /// -interface Options { - endpoint : string - json ?: boolean - version ?: number - strictMode ?: boolean - start ?: () => any - ready ?: () => any - error ?: () => any - headers ?: string[] - username ?: string - password ?: string - isAsync ?: boolean -} - -interface OHandler { - inlinecount : number - data : T - - config(options ?: Options) : OHandler - progress(callback : () => any) : OHandler - - get(callback ?: (data : T) => void) : Q.Promise> - save(callback ?: (data : T) => void) : Q.Promise> - - post(params : any) : OHandler - patch(params : any) : OHandler - put(params : any) : OHandler - remove(params ?: any) : OHandler - - routes(path : string, callback ?: (data : T) => void) : OHandler - route(path : string, callback ?: (data : T) => void) : OHandler - triggerRoute(hash : string) : OHandler - beforeRouting(callback : (routeParams : any) => boolean) : OHandler - - isEndpoint() : boolean - loading(startFn : () => any | boolean, endFn : () => any) : OHandler - - find(selector : string|number) : OHandler - - top(quantity : number) : OHandler - take(quantity : number) : OHandler - skip(quantity : number) : OHandler - first() : OHandler - - include(column : string, data : string) : OHandler - exclude(column : string, data : string) : OHandler - filterByList(column : string, data : string) : OHandler - - filter(filter : string) : OHandler - where(filter : string) : OHandler - any(filter : string, resource : string) : OHandler - search(columns : string[], term : string) : OHandler - - orderBy(column : string, direction ?: boolean) : OHandler - orderByDesc(column : string) : OHandler - select(selectStr : string) : OHandler - - count() : OHandler - inlineCount(paramName ?: string) : OHandler - - batch(resource : string) : OHandler - expand(resource : string) : OHandler - ref(resource : string, id : string | number) : OHandler - removeRef(resource : string, id : string | number) : OHandler - deleteRef(resource : string, id : string | number) : OHandler -} - -interface OFn extends OHandler { - (options ?: string | Options) : OHandler -} - -declare var o : OFn<{}>; - declare module 'o.js' { + interface Options { + endpoint : string + json ?: boolean + version ?: number + strictMode ?: boolean + start ?: () => any + ready ?: () => any + error ?: () => any + headers ?: string[] + username ?: string + password ?: string + isAsync ?: boolean + } + + interface OHandler { + inlinecount : number + data : T + + config(options ?: Options) : OHandler + progress(callback : () => any) : OHandler + + get(callback ?: (data : T) => void) : Q.Promise> + save(callback ?: (data : T) => void) : Q.Promise> + + post(params : any) : OHandler + patch(params : any) : OHandler + put(params : any) : OHandler + remove(params ?: any) : OHandler + + routes(path : string, callback ?: (data : T) => void) : OHandler + route(path : string, callback ?: (data : T) => void) : OHandler + triggerRoute(hash : string) : OHandler + beforeRouting(callback : (routeParams : any) => boolean) : OHandler + + isEndpoint() : boolean + loading(startFn : () => any | boolean, endFn : () => any) : OHandler + + find(selector : string|number) : OHandler + + top(quantity : number) : OHandler + take(quantity : number) : OHandler + skip(quantity : number) : OHandler + first() : OHandler + + include(column : string, data : string) : OHandler + exclude(column : string, data : string) : OHandler + filterByList(column : string, data : string) : OHandler + + filter(filter : string) : OHandler + where(filter : string) : OHandler + any(filter : string, resource : string) : OHandler + search(columns : string[], term : string) : OHandler + + orderBy(column : string, direction ?: boolean) : OHandler + orderByDesc(column : string) : OHandler + select(selectStr : string) : OHandler + + count() : OHandler + inlineCount(paramName ?: string) : OHandler + + batch(resource : string) : OHandler + expand(resource : string) : OHandler + ref(resource : string, id : string | number) : OHandler + removeRef(resource : string, id : string | number) : OHandler + deleteRef(resource : string, id : string | number) : OHandler + } + + interface OFn extends OHandler { + (options ?: string | Options) : OHandler + } + + var o : OFn<{}>; + export = o } \ No newline at end of file From f4845ed7befb04cf94542c3e9fe37a5cb73335dd Mon Sep 17 00:00:00 2001 From: blbigelow Date: Fri, 6 May 2016 10:12:02 -0600 Subject: [PATCH 136/415] adding skipHide as option to IDialogOptions --- angular-material/angular-material.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 12fe28a9b8..5120f76370 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -84,6 +84,7 @@ declare namespace angular.material { onComplete?: Function; onRemoving?: Function; fullscreen?: boolean; + skipHide?: boolean; } interface IDialogService { From 4183b9b75f70a884639e3e55132cf9cc12be1fc2 Mon Sep 17 00:00:00 2001 From: Boris Breuer Date: Fri, 6 May 2016 20:41:02 +0200 Subject: [PATCH 137/415] Update node.d.ts --- node/node.d.ts | 140 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 184bd02a78..6364a27012 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1791,7 +1791,147 @@ declare module "tls" { var CLIENT_RENEG_LIMIT: number; var CLIENT_RENEG_WINDOW: number; + + export interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + export interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + } + + export interface TLSSocket extends stream.Duplex { + /** + * Returns the bound address, the address family name and port of the underlying socket as reported by + * the operating system. + * @returns {any} - An object with three properties, e.g. { port: 12346, family: 'IPv4', address: '127.0.0.1' }. + */ + address(): { port: number; family: string; address: string }; + /** + * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false. + */ + authorized: boolean; + /** + * The reason why the peer's certificate has not been verified. + * This property becomes available only when tlsSocket.authorized === false. + */ + authorizationError?: Error; + /** + * Static boolean value, always true. + * May be used to distinguish TLS sockets from regular ones. + */ + encrypted: boolean; + /** + * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection. + * @returns {CipherNameAndProtocol} - Returns an object representing the cipher name + * and the SSL/TLS protocol version of the current connection. + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the peer's certificate. + * The returned object has some properties corresponding to the field of the certificate. + * If detailed argument is true the full chain with issuer property will be returned, + * if false only the top certificate without issuer property. + * If the peer does not provide a certificate, it returns null or an empty object. + * @param {boolean} detailed - If true; the full chain with issuer property will be returned. + * @returns {any} - An object representing the peer's certificate. + */ + getPeerCertificate(detailed?: boolean): { + subject: Certificate; + issuerInfo: Certificate; + issuer: Certificate; + raw: any; + valid_from: string; + valid_to: string; + fingerprint: string; + serialNumber: string; + }; + /** + * Could be used to speed up handshake establishment when reconnecting to the server. + * @returns {any} - ASN.1 encoded TLS session or undefined if none was negotiated. + */ + getSession(): any; + /** + * NOTE: Works only with client TLS sockets. + * Useful only for debugging, for session reuse provide session option to tls.connect(). + * @returns {any} - TLS session ticket or undefined if none was negotiated. + */ + getTLSTicket(): any; + /** + * The string representation of the local IP address. + */ + localAddress: string; + /** + * The numeric representation of the local port. + */ + localPort: string; + /** + * The string representation of the remote IP address. + * For example, '74.125.127.100' or '2001:4860:a005::68'. + */ + remoteAddress: string; + /** + * The string representation of the remote IP family. 'IPv4' or 'IPv6'. + */ + remoteFamily: string; + /** + * The numeric representation of the remote port. For example, 443. + */ + remotePort: number; + /** + * Initiate TLS renegotiation process. + * + * NOTE: Can be used to request peer's certificate after the secure connection has been established. + * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout. + * @param {any} options - The options may contain the following fields: rejectUnauthorized, + * requestCert (See tls.createServer() for details). + * @param {} callback - callback(err) will be executed with null as err, once the renegotiation + * is successfully completed. + */ + renegotiate(options, callback: (err) => any): any; + /** + * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by + * the TLS layer until the entire fragment is received and its integrity is verified; + * large fragments can span multiple roundtrips, and their processing can be delayed due to packet + * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, + * which may decrease overall server throughput. + * @param {number} size - TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * @returns {boolean} - Returns true on success, false otherwise. + */ + setMaxSendFragment(size: number): boolean; + } + export interface TlsOptions { host?: string; port?: number; From 316b3342a74076e44570598fd62bee74a88f32aa Mon Sep 17 00:00:00 2001 From: Boris Breuer Date: Sat, 7 May 2016 00:09:18 +0200 Subject: [PATCH 138/415] Added missing type information for options and err --- node/node.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 6364a27012..235c8fb005 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1913,12 +1913,12 @@ declare module "tls" { * * NOTE: Can be used to request peer's certificate after the secure connection has been established. * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout. - * @param {any} options - The options may contain the following fields: rejectUnauthorized, + * @param {TlsOptions} options - The options may contain the following fields: rejectUnauthorized, * requestCert (See tls.createServer() for details). - * @param {} callback - callback(err) will be executed with null as err, once the renegotiation + * @param {Function} callback - callback(err) will be executed with null as err, once the renegotiation * is successfully completed. */ - renegotiate(options, callback: (err) => any): any; + renegotiate(options: TlsOptions, callback: (err: Error) => any): any; /** * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by From cc0afa72895a922f711008deb89efe931bfe79be Mon Sep 17 00:00:00 2001 From: Junle Li Date: Mon, 9 May 2016 21:36:11 +0800 Subject: [PATCH 139/415] The DragEvent should inherit from MouseEvent. Reference: https://developer.mozilla.org/en-US/docs/Web/API/DragEvent --- react/react.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/react.d.ts b/react/react.d.ts index efe8d8c2e8..c001173a8d 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -287,7 +287,7 @@ declare namespace __React { data: string; } - interface DragEvent extends SyntheticEvent { + interface DragEvent extends MouseEvent { dataTransfer: DataTransfer; } From 0209fed7ff3797ef1584a5acc8a03525449b2e84 Mon Sep 17 00:00:00 2001 From: Boris Breuer Date: Tue, 10 May 2016 22:59:58 +0200 Subject: [PATCH 140/415] TLSSocket is actually a class Thanks for point it out, @vvakame . --- node/node.d.ts | 226 +++++++++++++++++++++++++------------------------ 1 file changed, 114 insertions(+), 112 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 235c8fb005..40a12057db 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -17,10 +17,10 @@ interface Error { // compat for TypeScript 1.8 // if you use with --target es3 or --target es5 and use below definitions, // use the lib.es6.d.ts that is bundled with TypeScript 1.8. -interface MapConstructor {} -interface WeakMapConstructor {} -interface SetConstructor {} -interface WeakSetConstructor {} +interface MapConstructor { } +interface WeakMapConstructor { } +interface SetConstructor { } +interface WeakSetConstructor { } /************************************************ * * @@ -45,7 +45,7 @@ interface NodeRequireFunction { } interface NodeRequire extends NodeRequireFunction { - resolve(id:string): string; + resolve(id: string): string; cache: any; extensions: any; main: any; @@ -81,7 +81,7 @@ declare var SlowBuffer: { // Buffer class type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "binary" | "hex"; -interface Buffer extends NodeBuffer {} +interface Buffer extends NodeBuffer { } /** * Raw data is stored in instances of the Buffer class. @@ -145,7 +145,7 @@ declare var Buffer: { * @param byteOffset * @param length */ - from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?:number): Buffer; + from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; /** * Copies the passed {buffer} data onto a new Buffer instance. * @@ -228,7 +228,7 @@ declare namespace NodeJS { export interface ReadableStream extends EventEmitter { readable: boolean; - read(size?: number): string|Buffer; + read(size?: number): string | Buffer; setEncoding(encoding: string): void; pause(): void; resume(): void; @@ -241,7 +241,7 @@ declare namespace NodeJS { export interface WritableStream extends EventEmitter { writable: boolean; - write(buffer: Buffer|string, cb?: Function): boolean; + write(buffer: Buffer | string, cb?: Function): boolean; write(str: string, encoding?: string, cb?: Function): boolean; end(): void; end(buffer: Buffer, cb?: Function): void; @@ -249,7 +249,7 @@ declare namespace NodeJS { end(str: string, encoding?: string, cb?: Function): void; } - export interface ReadWriteStream extends ReadableStream, WritableStream {} + export interface ReadWriteStream extends ReadableStream, WritableStream { } export interface Events extends EventEmitter { } @@ -328,7 +328,7 @@ declare namespace NodeJS { visibility: string; }; }; - kill(pid:number, signal?: string|number): void; + kill(pid: number, signal?: string | number): void; pid: number; title: string; arch: string; @@ -337,7 +337,7 @@ declare namespace NodeJS { nextTick(callback: Function): void; umask(mask?: number): number; uptime(): number; - hrtime(time?:number[]): number[]; + hrtime(time?: number[]): number[]; domain: Domain; // Worker @@ -413,8 +413,8 @@ declare namespace NodeJS { } export interface Timer { - ref() : void; - unref() : void; + ref(): void; + unref(): void; } } @@ -539,7 +539,7 @@ declare module "http" { path?: string; headers?: { [key: string]: any }; auth?: string; - agent?: Agent|boolean; + agent?: Agent | boolean; } export interface Server extends events.EventEmitter, net.Server { @@ -679,7 +679,7 @@ declare module "http" { [errorCode: number]: string; [errorCode: string]: string; }; - export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; + export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server; export function createClient(port?: number, host?: string): any; export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; @@ -763,19 +763,19 @@ declare module "zlib" { export function createInflateRaw(options?: ZlibOptions): InflateRaw; export function createUnzip(options?: ZlibOptions): Unzip; - export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function deflate(buf: Buffer, callback: (error: Error, result: any) => void): void; export function deflateSync(buf: Buffer, options?: ZlibOptions): any; - export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) => void): void; export function deflateRawSync(buf: Buffer, options?: ZlibOptions): any; - export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function gzip(buf: Buffer, callback: (error: Error, result: any) => void): void; export function gzipSync(buf: Buffer, options?: ZlibOptions): any; - export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function gunzip(buf: Buffer, callback: (error: Error, result: any) => void): void; export function gunzipSync(buf: Buffer, options?: ZlibOptions): any; - export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function inflate(buf: Buffer, callback: (error: Error, result: any) => void): void; export function inflateSync(buf: Buffer, options?: ZlibOptions): any; - export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) => void): void; export function inflateRawSync(buf: Buffer, options?: ZlibOptions): any; - export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function unzip(buf: Buffer, callback: (error: Error, result: any) => void): void; export function unzipSync(buf: Buffer, options?: ZlibOptions): any; // Constants @@ -846,7 +846,7 @@ declare module "os" { export function totalmem(): number; export function freemem(): number; export function cpus(): CpuInfo[]; - export function networkInterfaces(): {[index: string]: NetworkInterfaceInfo[]}; + export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] }; export var EOL: string; } @@ -870,7 +870,7 @@ declare module "https" { SNICallback?: (servername: string) => any; } - export interface RequestOptions extends http.RequestOptions{ + export interface RequestOptions extends http.RequestOptions { pfx?: any; key?: any; passphrase?: string; @@ -891,8 +891,8 @@ declare module "https" { }; export interface Server extends tls.Server { } export function createServer(options: ServerOptions, requestListener?: Function): Server; - export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; - export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; + export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; export var globalAgent: Agent; } @@ -946,7 +946,7 @@ declare module "readline" { pause(): ReadLine; resume(): ReadLine; close(): void; - write(data: string|Buffer, key?: Key): void; + write(data: string | Buffer, key?: Key): void; } export interface Completer { @@ -971,7 +971,7 @@ declare module "readline" { export function createInterface(options: ReadLineOptions): ReadLine; export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void; - export function moveCursor(stream: NodeJS.WritableStream, dx: number|string, dy: number|string): void; + export function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void; export function clearLine(stream: NodeJS.WritableStream, dir: number): void; export function clearScreenDown(stream: NodeJS.WritableStream): void; } @@ -1013,7 +1013,7 @@ declare module "child_process" { import * as stream from "stream"; export interface ChildProcess extends events.EventEmitter { - stdin: stream.Writable; + stdin: stream.Writable; stdout: stream.Readable; stderr: stream.Readable; stdio: [stream.Writable, stream.Readable, stream.Readable]; @@ -1051,11 +1051,11 @@ declare module "child_process" { export interface ExecOptionsWithBufferEncoding extends ExecOptions { encoding: string; // specify `null`. } - export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; // usage. child_process.exec("tsc", {encoding: null as string}, (err, stdout, stderr) => {}); - export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; export interface ExecFileOptions { cwd?: string; @@ -1072,16 +1072,16 @@ declare module "child_process" { export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { encoding: string; // specify `null`. } - export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; // usage. child_process.execFile("file.sh", {encoding: null as string}, (err, stdout, stderr) => {}); - export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; // usage. child_process.execFile("file.sh", ["foo"], {encoding: null as string}, (err, stdout, stderr) => {}); - export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; export interface ForkOptions { cwd?: string; @@ -1197,24 +1197,24 @@ declare module "url" { path?: string; } - export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url; + export function parse(urlStr: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): Url; export function format(url: Url): string; export function resolve(from: string, to: string): string; } declare module "dns" { - export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string; - export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string; - export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[]; + export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) => void): string; + export function lookup(domain: string, callback: (err: Error, address: string, family: number) => void): string; + export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) => void): string[]; + export function resolve(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; + export function resolve4(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; + export function resolve6(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; + export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; + export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; + export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; + export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; + export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; + export function reverse(ip: string, callback: (err: Error, domains: string[]) => void): string[]; } declare module "net" { @@ -1289,12 +1289,12 @@ declare module "net" { maxConnections: number; connections: number; } - export function createServer(connectionListener?: (socket: Socket) =>void ): Server; - export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server; - export function connect(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function createServer(connectionListener?: (socket: Socket) => void): Server; + export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) => void): Server; + export function connect(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; export function connect(port: number, host?: string, connectionListener?: Function): Socket; export function connect(path: string, connectionListener?: Function): Socket; - export function createConnection(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function createConnection(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; export function createConnection(path: string, connectionListener?: Function): Socket; export function isIP(input: string): number; @@ -1422,7 +1422,7 @@ declare module "fs" { export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; export function readlinkSync(path: string): string; export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; - export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; + export function realpath(path: string, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; export function realpathSync(path: string, cache?: { [path: string]: string }): string; /* * Asynchronous unlink - deletes the file specified in {path} @@ -1612,7 +1612,7 @@ declare module "fs" { export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void; export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */ - export function accessSync(path: string, mode ?: number): void; + export function accessSync(path: string, mode?: number): void; export function createReadStream(path: string, options?: { flags?: string; encoding?: string; @@ -1744,33 +1744,33 @@ declare module "path" { export function format(pathObject: ParsedPath): string; export module posix { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; } export module win32 { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; } } @@ -1791,7 +1791,7 @@ declare module "tls" { var CLIENT_RENEG_LIMIT: number; var CLIENT_RENEG_WINDOW: number; - + export interface Certificate { /** * Country code. @@ -1830,7 +1830,7 @@ declare module "tls" { version: string; } - export interface TLSSocket extends stream.Duplex { + export class TLSSocket extends stream.Duplex { /** * Returns the bound address, the address family name and port of the underlying socket as reported by * the operating system. @@ -1931,7 +1931,7 @@ declare module "tls" { */ setMaxSendFragment(size: number): boolean; } - + export interface TlsOptions { host?: string; port?: number; @@ -2012,10 +2012,10 @@ declare module "tls" { context: any; } - export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server; - export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; - export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; + export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) => void): Server; + export function connect(options: TlsOptions, secureConnectionListener?: () => void): ClearTextStream; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): ClearTextStream; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): ClearTextStream; export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; export function createSecureContext(details: SecureContextOptions): SecureContext; } @@ -2051,9 +2051,9 @@ declare module "crypto" { export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; export interface Cipher extends NodeJS.ReadWriteStream { update(data: Buffer): Buffer; - update(data: string, input_encoding: "utf8"|"ascii"|"binary"): Buffer; - update(data: Buffer, input_encoding: any, output_encoding: "binary"|"base64"|"hex"): string; - update(data: string, input_encoding: "utf8"|"ascii"|"binary", output_encoding: "binary"|"base64"|"hex"): string; + update(data: string, input_encoding: "utf8" | "ascii" | "binary"): Buffer; + update(data: Buffer, input_encoding: any, output_encoding: "binary" | "base64" | "hex"): string; + update(data: string, input_encoding: "utf8" | "ascii" | "binary", output_encoding: "binary" | "base64" | "hex"): string; final(): Buffer; final(output_encoding: string): string; setAutoPadding(auto_padding: boolean): void; @@ -2063,9 +2063,9 @@ declare module "crypto" { export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; export interface Decipher extends NodeJS.ReadWriteStream { update(data: Buffer): Buffer; - update(data: string, input_encoding: "binary"|"base64"|"hex"): Buffer; - update(data: Buffer, input_encoding: any, output_encoding: "utf8"|"ascii"|"binary"): string; - update(data: string, input_encoding: "binary"|"base64"|"hex", output_encoding: "utf8"|"ascii"|"binary"): string; + update(data: string, input_encoding: "binary" | "base64" | "hex"): Buffer; + update(data: Buffer, input_encoding: any, output_encoding: "utf8" | "ascii" | "binary"): string; + update(data: string, input_encoding: "binary" | "base64" | "hex", output_encoding: "utf8" | "ascii" | "binary"): string; final(): Buffer; final(output_encoding: string): string; setAutoPadding(auto_padding: boolean): void; @@ -2094,14 +2094,14 @@ declare module "crypto" { setPrivateKey(public_key: string, encoding?: string): void; } export function getDiffieHellman(group_name: string): DiffieHellman; - export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; - export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; - export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number) : Buffer; - export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string) : Buffer; + export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number): Buffer; + export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer; export function randomBytes(size: number): Buffer; - export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; + export function randomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void; export function pseudoRandomBytes(size: number): Buffer; - export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; + export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void; export interface RsaPublicKey { key: string; padding?: any; @@ -2111,8 +2111,8 @@ declare module "crypto" { passphrase?: string, padding?: any; } - export function publicEncrypt(public_key: string|RsaPublicKey, buffer: Buffer): Buffer - export function privateDecrypt(private_key: string|RsaPrivateKey, buffer: Buffer): Buffer + export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer + export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer } declare module "stream" { @@ -2176,7 +2176,7 @@ declare module "stream" { end(chunk: any, encoding?: string, cb?: Function): void; } - export interface TransformOptions extends ReadableOptions, WritableOptions {} + export interface TransformOptions extends ReadableOptions, WritableOptions { } // Note: Transform lacks the _read and _write methods of Readable/Writable. export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream { @@ -2201,7 +2201,7 @@ declare module "stream" { end(chunk: any, encoding?: string, cb?: Function): void; } - export class PassThrough extends Transform {} + export class PassThrough extends Transform { } } declare module "util" { @@ -2225,11 +2225,11 @@ declare module "util" { export function isDate(object: any): boolean; export function isError(object: any): boolean; export function inherits(constructor: any, superConstructor: any): void; - export function debuglog(key:string): (msg:string,...param: any[])=>void; + export function debuglog(key: string): (msg: string, ...param: any[]) => void; } declare module "assert" { - function internal (value: any, message?: string): void; + function internal(value: any, message?: string): void; namespace internal { export class AssertionError implements Error { name: string; @@ -2239,8 +2239,10 @@ declare module "assert" { operator: string; generatedMessage: boolean; - constructor(options?: {message?: string; actual?: any; expected?: any; - operator?: string; stackStartFunction?: Function}); + constructor(options?: { + message?: string; actual?: any; expected?: any; + operator?: string; stackStartFunction?: Function + }); } export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; From b69044ebdc5265024809a1f2da30c0089f418ac8 Mon Sep 17 00:00:00 2001 From: Boris Breuer Date: Tue, 10 May 2016 23:12:25 +0200 Subject: [PATCH 141/415] Reverted changes to formatting --- node/node.d.ts | 224 ++++++++++++++++++++++++------------------------- 1 file changed, 111 insertions(+), 113 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 40a12057db..bf8a3f9aea 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -17,10 +17,10 @@ interface Error { // compat for TypeScript 1.8 // if you use with --target es3 or --target es5 and use below definitions, // use the lib.es6.d.ts that is bundled with TypeScript 1.8. -interface MapConstructor { } -interface WeakMapConstructor { } -interface SetConstructor { } -interface WeakSetConstructor { } +interface MapConstructor {} +interface WeakMapConstructor {} +interface SetConstructor {} +interface WeakSetConstructor {} /************************************************ * * @@ -45,7 +45,7 @@ interface NodeRequireFunction { } interface NodeRequire extends NodeRequireFunction { - resolve(id: string): string; + resolve(id:string): string; cache: any; extensions: any; main: any; @@ -81,7 +81,7 @@ declare var SlowBuffer: { // Buffer class type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "binary" | "hex"; -interface Buffer extends NodeBuffer { } +interface Buffer extends NodeBuffer {} /** * Raw data is stored in instances of the Buffer class. @@ -145,7 +145,7 @@ declare var Buffer: { * @param byteOffset * @param length */ - from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?:number): Buffer; /** * Copies the passed {buffer} data onto a new Buffer instance. * @@ -228,7 +228,7 @@ declare namespace NodeJS { export interface ReadableStream extends EventEmitter { readable: boolean; - read(size?: number): string | Buffer; + read(size?: number): string|Buffer; setEncoding(encoding: string): void; pause(): void; resume(): void; @@ -241,7 +241,7 @@ declare namespace NodeJS { export interface WritableStream extends EventEmitter { writable: boolean; - write(buffer: Buffer | string, cb?: Function): boolean; + write(buffer: Buffer|string, cb?: Function): boolean; write(str: string, encoding?: string, cb?: Function): boolean; end(): void; end(buffer: Buffer, cb?: Function): void; @@ -249,7 +249,7 @@ declare namespace NodeJS { end(str: string, encoding?: string, cb?: Function): void; } - export interface ReadWriteStream extends ReadableStream, WritableStream { } + export interface ReadWriteStream extends ReadableStream, WritableStream {} export interface Events extends EventEmitter { } @@ -328,7 +328,7 @@ declare namespace NodeJS { visibility: string; }; }; - kill(pid: number, signal?: string | number): void; + kill(pid:number, signal?: string|number): void; pid: number; title: string; arch: string; @@ -337,7 +337,7 @@ declare namespace NodeJS { nextTick(callback: Function): void; umask(mask?: number): number; uptime(): number; - hrtime(time?: number[]): number[]; + hrtime(time?:number[]): number[]; domain: Domain; // Worker @@ -413,8 +413,8 @@ declare namespace NodeJS { } export interface Timer { - ref(): void; - unref(): void; + ref() : void; + unref() : void; } } @@ -539,7 +539,7 @@ declare module "http" { path?: string; headers?: { [key: string]: any }; auth?: string; - agent?: Agent | boolean; + agent?: Agent|boolean; } export interface Server extends events.EventEmitter, net.Server { @@ -679,7 +679,7 @@ declare module "http" { [errorCode: number]: string; [errorCode: string]: string; }; - export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server; + export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; export function createClient(port?: number, host?: string): any; export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; @@ -763,19 +763,19 @@ declare module "zlib" { export function createInflateRaw(options?: ZlibOptions): InflateRaw; export function createUnzip(options?: ZlibOptions): Unzip; - export function deflate(buf: Buffer, callback: (error: Error, result: any) => void): void; + export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; export function deflateSync(buf: Buffer, options?: ZlibOptions): any; - export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) => void): void; + export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; export function deflateRawSync(buf: Buffer, options?: ZlibOptions): any; - export function gzip(buf: Buffer, callback: (error: Error, result: any) => void): void; + export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; export function gzipSync(buf: Buffer, options?: ZlibOptions): any; - export function gunzip(buf: Buffer, callback: (error: Error, result: any) => void): void; + export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; export function gunzipSync(buf: Buffer, options?: ZlibOptions): any; - export function inflate(buf: Buffer, callback: (error: Error, result: any) => void): void; + export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; export function inflateSync(buf: Buffer, options?: ZlibOptions): any; - export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) => void): void; + export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; export function inflateRawSync(buf: Buffer, options?: ZlibOptions): any; - export function unzip(buf: Buffer, callback: (error: Error, result: any) => void): void; + export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; export function unzipSync(buf: Buffer, options?: ZlibOptions): any; // Constants @@ -846,7 +846,7 @@ declare module "os" { export function totalmem(): number; export function freemem(): number; export function cpus(): CpuInfo[]; - export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] }; + export function networkInterfaces(): {[index: string]: NetworkInterfaceInfo[]}; export var EOL: string; } @@ -870,7 +870,7 @@ declare module "https" { SNICallback?: (servername: string) => any; } - export interface RequestOptions extends http.RequestOptions { + export interface RequestOptions extends http.RequestOptions{ pfx?: any; key?: any; passphrase?: string; @@ -891,8 +891,8 @@ declare module "https" { }; export interface Server extends tls.Server { } export function createServer(options: ServerOptions, requestListener?: Function): Server; - export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; - export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; + export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; export var globalAgent: Agent; } @@ -946,7 +946,7 @@ declare module "readline" { pause(): ReadLine; resume(): ReadLine; close(): void; - write(data: string | Buffer, key?: Key): void; + write(data: string|Buffer, key?: Key): void; } export interface Completer { @@ -971,7 +971,7 @@ declare module "readline" { export function createInterface(options: ReadLineOptions): ReadLine; export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void; - export function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void; + export function moveCursor(stream: NodeJS.WritableStream, dx: number|string, dy: number|string): void; export function clearLine(stream: NodeJS.WritableStream, dir: number): void; export function clearScreenDown(stream: NodeJS.WritableStream): void; } @@ -1013,7 +1013,7 @@ declare module "child_process" { import * as stream from "stream"; export interface ChildProcess extends events.EventEmitter { - stdin: stream.Writable; + stdin: stream.Writable; stdout: stream.Readable; stderr: stream.Readable; stdio: [stream.Writable, stream.Readable, stream.Readable]; @@ -1051,11 +1051,11 @@ declare module "child_process" { export interface ExecOptionsWithBufferEncoding extends ExecOptions { encoding: string; // specify `null`. } - export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; - export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; // usage. child_process.exec("tsc", {encoding: null as string}, (err, stdout, stderr) => {}); - export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess; - export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; export interface ExecFileOptions { cwd?: string; @@ -1072,16 +1072,16 @@ declare module "child_process" { export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { encoding: string; // specify `null`. } - export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; - export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; // usage. child_process.execFile("file.sh", {encoding: null as string}, (err, stdout, stderr) => {}); - export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess; - export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; - export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; - export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; // usage. child_process.execFile("file.sh", ["foo"], {encoding: null as string}, (err, stdout, stderr) => {}); - export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess; - export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; export interface ForkOptions { cwd?: string; @@ -1197,24 +1197,24 @@ declare module "url" { path?: string; } - export function parse(urlStr: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): Url; + export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url; export function format(url: Url): string; export function resolve(from: string, to: string): string; } declare module "dns" { - export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) => void): string; - export function lookup(domain: string, callback: (err: Error, address: string, family: number) => void): string; - export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) => void): string[]; - export function resolve(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; - export function resolve4(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; - export function resolve6(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; - export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; - export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; - export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; - export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; - export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; - export function reverse(ip: string, callback: (err: Error, domains: string[]) => void): string[]; + export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string; + export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string; + export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[]; } declare module "net" { @@ -1289,12 +1289,12 @@ declare module "net" { maxConnections: number; connections: number; } - export function createServer(connectionListener?: (socket: Socket) => void): Server; - export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) => void): Server; - export function connect(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function createServer(connectionListener?: (socket: Socket) =>void ): Server; + export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server; + export function connect(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; export function connect(port: number, host?: string, connectionListener?: Function): Socket; export function connect(path: string, connectionListener?: Function): Socket; - export function createConnection(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function createConnection(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; export function createConnection(path: string, connectionListener?: Function): Socket; export function isIP(input: string): number; @@ -1422,7 +1422,7 @@ declare module "fs" { export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; export function readlinkSync(path: string): string; export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; - export function realpath(path: string, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; + export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; export function realpathSync(path: string, cache?: { [path: string]: string }): string; /* * Asynchronous unlink - deletes the file specified in {path} @@ -1612,7 +1612,7 @@ declare module "fs" { export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void; export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */ - export function accessSync(path: string, mode?: number): void; + export function accessSync(path: string, mode ?: number): void; export function createReadStream(path: string, options?: { flags?: string; encoding?: string; @@ -1744,33 +1744,33 @@ declare module "path" { export function format(pathObject: ParsedPath): string; export module posix { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; } export module win32 { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; } } @@ -1791,7 +1791,7 @@ declare module "tls" { var CLIENT_RENEG_LIMIT: number; var CLIENT_RENEG_WINDOW: number; - + export interface Certificate { /** * Country code. @@ -1931,7 +1931,7 @@ declare module "tls" { */ setMaxSendFragment(size: number): boolean; } - + export interface TlsOptions { host?: string; port?: number; @@ -2012,10 +2012,10 @@ declare module "tls" { context: any; } - export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) => void): Server; - export function connect(options: TlsOptions, secureConnectionListener?: () => void): ClearTextStream; - export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): ClearTextStream; - export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): ClearTextStream; + export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server; + export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; export function createSecureContext(details: SecureContextOptions): SecureContext; } @@ -2051,9 +2051,9 @@ declare module "crypto" { export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; export interface Cipher extends NodeJS.ReadWriteStream { update(data: Buffer): Buffer; - update(data: string, input_encoding: "utf8" | "ascii" | "binary"): Buffer; - update(data: Buffer, input_encoding: any, output_encoding: "binary" | "base64" | "hex"): string; - update(data: string, input_encoding: "utf8" | "ascii" | "binary", output_encoding: "binary" | "base64" | "hex"): string; + update(data: string, input_encoding: "utf8"|"ascii"|"binary"): Buffer; + update(data: Buffer, input_encoding: any, output_encoding: "binary"|"base64"|"hex"): string; + update(data: string, input_encoding: "utf8"|"ascii"|"binary", output_encoding: "binary"|"base64"|"hex"): string; final(): Buffer; final(output_encoding: string): string; setAutoPadding(auto_padding: boolean): void; @@ -2063,9 +2063,9 @@ declare module "crypto" { export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; export interface Decipher extends NodeJS.ReadWriteStream { update(data: Buffer): Buffer; - update(data: string, input_encoding: "binary" | "base64" | "hex"): Buffer; - update(data: Buffer, input_encoding: any, output_encoding: "utf8" | "ascii" | "binary"): string; - update(data: string, input_encoding: "binary" | "base64" | "hex", output_encoding: "utf8" | "ascii" | "binary"): string; + update(data: string, input_encoding: "binary"|"base64"|"hex"): Buffer; + update(data: Buffer, input_encoding: any, output_encoding: "utf8"|"ascii"|"binary"): string; + update(data: string, input_encoding: "binary"|"base64"|"hex", output_encoding: "utf8"|"ascii"|"binary"): string; final(): Buffer; final(output_encoding: string): string; setAutoPadding(auto_padding: boolean): void; @@ -2094,14 +2094,14 @@ declare module "crypto" { setPrivateKey(public_key: string, encoding?: string): void; } export function getDiffieHellman(group_name: string): DiffieHellman; - export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; - export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; - export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number): Buffer; - export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer; + export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number) : Buffer; + export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string) : Buffer; export function randomBytes(size: number): Buffer; - export function randomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void; + export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; export function pseudoRandomBytes(size: number): Buffer; - export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void; + export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; export interface RsaPublicKey { key: string; padding?: any; @@ -2111,8 +2111,8 @@ declare module "crypto" { passphrase?: string, padding?: any; } - export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer - export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer + export function publicEncrypt(public_key: string|RsaPublicKey, buffer: Buffer): Buffer + export function privateDecrypt(private_key: string|RsaPrivateKey, buffer: Buffer): Buffer } declare module "stream" { @@ -2176,7 +2176,7 @@ declare module "stream" { end(chunk: any, encoding?: string, cb?: Function): void; } - export interface TransformOptions extends ReadableOptions, WritableOptions { } + export interface TransformOptions extends ReadableOptions, WritableOptions {} // Note: Transform lacks the _read and _write methods of Readable/Writable. export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream { @@ -2201,7 +2201,7 @@ declare module "stream" { end(chunk: any, encoding?: string, cb?: Function): void; } - export class PassThrough extends Transform { } + export class PassThrough extends Transform {} } declare module "util" { @@ -2225,11 +2225,11 @@ declare module "util" { export function isDate(object: any): boolean; export function isError(object: any): boolean; export function inherits(constructor: any, superConstructor: any): void; - export function debuglog(key: string): (msg: string, ...param: any[]) => void; + export function debuglog(key:string): (msg:string,...param: any[])=>void; } declare module "assert" { - function internal(value: any, message?: string): void; + function internal (value: any, message?: string): void; namespace internal { export class AssertionError implements Error { name: string; @@ -2239,10 +2239,8 @@ declare module "assert" { operator: string; generatedMessage: boolean; - constructor(options?: { - message?: string; actual?: any; expected?: any; - operator?: string; stackStartFunction?: Function - }); + constructor(options?: {message?: string; actual?: any; expected?: any; + operator?: string; stackStartFunction?: Function}); } export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; From f65db9f99f57c617ccb92e98659299f3d14bda7f Mon Sep 17 00:00:00 2001 From: Boris Breuer Date: Tue, 10 May 2016 23:15:32 +0200 Subject: [PATCH 142/415] Made TLSSocket authorizationError non-optional --- node/node.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index bf8a3f9aea..5a56c68a73 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1845,7 +1845,7 @@ declare module "tls" { * The reason why the peer's certificate has not been verified. * This property becomes available only when tlsSocket.authorized === false. */ - authorizationError?: Error; + authorizationError: Error; /** * Static boolean value, always true. * May be used to distinguish TLS sockets from regular ones. From 5d0618b145a887d69b8282119aacae2748927a39 Mon Sep 17 00:00:00 2001 From: Manuel Schweigert Date: Thu, 12 May 2016 14:58:31 +0200 Subject: [PATCH 143/415] Add expressionRewriting members These members are needed to create custom two-way bindings. --- knockout/knockout.d.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 6e53ac2e25..14dbce04a5 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -523,8 +523,26 @@ interface KnockoutStatic { renderTemplateForEach(template: any, arrayOrObservableArray: KnockoutObservable, options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any; expressionRewriting: { - bindingRewriteValidators: any; - parseObjectLiteral: { (objectLiteralString: string): any[] } + bindingRewriteValidators: any[]; + twoWayBindings: any; + parseObjectLiteral: (objectLiteralString: string): any[]; + + /** + Internal, private KO utility for updating model properties from within bindings + property: If the property being updated is (or might be) an observable, pass it here + If it turns out to be a writable observable, it will be written to directly + allBindings: An object with a get method to retrieve bindings in the current execution context. + This will be searched for a '_ko_property_writers' property in case you're writing to a non-observable + (See note below) + key: The key identifying the property to be written. Example: for { hasFocus: myValue }, write to 'myValue' by specifying the key 'hasFocus' + value: The value to be written + checkIfDifferent: If true, and if the property being written is a writable observable, the value will only be written if + it is !== existing value on that writable observable + + Note that if you need to write to the viewModel without an observable property, + you need to set ko.expressionRewriting.twoWayBindings[key] = true; *before* the binding evaluation. + */ + writeValueToProperty: (property: KnockoutObservable | any, allBindings: KnockoutAllBindingsAccessor, key: string, value: any, checkIfDifferent?: boolean): void; }; ///////////////////////////////// From 1a3b6bdf54455b5dd828afb149e6fc758acd23b6 Mon Sep 17 00:00:00 2001 From: Manuel Schweigert Date: Thu, 12 May 2016 15:09:47 +0200 Subject: [PATCH 144/415] Fix build error --- knockout/knockout.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 14dbce04a5..6321cff0a5 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -525,7 +525,7 @@ interface KnockoutStatic { expressionRewriting: { bindingRewriteValidators: any[]; twoWayBindings: any; - parseObjectLiteral: (objectLiteralString: string): any[]; + parseObjectLiteral: (objectLiteralString: string) => any[]; /** Internal, private KO utility for updating model properties from within bindings @@ -542,7 +542,7 @@ interface KnockoutStatic { Note that if you need to write to the viewModel without an observable property, you need to set ko.expressionRewriting.twoWayBindings[key] = true; *before* the binding evaluation. */ - writeValueToProperty: (property: KnockoutObservable | any, allBindings: KnockoutAllBindingsAccessor, key: string, value: any, checkIfDifferent?: boolean): void; + writeValueToProperty: (property: KnockoutObservable | any, allBindings: KnockoutAllBindingsAccessor, key: string, value: any, checkIfDifferent?: boolean) => void; }; ///////////////////////////////// From 10677627809c5724457262661440110a801d92db Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Thu, 12 May 2016 16:48:54 +0200 Subject: [PATCH 145/415] Add promise based API to RTCPeerConnection --- webrtc/RTCPeerConnection-tests.ts | 51 +++++++++++-------------------- webrtc/RTCPeerConnection.d.ts | 40 +++++++++++++++++------- 2 files changed, 47 insertions(+), 44 deletions(-) diff --git a/webrtc/RTCPeerConnection-tests.ts b/webrtc/RTCPeerConnection-tests.ts index 1ed79bf2cc..ea850f8724 100644 --- a/webrtc/RTCPeerConnection-tests.ts +++ b/webrtc/RTCPeerConnection-tests.ts @@ -1,6 +1,8 @@ /// /// +let voidpromise: Promise; + var config: RTCConfiguration = { iceServers: [{ urls: "stun.l.google.com:19302" }] }; var constraints: RTCMediaConstraints = @@ -27,34 +29,27 @@ peerConnection.onicecandidate = ev => console.log(ev.type); peerConnection.onremovestream = ev => console.log(ev.type); peerConnection.onstatechange = ev => console.log(ev.type); -peerConnection.createOffer( - offer => { - peerConnection.setLocalDescription(offer, - () => console.log("set local description"), - error => console.log("Error setting local description: " + error)); - }, - error => console.log("Error creating offer: " + error)); +peerConnection.createOffer(); +let offer2: Promise = peerConnection.createOffer({ + voiceActivityDetection: true, + iceRestart: false +}); var type: string = RTCSdpType[RTCSdpType.offer]; var offer: RTCSessionDescriptionInit = { type: type, sdp: "some sdp" }; var sessionDescription = new RTCSessionDescription(offer); -peerConnection.setRemoteDescription(sessionDescription, () => { - peerConnection.createAnswer( - answer => { - peerConnection.setLocalDescription(answer, - () => console.log('Set local description'), - error => console.log( - "Error setting local description from created answer: " + error + - "; answer.sdp=" + answer.sdp)); - }, - error => console.log("Error creating answer: " + error)); -}, -error => console.log('Error setting remote description: ' + error + - "; offer.sdp=" + offer.sdp)); +peerConnection.setRemoteDescription(sessionDescription).then( + () => peerConnection.createAnswer(), + error => console.log('Error setting remote description: ' + error + "; offer.sdp=" + offer.sdp) +); var webkitSessionDescription = new webkitRTCSessionDescription(offer); +// New syntax +voidpromise = peerConnection.setLocalDescription(webkitSessionDescription); + +// Legacy syntax peerConnection.setRemoteDescription(webkitSessionDescription, () => { peerConnection.createAnswer( answer => { @@ -71,20 +66,10 @@ error => console.log('Error setting remote description: ' + error + var mozSessionDescription = new mozRTCSessionDescription(offer); -peerConnection.setRemoteDescription(mozSessionDescription, () => { - peerConnection.createAnswer( - answer => { - peerConnection.setLocalDescription(answer, - () => console.log('Set local description'), - error => console.log( - "Error setting local description from created answer: " + error + - "; answer.sdp=" + answer.sdp)); - }, - error => console.log("Error creating answer: " + error)); -}, -error => console.log('Error setting remote description: ' + error + - "; offer.sdp=" + offer.sdp)); +peerConnection.setRemoteDescription(mozSessionDescription); var wkPeerConnection: webkitRTCPeerConnection = new webkitRTCPeerConnection(config, constraints); +let candidate: RTCIceCandidate = {'candidate': 'foobar'}; +voidpromise = peerConnection.addIceCandidate(candidate); diff --git a/webrtc/RTCPeerConnection.d.ts b/webrtc/RTCPeerConnection.d.ts index b95b0b0a5c..dcd36d9aec 100644 --- a/webrtc/RTCPeerConnection.d.ts +++ b/webrtc/RTCPeerConnection.d.ts @@ -243,24 +243,40 @@ interface RTCStatsCallback { (report: RTCStatsReport): void; } +interface RTCOfferAnswerOptions { + voiceActivityDetection ?: boolean; // default = true +} + +interface RTCOfferOptions extends RTCOfferAnswerOptions { + iceRestart ?: boolean; // default = false +} + +interface RTCAnswerOptions extends RTCOfferAnswerOptions { } + interface RTCPeerConnection { + + createOffer(options?: RTCOfferOptions): Promise; createOffer(successCallback: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, - constraints?: RTCMediaConstraints): void; + constraints?: RTCMediaConstraints): void; // Deprecated + createAnswer(options?: RTCAnswerOptions): Promise; createAnswer(successCallback: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, - constraints?: RTCMediaConstraints): void; + constraints?: RTCMediaConstraints): void; // Deprecated + setLocalDescription(description: RTCSessionDescription | RTCSessionDescriptionInit): Promise; setLocalDescription(description: RTCSessionDescription, successCallback?: RTCVoidCallback, - failureCallback?: RTCPeerConnectionErrorCallback): void; - localDescription: RTCSessionDescription; + failureCallback?: RTCPeerConnectionErrorCallback): void; // Deprecated + setRemoteDescription(description: RTCSessionDescription | RTCSessionDescriptionInit): Promise; setRemoteDescription(description: RTCSessionDescription, successCallback?: RTCVoidCallback, failureCallback?: RTCPeerConnectionErrorCallback): void; + localDescription: RTCSessionDescription; remoteDescription: RTCSessionDescription; signalingState: string; // RTCSignalingState; see TODO(1) updateIce(configuration?: RTCConfiguration, constraints?: RTCMediaConstraints): void; + addIceCandidate(candidate: RTCIceCandidate): Promise; addIceCandidate(candidate:RTCIceCandidate, successCallback:() => void, failureCallback:RTCPeerConnectionErrorCallback): void; @@ -284,8 +300,10 @@ interface RTCPeerConnection { onicecandidate: (event: RTCIceCandidateEvent) => void; onidentityresult: (event: Event) => void; onsignalingstatechange: (event: Event) => void; - getStats: (successCallback: RTCStatsCallback, - failureCallback: RTCPeerConnectionErrorCallback) => void; + getStats(selector: MediaStreamTrack): Promise; + getStats(selector: MediaStreamTrack, // nullable + successCallback: RTCStatsCallback, + failureCallback: RTCPeerConnectionErrorCallback): void; } declare var RTCPeerConnection: { prototype: RTCPeerConnection; @@ -294,7 +312,7 @@ declare var RTCPeerConnection: { }; interface RTCIceCandidate { - candidate?: string; + candidate: string; sdpMid?: string; sdpMLineIndex?: number; } @@ -304,7 +322,7 @@ declare var RTCIceCandidate: { }; interface webkitRTCIceCandidate extends RTCIceCandidate { - candidate?: string; + candidate: string; sdpMid?: string; sdpMLineIndex?: number; } @@ -314,7 +332,7 @@ declare var webkitRTCIceCandidate: { }; interface mozRTCIceCandidate extends RTCIceCandidate { - candidate?: string; + candidate: string; sdpMid?: string; sdpMLineIndex?: number; } @@ -325,8 +343,8 @@ declare var mozRTCIceCandidate: { interface RTCIceCandidateInit { candidate: string; - sdpMid: string; - sdpMLineIndex: number; + sdpMid?: string; + sdpMLineIndex?: number; } declare var RTCIceCandidateInit:{ prototype: RTCIceCandidateInit; From 4e4e65dd4c672b346e64e950bd5c6109e85fd165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luiz=20dos=20Santos?= Date: Fri, 13 May 2016 09:50:29 -0300 Subject: [PATCH 146/415] Rename rx.node.d.ts to rx-node.d.ts --- rx-node/{rx.node.d.ts => rx-node.d.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename rx-node/{rx.node.d.ts => rx-node.d.ts} (100%) diff --git a/rx-node/rx.node.d.ts b/rx-node/rx-node.d.ts similarity index 100% rename from rx-node/rx.node.d.ts rename to rx-node/rx-node.d.ts From fb436e4df4f98e1a1244733c8bdfd82a482035ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luiz=20dos=20Santos?= Date: Fri, 13 May 2016 10:05:18 -0300 Subject: [PATCH 147/415] Rename rx.node-tests.ts to rx-node-tests.ts --- rx-node/{rx.node-tests.ts => rx-node-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename rx-node/{rx.node-tests.ts => rx-node-tests.ts} (100%) diff --git a/rx-node/rx.node-tests.ts b/rx-node/rx-node-tests.ts similarity index 100% rename from rx-node/rx.node-tests.ts rename to rx-node/rx-node-tests.ts From 2c5c3520d341526c54ca64ca3245d2569dce1d6e Mon Sep 17 00:00:00 2001 From: Ivaylo Bratoev Date: Tue, 17 May 2016 15:06:55 +0300 Subject: [PATCH 148/415] Update fs-extra typings 'fs-extra' extends 'fs' as it is by definition. Clean up definition and tests related to the extended node 'fs' module. --- fs-extra/fs-extra-tests.ts | 179 ------------------------------------- fs-extra/fs-extra.d.ts | 138 ++-------------------------- 2 files changed, 7 insertions(+), 310 deletions(-) diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index c1785f851d..a31df8cfd7 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -2,50 +2,16 @@ /// import fs = require('fs-extra'); -import stream = require('stream'); -var stats: fs.Stats; -var str: string; -var strArr: string[]; -var bool: boolean; -var num: number; var src: string; var dest: string; var file: string; -var filename: string; var dir: string; var path: string; var data: any; var object: Object; -var buffer: NodeBuffer; -var modeNum: number; -var modeStr: string; -var encoding: string; -var type: string; -var flags: string; -var srcpath: string; -var dstpath: string; -var oldPath: string; -var newPath: string; -var cache: string; -var offset: number; -var length: number; -var position: number; -var cacheBool: boolean; -var cacheStr: string; -var fd: number; -var len: number; -var uid: number; -var gid: number; -var atime: number; -var mtime: number; -var statsCallback: (err: Error, stats: fs.Stats) => void; var errorCallback: (err: Error) => void; var openOpts: fs.OpenOptions; -var watcher: fs.FSWatcher; -var readStreeam: stream.Readable; -var writeStream: stream.Writable; -var outputStream: stream.Writable; fs.copy(src, dest, errorCallback); fs.copy(src, dest, (src: string) => { @@ -125,130 +91,6 @@ fs.writeJSON(file, object, openOpts, errorCallback); fs.writeJsonSync(file, object, openOpts); fs.writeJSONSync(file, object, openOpts); -fs.rename(oldPath, newPath, errorCallback); -fs.renameSync(oldPath, newPath); -fs.truncate(fd, len, errorCallback); -fs.truncateSync(fd, len); -fs.chown(path, uid, gid, errorCallback); -fs.chownSync(path, uid, gid); -fs.fchown(fd, uid, gid, errorCallback); -fs.fchownSync(fd, uid, gid); -fs.lchown(path, uid, gid, errorCallback); -fs.lchownSync(path, uid, gid); -fs.chmod(path, modeNum, errorCallback); -fs.chmod(path, modeStr, errorCallback); -fs.chmodSync(path, modeNum); -fs.chmodSync(path, modeStr); -fs.fchmod(fd, modeNum, errorCallback); -fs.fchmod(fd, modeStr, errorCallback); -fs.fchmodSync(fd, modeNum); -fs.fchmodSync(fd, modeStr); -fs.lchmod(path, modeStr, errorCallback); -fs.lchmod(path, modeNum, errorCallback); -fs.lchmodSync(path, modeNum); -fs.lchmodSync(path, modeStr); -fs.stat(path, statsCallback); -fs.lstat(path, statsCallback); -fs.fstat(fd, statsCallback); -stats = fs.statSync(path); -stats = fs.lstatSync(path); -stats = fs.fstatSync(fd); -fs.link(srcpath, dstpath, errorCallback); -fs.linkSync(srcpath, dstpath); -fs.symlink(srcpath, dstpath, type, errorCallback); -fs.symlinkSync(srcpath, dstpath, type); -fs.readlink(path, (err: Error, linkString: string) => { - -}); -fs.realpath(path, (err: Error, resolvedPath: string) => { - -}); -fs.realpath(path, cache, (err: Error, resolvedPath: string) => { - -}); -str = fs.realpathSync(path, cacheBool); -fs.unlink(path, errorCallback); -fs.unlinkSync(path); -fs.rmdir(path, errorCallback); -fs.rmdirSync(path); -fs.mkdir(path, modeNum, errorCallback); -fs.mkdir(path, modeStr, errorCallback); -fs.mkdirSync(path, modeNum); -fs.mkdirSync(path, modeStr); -fs.readdir(path, (err: Error, files: string[]) => { - -}); -strArr = fs.readdirSync(path); -fs.close(fd, errorCallback); -fs.closeSync(fd); -fs.open(path, flags, modeStr, (err: Error, fd: number) => { - -}); -num = fs.openSync(path, flags, modeStr); -fs.utimes(path, atime, mtime, errorCallback); -fs.utimesSync(path, atime, mtime); -fs.futimes(fd, atime, mtime, errorCallback); -fs.futimesSync(fd, atime, mtime); -fs.fsync(fd, errorCallback); -fs.fsyncSync(fd); -fs.write(fd, buffer, offset, length, position, (err: Error, written: number, buffer: NodeBuffer) => { - -}); -num = fs.writeSync(fd, buffer, offset, length, position); -fs.read(fd, buffer, offset, length, position, (err: Error, bytesRead: number, buffer: NodeBuffer) => { - -}); -num = fs.readSync(fd, buffer, offset, length, position); -fs.readFile(filename, (err: Error, data: NodeBuffer) => { - -}); -fs.readFile(filename, encoding, (err: Error, data: string) => { - -}); -fs.readFile(filename, openOpts, (err: Error, data: string) => { - -}); -fs.readFile(filename, (err: Error, data: NodeBuffer) => { - -}); -buffer = fs.readFileSync(filename); -str = fs.readFileSync(filename, encoding); -str = fs.readFileSync(filename, openOpts); - -fs.writeFile(filename, data, errorCallback); -fs.writeFile(filename, data, encoding, errorCallback); -fs.writeFile(filename, data, openOpts, errorCallback); -fs.writeFileSync(filename, data); -fs.writeFileSync(filename, data, encoding); -fs.writeFileSync(filename, data, openOpts); - -fs.appendFile(filename, data, errorCallback); -fs.appendFile(filename, data, encoding, errorCallback); -fs.appendFile(filename, data, openOpts, errorCallback); -fs.appendFileSync(filename, data); -fs.appendFileSync(filename, data, encoding); -fs.appendFileSync(filename, data, openOpts); - -fs.watchFile(filename, { - curr: stats, - prev: stats -}); -fs.watchFile(filename, { - persistent: bool, - interval: num -}, { - curr: stats, - prev: stats -}); -fs.unwatchFile(filename); -watcher = fs.watch(filename, { persistent: bool }, (event: string, filename: string) => { - -}); -fs.exists(path, (exists: boolean) => { - -}); -bool = fs.existsSync(path); - fs.ensureDir(path, errorCallback); fs.ensureDirSync(path); fs.ensureFile(path, errorCallback); @@ -259,24 +101,3 @@ fs.ensureSymlink(path, errorCallback); fs.ensureSymlinkSync(path); fs.emptyDir(path, errorCallback); fs.emptyDirSync(path); - -readStreeam = fs.createReadStream(path); -readStreeam = fs.createReadStream(path, { - flags: str, - encoding: str, - fd: num, - mode: num, - bufferSize: num -}); -writeStream = fs.createWriteStream(path); -writeStream = fs.createWriteStream(path, { - flags: str, - encoding: str, - string: str -}); -outputStream = fs.createOutputStream(path); -outputStream = fs.createOutputStream(path, { - flags: str, - encoding: str, - string: str -}); diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts index b133047dec..39656ce685 100644 --- a/fs-extra/fs-extra.d.ts +++ b/fs-extra/fs-extra.d.ts @@ -8,39 +8,8 @@ /// declare module "fs-extra" { - import stream = require("stream"); + export * from "fs"; - export interface Stats { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: number; - ino: number; - mode: number; - nlink: number; - uid: number; - gid: number; - rdev: number; - size: number; - blksize: number; - blocks: number; - atime: Date; - mtime: Date; - ctime: Date; - } - - export interface FSWatcher { - close(): void; - } - - export class ReadStream extends stream.Readable { } - export class WriteStream extends stream.Writable { } - - //extended methods export function copy(src: string, dest: string, callback?: (err: Error) => void): void; export function copy(src: string, dest: string, filter: CopyFilter, callback?: (err: Error) => void): void; export function copy(src: string, dest: string, options: CopyOptions, callback?: (err: Error) => void): void; @@ -77,8 +46,6 @@ declare module "fs-extra" { export function remove(dir: string, callback?: (err: Error) => void): void; export function removeSync(dir: string): void; - // export function delete(dir: string, callback?: (err: Error) => void): void; - // export function deleteSync(dir: string): void; export function writeJson(file: string, object: any, callback?: (err: Error) => void): void; export function writeJson(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void; @@ -88,98 +55,22 @@ declare module "fs-extra" { export function writeJsonSync(file: string, object: any, options?: OpenOptions): void; export function writeJSONSync(file: string, object: any, options?: OpenOptions): void; - export function rename(oldPath: string, newPath: string, callback?: (err: Error) => void): void; - export function renameSync(oldPath: string, newPath: string): void; - export function truncate(fd: number, len: number, callback?: (err: Error) => void): void; - export function truncateSync(fd: number, len: number): void; - export function chown(path: string, uid: number, gid: number, callback?: (err: Error) => void): void; - export function chownSync(path: string, uid: number, gid: number): void; - export function fchown(fd: number, uid: number, gid: number, callback?: (err: Error) => void): void; - export function fchownSync(fd: number, uid: number, gid: number): void; - export function lchown(path: string, uid: number, gid: number, callback?: (err: Error) => void): void; - export function lchownSync(path: string, uid: number, gid: number): void; - export function chmod(path: string, mode: number, callback?: (err: Error) => void): void; - export function chmod(path: string, mode: string, callback?: (err: Error) => void): void; - export function chmodSync(path: string, mode: number): void; - export function chmodSync(path: string, mode: string): void; - export function fchmod(fd: number, mode: number, callback?: (err: Error) => void): void; - export function fchmod(fd: number, mode: string, callback?: (err: Error) => void): void; - export function fchmodSync(fd: number, mode: number): void; - export function fchmodSync(fd: number, mode: string): void; - export function lchmod(path: string, mode: string, callback?: (err: Error) => void): void; - export function lchmod(path: string, mode: number, callback?: (err: Error) => void): void; - export function lchmodSync(path: string, mode: number): void; - export function lchmodSync(path: string, mode: string): void; - export function stat(path: string, callback?: (err: Error, stats: Stats) => void): void; - export function lstat(path: string, callback?: (err: Error, stats: Stats) => void): void; - export function fstat(fd: number, callback?: (err: Error, stats: Stats) => void): void; - export function statSync(path: string): Stats; - export function lstatSync(path: string): Stats; - export function fstatSync(fd: number): Stats; - export function link(srcpath: string, dstpath: string, callback?: (err: Error) => void): void; - export function linkSync(srcpath: string, dstpath: string): void; - export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err: Error) => void): void; - export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; - export function readlink(path: string, callback?: (err: Error, linkString: string) => void): void; - export function realpath(path: string, callback?: (err: Error, resolvedPath: string) => void): void; - export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) => void): void; - export function realpathSync(path: string, cache?: boolean): string; - export function unlink(path: string, callback?: (err: Error) => void): void; - export function unlinkSync(path: string): void; - export function rmdir(path: string, callback?: (err: Error) => void): void; - export function rmdirSync(path: string): void; - export function mkdir(path: string, mode?: number, callback?: (err: Error) => void): void; - export function mkdir(path: string, mode?: string, callback?: (err: Error) => void): void; - export function mkdirSync(path: string, mode?: number): void; - export function mkdirSync(path: string, mode?: string): void; - export function readdir(path: string, callback?: (err: Error, files: string[]) => void ): void; - export function readdirSync(path: string): string[]; - export function close(fd: number, callback?: (err: Error) => void): void; - export function closeSync(fd: number): void; - export function open(path: string, flags: string, mode?: string, callback?: (err: Error, fs: number) => void): void; - export function openSync(path: string, flags: string, mode?: string): number; - export function utimes(path: string, atime: number, mtime: number, callback?: (err: Error) => void): void; - export function utimesSync(path: string, atime: number, mtime: number): void; - export function futimes(fd: number, atime: number, mtime: number, callback?: (err: Error) => void): void; - export function futimesSync(fd: number, atime: number, mtime: number): void; - export function fsync(fd: number, callback?: (err: Error) => void): void; - export function fsyncSync(fd: number): void; - export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void; - export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; - export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void ): void; - export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; - export function readFile(filename: string, encoding: string, callback: (err: Error, data: string) => void ): void; - export function readFile(filename: string, options: OpenOptions, callback: (err: Error, data: string) => void ): void; - export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void; - export function readFileSync(filename: string): NodeBuffer; - export function readFileSync(filename: string, encoding: string): string; - export function readFileSync(filename: string, options: OpenOptions): string; - export function writeFile(filename: string, data: any, encoding?: string, callback?: (err: Error) => void): void; - export function writeFile(filename: string, data: any, options?: OpenOptions, callback?: (err: Error) => void): void; - export function writeFileSync(filename: string, data: any, encoding?: string): void; - export function writeFileSync(filename: string, data: any, option?: OpenOptions): void; - export function appendFile(filename: string, data: any, encoding?: string, callback?: (err: Error) => void): void; - export function appendFile(filename: string, data: any,option?: OpenOptions, callback?: (err: Error) => void): void; - export function appendFileSync(filename: string, data: any, encoding?: string): void; - export function appendFileSync(filename: string, data: any, option?: OpenOptions): void; - export function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void; - export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void; - export function unwatchFile(filename: string, listener?: Stats): void; - export function watch(filename: string, options?: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; - export function exists(path: string, callback?: (exists: boolean) => void ): void; - export function existsSync(path: string): boolean; export function ensureDir(path: string, cb: (err: Error) => void): void; export function ensureDirSync(path: string): void; + export function ensureFile(path: string, cb: (err: Error) => void): void; export function ensureFileSync(path: string): void; + export function ensureLink(path: string, cb: (err: Error) => void): void; export function ensureLinkSync(path: string): void; + export function ensureSymlink(path: string, cb: (err: Error) => void): void; export function ensureSymlinkSync(path: string): void; + export function emptyDir(path: string, callback?: (err: Error) => void): void; export function emptyDirSync(path: string): boolean; - export interface CopyFilterFunction { + export interface CopyFilterFunction { (src: string): boolean } @@ -188,6 +79,7 @@ declare module "fs-extra" { export interface CopyOptions { clobber?: boolean preserveTimestamps?: boolean + dereference?: boolean filter?: CopyFilter } @@ -200,20 +92,4 @@ declare module "fs-extra" { fs?: any; mode?: number; } - - export interface ReadStreamOptions { - flags?: string; - encoding?: string; - fd?: number; - mode?: number; - bufferSize?: number; - } - export interface WriteStreamOptions { - flags?: string; - encoding?: string; - string?: string; - } - export function createReadStream(path: string, options?: ReadStreamOptions): ReadStream; - export function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream; - export function createOutputStream(path: string, options?: WriteStreamOptions): WriteStream; } From 5fd4595b4474eb7dc7415a303083cb3086a50974 Mon Sep 17 00:00:00 2001 From: Sarsaw Date: Fri, 20 May 2016 10:52:14 +0200 Subject: [PATCH 149/415] precision is optional in toBeCloseTo --- jasmine/jasmine.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index 9841a74fc8..5fd8b49f56 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -301,7 +301,7 @@ declare namespace jasmine { toContain(expected: any, expectationFailOutput?: any): boolean; toBeLessThan(expected: number, expectationFailOutput?: any): boolean; toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean; - toBeCloseTo(expected: number, precision: any, expectationFailOutput?: any): boolean; + toBeCloseTo(expected: number, precision?: any, expectationFailOutput?: any): boolean; toThrow(expected?: any): boolean; toThrowError(message?: string | RegExp): boolean; toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean; From b8fc7bf0a62f4d610f712b35280d875544defb59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luiz=20dos=20Santos?= Date: Fri, 20 May 2016 15:12:55 -0300 Subject: [PATCH 150/415] Fix reference --- rx-node/rx-node-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rx-node/rx-node-tests.ts b/rx-node/rx-node-tests.ts index b5450e9945..bd66ac10d5 100644 --- a/rx-node/rx-node-tests.ts +++ b/rx-node/rx-node-tests.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// +/// { var source = Rx.Observable.return(42); From 0e3b134ae0812f1ee779c54412a5f76d0ce6f40e Mon Sep 17 00:00:00 2001 From: Alex Staroselsky Date: Sun, 22 May 2016 15:56:09 -0500 Subject: [PATCH 151/415] Added interface for Angular Material Prompt Dialog added in 1.1.0-rc1 (2016-03-09) extending IPresetDialog and included cancel() and placeholder() methods. --- angular-material/angular-material-tests.ts | 12 ++++++++++++ angular-material/angular-material.d.ts | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts index 3c70dd27e8..cecaf07e67 100644 --- a/angular-material/angular-material-tests.ts +++ b/angular-material/angular-material-tests.ts @@ -55,6 +55,18 @@ myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material. $scope['confirmDialog'] = () => { $mdDialog.show($mdDialog.confirm().htmlContent('Confirm!')); }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().textContent('Prompt!')); + }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().htmlContent('Prompt!')); + }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().cancel('Prompt "Cancel" button text')); + }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().placeholder('Prompt input placeholder text')); + }; $scope['hideDialog'] = $mdDialog.hide.bind($mdDialog, 'hide'); $scope['cancelDialog'] = $mdDialog.cancel.bind($mdDialog, 'cancel'); }); diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 12fe28a9b8..bb144d15d4 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -59,6 +59,11 @@ declare namespace angular.material { interface IConfirmDialog extends IPresetDialog { cancel(cancel: string): IConfirmDialog; } + + interface IPromptDialog extends IPresetDialog { + cancel(cancel: string): IPromptDialog; + placeholder(placeholder: string): IPromptDialog; + } interface IDialogOptions { templateUrl?: string; @@ -90,6 +95,7 @@ declare namespace angular.material { show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise; confirm(): IConfirmDialog; alert(): IAlertDialog; + prompt(): IPromptDialog; hide(response?: any): angular.IPromise; cancel(response?: any): void; } From 7db63a2dd878c47db2cbb17cc257d8f60ceb38cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Boya=20Garc=C3=ADa?= Date: Mon, 23 May 2016 03:10:11 +0200 Subject: [PATCH 152/415] Rx: resultSelector should be optional --- rx/rx-lite.d.ts | 278 ++++++++++++++++++++++++------------------------ 1 file changed, 139 insertions(+), 139 deletions(-) diff --git a/rx/rx-lite.d.ts b/rx/rx-lite.d.ts index 3a4ee18450..5bae390cc9 100644 --- a/rx/rx-lite.d.ts +++ b/rx/rx-lite.d.ts @@ -225,48 +225,48 @@ declare namespace Rx { catchException(handler: (exception: any) => IPromise): Observable; // alias for catch catch(second: Observable): Observable; catchException(second: Observable): Observable; // alias for catch - combineLatest(second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - combineLatest(souces: Observable[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; - combineLatest(souces: IPromise[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; - withLatestFrom(second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - withLatestFrom(souces: Observable[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; - withLatestFrom(souces: IPromise[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; + combineLatest(second: Observable, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + combineLatest(second: IPromise, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + combineLatest(second: Observable, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(second: Observable, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(second: IPromise, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(second: IPromise, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(second: Observable, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: Observable, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: Observable, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: Observable, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: IPromise, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: IPromise, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: IPromise, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: IPromise, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; + combineLatest(souces: Observable[], resultSelector?: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; + combineLatest(souces: IPromise[], resultSelector?: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; + withLatestFrom(second: Observable, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + withLatestFrom(second: IPromise, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + withLatestFrom(second: Observable, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(second: Observable, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(second: IPromise, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(second: IPromise, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(second: Observable, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(second: Observable, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(second: Observable, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(second: Observable, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(second: IPromise, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(second: IPromise, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(second: IPromise, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(second: IPromise, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; + withLatestFrom(souces: Observable[], resultSelector?: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; + withLatestFrom(souces: IPromise[], resultSelector?: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; concat(...sources: Observable[]): Observable; concat(...sources: IPromise[]): Observable; concat(sources: Observable[]): Observable; concat(sources: IPromise[]): Observable; concatAll(): T; concatObservable(): T; // alias for concatAll - concatMap(selector: (value: T, index: number) => Observable, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat - concatMap(selector: (value: T, index: number) => IPromise, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat + concatMap(selector: (value: T, index: number) => Observable, resultSelector?: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat + concatMap(selector: (value: T, index: number) => IPromise, resultSelector?: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat concatMap(selector: (value: T, index: number) => Observable): Observable; // alias for selectConcat concatMap(selector: (value: T, index: number) => IPromise): Observable; // alias for selectConcat concatMap(selector: (value: T, index: number) => R[]): Observable; // alias for selectConcat @@ -283,23 +283,23 @@ declare namespace Rx { switchLatest(): T; // alias for switch takeUntil(other: Observable): Observable; takeUntil(other: IPromise): Observable; - zip(second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - zip(second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - zip(second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - zip(second: Observable[], resultSelector: (left: T, ...right: TOther[]) => TResult): Observable; - zip(second: IPromise[], resultSelector: (left: T, ...right: TOther[]) => TResult): Observable; + zip(second: Observable, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + zip(second: IPromise, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + zip(second: Observable, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + zip(second: Observable, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + zip(second: IPromise, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + zip(second: IPromise, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + zip(second: Observable, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: Observable, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: Observable, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: Observable, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: IPromise, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: IPromise, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: IPromise, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: IPromise, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; + zip(second: Observable[], resultSelector?: (left: T, ...right: TOther[]) => TResult): Observable; + zip(second: IPromise[], resultSelector?: (left: T, ...right: TOther[]) => TResult): Observable; asObservable(): Observable; dematerialize(): Observable; @@ -348,15 +348,15 @@ declare namespace Rx { select(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; map(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for select pluck(prop: string): Observable; - selectMany(selector: (value: T) => Observable, resultSelector: (item: T, other: TOther) => TResult): Observable; - selectMany(selector: (value: T) => IPromise, resultSelector: (item: T, other: TOther) => TResult): Observable; + selectMany(selector: (value: T) => Observable, resultSelector?: (item: T, other: TOther) => TResult): Observable; + selectMany(selector: (value: T) => IPromise, resultSelector?: (item: T, other: TOther) => TResult): Observable; selectMany(selector: (value: T) => Observable): Observable; selectMany(selector: (value: T) => IPromise): Observable; selectMany(other: Observable): Observable; selectMany(other: IPromise): Observable; selectMany(selector: (value: T) => TResult[]): Observable; // alias for selectMany - flatMap(selector: (value: T) => Observable, resultSelector: (item: T, other: TOther) => TResult): Observable; // alias for selectMany - flatMap(selector: (value: T) => IPromise, resultSelector: (item: T, other: TOther) => TResult): Observable; // alias for selectMany + flatMap(selector: (value: T) => Observable, resultSelector?: (item: T, other: TOther) => TResult): Observable; // alias for selectMany + flatMap(selector: (value: T) => IPromise, resultSelector?: (item: T, other: TOther) => TResult): Observable; // alias for selectMany flatMap(selector: (value: T) => Observable): Observable; // alias for selectMany flatMap(selector: (value: T) => IPromise): Observable; // alias for selectMany flatMap(other: Observable): Observable; // alias for selectMany @@ -383,8 +383,8 @@ declare namespace Rx { */ flatMapObserver(onNext: (value: T, index: number) => Observable, onError: (exception: any) => Observable, onCompleted: () => Observable, thisArg?: any): Observable; - selectConcat(selector: (value: T, index: number) => Observable, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; - selectConcat(selector: (value: T, index: number) => IPromise, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; + selectConcat(selector: (value: T, index: number) => Observable, resultSelector?: (value1: T, value2: T2, index: number) => R): Observable; + selectConcat(selector: (value: T, index: number) => IPromise, resultSelector?: (value1: T, value2: T2, index: number) => R): Observable; selectConcat(selector: (value: T, index: number) => Observable): Observable; selectConcat(selector: (value: T, index: number) => IPromise): Observable; selectConcat(sequence: Observable): Observable; @@ -524,7 +524,7 @@ declare namespace Rx { fromArray(array: T[], scheduler?: IScheduler): Observable; fromArray(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable; - generate(initialState: TState, condition: (state: TState) => boolean, iterate: (state: TState) => TState, resultSelector: (state: TState) => TResult, scheduler?: IScheduler): Observable; + generate(initialState: TState, condition: (state: TState) => boolean, iterate: (state: TState) => TState, resultSelector?: (state: TState) => TResult, scheduler?: IScheduler): Observable; never(): Observable; /** @@ -575,73 +575,73 @@ declare namespace Rx { catchError(...sources: IPromise[]): Observable; // alias for catch combineLatest(first: Observable, second: Observable): Observable<[T, T2]>; - combineLatest(first: Observable, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; + combineLatest(first: Observable, second: Observable, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, resultSelector?: (v1: T, v2: T2) => TResult): Observable; combineLatest(first: Observable, second: Observable, third: Observable): Observable<[T, T2, T3]>; - combineLatest(first: Observable, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable): Observable<[T, T2, T3, T4]>; - combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable): Observable<[T, T2, T3, T4, T5]>; - combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; combineLatest(sources: Observable[]): Observable; - combineLatest(sources: Observable[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; - combineLatest(sources: IPromise[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; + combineLatest(sources: Observable[], resultSelector?: (...otherValues: TOther[]) => TResult): Observable; + combineLatest(sources: IPromise[], resultSelector?: (...otherValues: TOther[]) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - withLatestFrom(souces: Observable[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; - withLatestFrom(souces: IPromise[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; + withLatestFrom(first: Observable, second: Observable, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + withLatestFrom(first: IPromise, second: Observable, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + withLatestFrom(first: Observable, second: IPromise, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + withLatestFrom(first: IPromise, second: IPromise, resultSelector?: (v1: T, v2: T2) => TResult): Observable; + withLatestFrom(first: Observable, second: Observable, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(first: Observable, second: Observable, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(first: Observable, second: IPromise, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(first: Observable, second: IPromise, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(first: IPromise, second: Observable, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(first: IPromise, second: Observable, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(first: IPromise, second: IPromise, third: Observable, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(first: IPromise, second: IPromise, third: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3) => TResult): Observable; + withLatestFrom(first: Observable, second: Observable, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: Observable, second: Observable, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: Observable, second: Observable, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: Observable, second: Observable, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: Observable, second: IPromise, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: Observable, second: IPromise, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: Observable, second: IPromise, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: Observable, second: IPromise, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: IPromise, second: Observable, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: IPromise, second: Observable, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: IPromise, second: Observable, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: IPromise, second: Observable, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: IPromise, second: IPromise, third: Observable, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: IPromise, second: IPromise, third: Observable, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: IPromise, second: IPromise, third: IPromise, fourth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: IPromise, second: IPromise, third: IPromise, fourth: IPromise, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + withLatestFrom(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector?: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; + withLatestFrom(souces: Observable[], resultSelector?: (...otherValues: TOther[]) => TResult): Observable; + withLatestFrom(souces: IPromise[], resultSelector?: (...otherValues: TOther[]) => TResult): Observable; concat(...sources: Observable[]): Observable; concat(...sources: IPromise[]): Observable; @@ -658,23 +658,23 @@ declare namespace Rx { pairs(obj: { [key: string]: T }, scheduler?: IScheduler): Observable<[string, T]>; - zip(first: Observable, sources: Observable[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable; - zip(first: Observable, sources: IPromise[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable; - zip(source1: Observable, source2: Observable, resultSelector: (item1: T1, item2: T2) => TResult): Observable; - zip(source1: Observable, source2: IPromise, resultSelector: (item1: T1, item2: T2) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: Observable, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: IPromise, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: IPromise, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: Observable, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: Observable, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: IPromise, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: IPromise, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TResult): Observable; + zip(first: Observable, sources: Observable[], resultSelector?: (item1: T1, ...right: T2[]) => TResult): Observable; + zip(first: Observable, sources: IPromise[], resultSelector?: (item1: T1, ...right: T2[]) => TResult): Observable; + zip(source1: Observable, source2: Observable, resultSelector?: (item1: T1, item2: T2) => TResult): Observable; + zip(source1: Observable, source2: IPromise, resultSelector?: (item1: T1, item2: T2) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: Observable, resultSelector?: (item1: T1, item2: T2, item3: T3) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: IPromise, resultSelector?: (item1: T1, item2: T2, item3: T3) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: Observable, resultSelector?: (item1: T1, item2: T2, item3: T3) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: IPromise, resultSelector?: (item1: T1, item2: T2, item3: T3) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector?: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: Observable, source4: IPromise, resultSelector?: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: IPromise, source4: Observable, resultSelector?: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: IPromise, source4: IPromise, resultSelector?: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: Observable, source4: Observable, resultSelector?: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: Observable, source4: IPromise, resultSelector?: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: IPromise, source4: Observable, resultSelector?: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: IPromise, source4: IPromise, resultSelector?: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector?: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TResult): Observable; zipArray(...sources: Observable[]): Observable; zipArray(sources: Observable[]): Observable; From de3103a10709308a3cc02924a839701b72edb509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=A9t=C3=A9?= Date: Tue, 24 May 2016 10:42:05 +0200 Subject: [PATCH 153/415] Update fbsdk.d.ts Added missing "data" in FBResponseObject to avoid throwing errors in TS. --- fbsdk/fbsdk.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/fbsdk/fbsdk.d.ts b/fbsdk/fbsdk.d.ts index 6153de6579..79c710f8f7 100644 --- a/fbsdk/fbsdk.d.ts +++ b/fbsdk/fbsdk.d.ts @@ -150,6 +150,7 @@ interface FBSDKCanvas{ } interface FBResponseObject { + data: any; error: any; } From 38a708db95f8b49282a8292e6fc8f186a72c4f82 Mon Sep 17 00:00:00 2001 From: Atanas Atanasov Date: Wed, 25 May 2016 09:59:27 +0300 Subject: [PATCH 154/415] `gijgo definitions for version 0.6.2 --- gijgo/gijgo-tests.ts | 23 +++++++ gijgo/gijgo.d.ts | 161 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+) create mode 100644 gijgo/gijgo-tests.ts create mode 100644 gijgo/gijgo.d.ts diff --git a/gijgo/gijgo-tests.ts b/gijgo/gijgo-tests.ts new file mode 100644 index 0000000000..85b7f00b38 --- /dev/null +++ b/gijgo/gijgo-tests.ts @@ -0,0 +1,23 @@ +/// +/// + +// Grid +$(() => { + this.grid = $('#grid').grid({ + primaryKey: 'ID', + columns: [ + { field: 'ID', width: 50, sortable: true }, + { field: 'Name', sortable: true }, + ], + pager: { limit: 5, sizes: [2, 5, 10, 20] } + }); +}); + +// Dialog +$(() => { + this.dialog = $('#playerModal').dialog({ + autoOpen: false, + title: 'Player', + width: 400 + }); +}); \ No newline at end of file diff --git a/gijgo/gijgo.d.ts b/gijgo/gijgo.d.ts new file mode 100644 index 0000000000..ccfee96047 --- /dev/null +++ b/gijgo/gijgo.d.ts @@ -0,0 +1,161 @@ +//Grid + +interface GridPager { + limit: number; + sizes: Array; + leftControls?: any; + rightControls?: any; +} + +interface GridColumn { + align?: string; + cssClass?: string; + decimalDigits?: number; + editor?: any; + events?: any; + field?: string; + format?: string; + headerCssClass?: string; + hidden?: boolean; + icon?: string; + minWidth?: number; + priority?: number; + sortable?: boolean; + stopPropagation?: boolean; + title?: string; + tmpl?: string; + tooltip?: string; + type?: string; + width?: number; +} + +interface GridDefaultParams { + direction?: string; + limit?: string; + page?: string; + sortBy?: string; +} + +interface GridMapping { + dataField?: string; + totalRecordsField?: string; +} + +interface GridSettings { + //Configuration options + autoGenerateColumns?: boolean; + autoLoad?: boolean; + columns?: Array; + dataSource?: any; + defaultColumnSettings?: GridColumn; + defaultParams?: GridDefaultParams; + detailTemplate?: string; + fontSize?: string; + mapping?: string; + minWidth?: number; + notFoundText?: string; + pager?: GridPager; + primaryKey?: string; + resizableColumns?: boolean; + resizeCheckInterval?: number; + responsive?: boolean; + selectionMethod?: string; + selectionType?: string; + showHiddenColumnsAsDetails?: boolean; + title?: string; + toolbarTemplate?: string; + uiLibrary?: string; + width?: number; + params?: any; + + //Events + beforeEmptyRowInsert?: (e: any, $row: JQuery) => any; + cellDataBound?: (e: any, $wrapper: JQuery, id: string, column: GridColumn, record: Entity) => any; + cellDataChanged?: (e: any, $cell: JQuery, column: GridColumn, record: Entity, oldValue: any, newValue: any) => any; + columnHide?: (e: any, column: GridColumn) => any; + columnShow?: (e: any, column: GridColumn) => any; + dataBinding?: (e: any, records: Array) => any; + dataBound?: (e: any, records: Array, totalRecords: number) => any; + destroying?: (e: any) => any; + detailCollapse?: (e: any, detailWrapper: JQuery, record: Entity) => any; + detailExpand?: (e: any, detailWrapper: JQuery, record: Entity) => any; + initialized?: (e: any) => any; + pageChanging?: (e: any, newPage: number) => any; + pageSizeChange?: (e: any, newPage: number) => any; + resize?: (e: any, newWidth: number, oldWidth: number) => any; + rowDataBound?: (e: any, $row: JQuery, id: string, record: Entity) => any; + rowRemoving?: (e: any, $row: JQuery, id: string, record: Entity) => any; + rowSelect?: (e: any, $row: JQuery, id: string, record: Entity) => any; + rowUnselect?: (e: any, $row: JQuery, id: string, record: Entity) => any; +} + +interface Grid extends JQuery { + addRow(record: Entity): Grid; + clear(showNotFoundText?: boolean): Grid; + count(): number; + destroy(keepTableTag?: boolean, keepWrapperTag?: boolean): void; + //get(position: number): Entity; //TODO: rename to getByPosition to avoid conflicts with jquery.get + getAll(): Array; + getById(id: string): Entity; + getChanges(): Array; + getSelected(): string; + getSelections(): Array; + hideColumn(field: string): Grid; + makeResponsive(): void; + reload(params?: Params): Grid; + removeRow(id: string): Grid; + render(response: any): Grid; + selectAll(): Grid; + setSelected(id: string|number): Grid; + showColumn(field: string): Grid; + title(text: any): any; + unSelectAll(): Grid; + updateRow(id: string, record: Entity): Grid; +} + +interface JQuery { + grid(settings: GridSettings): Grid; + grid(settings: GridSettings): Grid; + grid(settings: GridSettings): Grid; +} + +//Dialog +interface DialogSettings { + //Configuration options + autoOpen?: boolean; + closeOnEscape?: boolean; + draggable?: boolean; + height?: number|string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + resizable?: boolean; + title?: string; + uiLibrary?: string; + width?: number; + + //Events + closed?: (e: any) => any; + closing?: (e: any) => any; + drag?: (e: any) => any; + dragStart?: (e: any) => any; + dragStop?: (e: any) => any; + initialized?: (e: any) => any; + opened?: (e: any) => any; + opening?: (e: any) => any; + resize?: (e: any) => any; + resizeStart?: (e: any) => any; + resizeStop?: (e: any) => any; +} + +interface Dialog extends JQuery { + close(): Dialog; + isOpen(): boolean; + open(): Dialog; +} + +interface JQuery { + dialog(settings: DialogSettings): Dialog; +} \ No newline at end of file From 9b3ca60d7f2e16e57f434532d7d55650a6103ff6 Mon Sep 17 00:00:00 2001 From: Atanas Atanasov Date: Wed, 25 May 2016 10:00:36 +0300 Subject: [PATCH 155/415] Delete grid.d.ts --- gijgo/grid.d.ts | 123 ------------------------------------------------ 1 file changed, 123 deletions(-) delete mode 100644 gijgo/grid.d.ts diff --git a/gijgo/grid.d.ts b/gijgo/grid.d.ts deleted file mode 100644 index 5864f2efd6..0000000000 --- a/gijgo/grid.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -// Type definitions for Gijgo v0.6.2 -// Project: http://gijgo.com -// Definitions by: Atanas Atanasov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface GridPager { - limit: number; - sizes: Array; - leftControls?: any; - rightControls?: any; -} - -interface GridColumn { - align?: string; - cssClass?: string; - decimalDigits?: number; - editor?: any; - events?: any; - field?: string; - format?: string; - headerCssClass?: string; - hidden?: boolean; - icon?: string; - minWidth?: number; - priority?: number; - sortable?: boolean; - stopPropagation?: boolean; - title?: any; - tmpl?: string; - tooltip?: string; - type?: string; - width?: number; -} - -interface GridDefaultParams { - direction?: string; - limit?: string; - page?: string; - sortBy?: string; -} - -interface GridMapping { - dataField?: string; - totalRecordsField?: string; -} - -interface GridSettings { - //Configuration options - autoGenerateColumns?: boolean; - autoLoad?: boolean; - columns?: Array; - dataSource?: any; - defaultColumnSettings?: GridColumn; - defaultParams?: GridDefaultParams; - detailTemplate?: string; - fontSize?: string; - mapping?: string; - minWidth?: number; - notFoundText?: string; - pager?: GridPager; - primaryKey?: string; - resizableColumns?: boolean; - resizeCheckInterval?: number; - responsive?: boolean; - selectionMethod?: string; - selectionType?: string; - showHiddenColumnsAsDetails?: boolean; - title?: string; - toolbarTemplate?: string; - uiLibrary?: string; - width?: number; - params?: any; - - //Events - beforeEmptyRowInsert(e: any, $row: JQuery); - cellDataBound(e: any, $wrapper: JQuery, id: string, column: GridColumn, record: Entity); - cellDataChanged(e: any, $cell: JQuery, column: GridColumn, record: Entity, oldValue: any, newValue: any); - columnHide(e: any, column: GridColumn); - columnShow(e: any, column: GridColumn); - dataBinding(e: any, records: Array); - dataBound(e: any, records: Array, totalRecords: number); - destroying(e: any); - detailCollapse(e: any, detailWrapper: JQuery, record: Entity); - detailExpand(e: any, detailWrapper: JQuery, record: Entity); - initialized(e: any); - pageChanging(e: any, newPage: number); - pageSizeChange(e: any, newPage: number); - resize(e: any, newWidth: number, oldWidth: number); - rowDataBound(e: any, $row: JQuery, id: string, record: Entity); - rowRemoving(e: any, $row: JQuery, id: string, record: Entity); - rowSelect(e: any, $row: JQuery, id: string, record: Entity); - rowUnselect(e: any, $row: JQuery, id: string, record: Entity); -} - -interface Grid extends JQuery { - addRow(record: Entity): Grid; - clear(showNotFoundText?: boolean): Grid; - count(): number; - destroy(keepTableTag?: boolean, keepWrapperTag?: boolean): void; - //get(position: number): Entity; //TODO: rename to getByPosition to avoid conflicts with jquery.get - getAll(): Array; - getById(id: string): Entity; - getChanges(): Array; - getSelected(): string; - getSelections(): Array; - hideColumn(field: string): Grid; - makeResponsive(): void; - reload(params?: Params): Grid; - removeRow(id: string): Grid; - render(response: any): Grid; - selectAll(): Grid; - setSelected(id: string): Grid; - showColumn(field: string): Grid; - title(text: any): any; - unSelectAll(): Grid; - updateRow(id: string, record: Entity): Grid; -} - -interface JQuery { - grid(settings: GridSettings): Grid; - grid(settings: GridSettings): Grid; - grid(settings: GridSettings): Grid; -} From 2309b41ca1914120c0fcf5ccdb2be77eb6988c1f Mon Sep 17 00:00:00 2001 From: Atanas Atanasov Date: Wed, 25 May 2016 10:01:12 +0300 Subject: [PATCH 156/415] added comments --- gijgo/gijgo.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gijgo/gijgo.d.ts b/gijgo/gijgo.d.ts index ccfee96047..faa2609fbc 100644 --- a/gijgo/gijgo.d.ts +++ b/gijgo/gijgo.d.ts @@ -1,4 +1,9 @@ -//Grid +// Type definitions for Gijgo v0.6.2 +// Project: http://gijgo.com +// Definitions by: Atanas Atanasov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +//Grid interface GridPager { limit: number; @@ -158,4 +163,4 @@ interface Dialog extends JQuery { interface JQuery { dialog(settings: DialogSettings): Dialog; -} \ No newline at end of file +} From efd8d9232567d83e338ff72da849d64eaabf795a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Guti=C3=A9rrez?= Date: Wed, 25 May 2016 13:01:45 -0500 Subject: [PATCH 157/415] Add support for svgjs.resize --- svgjs.resize/svgjs.resize.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 svgjs.resize/svgjs.resize.d.ts diff --git a/svgjs.resize/svgjs.resize.d.ts b/svgjs.resize/svgjs.resize.d.ts new file mode 100644 index 0000000000..fa06d94110 --- /dev/null +++ b/svgjs.resize/svgjs.resize.d.ts @@ -0,0 +1,15 @@ +// Type definitions for svgjs.resize +// Project: http://www.svgjs.com/ +// Definitions by: Kevin Gutiérrez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Reference: https://github.com/Fuzzyma/svg.resize.js + + +declare namespace svgjs { + export interface Element { + selectize(): Element + selectize(obj: Object): Element + resize(): Element + resize(obj: Object): Element + } +} From 35d759b73b0acdb6d429165a3d233604604d8f17 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Thu, 26 May 2016 10:42:18 +0100 Subject: [PATCH 158/415] Started adding additional typings for jquery.fileupload callbacks Typings have been added for the following callbacks: progress, progressall, start, stop, change, paste, drop, dragover, chunksend, chunkdone, chunkfail, chunkalways. The docs (https://github.com/blueimp/jQuery-File-Upload/wiki/Options), and the source jquery.fileupload.js were used to create these typings. --- jquery.fileupload/jquery.fileupload.d.ts | 55 ++++++++++++++++++------ 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/jquery.fileupload/jquery.fileupload.d.ts b/jquery.fileupload/jquery.fileupload.d.ts index 3575ab2738..eb47f6e172 100644 --- a/jquery.fileupload/jquery.fileupload.d.ts +++ b/jquery.fileupload/jquery.fileupload.d.ts @@ -207,7 +207,7 @@ interface JQueryFileInputOptions { timeout?: number; active?: Function; - progress?: Function; + progress?: (e: JQueryEventObject, data: JQueryFileUploadProgressObject) => void; send?: Function; // Other callbacks: @@ -215,17 +215,17 @@ interface JQueryFileInputOptions { done?: Function; fail?: Function; always?: Function; - progressall?: Function; - start?: Function; - stop?: Function; - change?: Function; - paste?: Function; - drop?: Function; - dragover?: Function; - chunksend?: Function; - chunkdone?: Function; - chunkfail?: Function; - chunkalways?: Function; + progressall?: (e: JQueryEventObject, data: JQueryFileUploadProgressAllObject) => void; + start?: (e: JQueryEventObject) => void; + stop?: (e: JQueryEventObject) => void; + change?: (e: JQueryEventObject, data: JQueryFileUploadChangeObject) => void; + paste?: (e: JQueryEventObject, data: JQueryFileUploadFilesObject) => void; + drop?: (e: JQueryEventObject, data: JQueryFileUploadFilesObject) => void; + dragover?: (e: JQueryEventObject) => void; + chunksend?: (e: JQueryEventObject, data: JQueryFileUploadChunkObject) => void; + chunkdone?: (e: JQueryEventObject, data: JQueryFileUploadChunkObject) => void; + chunkfail?: (e: JQueryEventObject, data: JQueryFileUploadChunkObject) => void; + chunkalways?: (e: JQueryEventObject, data: JQueryFileUploadChunkObject) => void; // Others url?: string; @@ -250,3 +250,34 @@ interface JQuery { interface JQuerySupport { fileInput?: boolean; } + +interface JQueryFileUploadChangeObject { + fileInput?: JQuery; + fileInputClone?: JQuery; + files: File[]; + form?: JQuery; + originalFiles: File[]; +} + +interface JQueryFileUploadProgressAllObject { + loaded?: number; + total?: number; + bitrate?: number; +} + +interface JQueryFileUploadProgressObject extends JQueryFileInputOptions, JQueryFileUploadProgressAllObject { +} + +interface JQueryFileUploadFilesObject { + files: File[]; +} + +interface JQueryFileUploadChunkObject extends JQueryFileInputOptions { + blob: any; + chunkSize: number; + contentRange: string; + errorThrown: any; + jqXHR: JQueryXHR; + result: any; + textStatus: string; +} \ No newline at end of file From da735a2b7ff9153d94c55e0ff238c722503f4e5d Mon Sep 17 00:00:00 2001 From: David Date: Thu, 26 May 2016 22:28:34 -0400 Subject: [PATCH 159/415] Added 2 missing methods namely, createTableIfNotExistsknex and bigIncrements. Not sure why they were omitted. --- knex/knex.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 6fadd1b450..1084b9936b 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -301,6 +301,7 @@ declare module "knex" { interface SchemaBuilder extends Promise { createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): SchemaBuilder; + createTableIfNotExistsknex(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): SchemaBuilder; renameTable(oldTableName: string, newTableName: string): Promise; dropTable(tableName: string): SchemaBuilder; hasTable(tableName: string): Promise; @@ -312,6 +313,7 @@ declare module "knex" { interface TableBuilder { increments(columnName?: string): ColumnBuilder; + bigIncrements(columnName?: string): ColumnBuilder; dropColumn(columnName: string): TableBuilder; dropColumns(...columnNames: string[]): TableBuilder; renameColumn(from: string, to: string): ColumnBuilder; From e0ab7738a110ecbad3c0a68430b2323b6185b33c Mon Sep 17 00:00:00 2001 From: David Date: Thu, 26 May 2016 23:08:37 -0400 Subject: [PATCH 160/415] minor typo --- knex/knex.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 1084b9936b..bf9b46f75e 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -301,7 +301,7 @@ declare module "knex" { interface SchemaBuilder extends Promise { createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): SchemaBuilder; - createTableIfNotExistsknex(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): SchemaBuilder; + createTableIfNotExists(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): SchemaBuilder; renameTable(oldTableName: string, newTableName: string): Promise; dropTable(tableName: string): SchemaBuilder; hasTable(tableName: string): Promise; From cf3f762c9a9119f8f461843595bc4da929bba42e Mon Sep 17 00:00:00 2001 From: Diluka Date: Fri, 27 May 2016 15:20:12 +0800 Subject: [PATCH 161/415] add another name which is usually use in project --- avoscloud-sdk/avoscloud-sdk.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/avoscloud-sdk/avoscloud-sdk.d.ts b/avoscloud-sdk/avoscloud-sdk.d.ts index c3bd03e570..af904a6c8c 100644 --- a/avoscloud-sdk/avoscloud-sdk.d.ts +++ b/avoscloud-sdk/avoscloud-sdk.d.ts @@ -797,3 +797,8 @@ declare module "avoscloud-sdk" { export = AV; } + +declare module 'leanengine' { + import alias = require('avoscloud-sdk'); + export = alias; +} From dc4779445c8b1c8ac7be2e7df88bfe0b3ba82d2b Mon Sep 17 00:00:00 2001 From: Neil Culver Date: Fri, 27 May 2016 16:02:54 +0100 Subject: [PATCH 162/415] refactored tests added done typings --- jquery.fileupload/jquery.fileupload-tests.ts | 28 +++++++++----------- jquery.fileupload/jquery.fileupload.d.ts | 18 ++++++++----- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/jquery.fileupload/jquery.fileupload-tests.ts b/jquery.fileupload/jquery.fileupload-tests.ts index 87149e0151..f07c60b87d 100644 --- a/jquery.fileupload/jquery.fileupload-tests.ts +++ b/jquery.fileupload/jquery.fileupload-tests.ts @@ -13,6 +13,18 @@ var __handleAddingFile = function (event:any, data:any) data.submit(); }; +var options: JQueryFileInputOptions = { + dataType: 'json', + singleFileUploads: true, + limitMultiFileUploads: 1, + add: __handleAddingFile, + done: (e, data) => { + data.result; + data.jqXHR; + data.textStatus; + } +} + class TestFileInput { // The whole body will be the container for this test @@ -24,20 +36,6 @@ class TestFileInput { constructor() { // The file upload object receives a fileInputOptions configuration object - this.fileInput = this.$el.fileupload({ - - dataType: 'json', - - // By default, each file of a selection is uploaded using an individual - // request for XHR type uploads. Set to false to upload file - // selections in one request each: - singleFileUploads: true, - // To limit the number of files uploaded with one XHR request, - // set the following option to an integer greater than 0: - limitMultiFileUploads: 1, - - add: __handleAddingFile - - }); + this.fileInput = this.$el.fileupload(options); } } diff --git a/jquery.fileupload/jquery.fileupload.d.ts b/jquery.fileupload/jquery.fileupload.d.ts index eb47f6e172..3cf92af62c 100644 --- a/jquery.fileupload/jquery.fileupload.d.ts +++ b/jquery.fileupload/jquery.fileupload.d.ts @@ -212,7 +212,7 @@ interface JQueryFileInputOptions { // Other callbacks: submit?: Function; - done?: Function; + done?: (e: JQueryEventObject, data: JQueryFileUploadDone) => void; fail?: Function; always?: Function; progressall?: (e: JQueryEventObject, data: JQueryFileUploadProgressAllObject) => void; @@ -265,19 +265,25 @@ interface JQueryFileUploadProgressAllObject { bitrate?: number; } -interface JQueryFileUploadProgressObject extends JQueryFileInputOptions, JQueryFileUploadProgressAllObject { +interface JQueryFileUploadWithXhr { + jqXHR: JQueryXHR; + result: any; + textStatus: string; } interface JQueryFileUploadFilesObject { files: File[]; } -interface JQueryFileUploadChunkObject extends JQueryFileInputOptions { +interface JQueryFileUploadChunkObject extends JQueryFileInputOptions, JQueryFileUploadWithXhr { blob: any; chunkSize: number; contentRange: string; errorThrown: any; - jqXHR: JQueryXHR; - result: any; - textStatus: string; +} + +interface JQueryFileUploadProgressObject extends JQueryFileInputOptions, JQueryFileUploadProgressAllObject { +} + +interface JQueryFileUploadDone extends JQueryFileInputOptions, JQueryFileUploadWithXhr { } \ No newline at end of file From 10468a3425a45097a929309133c587b72da15a98 Mon Sep 17 00:00:00 2001 From: Nathan Brown Date: Sat, 28 May 2016 08:42:25 -0700 Subject: [PATCH 163/415] Update README.md to point to Typings instead of tsd Based on the note on the `tsd` page and the issue DefinitelyTyped/tsd#269, it would make sense to point people to Typings instead. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c218aaa19..8d3b7bfc40 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Please see the [contribution guide](http://definitelytyped.org/guides/contributi * Directly from the GitHub repos * [NuGet packages](http://nuget.org/packages?q=DefinitelyTyped) -* [TypeScript Definition manager](https://github.com/DefinitelyTyped/tsd) +* [Typings - TypeScript Definition Manager](https://github.com/typings/typings) ## List of definitions From 54a8a56af19d2200de348257c59adc4ceb323a30 Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Mon, 30 May 2016 23:00:07 +0200 Subject: [PATCH 164/415] add node-fetch based on whatwg-fetch (#8931) --- node-fetch/node-fetch-tests.ts | 60 ++++++++++++++++++++++ node-fetch/node-fetch.d.ts | 91 ++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 node-fetch/node-fetch-tests.ts create mode 100644 node-fetch/node-fetch.d.ts diff --git a/node-fetch/node-fetch-tests.ts b/node-fetch/node-fetch-tests.ts new file mode 100644 index 0000000000..3188d319bc --- /dev/null +++ b/node-fetch/node-fetch-tests.ts @@ -0,0 +1,60 @@ +/// + +import fetch = require('node-fetch'); + +function test_fetchUrlWithOptions() { + var headers = new Headers(); + headers.append("Content-Type", "application/json"); + var requestOptions: RequestInit = { + method: "POST", + headers: headers, + mode: 'same-origin', + credentials: 'omit', + cache: 'default', + redirect: 'manual' + }; + handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php", requestOptions)); +} + +function test_fetchUrlWithHeadersObject() { + var requestOptions: RequestInit = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + } + }; + handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php", requestOptions)); +} + +function test_fetchUrl() { + handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php")); +} + +function test_fetchUrlWithRequestObject() { + var requestOptions: RequestInit = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + } + }; + var request: Request = new Request("http://www.andlabs.net/html5/uCOR.php", requestOptions); + handlePromise(fetch(request)); +} + +function test_globalFetchVar() { + fetch('http://test.com', {}) + .then(response => { + // for test only + }); +} + +function handlePromise(promise: Promise) { + promise.then((response) => { + if (response.type === 'basic') { + // for test only + } + return response.text(); + }).then((text) => { + console.log(text); + }); +} diff --git a/node-fetch/node-fetch.d.ts b/node-fetch/node-fetch.d.ts new file mode 100644 index 0000000000..eeaf049fcf --- /dev/null +++ b/node-fetch/node-fetch.d.ts @@ -0,0 +1,91 @@ +// Type definitions for fetch API +// Project: https://github.com/github/fetch +// Definitions by: Ryan Graham +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Request extends Body { + constructor(input: string|Request, init?:RequestInit); + method: string; + url: string; + headers: Headers; + context: RequestContext; + referrer: string; + mode: RequestMode; + redirect: RequestRedirect; + credentials: RequestCredentials; + cache: RequestCache; +} + +interface RequestInit { + method?: string; + headers?: HeaderInit|{ [index: string]: string }; + body?: BodyInit; + mode?: RequestMode; + redirect?: RequestRedirect; + credentials?: RequestCredentials; + cache?: RequestCache; +} + +type RequestContext = + "audio" | "beacon" | "cspreport" | "download" | "embed" | + "eventsource" | "favicon" | "fetch" | "font" | "form" | "frame" | + "hyperlink" | "iframe" | "image" | "imageset" | "import" | + "internal" | "location" | "manifest" | "object" | "ping" | "plugin" | + "prefetch" | "script" | "serviceworker" | "sharedworker" | + "subresource" | "style" | "track" | "video" | "worker" | + "xmlhttprequest" | "xslt"; +type RequestMode = "same-origin" | "no-cors" | "cors"; +type RequestRedirect = "follow" | "error" | "manual"; +type RequestCredentials = "omit" | "same-origin" | "include"; +type RequestCache = + "default" | "no-store" | "reload" | "no-cache" | + "force-cache" | "only-if-cached"; + +declare class Headers { + append(name: string, value: string): void; + delete(name: string):void; + get(name: string): string; + getAll(name: string): Array; + has(name: string): boolean; + set(name: string, value: string): void; + forEach(callback: (value: string, name: string) => void): void; +} + +declare class Body { + bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + formData(): Promise; + json(): Promise; + json(): Promise; + text(): Promise; +} +declare class Response extends Body { + constructor(body?: BodyInit, init?: ResponseInit); + static error(): Response; + static redirect(url: string, status: number): Response; + type: ResponseType; + url: string; + status: number; + ok: boolean; + statusText: string; + headers: Headers; + clone(): Response; +} + +type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; + +interface ResponseInit { + status: number; + statusText?: string; + headers?: HeaderInit; +} + +declare type HeaderInit = Headers|Array; +declare type BodyInit = ArrayBuffer|ArrayBufferView|Blob|FormData|string; +declare type RequestInfo = Request|string; + +declare module 'node-fetch' { + function fetch(url: string | Request, init?: RequestInit): Promise; + export = fetch; +} From a0599f53fc22c36817ebc5161081e6c316b1ba63 Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Tue, 31 May 2016 07:33:51 +0200 Subject: [PATCH 165/415] add myself to comment in node-fetch.d.ts --- node-fetch/node-fetch.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node-fetch/node-fetch.d.ts b/node-fetch/node-fetch.d.ts index eeaf049fcf..e91ac99904 100644 --- a/node-fetch/node-fetch.d.ts +++ b/node-fetch/node-fetch.d.ts @@ -1,6 +1,7 @@ // Type definitions for fetch API // Project: https://github.com/github/fetch -// Definitions by: Ryan Graham +// Definitions by: Torsten Werner based on whatwg-fetch +// that was created by: Ryan Graham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare class Request extends Body { From 8af4eb0036e33dc5f895b4f1f330feb2369fa318 Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Tue, 31 May 2016 08:17:45 +0200 Subject: [PATCH 166/415] node-fetch.d.ts: fix comment --- node-fetch/node-fetch.d.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/node-fetch/node-fetch.d.ts b/node-fetch/node-fetch.d.ts index e91ac99904..4e61f6bcd2 100644 --- a/node-fetch/node-fetch.d.ts +++ b/node-fetch/node-fetch.d.ts @@ -1,7 +1,6 @@ -// Type definitions for fetch API -// Project: https://github.com/github/fetch -// Definitions by: Torsten Werner based on whatwg-fetch -// that was created by: Ryan Graham +// Type definitions for node-fetch based on whatwg-fetch +// Project: https://github.com/bitinn/node-fetch +// Definitions by: Torsten Werner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare class Request extends Body { From 25c96a1f24a2bbe8bae7470a0f1bd16c5d676cf2 Mon Sep 17 00:00:00 2001 From: Ben Dixon Date: Tue, 31 May 2016 11:29:15 +0100 Subject: [PATCH 167/415] Fixes #4467 - Separate out Stripe.js and stripe-node definitions --- {stripe => stripe-node}/stripe-node-tests.ts | 0 {stripe => stripe-node}/stripe-node.d.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {stripe => stripe-node}/stripe-node-tests.ts (100%) rename {stripe => stripe-node}/stripe-node.d.ts (100%) diff --git a/stripe/stripe-node-tests.ts b/stripe-node/stripe-node-tests.ts similarity index 100% rename from stripe/stripe-node-tests.ts rename to stripe-node/stripe-node-tests.ts diff --git a/stripe/stripe-node.d.ts b/stripe-node/stripe-node.d.ts similarity index 100% rename from stripe/stripe-node.d.ts rename to stripe-node/stripe-node.d.ts From fc61cd3b887486c91e1be65f3bca5fda284a9c57 Mon Sep 17 00:00:00 2001 From: Radu Woinaroski Date: Tue, 31 May 2016 21:07:42 +0200 Subject: [PATCH 168/415] mCustomScrollbar, fixed CustomScrollbarOptions for mouseWheel --- mCustomScrollbar/mCustomScrollbar.d.ts | 43 ++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/mCustomScrollbar/mCustomScrollbar.d.ts b/mCustomScrollbar/mCustomScrollbar.d.ts index 4aad109c66..08e532d7bf 100644 --- a/mCustomScrollbar/mCustomScrollbar.d.ts +++ b/mCustomScrollbar/mCustomScrollbar.d.ts @@ -36,9 +36,48 @@ declare namespace MCustomScrollbar { */ scrollInertia?: number; /** - * Mouse wheel support, value: true, false + * Mouse wheel support */ - mouseWheel?: boolean; + mouseWheel?: { + /** + * Enable or disable content scrolling via mouse-wheel. + */ + enable?: boolean; + /** + * Set the mouse-wheel scrolling amount (in pixels). + * The default value "auto" adjusts scrolling amount according to scrollable content length. + */ + scrollAmount?: number; + /** + * Define the mouse-wheel scrolling axis when both vertical and horizontal scrollbars are present. + * Set axis: "y" (default) for vertical or axis: "x" for horizontal scrolling. + */ + axis?: "x"|"y"; + /** + * Prevent the default behaviour which automatically scrolls the parent element when end + * or beginning of scrolling is reached (same bahavior with browser’s native scrollbar). + */ + preventDefault?: boolean; + /** + * Set the number of pixels one wheel notch scrolls. The default value “auto” uses the OS/browser value. + */ + deltaFactor?: number; + /** + * Enable or disable mouse-wheel (delta) acceleration. + * Setting normalizeDelta: true translates mouse-wheel delta value to -1 or 1. + */ + normalizeDelta?:boolean; + /** + * Invert mouse-wheel scrolling direction. + * Set to true to scroll down or right when mouse-wheel is turned upwards. + */ + invert?: boolean; + /** + * Set the tags that disable mouse-wheel when cursor is over them. + * Default value: ["select","option","keygen","datalist","textarea"] + */ + disableOver?: string[] + } /** * Mouse wheel scrolling pixels amount, value in pixels (integer) or "auto" (script calculates and sets pixels amount according to content length) */ From 752e1faa8d6af023743aa4de3970fae19eb56c58 Mon Sep 17 00:00:00 2001 From: Ryan McNamara Date: Tue, 31 May 2016 16:08:16 -0700 Subject: [PATCH 169/415] Add dagre-d3 type for transition --- dagre-d3/dagre-d3-tests.ts | 3 +++ dagre-d3/dagre-d3.d.ts | 2 ++ 2 files changed, 5 insertions(+) diff --git a/dagre-d3/dagre-d3-tests.ts b/dagre-d3/dagre-d3-tests.ts index ef5fddffac..6451913a89 100644 --- a/dagre-d3/dagre-d3-tests.ts +++ b/dagre-d3/dagre-d3-tests.ts @@ -11,6 +11,9 @@ namespace DagreD3Tests { predecessors["a"] = graph.predecessors("a"); successors["a"] = graph.successors("a"); + graph.transition = (selection: d3.Selection) => { + return d3.transition(); + }; const render = new dagreD3.render(); const svg = d3.select("svg"); diff --git a/dagre-d3/dagre-d3.d.ts b/dagre-d3/dagre-d3.d.ts index 68e24c2fa5..a0ab31e041 100644 --- a/dagre-d3/dagre-d3.d.ts +++ b/dagre-d3/dagre-d3.d.ts @@ -20,6 +20,8 @@ declare namespace Dagre { height: number; predecessors(id: string): string[]; successors(id: string): string[]; + // see source of http://cpettitt.github.io/project/dagre-d3/latest/demo/interactive-demo.html + transition?(selection: d3.Selection): d3.Transition; width: number; } From 97ccd59fba61677948dc65a8aed6d50deab9e7fb Mon Sep 17 00:00:00 2001 From: Seteh Date: Wed, 1 Jun 2016 19:17:03 +0300 Subject: [PATCH 170/415] Update to 15.2.10 --- devextreme/devextreme-15.2.9.d.ts | 7443 +++++++++++++++++++++++++++++ devextreme/devextreme.d.ts | 353 +- 2 files changed, 7650 insertions(+), 146 deletions(-) create mode 100644 devextreme/devextreme-15.2.9.d.ts diff --git a/devextreme/devextreme-15.2.9.d.ts b/devextreme/devextreme-15.2.9.d.ts new file mode 100644 index 0000000000..3a7d42e05a --- /dev/null +++ b/devextreme/devextreme-15.2.9.d.ts @@ -0,0 +1,7443 @@ +// Type definitions for DevExtreme 15.2.9 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module DevExpress { + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ + export function registerModelForValidation(model: Object) : void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** Specifies whether or not the entire application/site supports right-to-left representation. */ + export var rtlEnabled: boolean; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + export function requestAnimationFrame(callback: Function): number; + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** Used to get URLs that vary in a locally running application and the application running on production. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns a local or a productional URL depending on how the application is currently running. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: string; + /** The element within which the widget is positioned. */ + boundary?: Element; + /** A string value holding horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: string; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: string; + /** The target element that the widget is positioned against. */ + of?: HTMLElement; + /** A string value holding horizontal and vertical offset in pixels, separated by a space (e.g., "5 -10"). */ + offset?: string; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + export interface OperationPromise extends JQueryPromise { + operationId: number; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(url: string); + constructor(data: Array); + constructor(options: CustomStoreOptions); + constructor(options: DataSourceOptions); + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): OperationPromise>; + /** Clears currently loaded DataSource items and calls the load() method. */ + reload(): OperationPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(expr: Object): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + cancel(operationId: number): boolean; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + async: boolean; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + keyType?: any; + /** Specifies whether or not dates found in the response are deserialized. */ + deserializeDates?: boolean; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Filters the current Query data. */ + filter(predicate: (item: any) => boolean): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare module DevExpress.ui { + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate and how to apply the validation result. */ + adapter?: Object; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: Object; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated dataSource.paginate.md + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + /** A handler for the cut event. */ + onCut?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + /** A handler for the input event. */ + onInput?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + focusStateEnabled?: boolean; + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether to enable or disable scrolling. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + /** Holds the list of selected values. */ + values?: Array; + /** A read-only option that holds the last selected value. */ + value?: Object; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + buttons?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object defining animation options of the widget. */ + animation?: fx.AnimationOptions; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + onContentReady?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + /** The "mode" attribute value of the actual HTML input element representing the widget. */ + mode?: string; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ + autoAdjust?: boolean; + center?: { + /** The latitude location displayed in the center of the widget. */ + lat?: number; + /** The longitude location displayed in the center of the widget. */ + lng?: number; + }; + /** A handler for the click event. */ + onClick?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + /** An object defining widget animation options. */ + animation?: fx.AnimationOptions; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated pageLoadMode.md + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + /** This section lists the data source fields that are used in a default template for lookup drop-down items. */ + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + onSelectAllChanged?: Function; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + /** A format used to display date/time information. */ + format?: string; + /** A Globalize format string specifying the date display format. */ + formatString?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use 'pickerType' option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use 'pickerType' option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The latest date the widget allows to select. */ + max?: Date; + /** The earliest date the widget allows to select. */ + min?: Date; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidget { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** A handler for the itemTitleHold event. */ + onItemTitleHold?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: File; + /** Holds the File instances representing files selected in the widget. */ + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormEmptyItem extends dxFormItem { + /** Specifies the form item name. */ + name?: string; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifies which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering the group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + /** Specifies a badge text for the tab. */ + badge?: string; + /** A Boolean value specifying whether or not the tab can respond to user interaction. */ + disabled?: boolean; + /** Specifies the icon to be displayed on the tab. */ + icon?: string; + /** The template to be used for rendering the tab. */ + tabTemplate?: any; + /** The template to be used for rendering the tab content. */ + template?: any; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for required fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies the message that is shown for end-users if a required field value is not specified. */ + requiredMessage?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + onContentReady?: Function; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxFormOptions): JQuery; +} + +declare module DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + /** Specifies the current menu position. */ + menuPosition?: string; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + buttonIconSrc?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + hoverStateEnabled?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** This section lists the data source fields that are used in a default template for drop-down menu items. */ + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare module DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Sorts the header items of this field by the summary values of another field. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies a display format for field values. */ + format?: string; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies a precision for formatted field values. */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the header cell of a row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare module DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: Date; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurring appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the 'useColorAsDefault' property instead + */ + mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** The name of the appointment object field that specifies a resource of this kind. */ + field?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** Specifies whether or not an end-user can scroll the view horizontally. */ + horizontalScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; + /** Specifies the name of the data source item field that defines the start of an appointment. */ + startDateExpr?: string; + /** Specifies the name of the data source item field that defines the ending of an appointment. */ + endDateExpr?: string; + /** Specifies the name of the data source item field that holds the subject of an appointment. */ + textExpr?: string; + /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ + descriptionExpr?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ + allDayExpr?: string; + /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ + recurrenceRuleExpr?: string; + /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ + recurrenceExceptionExpr?: string; + /** Specifies whether filtering is performed on the server or client side. */ + remoteFiltering?: boolean; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time of the specified day. */ + scrollToTime(hours: number, minutes: number, date: Date): void; + /** Displayes the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ + expandedExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * Specifies whether or not a check box is displayed at each tree view item. + * @deprecated Use the showCheckBoxesMode option instead. + */ + showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; + /** + * Specifies whether the "Select All" check box is displayed over the tree view. + * @deprecated Use the showCheckBoxesMode option instead. + */ + selectAllEnabled?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: any; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelected event. */ + onItemSelected?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** Specifies whether or not an item becomes selected if an end-user clicks it. */ + selectionByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + } + export class dxMenuBase extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay in submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; + } + export interface dxDataGridRow { + /** The data object represented by the row. */ + data: Object; + /** The key of the data object represented by the row. */ + key: any; + /** The visible index of the row. */ + rowIndex: number; + /** The type of the row. */ + rowType: string; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: string; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for the header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; + /** Specifies a precision for formatted values displayed in a column. */ + precision?: number; + /** Specifies a filter operation applied to a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + editMode?: string; + editEnabled?: boolean; + insertEnabled?: boolean; + removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the editMode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + }; + /** Specifies options that configure the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: boolean; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: boolean; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + /** Specifies whether to enable two-way data binding. */ + twoWayBindingEnabled?: boolean; + /** A handler for the rowClick event. */ + onRowClick?: any; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Specifies options for exporting grid data. */ + export?: { + /** Indicates if the export feature is enabled in the grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + exportTo?: string; + /** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */ + exportToExcel?: string; + /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ + excelFormat?: string; + /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ + selectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (state: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): void; + /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow() method instead. + */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): void; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Specifies options for exporting pivot grid data. */ + export?: { + /** Indicates whether the export feature is enabled for the pivot grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare module DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare module DevExpress.viz.core { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies the opacity of the tooltip's border. */ + opacity?: number; + } + export interface Font { + /** Specifies the font color for a strip label. */ + color?: string; + /** Specifies the font family for a strip label. */ + family?: string; + /** Specifies the font opacity for a strip label. */ + opacity?: number; + /** Specifies the font size for a strip label. */ + size?: any; + /** Specifies the font weight for the text displayed in strips. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ + bottom?: number; + /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ + left?: number; + /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ + right?: number; + /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ + top?: number; + } + export interface Size { + /** Specifies the width of the widget. */ + width?: number; + /** Specifies the height of the widget. */ + height?: number; + } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the widget title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies the widget title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding widget elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: viz.core.DashedBorderWithOpacity; + /** Specifies a color for the tooltip. */ + color?: string; + /** Specifies the z-index for tooltips. */ + zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ + container?: any; + /** Specifies text and appearance of a set of tooltips. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies font options for the text displayed by the tooltip. */ + font?: Font; + /** Specifies a format for the text displayed by the tooltip. */ + format?: string; + /** Specifies the opacity of a tooltip. */ + opacity?: number; + /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + paddingLeftRight?: number; + /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + paddingTopBottom?: number; + /** Specifies a precision for formatted values displayed by the tooltip. */ + precision?: number; + /** Specifies options of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Specifies a color for the loading indicator background. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator text. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies a text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions extends DOMComponentOptions { + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + } +} +declare module DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): boolean; + /** Provides information about the selection state of a point. */ + isSelected(): boolean; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label of a series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: string; + /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: string; + position?: string; + /** Specifies a precision for formatted point values displayed in point labels. */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show a label when the point has a zero value. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + alignment?: string; + /** Specifies how to shift point labels horizontally from their initial positions. */ + horizontalOffset?: number; + /** Specifies how to shift point labels vertically from their initial positions. */ + verticalOffset?: number; + /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + /** An object defining the label configuration options for a series in the dxChart widget. */ + label?: ChartSeriesConfigLabel; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /**

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

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

Sets a color for a point when it is selected.

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

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

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

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

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

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

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

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

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

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

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

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

*/ @@ -5245,14 +5306,14 @@ declare module DevExpress.viz.charts { export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { /** * Specifies the type of the pie chart series. - * @deprecated use the 'type' option instead + * @deprecated Use the type option instead. */ type?: string; } export interface PieSeriesConfig extends CommonPieSeriesConfig { /** * Sets the series type. - * @deprecated use the 'type' option instead + * @deprecated Use the type option instead. */ type?: string; /** Specifies the name that identifies the series. */ @@ -5525,7 +5586,7 @@ declare module DevExpress.viz.charts { /** Specifies the position of the value axis on a chart. */ position?: string; /** Specifies the title for a value axis. */ - title?: AxisTitle; + title?: any; } export interface PolarAxis extends PolarCommonAxisSettings, Axis { /** Defines an array of the value axis constant lines. */ @@ -5952,7 +6013,7 @@ declare module DevExpress.viz.charts { constructor(element: Element, options?: dxPieChartOptions); /** * Provides access to the dxPieChart series. - * @deprecated ..\..\BaseChart\3 Methods\getAllSeries().md + * @deprecated Use the getAllSeries() method instead. */ getSeries(): PieSeries; } @@ -5990,19 +6051,19 @@ declare module DevExpress.viz.gauges { color?: string; /** * Specifies an array of custom minor ticks. - * @deprecated ..\customMinorTicks.md + * @deprecated Use the scale | customMinorTicks option instead. */ customTickValues?: Array; /** Specifies the length of the scale's minor ticks. */ length?: number; /** * Indicates whether automatically calculated minor ticks are visible or not. - * @deprecated This functionality in not more available + * @deprecated This feature is no longer available. */ showCalculatedTicks?: boolean; /** * Specifies an interval between minor ticks. - * @deprecated ..\minorTickInterval.md + * @deprecated Use the scale | minorTickInterval option instead. */ tickInterval?: number; /** Indicates whether scale minor ticks are visible or not. */ @@ -6013,7 +6074,7 @@ declare module DevExpress.viz.gauges { export interface ScaleMajorTick extends ScaleTick { /** * Specifies whether or not to expand the current major tick interval if labels overlap each other. - * @deprecated ..\label\overlappingBehavior\useAutoArrangement.md + * @deprecated Use the overlappingBehavior | useAutoArrangement option instead. */ useTicksAutoArrangement?: boolean; } @@ -6047,22 +6108,22 @@ declare module DevExpress.viz.gauges { endValue?: number; /** * Specifies whether or not to hide the first scale label. - * @deprecated This functionality in not more available + * @deprecated This feature is no longer available. */ hideFirstLabel?: boolean; /** * Specifies whether or not to hide the first major tick on the scale. - * @deprecated This functionality in not more available + * @deprecated This feature is no longer available. */ hideFirstTick?: boolean; /** * Specifies whether or not to hide the last scale label. - * @deprecated This functionality in not more available + * @deprecated This feature is no longer available. */ hideLastLabel?: boolean; /** * Specifies whether or not to hide the last major tick on the scale. - * @deprecated This functionality in not more available + * @deprecated This feature is no longer available. */ hideLastTick?: boolean; /** Specifies an interval between major ticks. */ @@ -6077,7 +6138,7 @@ declare module DevExpress.viz.gauges { label?: BaseScaleLabel; /** * Specifies options of the gauge's major ticks. - * @deprecated ..\tick\tick.md + * @deprecated Use the tick option instead. */ majorTick?: ScaleMajorTick; /** Specifies options of the gauge's major ticks. */ @@ -6153,17 +6214,17 @@ declare module DevExpress.viz.gauges { size?: viz.core.Size; /** * Specifies a subtitle for the widget. - * @deprecated ..\..\..\BaseGauge\1 Configuration\title\subtitle\subtitle.md + * @deprecated Use the title | subtitle option instead. */ subtitle?: { /** * Specifies font options for the subtitle. - * @deprecated ..\..\title\subtitle\font\font.md + * @deprecated Use the title | subtitle | font option instead. */ font?: viz.core.Font; /** * Specifies a text for the subtitle. - * @deprecated ..\title\subtitle\text.md + * @deprecated Use the title | subtitle | text option instead. */ text?: string; }; @@ -6173,7 +6234,7 @@ declare module DevExpress.viz.gauges { font?: viz.core.Font; /** * Specifies a title's position on the gauge. - * @deprecated basegaugeoptions_title_verticalAlignment and basegaugeoptions_title_horizontalAlignment + * @deprecated Use the horizontalAlignment and verticalAlignment options instead. */ position?: string; /** Specifies the distance between the title and surrounding gauge elements in pixels. */ @@ -6350,7 +6411,7 @@ declare module DevExpress.viz.gauges { visible?: boolean; }; /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ - palette?: string; + palette?: any; /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ relativeInnerRadius?: number; /** Specifies a start value for the gauge's invisible scale. */ @@ -6500,7 +6561,7 @@ declare module DevExpress.viz.rangeSelector { logarithmBase?: number; /** * Specifies an interval between major ticks. - * @deprecated ..\tickInterval\tickInterval.md + * @deprecated Use the tickInterval option instead. */ majorTickInterval?: any; /** Specifies an interval between axis ticks. */ @@ -6541,7 +6602,7 @@ declare module DevExpress.viz.rangeSelector { showCustomBoundaryTicks?: boolean; /** * Indicates whether or not to show minor ticks on the scale. - * @deprecated minorTick\visible.md + * @deprecated Use the minorTick | visible option instead. */ showMinorTicks?: boolean; /** Specifies the scale's start value. */ @@ -6630,7 +6691,7 @@ declare module DevExpress.viz.rangeSelector { invalidRangeColor?: string; /** * Specifies the empty space between the marker's border and the marker’s text. - * @deprecated Use the 'paddingTopBottom' and 'paddingLeftRight' options instead + * @deprecated Use the paddingTopBottom and paddingLeftRight options instead. */ padding?: number; /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ @@ -6641,7 +6702,7 @@ declare module DevExpress.viz.rangeSelector { placeholderHeight?: number; /** * Specifies in pixels the height and width of the space reserved for the range selector slider markers. - * @deprecated Use the 'placeholderHeight' and 'indent' options instead + * @deprecated Use the placeholderHeight and indent options instead. */ placeholderSize?: { /** Specifies the height of the placeholder for the left and right slider markers. */ @@ -6716,88 +6777,88 @@ declare module DevExpress.viz.map { } /** * This section describes the fields and methods that can be used in code to manipulate the Area object. - * @deprecated Use the "Layer Element" instead + * @deprecated Use the Layer Element instead. */ export interface Area { /** * Contains the element type. - * @deprecated ..\..\Layer\2 Fields\type.md + * @deprecated Use the Layer | type instead. */ type: string; /** * Return the value of an attribute. - * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + * @deprecated Use the Layer Element | attribute(name, value) method instead. */ attribute(name: string): any; /** * Provides information about the selection state of an area. - * @deprecated Use the "selected()" method of the Layer Element + * @deprecated Use the Layer Element | selected() method instead. */ selected(): boolean; /** * Sets a new selection state for an area. - * @deprecated Use the "selected(state)" method of the Layer Element + * @deprecated Use the Layer Element | selected(state) method instead. */ selected(state: boolean): void; /** * Applies the area settings specified as a parameter and updates the area appearance. - * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + * @deprecated Use the Layer Element | applySettings(settings) method instead. */ applySettings(settings: any): void; } /** * This section describes the fields and methods that can be used in code to manipulate the Markers object. - * @deprecated Use the "Layer Element" instead + * @deprecated Use the Layer Element instead. */ export interface Marker { /** * Contains the descriptive text accompanying the map marker. - * @deprecated Get the text with the "attribute" method (using the "layers.label.dataField" value) + * @deprecated Get the text using the Layer Element | attribute(name) method. The name parameter value for text is set at the dataField option. */ text: string; /** * Contains the type of the element. - * @deprecated ..\..\Layer\2 Fields\type.md + * @deprecated Use the Layer | type instead. */ type: string; /** * Contains the URL of an image map marker. - * @deprecated Get the url with the "attribute" method (using the "layers.dataField" value) + * @deprecated Get the image URL using the Layer Element | attribute(name) method. The name parameter value for the image URL is set at the dataField option. */ url: string; /** * Contains the value of a bubble map marker. - * @deprecated Get the value with the "attribute" method (using the "layers.dataField" value) + * @deprecated Get the bubble value using the Layer Element | attribute(name) method. The name parameter for the bubble value is set at the dataField option. */ value: number; /** * Contains the values of a pie map marker. - * @deprecated Get the values with the "attribute" method (using the "layers.dataField" value) + * @deprecated Get the pie values using the Layer Element | attribute(name) method. The name parameter for pie values is set at the dataField option. */ values: Array; /** * Returns the value of an attribute. - * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + * @deprecated Use the Layer Element | attribute(name, value) method instead. */ attribute(name: string): any; /** * Returns the coordinates of a specific marker. - * @deprecated ..\..\Layer Element\3 Methods\coordinates().md + * @deprecated Use the Layer Element | coordinates() method instead. */ coordinates(): Array; /** * Provides information about the selection state of a marker. - * @deprecated Use the "selected()" method of the Layer Element + * @deprecated Use the Layer Element | selected() method instead. */ selected(): boolean; /** * Sets a new selection state for a marker. - * @deprecated Use the "selected(state)" method of the Layer Element + * @deprecated Use the Layer Element | selected(state) method instead. */ selected(state: boolean): void; /** * Applies the marker settings specified as a parameter and updates marker appearance. - * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + * @deprecated Use the Layer Element | applySettings(settings) method instead. */ applySettings(settings: any): void; } @@ -6809,7 +6870,7 @@ declare module DevExpress.viz.map { /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ elementType?: string; /** Specifies a data source for the layer. */ - data?: any; + dataSource?: any; /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ borderWidth?: number; /** Specifies a color for the border of the layer elements. */ @@ -6858,7 +6919,7 @@ declare module DevExpress.viz.map { customize?: (eleemnts: Array) => void; /** Specifies marker label options. */ label?: { - /** The name of the data attribute containing marker texts. */ + /** The name of the dataSource attribute containing marker texts. */ dataField?: string; /** Enables marker labels. */ enabled?: boolean; @@ -6869,238 +6930,238 @@ declare module DevExpress.viz.map { export interface AreaSettings { /** * Specifies the width of the area border in pixels. - * @deprecated ..\layers\borderWidth.md + * @deprecated Use the layers | borderWidth option instead. */ borderWidth?: number; /** * Specifies a color for the area border. - * @deprecated ..\layers\borderColor.md + * @deprecated Use the layers | borderColor option instead. */ borderColor?: string; /** * Specifies a color for an area. - * @deprecated ..\layers\color.md + * @deprecated Use the layers | color option instead. */ color?: string; /** * Specifies the function that customizes each area individually. - * @deprecated ..\layers\customize.md + * @deprecated Use the layers | customize option instead. */ customize?: (areaInfo: Area) => AreaSettings; /** * Specifies a color for the area border when the area is hovered over. - * @deprecated ..\layers\hoveredBorderColor.md + * @deprecated Use the layers | hoveredBorderColor option instead. */ hoveredBorderColor?: string; /** * Specifies the pixel-measured width of the area border when the area is hovered over. - * @deprecated ..\layers\hoveredBorderWidth.md + * @deprecated Use the layers | hoveredBorderWidth option instead. */ hoveredBorderWidth?: number; /** * Specifies a color for an area when this area is hovered over. - * @deprecated ..\layers\hoveredColor.md + * @deprecated Use the layers | hoveredColor option instead. */ hoveredColor?: string; /** * Specifies whether or not to change the appearance of an area when it is hovered over. - * @deprecated ..\layers\hoverEnabled.md + * @deprecated Use the layers | hoverEnabled option instead. */ hoverEnabled?: boolean; /** * Configures area labels. - * @deprecated ..\..\layers\label\label.md + * @deprecated Use the layers | label option instead. */ label?: { /** * Specifies the data field that provides data for area labels. - * @deprecated ..\..\layers\label\dataField.md + * @deprecated Use the layers | label | dataField option instead. */ dataField?: string; /** * Enables area labels. - * @deprecated ..\..\layers\label\enabled.md + * @deprecated Use the layers | label | enabled option instead. */ enabled?: boolean; /** * Specifies font options for area labels. - * @deprecated ..\..\..\layers\label\font\font.md + * @deprecated Use the layers | label | font option instead. */ font?: viz.core.Font; }; /** * Specifies the name of the palette or a custom range of colors to be used for coloring a map. - * @deprecated ..\layers\palette.md + * @deprecated Use the layers | palette option instead. */ palette?: any; /** * Specifies the number of colors in a palette. - * @deprecated ..\layers\paletteSize.md + * @deprecated Use the layers | paletteSize option instead. */ paletteSize?: number; /** * Allows you to paint areas with similar attributes in the same color. - * @deprecated ..\layers\colorGroups.md + * @deprecated Use the layers | colorGroups option instead. */ colorGroups?: Array; /** * Specifies the field that provides data to be used for coloring areas. - * @deprecated ..\layers\colorGroupingField.md + * @deprecated Use the layers | colorGroupingField option instead. */ colorGroupingField?: string; /** * Specifies a color for the area border when the area is selected. - * @deprecated ..\layers\selectedBorderColor.md + * @deprecated Use the layers | selectedBorderColor option instead. */ selectedBorderColor?: string; /** * Specifies a color for an area when this area is selected. - * @deprecated ..\layers\selectedColor.md + * @deprecated Use the layers | selectedColor option instead. */ selectedColor?: string; /** * Specifies the pixel-measured width of the area border when the area is selected. - * @deprecated ..\layers\selectedBorderWidth.md + * @deprecated Use the layers | selectedBorderWidth option instead. */ selectedBorderWidth?: number; /** * Specifies whether single or multiple areas can be selected on a vector map. - * @deprecated ..\layers\selectionMode.md + * @deprecated Use the layers | selectionMode option instead. */ selectionMode?: string; } export interface MarkerSettings { /** * Specifies a color for the marker border. - * @deprecated ..\layers\borderColor.md + * @deprecated Use the layers | borderColor option instead. */ borderColor?: string; /** * Specifies the width of the marker border in pixels. - * @deprecated ..\layers\borderWidth.md + * @deprecated Use the layers | borderWidth option instead. */ borderWidth?: number; /** * Specifies a color for a marker of the dot or bubble type. - * @deprecated ..\layers\color.md + * @deprecated Use the layers | color option instead. */ color?: string; /** * Specifies the function that customizes each marker individually. - * @deprecated ..\layers\customize.md + * @deprecated Use the layers | customize option instead. */ customize?: (markerInfo: Marker) => MarkerSettings; /** * Specifies the pixel-measured width of the marker border when the marker is hovered over. - * @deprecated ..\layers\hoveredBorderWidth.md + * @deprecated Use the layers | hoveredBorderWidth option instead. */ hoveredBorderWidth?: number; /** * Specifies a color for the marker border when the marker is hovered over. - * @deprecated ..\layers\hoveredBorderColor.md + * @deprecated Use the layers | hoveredBorderColor option instead. */ hoveredBorderColor?: string; /** * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. - * @deprecated ..\layers\hoveredColor.md + * @deprecated Use the layers | hoveredColor option instead. */ hoveredColor?: string; /** * Specifies whether or not to change the appearance of a marker when it is hovered over. - * @deprecated ..\layers\hoverEnabled.md + * @deprecated Use the layers | hoverEnabled option instead. */ hoverEnabled?: boolean; /** * Specifies marker label options. - * @deprecated ..\..\layers\label\label.md + * @deprecated Use the layers | label option instead. */ label?: { /** * Enables marker labels. - * @deprecated ..\..\layers\label\enabled.md + * @deprecated Use the layers | label | enabled option instead. */ enabled?: boolean; /** * Specifies font options for marker labels. - * @deprecated ..\..\..\layers\label\font\font.md + * @deprecated Use the layers | label | font option instead. */ font?: viz.core.Font; }; /** * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. - * @deprecated ..\layers\maxSize.md + * @deprecated Use the layers | maxSize option instead. */ maxSize?: number; /** * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. - * @deprecated ..\layers\minSize.md + * @deprecated Use the layers | minSize option instead. */ minSize?: number; /** * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. - * @deprecated ..\layers\opacity.md + * @deprecated Use the layers | opacity option instead. */ opacity?: number; /** * Specifies the pixel-measured width of the marker border when the marker is selected. - * @deprecated ..\layers\selectedBorderWidth.md + * @deprecated Use the layers | selectedBorderWidth option instead. */ selectedBorderWidth?: number; /** * Specifies a color for the marker border when the marker is selected. - * @deprecated ..\layers\selectedBorderColor.md + * @deprecated Use the layers | selectedBorderColor option instead. */ selectedBorderColor?: string; /** * Specifies a color for a marker of the dot or bubble type when this marker is selected. - * @deprecated ..\layers\selectedColor.md + * @deprecated Use the layers | selectedColor option instead. */ selectedColor?: string; /** * Specifies whether a single or multiple markers can be selected on a vector map. - * @deprecated ..\layers\selectionMode.md + * @deprecated Use the layers | selectionMode option instead. */ selectionMode?: string; /** * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. - * @deprecated ..\layers\size.md + * @deprecated Use the layers | size option instead. */ size?: number; /** * Specifies the type of markers to be used on the map. - * @deprecated ..\layers\elementType.md + * @deprecated Use the layers | elementType option instead. */ type?: string; /** * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. - * @deprecated ..\layers\palette.md + * @deprecated Use the layers | palette option instead. */ palette?: any; /** * Allows you to paint markers with similar attributes in the same color. - * @deprecated ..\layers\colorGroups.md + * @deprecated Use the layers | colorGroups option instead. */ colorGroups?: Array; /** * Specifies the field that provides data to be used for coloring markers. - * @deprecated ..\layers\colorGroupingField.md + * @deprecated Use the layers | colorGroupingField option instead. */ colorGroupingField?: string; /** * Allows you to display bubbles with similar attributes in the same size. - * @deprecated ..\layers\sizeGroups.md + * @deprecated Use the layers | sizeGroups option instead. */ sizeGroups?: Array; /** * Specifies the field that provides data to be used for sizing bubble markers. - * @deprecated ..\layers\sizeGroupingField.md + * @deprecated Use the layers | sizeGroupingField option instead. */ sizeGroupingField?: string; } export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { /** * An object specifying options for the map areas. - * @deprecated Use the 'layers' option instead + * @deprecated Use the "area" type element of the layers array. */ areaSettings?: AreaSettings; /** Specifies the options for the map background. */ @@ -7130,24 +7191,24 @@ declare module DevExpress.viz.map { horizontalAlignment?: string; /** Specifies the position of the control bar. */ verticalAlignment?: string; - /** Specifies the opacity of the Control_Bar. */ + /** Specifies the opacity of the control bar. */ opacity?: number; }; /** Specifies the appearance of the loading indicator. */ loadingIndicator?: viz.core.LoadingIndicator; /** * Specifies a data source for the map area. - * @deprecated Use the 'layers.data' option instead + * @deprecated Use the layers | dataSource option instead. */ mapData?: any; /** * Specifies a data source for the map markers. - * @deprecated Use the 'layers.data' option instead + * @deprecated Use the layers | dataSource option instead. */ markers?: any; /** * An object specifying options for the map markers. - * @deprecated Use the 'layers' option instead + * @deprecated Use the "marker" type element of the layers array. */ markerSettings?: MarkerSettings; /** Specifies the size of the dxVectorMap widget. */ @@ -7204,12 +7265,12 @@ declare module DevExpress.viz.map { }) => void; /** * A handler for the areaClick event. - * @deprecated Use the 'onClick' option instead + * @deprecated Use the onClick option instead. */ onAreaClick?: any; /** * A handler for the areaSelectionChanged event. - * @deprecated Use the 'onSelectionChanged' option instead + * @deprecated Use the onSelectionChanged option instead. */ onAreaSelectionChanged?: (e: { target: Area; @@ -7218,12 +7279,12 @@ declare module DevExpress.viz.map { }) => void; /** * A handler for the markerClick event. - * @deprecated Use the 'onClick' option instead + * @deprecated Use the onClick option instead. */ onMarkerClick?: any; /** * A handler for the markerSelectionChanged event. - * @deprecated Use the 'onSelecitonChanged' option instead + * @deprecated Use the onSelecitonChanged option instead. */ onMarkerSelectionChanged?: (e: { target: Marker; @@ -7264,12 +7325,12 @@ declare module DevExpress.viz.map { center(centerCoordinates: Array): void; /** * Deselects all the selected areas on a map. The areas are displayed in their initial style after. - * @deprecated Use the 'clearSelection' method on a layer instead + * @deprecated Use the layer's clearSelection() method instead. */ clearAreaSelection(): void; /** * Deselects all the selected markers on a map. The markers are displayed in their initial style after. - * @deprecated Use the 'clearSelection' method on a layer instead + * @deprecated Use the layer's clearSelection() method instead. */ clearMarkerSelection(): void; /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ @@ -7284,12 +7345,12 @@ declare module DevExpress.viz.map { getLayerByName(name: string): MapLayer; /** * Returns an array with all the map areas. - * @deprecated Use the 'getElements' method on a layer instead + * @deprecated Use the layer's getElements() method instead. */ getAreas(): Array; /** * Returns an array with all the map markers. - * @deprecated Use the 'getElements' method on a layer instead + * @deprecated Use the layer's getElements() method instead. */ getMarkers(): Array; /** Gets the current coordinates of the map viewport. */ @@ -7324,12 +7385,12 @@ declare module DevExpress.viz.sparklines { export interface SparklineTooltip extends viz.core.Tooltip { /** * Specifies how a tooltip is horizontally aligned relative to the graph. - * @deprecated Tooltip alignment is no more available. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. */ horizontalAlignment?: string; /** * Specifies how a tooltip is vertically aligned relative to the graph. - * @deprecated Tooltip alignment is no more available. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. */ verticalAlignment?: string; } @@ -7389,7 +7450,7 @@ declare module DevExpress.viz.sparklines { /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ barPositiveColor?: string; /** Specifies a data source for the sparkline. */ - dataSource?: Array; + dataSource?: any; /** Sets a color for the boundary of both the first and last points on a sparkline. */ firstLastColor?: string; /** Specifies whether a sparkline ignores null data points or not. */ @@ -7440,4 +7501,4 @@ interface JQuery { dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; dxSparkline(methodName: string, ...params: any[]): any; dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; -} +} \ No newline at end of file From 7273c57f5b35de28b77649d9160f557906a95c68 Mon Sep 17 00:00:00 2001 From: Ryan McNamara Date: Tue, 31 May 2016 15:37:29 -0700 Subject: [PATCH 171/415] Added properties to chai config block. See http://chaijs.com/guide/styles/ for more information --- chai/chai.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/chai/chai.d.ts b/chai/chai.d.ts index 0ebc855022..8eb0995947 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -378,7 +378,20 @@ declare namespace Chai { } export interface Config { + /** + * Default: false + */ includeStack: boolean; + + /** + * Default: true + */ + showDiff: boolean; + + /** + * Default: 40 + */ + truncateThreshold: number; } export class AssertionError { From fceb0e37c0c0c9d0985e28b53566720767a94c45 Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Thu, 2 Jun 2016 12:00:24 +0200 Subject: [PATCH 172/415] getComponent/getComponents now takes state parameter instead of location see https://github.com/reactjs/react-router/commit/0cdee03a54aeb79f7c7e35628e3ba58bde54e2bd --- react-router/react-router.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index 80d2e4ee6d..322ad3ef9b 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -144,8 +144,8 @@ declare namespace ReactRouter { path?: RoutePattern component?: RouteComponent components?: RouteComponents - getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void - getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void + getComponent?: (nextState: RouterState, cb: (error: any, component?: RouteComponent) => void) => void + getComponents?: (nextState: RouterState, cb: (error: any, components?: RouteComponents) => void) => void onEnter?: EnterHook onLeave?: LeaveHook onChange?: ChangeHook From be2905b8ea021284308255e681210a6fff97c949 Mon Sep 17 00:00:00 2001 From: Mike Winfield Date: Thu, 2 Jun 2016 11:21:40 +0100 Subject: [PATCH 173/415] Fix base props of react-bootstrap components (refs are useful!) --- react-bootstrap/react-bootstrap.d.ts | 126 +++++++++++++-------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/react-bootstrap/react-bootstrap.d.ts b/react-bootstrap/react-bootstrap.d.ts index 366eeef7b5..fc9fd60a2c 100644 --- a/react-bootstrap/react-bootstrap.d.ts +++ b/react-bootstrap/react-bootstrap.d.ts @@ -12,7 +12,7 @@ declare module "react-bootstrap" { //